Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to embed QDialog into QWidget ?
Forum Updated to NodeBB v4.3 + New Features

How to embed QDialog into QWidget ?

Scheduled Pinned Locked Moved Solved General and Desktop
1 Posts 1 Posters 399 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Anonymous_Banned275
    wrote on last edited by Anonymous_Banned275
    #1

    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()
          
          
    
    1 Reply Last reply
    0
    • A Anonymous_Banned275 has marked this topic as solved on

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved