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 morph a Qdialog into a QMainWindow
Qt 6.11 is out! See what's new in the release blog

how to morph a Qdialog into a QMainWindow

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 722 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.
  • E Offline
    E Offline
    Echeban
    wrote on last edited by
    #1

    Being a newbie, I put a lot of effort designing a Ui but unfortunately I started with a Qdialog and now I realize I am better off with a QMainWindow.

    I found the post Re below, then edited the ui XML file, substituted QMainWindow for QDialog (it was there only once), but the effect was I lost all my content. When opened in QtDesigner everything is gone. Fortunately I kept a backup copy :)

    It seems it works from QMainWindow to QDialog but not the reverse. What can I do?

    Re: Converting between QMainWindow/QWidget/QDialog in QtDesigner

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      You likely have put everything in a layout, right ?
      That's the correct thing to do however, QMainWindow already has a layout hence your "losing" stuff impression.

      What you would need to do is to set a central widget on it and put your layout on that central widget.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      2

      • Login

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