Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Include a dialog twice
Qt 6.11 is out! See what's new in the release blog

Include a dialog twice

Scheduled Pinned Locked Moved Solved General and Desktop
16 Posts 7 Posters 2.5k Views 3 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.
  • SGaistS SGaist

    What is keyMappingsColor ?

    S Offline
    S Offline
    Sucharek
    wrote on last edited by
    #7

    The class I'm including

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #8

      That I understood.

      My question was rather: how did you implement it ?

      Is it really located in "keymapping.h" ?
      Is it in a namespace ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      S 1 Reply Last reply
      0
      • SGaistS SGaist

        That I understood.

        My question was rather: how did you implement it ?

        Is it really located in "keymapping.h" ?
        Is it in a namespace ?

        S Offline
        S Offline
        Sucharek
        wrote on last edited by
        #9

        @SGaist, I implemented including the keymapping.h as you said, and putting keyMappingColor map; in private:
        I included it in MainWindow too (the same way, but under a different name (not map but keyMap)), and it works.

        1 Reply Last reply
        0
        • Christian EhrlicherC Offline
          Christian EhrlicherC Offline
          Christian Ehrlicher
          Lifetime Qt Champion
          wrote on last edited by
          #10

          @Sucharek said in Include a dialog twice:

          keyColor

          Do oyu include this header file inside keymapping.h ? If so you've a circular include problem -> google for 'forward declaration' and remove the circular include with the help of this.

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

          S 1 Reply Last reply
          1
          • Christian EhrlicherC Christian Ehrlicher

            @Sucharek said in Include a dialog twice:

            keyColor

            Do oyu include this header file inside keymapping.h ? If so you've a circular include problem -> google for 'forward declaration' and remove the circular include with the help of this.

            S Offline
            S Offline
            Sucharek
            wrote on last edited by
            #11

            Hi @Christian-Ehrlicher, yes I had it included in both dialogs. When I removed it in keymapping.h, I could include the in the other class, so thanks, but I have another problem, which was actually the first one I had.
            So everytime I'm opening the dialog, I check for differences in some variables from the keymapping.h, but when I do, they don't update for some reason. Even when I try to update them in the dialog, the don't.

            JonBJ 1 Reply Last reply
            0
            • S Sucharek

              Hi @Christian-Ehrlicher, yes I had it included in both dialogs. When I removed it in keymapping.h, I could include the in the other class, so thanks, but I have another problem, which was actually the first one I had.
              So everytime I'm opening the dialog, I check for differences in some variables from the keymapping.h, but when I do, they don't update for some reason. Even when I try to update them in the dialog, the don't.

              JonBJ Offline
              JonBJ Offline
              JonB
              wrote on last edited by
              #12

              @Sucharek said in Include a dialog twice:

              So everytime I'm opening the dialog, I check for differences in some variables from the keymapping.h, but when I do, they don't update for some reason. Even when I try to update them in the dialog, the don't.

              Do you really think anyone can answer from this description?

              S 1 Reply Last reply
              0
              • JonBJ JonB

                @Sucharek said in Include a dialog twice:

                So everytime I'm opening the dialog, I check for differences in some variables from the keymapping.h, but when I do, they don't update for some reason. Even when I try to update them in the dialog, the don't.

                Do you really think anyone can answer from this description?

                S Offline
                S Offline
                Sucharek
                wrote on last edited by
                #13

                Hi @JonB, sorry for doing a bad description. Here's a better one:
                Everytime I execute a dialog, I have a void that sets text for buttons and gets the text from keymapping.h, but when I try to get the variables after I change some of them, they don't update. For example, I have a variable called X. I execute the keymapping dialog, and change it. Then I go to the dialog where I want to get the variable, but when I try to update it, it stays the same.

                jsulmJ J.HilkJ 2 Replies Last reply
                0
                • S Sucharek

                  Hi @JonB, sorry for doing a bad description. Here's a better one:
                  Everytime I execute a dialog, I have a void that sets text for buttons and gets the text from keymapping.h, but when I try to get the variables after I change some of them, they don't update. For example, I have a variable called X. I execute the keymapping dialog, and change it. Then I go to the dialog where I want to get the variable, but when I try to update it, it stays the same.

                  jsulmJ Offline
                  jsulmJ Offline
                  jsulm
                  Lifetime Qt Champion
                  wrote on last edited by
                  #14

                  @Sucharek Please show the code...
                  Are those really stand alone variables?
                  Declare them as "extern" to make sure you're not simply creating new variables with same name everywhere you include that header file.

                  https://forum.qt.io/topic/113070/qt-code-of-conduct

                  1 Reply Last reply
                  0
                  • S Sucharek

                    Hi @JonB, sorry for doing a bad description. Here's a better one:
                    Everytime I execute a dialog, I have a void that sets text for buttons and gets the text from keymapping.h, but when I try to get the variables after I change some of them, they don't update. For example, I have a variable called X. I execute the keymapping dialog, and change it. Then I go to the dialog where I want to get the variable, but when I try to update it, it stays the same.

                    J.HilkJ Offline
                    J.HilkJ Offline
                    J.Hilk
                    Moderators
                    wrote on last edited by
                    #15

                    @Sucharek said in Include a dialog twice:

                    Hi @JonB, sorry for doing a bad description. Here's a better one:
                    Everytime I execute a dialog, I have a void that sets text for buttons and gets the text from keymapping.h, but when I try to get the variables after I change some of them, they don't update. For example, I have a variable called X. I execute the keymapping dialog, and change it. Then I go to the dialog where I want to get the variable, but when I try to update it, it stays the same.

                    please keep in mind, your 2 dialogs are 2 different instances, even though they share a base class, they are completely separated. That means changing stuff in the base class from inside one dialog will not ever effect stuff in the base class of the other dialog, when your program is running.


                    Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


                    Q: What's that?
                    A: It's blue light.
                    Q: What does it do?
                    A: It turns blue.

                    S 1 Reply Last reply
                    1
                    • J.HilkJ J.Hilk

                      @Sucharek said in Include a dialog twice:

                      Hi @JonB, sorry for doing a bad description. Here's a better one:
                      Everytime I execute a dialog, I have a void that sets text for buttons and gets the text from keymapping.h, but when I try to get the variables after I change some of them, they don't update. For example, I have a variable called X. I execute the keymapping dialog, and change it. Then I go to the dialog where I want to get the variable, but when I try to update it, it stays the same.

                      please keep in mind, your 2 dialogs are 2 different instances, even though they share a base class, they are completely separated. That means changing stuff in the base class from inside one dialog will not ever effect stuff in the base class of the other dialog, when your program is running.

                      S Offline
                      S Offline
                      Sucharek
                      wrote on last edited by
                      #16

                      Hi @J-Hilk, thanks for your answer.
                      I'll just change the variables from MainWidnow.

                      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
                      • Unsolved