QTabWidget Question
Hi All,
I’ve created a widget subclass and added this as a tab onto QTabWidget. My main code below.
- int main(int argc, char *argv[])
- {
- Widget* w = new Widget;
- desktopUI->addTab(w, "Test");
- mainLayout->addWidget(desktopUI);
- return a.exec();
- }
When i run this app. The app default size is half the size of my widget, i’m forced to resize it manually before i can see all widgets on the tab.
For the life of me i cant figure out how to change the default size of the qtabwidget.
Any ideas?
Thanks
3 replies
you don’t need layout manager
- int main(int argc, char *argv[])
- {
- Widget* w = new Widget;
- QTabWidget desktopUI;
- desktopUI.addTab(w, "Test");
- desktopUI.resize(w->size());
- desktopUI.show();
- // QVBoxLayout* mainLayout = new QVBoxLayout;
- // mainLayout->addWidget(desktopUI);
- return a.exec();
- }
[Edit:] Gerolf faster :-)
You must log in to post a reply. Not a member yet? Register here!


