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. Applying New UI Overtop the Existing Main Window
Qt 6.11 is out! See what's new in the release blog

Applying New UI Overtop the Existing Main Window

Scheduled Pinned Locked Moved General and Desktop
5 Posts 2 Posters 964 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.
  • H Offline
    H Offline
    haroldjclements
    wrote on last edited by
    #1

    This is a bit of a newbe question: How do you apply a new UI overtop the existing mainwindow?

    If I create a new form (newform.ui). Then on a button press, create a new instance
    @NewForm nf = new NewForm();@

    then initiate the new form:
    @nf.show(); @

    The new form opens in a new window and not the overtop the mainwindow. I take it that I have to somehow replace the existing form, but I am not too sure how?

    Thanks for any help,
    Harold Clements

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

      Hi and welcome to devnet,

      What exactly are you trying to achieve with NewForm ?

      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
      0
      • H Offline
        H Offline
        haroldjclements
        wrote on last edited by
        #3

        Thank you for your reply,

        At the moment, I am getting a new window with a title bar, that can be moved around the screen, with the parent form being visible under the new. I want to be able to have only one windows who's content changes and no new windows.

        I hope that makes sense!

        I think I need to create a widget rather than a form... but I am not too sure...

        Thanks again,
        Harold Clements

        1 Reply Last reply
        0
        • H Offline
          H Offline
          haroldjclements
          wrote on last edited by
          #4

          OK, found it. I need to setCentralWidget with my new form...

          Thanks again,
          Harold Clements

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

            Depending on what you'll be doing a QStackedWidget as central widget will be more suited

            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
            0

            • Login

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