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?
Forum Updated to NodeBB v4.3 + New Features

How to use widgets designed in UI designer?

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 2 Posters 445 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 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
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by mrjj
      #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
      4
      • mrjjM mrjj

        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 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"?

        mrjjM 1 Reply Last reply
        0
        • I incam

          @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"?

          mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on last edited by mrjj
          #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

          • Login

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