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. Tips and tricks for 'backtracing' UI elements into the code.
Forum Updated to NodeBB v4.3 + New Features

Tips and tricks for 'backtracing' UI elements into the code.

Scheduled Pinned Locked Moved Unsolved General and Desktop
8 Posts 2 Posters 1.4k 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.
  • osssomeO Offline
    osssomeO Offline
    osssome
    wrote on last edited by
    #1

    Hi,

    OK making a UI with Qt is not a problem, but for an existing codebase and tracing what goes where is what I'm having difficulty with.

    Certainly this is not a knock against Qt. All UI software is kind of like this. So for this case, where an existing codebase uses Qt and localization, how do I figure out, from looking at something like a QDialog, where the associated logic will be? I don't expect it to be in plain sight and I don't know what files/constructs/docs to look for.

    I see the text specified in .ini files being used in the QDialog but I am having trouble tracing the string's name to a form file or code.

    Thanks

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi, its not 100% sure the dialog has a UI file.
      It is easy to make without.
      You can check the constructor of the Dialog (in cpp)
      if It has
      ui->setupUi(this);
      there is a UI file.

      Also if u stand in the Dialogs h file, you can right click functions and variables and
      use the "Find Usages" too see where its being used.
      That is what I use to "discover" the structure of a new project.

      Also "follow symbol under cursor" is good for the other way, as in
      where does this live.

      If you are after localization, you would go and look for QTranslator using the super find function.
      Note, if they use a ini file, it might not be the normal way.

      1 Reply Last reply
      0
      • osssomeO Offline
        osssomeO Offline
        osssome
        wrote on last edited by osssome
        #3

        This is too dependent of the project. I found what I needed. It's just buried by lots of fuction calls and won't have the name that you expect.

        mrjjM 1 Reply Last reply
        0
        • osssomeO osssome

          This is too dependent of the project. I found what I needed. It's just buried by lots of fuction calls and won't have the name that you expect.

          mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @osssome
          super.
          well people name things very differently sometimes.

          osssomeO 2 Replies Last reply
          0
          • mrjjM mrjj

            @osssome
            super.
            well people name things very differently sometimes.

            osssomeO Offline
            osssomeO Offline
            osssome
            wrote on last edited by
            #5

            @mrjj

            I didn't get a chance to use your info yet. I will dig around some more using your advice. Thanks!

            1 Reply Last reply
            0
            • mrjjM mrjj

              @osssome
              super.
              well people name things very differently sometimes.

              osssomeO Offline
              osssomeO Offline
              osssome
              wrote on last edited by
              #6

              @mrjj Yes they are using .ini everywhere. :'(

              mrjjM 1 Reply Last reply
              0
              • osssomeO osssome

                @mrjj Yes they are using .ini everywhere. :'(

                mrjjM Offline
                mrjjM Offline
                mrjj
                Lifetime Qt Champion
                wrote on last edited by
                #7

                @osssome
                Well sometimes running the program in debug mode and single step around also helps to see
                what calls what and when.

                Are you trying to add new translation to it?

                1 Reply Last reply
                0
                • osssomeO Offline
                  osssomeO Offline
                  osssome
                  wrote on last edited by
                  #8

                  I'm not. But your advice helped me. Thanks!

                  1 Reply Last reply
                  1

                  • Login

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