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. Is there a way to create a .ui file from a running QApplication?
Forum Updated to NodeBB v4.3 + New Features

Is there a way to create a .ui file from a running QApplication?

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 397 Views 2 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.
  • E Offline
    E Offline
    esoteric
    wrote on last edited by
    #1

    Say you have a C++ QApplication running, can you create a .ui file from some specific widget in that application?
    This would be useful for debugging purposes.
    I tried using QFormBuilder::save() but:

    • It seems like it wasn't meant to be used in anything except Qt Designer

    • Some things that exist during runtime aren't supported in the .ui like QStackedLayout

    • Trying to open some of the generated .ui files in Qt Designer causes it to crash

    Pl45m4P 1 Reply Last reply
    0
    • E esoteric

      Say you have a C++ QApplication running, can you create a .ui file from some specific widget in that application?
      This would be useful for debugging purposes.
      I tried using QFormBuilder::save() but:

      • It seems like it wasn't meant to be used in anything except Qt Designer

      • Some things that exist during runtime aren't supported in the .ui like QStackedLayout

      • Trying to open some of the generated .ui files in Qt Designer causes it to crash

      Pl45m4P Offline
      Pl45m4P Offline
      Pl45m4
      wrote on last edited by
      #2

      @esoteric

      The QFormBuilder class is typically used by custom components and applications that embed Qt Designer. Standalone applications that need to dynamically generate user interfaces at run-time use the QUiLoader class, found in the QtUiTools module.

      (from: https://doc.qt.io/qt-5/qformbuilder.html#details)

      QFormBuilder is to create GUI code from an existing UI file at run time, not the other way around.
      AFAIK the uic process in not reversable.

      • https://doc.qt.io/qt-5/uic.html

      But you can save the state of widgets by using something like QSettings

      • https://doc.qt.io/qt-5/qsettings.html#restoring-the-state-of-a-gui-application

      If debugging is the process of removing software bugs, then programming must be the process of putting them in.

      ~E. W. Dijkstra

      1 Reply Last reply
      2

      • Login

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