QStackedWidget实现左侧列表与右侧控件关联
来源:互联网 发布:linux下启动tomcat服务 编辑:程序博客网 时间:2024/06/13 17:38
实现效果:
源码:
setWindowTitle(tr("StackedWidget")); list =new QListWidget(this); list->insertItem(0,tr("Window1")); list->insertItem(1,tr("Window2")); list->insertItem(2,tr("Window3")); label1 =new QLabel(tr("WindowTest1")); label1->setStyleSheet("background-color:red"); label2 =new QLabel(tr("WindowTest2")); label2->setStyleSheet("background-color:green"); label3 =new QLabel(tr("WindowTest3")); stack =new QStackedWidget(this); stack->setStyleSheet("background-color:yellow"); stack->addWidget(label1); stack->addWidget(label2); stack->addWidget(label3); QHBoxLayout *mainLayout =new QHBoxLayout(this); mainLayout->setMargin(5); mainLayout->setSpacing(5); mainLayout->addWidget(list); mainLayout->addWidget(stack,0,Qt::AlignHCenter); mainLayout->setStretchFactor(list,1); mainLayout->setStretchFactor(stack,4); connect(list,SIGNAL(currentRowChanged(int)),stack,SLOT(setCurrentIndex(int)));
阅读全文
0 0
- QStackedWidget实现左侧列表与右侧控件关联
- Qt中左侧列表与右侧窗口关联
- android布局时,左侧宽度固定而右侧textview高度变化,怎么9png实现左侧高度与右侧相等?
- wingIDE右侧文件列表移动到左侧
- 左侧列表内容移动至右侧
- zTree树插件实现点击左侧树,右侧展示文章列表页面实现思路
- 左侧数据移到右侧 select 实现法
- CSSS实现右侧定宽左侧自适应
- ifame实现左侧导航栏右侧内容
- Android——实现RecyclerView左侧滑删除与右侧滑选择
- css实现右侧固定宽度,左侧宽度自适应
- PopupWindow实现右侧、左侧和底部弹出菜单
- css实现右侧固定宽度,左侧宽度自适应
- PopupWindow实现右侧、左侧和底部弹出菜单
- 老生长谈:CSS实现右侧固定宽度,左侧宽度自适应
- PopupWindow实现右侧、左侧和底部弹出菜单
- css实现右侧固定宽度,左侧宽度自适应
- PopupWindow实现右侧、左侧和底部弹出菜单
- HTML5小游戏
- 统计SQuAD的词汇得到word2id 并把词都转成id的python代码
- 2017年7月,桌面分享
- java随机生成6位随机数 5位随机数 4位随机数
- Django-中间件Middleware
- QStackedWidget实现左侧列表与右侧控件关联
- 基于 Vue、Electron、Node、Koa、Python 等构建的独立音乐社区客户端!
- leetcode561: Array Partition I
- java.lang.NoClassDefFoundError: com/fasterxml/jackson/databind/ObjectMapper
- 在 SQLite 中使用 CSV
- C++连接数据库并实现读写操作
- i=i++问题
- java web项目 路径url有中文,图片是中文,tomcat404解决方案
- 贪心的一道题 Supermarket