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 Tell the MainWindow to use a different .ui file?
Forum Updated to NodeBB v4.3 + New Features

How to Tell the MainWindow to use a different .ui file?

Scheduled Pinned Locked Moved General and Desktop
5 Posts 3 Posters 1.7k 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.
  • F Offline
    F Offline
    fiendfan1
    wrote on last edited by
    #1

    How can i tell the mainWindow to use a different .ui when the user say... clicks a button?

    1 Reply Last reply
    0
    • JKSHJ Offline
      JKSHJ Offline
      JKSH
      Moderators
      wrote on last edited by
      #2

      Make a new Widget that uses that .ui file. When the user clicks the button, show your new Widget.

      Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

      1 Reply Last reply
      0
      • F Offline
        F Offline
        fiendfan1
        wrote on last edited by
        #3

        [quote author="JKSH" date="1346202833"]Make a new Widget that uses that .ui file. When the user clicks the button, show your new Widget.[/quote]

        Wont that create a new window?

        1 Reply Last reply
        0
        • JKSHJ Offline
          JKSHJ Offline
          JKSH
          Moderators
          wrote on last edited by
          #4

          [quote author="fiendfan1" date="1346203006"]Wont that create a new window?[/quote]Not if you add it to the same window as the original -- I did a project where I used a QStackedWidget that switches between different .ui-based widgets.

          But anyway, after some more reading, I realized this is probably an easier approach: http://qt-project.org/doc/qt-4.8/designer-using-a-ui-file.html#run-time-form-processing

          Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

          1 Reply Last reply
          0
          • S Offline
            S Offline
            Sam
            wrote on last edited by
            #5

            You can have a look on "QUiLoader Class":http://qt-project.org/doc/qt-4.8/quiloader.html#details

            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