Amindo
18th July 2007, 13:48
I have created with "QT Designer" simple form with tabWidget
I need to dynamically add checkboxes to tab area:
in my constructor:
======
ui.setupUi(this);
ui.tabWidget->QTabWidget::setTabText(0, QString::fromLocal8Bit("Params"));
ui.tabWidget->QTabWidget::setTabText(1, QString::fromLocal8Bit("SysParams"));
QCheckBox *mycheckBox[100];
mycheckBox[0] = new QCheckBox(ui.tab);
mycheckBox[0]->setObjectName(QString::fromUtf8("mycheckBox[0]"));
mycheckBox[0]->setGeometry(QRect(30, 30, 331, 18));
mycheckBox[0]->setText(QApplication::translate("BarkasikForm", "myCheckBox0", 0, QApplication::UnicodeUTF8));
=======
I can't understand how to scroll tab area when number of checkboxes > 10 and out of viewable area.
I found some code:
=====
QScrollArea *scrollArea;
scrollArea = new QScrollArea(ui.tab);
scrollArea->setBackgroundRole(QPalette::Dark);
scrollArea->setWidget(ui.<?????????>);
=====
Help please!
I need to dynamically add checkboxes to tab area:
in my constructor:
======
ui.setupUi(this);
ui.tabWidget->QTabWidget::setTabText(0, QString::fromLocal8Bit("Params"));
ui.tabWidget->QTabWidget::setTabText(1, QString::fromLocal8Bit("SysParams"));
QCheckBox *mycheckBox[100];
mycheckBox[0] = new QCheckBox(ui.tab);
mycheckBox[0]->setObjectName(QString::fromUtf8("mycheckBox[0]"));
mycheckBox[0]->setGeometry(QRect(30, 30, 331, 18));
mycheckBox[0]->setText(QApplication::translate("BarkasikForm", "myCheckBox0", 0, QApplication::UnicodeUTF8));
=======
I can't understand how to scroll tab area when number of checkboxes > 10 and out of viewable area.
I found some code:
=====
QScrollArea *scrollArea;
scrollArea = new QScrollArea(ui.tab);
scrollArea->setBackgroundRole(QPalette::Dark);
scrollArea->setWidget(ui.<?????????>);
=====
Help please!