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. I have a MainWindow .ui file and a QWidget .ui file, I want to use the latter one

I have a MainWindow .ui file and a QWidget .ui file, I want to use the latter one

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 1.1k 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.
  • L Offline
    L Offline
    lygstate
    wrote on last edited by
    #1

    I want to use the QWidget .ui file as and sub Widget for MainWindow
    how to do that?
    Is that possible to directly to description in .ui file or I need to use code to create it.

    1 Reply Last reply
    0
    • Chris KawaC Offline
      Chris KawaC Offline
      Chris Kawa
      Lifetime Qt Champion
      wrote on last edited by
      #2

      I'm not sure I understand. You want to use a custom widget inside your main window?
      If yes then the way it's done in Qt is via promotion mechanism. You create your main window and the custom widget as separate forms. Then, in your main window, you insert a empty placeholder widget, right click on it and select "promote to", where you declare your custom widget name and header location.
      More about it "here":http://qt-project.org/doc/qt-5.0/qtdesigner/designer-using-custom-widgets.html#promoting-widgets

      1 Reply Last reply
      0
      • L Offline
        L Offline
        lygstate
        wrote on last edited by
        #3

        That's really helpful, thank you very much!

        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