QT中怎么在tableview中显示表格数据?堆叠布局可用于分页布局。具体实现代码如下://createanobjectpwidgetqwidget*pwidget=newQWidgetofQWidgetclass//createalayoutmanagerclasslayoutqhboxlayout*manlayout=newqhboxlayout//listcontrolqlistwidget*listwidget=newonTheleftqlistwidget(pwidget)listwidget->additem(QObject::tr(”外观设置“)listwidget->additem(QObject::tr(”web浏览“)。。。//thepagingcontrolQWidget*page1ontheright=newQWidget(pwidget)<Addcontroltopage1>qwidget*Page2=newQWidget(pwidget)<AddcontrolonPage2><setlayoutmanagement>qvboxlayout*leftlayout=newqvboxlayoutleftlayout->addwidget(listwidget)。。。//rightpaginglayout(两页窗口)qstackedlayout*stackdlayout=NewQstakedlayoutstackedlayout->addwidget(page1)stackedlayout->addwidget(Page2)//通过调用QWidget::setlayout()函数,将布局管理器类添加到小部件对象pwidgetmanlayout->addlayout(leftlayout)manlayout->addlayout(stackedlayout)pwidget->setlayout(manlayout)listwidget->setcurrentrow(0)//关联:列表和组布局QObject::connect(listwidget,SIGNAL(currentRowChanged(int)),stackedlayout插槽(setCurrentIndex(int)))pWidget->show()
分享题目:stacked什么意思啊QT中怎么在tableview中显示表格数据?-创新互联
链接地址:
http://mswzjz.cn/article/gegei.html