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 make objects created in code visible in ui form?
Forum Updated to NodeBB v4.3 + New Features

How to make objects created in code visible in ui form?

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 3 Posters 389 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.
  • D Offline
    D Offline
    DevinQT
    wrote on last edited by aha_1980
    #1

    Hey,

    If i have a project A and i want make i new project B, and i copy the code from project A to project B, how do i 'update' the ui form in Qt Design?
    Otherwise how would you make ui elements created in code 'pop up' in this form?

    Thanks.

    Pablo J. RoginaP 1 Reply Last reply
    0
    • Christian EhrlicherC Offline
      Christian EhrlicherC Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      The designer can't show ui elements which are created in the code afterwards - how should this work?
      You can define custom classes in the designer e.g. with promoting them: http://doc.qt.io/qt-5/designer-using-custom-widgets.html

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      1 Reply Last reply
      3
      • D DevinQT

        Hey,

        If i have a project A and i want make i new project B, and i copy the code from project A to project B, how do i 'update' the ui form in Qt Design?
        Otherwise how would you make ui elements created in code 'pop up' in this form?

        Thanks.

        Pablo J. RoginaP Offline
        Pablo J. RoginaP Offline
        Pablo J. Rogina
        wrote on last edited by
        #3

        @DevinQT said in How to make objects created in code visible in ui form?:

        Otherwise how would you make ui elements created in code 'pop up' in this form?

        As @Christian-Ehrlicher stated, there's no direct way to do it currently.
        However, you may want to look at QUiLoader class source code to have some ideas of how they create widgets from a .ui file, so you may end up extending such class into kinda "QUiSaver" that should provide methods like "addWiget()" and "saveToFile()" to achieve your goal

        Upvote the answer(s) that helped you solve the issue
        Use "Topic Tools" button to mark your post as Solved
        Add screenshots via postimage.org
        Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

        1 Reply Last reply
        3

        • Login

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