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. Sending struct to QDialog
Forum Updated to NodeBB v4.3 + New Features

Sending struct to QDialog

Scheduled Pinned Locked Moved Solved General and Desktop
17 Posts 4 Posters 1.0k 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.
  • Christian EhrlicherC Christian Ehrlicher

    @RainyDays said in Sending struct to QDialog:

    but it complains when i want to point the data towards the dialog?

    What does this mean?

    R Offline
    R Offline
    RainyDays
    wrote on last edited by
    #7

    @Christian-Ehrlicher said in Sending struct to QDialog:

    @RainyDays said in Sending struct to QDialog:

    but it complains when i want to point the data towards the dialog?

    What does this mean?

    "No viable conversion from Mainstruct to Dialogstruct"

    Where Mainstruct is a struct in the MainWindow and Dialogstruct is a struct in the DialogWindow.

    Both are set up like this

    typedef struct
        {
            bool Condition1;        
            bool Condition2;        
            bool Condition3;
            QString String1;
            QString String2;
            QString String3;
    }
    
    Christian EhrlicherC 1 Reply Last reply
    0
    • R RainyDays

      @Christian-Ehrlicher said in Sending struct to QDialog:

      @RainyDays said in Sending struct to QDialog:

      but it complains when i want to point the data towards the dialog?

      What does this mean?

      "No viable conversion from Mainstruct to Dialogstruct"

      Where Mainstruct is a struct in the MainWindow and Dialogstruct is a struct in the DialogWindow.

      Both are set up like this

      typedef struct
          {
              bool Condition1;        
              bool Condition2;        
              bool Condition3;
              QString String1;
              QString String2;
              QString String3;
      }
      
      Christian EhrlicherC Offline
      Christian EhrlicherC Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #8

      @RainyDays said in Sending struct to QDialog:

      Both are set up like this

      Which is wrong - you need one struct definition.

      You really should start with the basics of c(++) before fiddling around with Qt.

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

      R 1 Reply Last reply
      1
      • Christian EhrlicherC Christian Ehrlicher

        @RainyDays said in Sending struct to QDialog:

        Both are set up like this

        Which is wrong - you need one struct definition.

        You really should start with the basics of c(++) before fiddling around with Qt.

        R Offline
        R Offline
        RainyDays
        wrote on last edited by
        #9

        @Christian-Ehrlicher

        Informative, well chosen.
        I hear QT is a mysterious device that could be dangerous for those who have not chosen the right path from the beginning.
        Thanks for the warning :)

        Christian EhrlicherC 1 Reply Last reply
        0
        • R RainyDays

          @Christian-Ehrlicher

          Informative, well chosen.
          I hear QT is a mysterious device that could be dangerous for those who have not chosen the right path from the beginning.
          Thanks for the warning :)

          Christian EhrlicherC Offline
          Christian EhrlicherC Offline
          Christian Ehrlicher
          Lifetime Qt Champion
          wrote on last edited by
          #10

          @RainyDays said in Sending struct to QDialog:

          I hear QT is a mysterious device that could be dangerous for those who have not chosen the right path from the beginning.

          If you think... but i only said that at least basic c++ knowledge is needed since Qt is a c++ library.

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

          R 1 Reply Last reply
          0
          • Christian EhrlicherC Christian Ehrlicher

            @RainyDays said in Sending struct to QDialog:

            I hear QT is a mysterious device that could be dangerous for those who have not chosen the right path from the beginning.

            If you think... but i only said that at least basic c++ knowledge is needed since Qt is a c++ library.

            R Offline
            R Offline
            RainyDays
            wrote on last edited by
            #11

            @Christian-Ehrlicher
            The first time is always the hardest time and for me this was too many years ago :)
            Takes a while to get the engine running again!
            But why stop when you reach an obstacle? Just ask for a friendly helping hand?

            I´m really sure though i need to define the structs in each of the header files.
            Otherwise the dialog does not know what it´s struct is...right?

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

              One single definition.

              Put that in a different header that both can include.

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

              R 1 Reply Last reply
              1
              • SGaistS SGaist

                One single definition.

                Put that in a different header that both can include.

                R Offline
                R Offline
                RainyDays
                wrote on last edited by
                #13

                @SGaist

                Ok, so any change in the struct will affect both with no mismatch of data?

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

                  That's the goal: one single source of truth.

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

                  JonBJ R 2 Replies Last reply
                  0
                  • SGaistS SGaist

                    That's the goal: one single source of truth.

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

                    @SGaist
                    I didn't realize C structs could have religious overtones ;-)

                    R 1 Reply Last reply
                    0
                    • JonBJ JonB

                      @SGaist
                      I didn't realize C structs could have religious overtones ;-)

                      R Offline
                      R Offline
                      RainyDays
                      wrote on last edited by RainyDays
                      #16

                      @JonB
                      It does, in PLC programming it stands for order in chaos.
                      A minimalistic well sorted complex data structure applicable to many objects with the same type of in and outputs.

                      1 Reply Last reply
                      0
                      • SGaistS SGaist

                        That's the goal: one single source of truth.

                        R Offline
                        R Offline
                        RainyDays
                        wrote on last edited by
                        #17

                        @SGaist

                        It works now by the way :)
                        Thanks for hanging around!

                        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