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 use widgets designed in UI designer?
Servers for Qt installer are currently down

How to use widgets designed in UI designer?

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 2 Posters 439 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.
  • I Offline
    I Offline
    incam
    wrote on 11 Jan 2019, 11:46 last edited by
    #1

    Hi everyone,

    I am new to QT and i cannot find an answer to my question.
    I designed a custom dialog using "Add New">"Qt">"Qt Designer Form Class">"Dialog without Buttons".
    This custom dialog should have interchangable sections which I designed as well using "Add New">"Qt">"Qt Designer Form">"Widget".

    Now I would like to place the widgets into the Dialog. How can I do that?

    Thank you in advance,
    Raoul

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mrjj
      Lifetime Qt Champion
      wrote on 11 Jan 2019, 11:50 last edited by mrjj 1 Nov 2019, 11:51
      #2

      Hi and welcome to the forums.
      You can use the promotion feature.
      http://doc.qt.io/qt-5/designer-using-custom-widgets.html#promoting-widgets

      so in the Dialog, you place a plain widget and then right click and promote it.
      when you then run the app, it will be your widget.

      promotion is basically just Replace function where you tell it the real class name and what .h file to use.

      I 1 Reply Last reply 11 Jan 2019, 11:58
      4
      • M mrjj
        11 Jan 2019, 11:50

        Hi and welcome to the forums.
        You can use the promotion feature.
        http://doc.qt.io/qt-5/designer-using-custom-widgets.html#promoting-widgets

        so in the Dialog, you place a plain widget and then right click and promote it.
        when you then run the app, it will be your widget.

        promotion is basically just Replace function where you tell it the real class name and what .h file to use.

        I Offline
        I Offline
        incam
        wrote on 11 Jan 2019, 11:58 last edited by
        #3

        @mrjj
        Thank you for your quick anser.
        So that means I should have used "Add New">"Qt">"Qt Designer Form Class">"Widget" instead of "Qt Designer Form"?

        M 1 Reply Last reply 11 Jan 2019, 12:04
        0
        • I incam
          11 Jan 2019, 11:58

          @mrjj
          Thank you for your quick anser.
          So that means I should have used "Add New">"Qt">"Qt Designer Form Class">"Widget" instead of "Qt Designer Form"?

          M Offline
          M Offline
          mrjj
          Lifetime Qt Champion
          wrote on 11 Jan 2019, 12:04 last edited by mrjj 1 Nov 2019, 12:31
          #4

          @incam
          Yes if you want to use promotion, then you need the .h file.
          (from Qt Designer Form Class)

          The stand alone UI file can be used with
          http://doc.qt.io/qt-5/quiloader.html

          but you can not visually add it in another form as promotion does.

          1 Reply Last reply
          4

          1/4

          11 Jan 2019, 11:46

          • Login

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