How to embed QDialog into QWidget ?
-
I am looking at this
https://stackoverflow.com/questions/17163585/simple-way-to-embed-a-qdialog-into-a-qwidget
here it the part I like to use - I am trying to improve my knowledge of QMdiArea. Unfortunately the code has no expiation / comments. It seem "backwards" as far as defining
the variables.
I could use some assistance decoding the purpose each line of code , maybe then I can convert the code to real C++ code,widget = QWidget()
mdiarea = QMdiArea()
layout = QVBoxLayout(widget)
layout.addWidget(mdiarea)
d = QInputDialog()
d.setLabelText("test2")
d.setInputMode(QInputDialog.TextInput)
w = mdiarea.addSubWindow(d)
w.show()
widget.show()i made some progress ... I think the example is pseudo
code ....// attach dialog to this form widget = new QWidget(); widget->setWindowTitle(" Window titke (widget) attach dialog to this form"); // show floating widget widget->show(); // create mdi area mdiarea = new QMdiArea(); // create widget basic layout layout = new QVBoxLayout(widget); // add mdiarea into layput layout->addWidget(mdiarea); d = QInputDialog() d.setLabelText("test2") d.setInputMode(QInputDialog.TextInput) w = mdiarea.addSubWindow(d) w.show() widget.show()
-