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. "coding " slots and signals in QtCreator
Forum Updated to NodeBB v4.3 + New Features

"coding " slots and signals in QtCreator

Scheduled Pinned Locked Moved Solved General and Desktop
7 Posts 3 Posters 1.2k 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.
  • A Offline
    A Offline
    Anonymous_Banned275
    wrote on last edited by Anonymous_Banned275
    #1

    Yet another silly QtCreator question...
    please help me find "Connections view " in QtCreator.

    I can "code" slots from QtCreator (form designer) BUT I cannot find "Connections" view to code signals - in QtCreator.

    https://doc.qt.io/qtcreator/quick-signals.html (??)

    This link gives impression I need QtQuick and QML

    A real QtCreator sample code (reference) would be appreciated, the "standard examples" are for plain Qtx - not for QtCreator / QtDesigner.

    I am not to keen on learning "connect" if there is a easier way (IDE) to code slots and signals.

    Addendum
    Found this

    https://doc.qt.io/archives/qt-4.8/designer-connection-mode.html

    it MAY help
    Addendum II

    It does BUT - where is the "signal" code function ??
    (Or QtDesigner does not "update " the "signal" code ? "slots " do !

    I can "push button" and delete widget , but I need to process some real logic...

    Pl45m4P 1 Reply Last reply
    0
    • A Offline
      A Offline
      Anonymous_Banned275
      wrote on last edited by
      #7

      SOLVED
      user error - RTFM

      1 Reply Last reply
      1
      • A Anonymous_Banned275

        Yet another silly QtCreator question...
        please help me find "Connections view " in QtCreator.

        I can "code" slots from QtCreator (form designer) BUT I cannot find "Connections" view to code signals - in QtCreator.

        https://doc.qt.io/qtcreator/quick-signals.html (??)

        This link gives impression I need QtQuick and QML

        A real QtCreator sample code (reference) would be appreciated, the "standard examples" are for plain Qtx - not for QtCreator / QtDesigner.

        I am not to keen on learning "connect" if there is a easier way (IDE) to code slots and signals.

        Addendum
        Found this

        https://doc.qt.io/archives/qt-4.8/designer-connection-mode.html

        it MAY help
        Addendum II

        It does BUT - where is the "signal" code function ??
        (Or QtDesigner does not "update " the "signal" code ? "slots " do !

        I can "push button" and delete widget , but I need to process some real logic...

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

        @AnneRanch said in "coding " slots and signals in QtCreator:

        I can "push button" and delete widget , but I need to process some real logic...

        The simple stuff may work... but as you've said, you can't "code" or add some logic to these simple connections, that are possible in QtDesigner.
        Your linked example from Qt doc shows a connection between a QPushButton::clicked signal and, I guess QLineEdit::return

        Edit:

        Never mind, it was the other way round... A return press inside this QLineEdit will animateClick the OK QPushbutton -> Direct connection, no logic involved, both (signal and slot) are standard Qt slots / signals.

        This is not very helpful, when creating your own programs.
        (I personally use this only for my custom QDialogs, to connect buttons to QDialog::reject () or accept())

        Are you trying to avoid as much coding work as possible? :-)

        @AnneRanch said in "coding " slots and signals in QtCreator:

        where is the "signal" code function ??
        (Or QtDesigner does not "update " the "signal" code ? "slots " do !

        Signals don't need much code. The standard Qt signals are just for use only. In most cases you don't have to change them at all and if you do, there are lambda's or signal overloading, which you dont need to worry about for now.
        And for custom signals: How should your QtDesigner know, what you are planning to do in order to create them for you? :)
        And it's just one little line in your header file. Signals don't get implemented in your *.cpp file. Add the definition to your header and feel free to use it everywhere you want :)


        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
        1
        • A Offline
          A Offline
          Anonymous_Banned275
          wrote on last edited by Anonymous_Banned275
          #3

          Of course I am for KISS , and so far QtCreator is nothing but KISS - in wrong sense.
          I just cannot help to wonder - QtDesigner "builds" slot and NOT signal in GUI and it magically works without code .. what is practical use for it ??
          I am just hoping I am just missing some option - AGAIN.

          I missed part of the reply.

          Here is in a nutshell WHY I like to have working slot /signal.

          Push button to start scan (slot) for nearby bluetooth devices. (DONE)
          That runs very rudimentary and well abused "blue-tooth inquiry" function..
          The "blue-tooth inquiry" returns with # of BT devices found AFTER several seconds. Hence "signal" to list the devices.

          Perhaps I need another approach to this or back to "connect".
          .

          Pl45m4P 1 Reply Last reply
          0
          • A Offline
            A Offline
            Anonymous_Banned275
            wrote on last edited by
            #4

            @Pl45m4 said in "coding " slots and signals in QtCreator:

            Signals don't get implemented in your *.cpp file.

            That is not correct - "slots" and "signals " are just another variables.
            "Go to slot.." builds required function in header and cpp.
            Why not "build signal" ??

            Chris KawaC 1 Reply Last reply
            0
            • A Anonymous_Banned275

              @Pl45m4 said in "coding " slots and signals in QtCreator:

              Signals don't get implemented in your *.cpp file.

              That is not correct - "slots" and "signals " are just another variables.
              "Go to slot.." builds required function in header and cpp.
              Why not "build signal" ??

              Chris KawaC Offline
              Chris KawaC Offline
              Chris Kawa
              Lifetime Qt Champion
              wrote on last edited by
              #5

              @AnneRanch said:

              "slots" and "signals " are just another variables.

              No, they're not. They are functions. Slots contain your logic. Signals are generated by moc to facilitate connections, so you don't implement them manually, just declare them so moc knows the signature.

              "Go to slot.." builds required function in header and cpp.

              "Go to slot" is a wizard that just generates a slot with a name that is understood by the auto-connection feature of QObjects. The generated slot function arguments are matched to those of the signal you want it auto-connected to.

              Why not "build signal" ??

              How would it know what signature you want for a signal? It can't. Only you, as the designer of your class know that, hence no "build signal". If there was a wizard for it, it would just ask you for a function name and a list of parameter names and their types. It can't make them up on its own. You would need to type that in anyway so you might as well just type in the signal. All a wizard could generate on its own are the () around function parameters.

              I just cannot help to wonder - QtDesigner "builds" slot and NOT signal in GUI and it magically works without code .. what is practical use for it ??

              I've already linked you the auto-connect feature documentation in another thread of yours and described how it works, its intended purpose and why it's a bad idea to use it at all. I feel like you're asking the same questions over and over but don't read or do read but don't want to accept the answers you're getting. They're not gonna change because you don't like them.

              It does BUT - where is the "signal" code function ??

              We've been over this too at least couple of times at this point in various topics over the months (years now?). You declare them in the header and moc generates body for them in a separate cpp file.

              I am not to keen on learning "connect" if there is a easier way (IDE) to code slots and signals.

              What's there to learn? connect(sender, signal, receiver, slot). That's it. It's one function. Sorry to say this, but if you invested half the time I've seen you complain about it into "learning it" you would be a connection master by now. There's really not that much to it. It's literally one function with four parameters.

              1 Reply Last reply
              6
              • A Anonymous_Banned275

                Of course I am for KISS , and so far QtCreator is nothing but KISS - in wrong sense.
                I just cannot help to wonder - QtDesigner "builds" slot and NOT signal in GUI and it magically works without code .. what is practical use for it ??
                I am just hoping I am just missing some option - AGAIN.

                I missed part of the reply.

                Here is in a nutshell WHY I like to have working slot /signal.

                Push button to start scan (slot) for nearby bluetooth devices. (DONE)
                That runs very rudimentary and well abused "blue-tooth inquiry" function..
                The "blue-tooth inquiry" returns with # of BT devices found AFTER several seconds. Hence "signal" to list the devices.

                Perhaps I need another approach to this or back to "connect".
                .

                Pl45m4P Online
                Pl45m4P Online
                Pl45m4
                wrote on last edited by Pl45m4
                #6

                Jeeeeesus.... :-)

                What's the purpose of all this?! You want to finish your Bluetooth project, right? And maybe continue with some other projects on your own?!
                Why are you question everything? If somebody tells you, how it is working, you question the WAY HOW it works...?! Just use your knowledge, you've gained from all this and accept that some things just cannot be done, because it would not make any sense or they are technically not possible.

                Don't get me wrong, I'm not mad, but I don't understand how you can ask so many questions without getting any benefit (seems like that).
                And most of them got answered very detailed.

                @AnneRanch said in "coding " slots and signals in QtCreator:

                QtDesigner "builds" slot and NOT signal in GUI and it magically works without code .. what is practical use for it ??

                QtDesigner is not doing less than it should... It provides already more than necessary to fulfill its purpose and you are missing exactly the things, that can't be done / QtDesigner wasn't made for. Most things are bonus features. Actually the whole QtDesigner is a bonus. You don't need it at all to create even complex GUIs and programs. So you can't start from there and expect QtDesigner to solve every problem with one mouse click/drag for you, even if it seems tempting :-)

                Try to do as much by code as possible. If you can speed some things up, by using e.g. the QtDesigner to quickly set up some basic connections, fine, but it's not meant to replace these things completely.

                If you continue to work like this, you will always come to a point, where some things are just not possible anymore and then we have the same discussions again and again :)


                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
                3
                • A Offline
                  A Offline
                  Anonymous_Banned275
                  wrote on last edited by
                  #7

                  SOLVED
                  user error - RTFM

                  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