|
1Qter豆
- MainWindow::MainWindow(QWidget *parent) :
- QMainWindow(parent),
- ui(new Ui::MainWindow)
- {
- //! [0]
- ui->setupUi(this);
- tabWidget = new QTabWidget(this);
- tabWidget->move(0,360);
- tabWidget->resize(340,340);
-
- m_tab1 = new qcw_meter(this);
- tabWidget->addTab(m_tab1,"123");
复制代码 我想在tabWidget的标签页m_tab1上new出4个widget,然后在每个widget上加容器类,代码应该怎么写?
我在第一步tabWidget上newwidget时就报错了...小白求教!
|
最佳答案
查看完整内容
文档上不是写的很清楚嘛~
The normal way to use QTabWidget is to do the following:
1. Create a QTabWidget.
2. Create a QWidget for each of the pages in the tab dialog, but do not specify parent widgets for them.
3. Insert child widgets into the page widget, using layouts to position them as normal.
4. Call addTab() or insertTab() to put the page widgets into the tab widget, giving each tab a su ...
|