Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Learning
  3. Qt in Education
  4. Some suggestions
Forum Updated to NodeBB v4.3 + New Features

Some suggestions

Scheduled Pinned Locked Moved Qt in Education
10 Posts 5 Posters 4.4k 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.
  • X Offline
    X Offline
    xie_jiuan008
    wrote on last edited by
    #1

    【From China】
    I really want that the ui could be changed with constructe function,or the constructe function will change as the ui manually changed.They should be the in time 同步的!

    1 Reply Last reply
    0
    • T Offline
      T Offline
      tobias.hunger
      wrote on last edited by
      #2

      Do you have an example of what you would like to see?

      1 Reply Last reply
      0
      • F Offline
        F Offline
        fluca1978
        wrote on last edited by
        #3

        I suspect you mean within the UI editor from/to source code, but it is not really clear what you want to achieve.
        And I suspect this is not the right forum to post on it.

        1 Reply Last reply
        0
        • X Offline
          X Offline
          xie_jiuan008
          wrote on last edited by
          #4

          Yes ,the UI editor and the source code.
          Sometimes I need UI editor to add a widget, and sometimes I need to use source code,
          After these, I cant see all the widgets in UI editor, which bored me a little.

          1 Reply Last reply
          0
          • F Offline
            F Offline
            fluca1978
            wrote on last edited by
            #5

            I believe this is not possible. The ui files are declarative, and do not know what is happening on the C++ side.

            1 Reply Last reply
            0
            • F Offline
              F Offline
              fredQt
              wrote on last edited by
              #6

              I think you want to change dinamically some widget of the app. I know that using c++ code you can create on line a list of widgets and put them in the app dinamically. But using ui editor?, I think it's only static like fluca1978 said ui are declarative.

              1 Reply Last reply
              0
              • F Offline
                F Offline
                fluca1978
                wrote on last edited by
                #7

                In fact you have to use @setupUI@ in order to build the C++ side widgets from an XML file. I also believe that mixing the two approaches can be hard to maintain, so my suggestion is to stick with one, and in the case of ui designer, define where and initial properties of the widgets in the designer, and then change thier behavior dynamically according to the application evolution.

                1 Reply Last reply
                0
                • A Offline
                  A Offline
                  andre
                  wrote on last edited by
                  #8

                  Note that
                  @setupUi()@
                  does not build the C++ side widgets from the XML file. It is just a generated function that actually constructs the GUI, but when ran, the XML (.ui) file is not used anymore. The xml is used to at compile time generate the setupUi() method, among other code. That code is then used to construct the actual GUI at runtime.

                  1 Reply Last reply
                  0
                  • F Offline
                    F Offline
                    fluca1978
                    wrote on last edited by
                    #9

                    [quote author="Andre" date="1346860206"]Note that
                    @setupUi()@
                    does not build the C++ side widgets from the XML file. It is just a generated function that actually constructs the GUI, but when ran, the XML (.ui) file is not used anymore. The xml is used to at compile time generate the setupUi() method, among other code. That code is then used to construct the actual GUI at runtime.[/quote]

                    Thanks for the details, I knew that but mis-explained by myself. I meant that setupUI initializes widgets as from the manual C++ side (that is as the developer could do using pure C++). What I as not aware of was that the setupUI method was generated during the compile time from XML, I thought it was still accessing the XML.

                    1 Reply Last reply
                    0
                    • A Offline
                      A Offline
                      andre
                      wrote on last edited by
                      #10

                      It is sometimes enlightening to open and read the generated code. In this case, take a look inside the generated ui.h file. The moc.cpp files are also interesting, but a bit harder to understand.

                      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