Add to mdiArea using C++ code and QTDesigner
Solved
C++ Gurus
-
SOLVED
...using KISS and let the mdiArea do the dirty work// TASK add mdiArea sub / child window - QMdiArea QMdiArea *qmdiarea = new QMdiArea(); m_mdiarea->addSubWindow( qmdiarea); qmdiarea->setWindowTitle(" Common hcitool (QMdiArea )"); // TOK QWidget *qWidget = new QWidget(); // test qmdiarea->addSubWindow( qWidget); qmdiarea->addSubWindow( qWidget); qmdiarea->addSubWindow( qWidget); qmdiarea->tileSubWindows();
Hello,
I am asking for actual C++ code and opinions / suggestions / help with the tasks.
( current code compiles/ links/runs.)
I need help with- adding QTabWidget INTO QWidget (mdiArea sunwindow) - NOT to mdiArea main parent !
- adding existing (loop) QWidget BUILD using QrDesigner into specific tab . (Is that even possible??)
I am including current (work in progresses) actual, partially working , copy of my code.
I have highlighted areas I need help with and would appreciate if you could annotate / add your corrections / suggestions.Your suggestion DOES NOT have to compile, I can manage that by myself.
Many thanks, appreciate actual C++ code where needed
// TASK add mdiArea sub / child window - QWidget // QWidget create QWidget *qWidget = new QWidget(); m_mdiarea->addSubWindow( qWidget); qWidget->setWindowTitle(" Common hcitool (QWidget )"); // TOK // create QTabWidget QTabWidget *tabWidget; tabWidget = new QTabWidget(this); // sort of works // create layout and add it to tabWidget QHBoxLayout *layout = new QHBoxLayout; **layout->addWidget(tabWidget);** // sort of works //**issue - shows in parent mdiArea** //i**ssue - shows small size** //?? crashesb tabWidget->setLayout(layout); //tabWidget->show(); //**TODO show full size in mdiArea sub wiundow** //tabWidget->maximumSize(); // add tabs in loop OK // for index .... tabWidget->addTab(qWidget, "TEST first tab "); ****
This is my "run"
Notice small "TEST.. " tab title showing attached in upper left corner. Wrong size and location!
-
A Axel Spoerl has marked this topic as solved on
-
-
J J.Hilk restored this topic on