Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Language Bindings
  4. Qt GUI with Eclipse c++
QtWS25 Last Chance

Qt GUI with Eclipse c++

Scheduled Pinned Locked Moved Unsolved Language Bindings
11 Posts 3 Posters 2.9k Views
  • 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.
  • G Offline
    G Offline
    GastonMelo
    wrote on last edited by
    #1

    Hi to all,
    I've created a basic GUI with 2 buttons. I can start the GUI from eclipse and now Im wondering how can I check the click event on each of those 2 buttons from eclipse? Im using linux and Qt5 (5.13.0 version). Can you provide a link to a tutorial on eclipse and Qt?
    Thanks
    Gaston

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

      Hi,

      What do you mean by "check the click event" ?

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

      1 Reply Last reply
      0
      • G Offline
        G Offline
        GastonMelo
        wrote on last edited by
        #3

        in the GUI I have 2 buttons. I want to print a message when I click on 1 button.
        Gastón

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

          Just use qDebug for that.

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

          1 Reply Last reply
          1
          • G Offline
            G Offline
            GastonMelo
            wrote on last edited by
            #5

            qDebug? Where en eclipse c++? Can you elaborate? Im using eclipse c++ with Qt5 Gui on linux tumbleweed.
            Gastón

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

              It has nothing specific to Eclipse, it's a stream operator that will send whatever you pass to it to the console.

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

              1 Reply Last reply
              0
              • G Offline
                G Offline
                GastonMelo
                wrote on last edited by
                #7

                Maybe I wrote incorrectly my question. Here we go: Im using Qt5 and eclipse c++. I made a simple GUI on Qt5 and converted to cpp with UIC file (in the binary folder inside Qt5). In eclipse I'm using this cpp file (as header file) to invoke that GUI.
                What I want to do now is to be able to use those 2 buttons in the GUI. I want to display a message when I press one of those 2 buttons. Here is the question, how I do that in eclipse cpp? looking in other forum I see this line:

                QObject::connect(button, SIGNAL(clicked()),this, SLOT(clickedSlot()));

                I dont understand the "this" parameter in the connect(). The clickedSlot() is the subroutine generated when the button is clicked. How to translate "this" to eclipse.

                Thanks for you help SGaist.
                Gastón

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

                  Ok, then first thing to understand: Eclipse is just an IDE, Eclipse C++, is just a specialisation of Eclipse to write C++ programs. There's nothing to translate here, Qt is a C++ framework, whether your write your application with Eclipse or on the command line, it doesn't change anything.

                  If you don't know what this represent in C++, I encourage you to first learn the C++ basics before going any further.

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

                  1 Reply Last reply
                  1
                  • G Offline
                    G Offline
                    GastonMelo
                    wrote on last edited by
                    #9

                    you are right. How do I define a private slot in c++. I dont have that vast knlowdge.
                    Gastón

                    aha_1980A 1 Reply Last reply
                    0
                    • G GastonMelo

                      you are right. How do I define a private slot in c++. I dont have that vast knlowdge.
                      Gastón

                      aha_1980A Offline
                      aha_1980A Offline
                      aha_1980
                      Lifetime Qt Champion
                      wrote on last edited by
                      #10

                      @GastonMelo

                      You should read https://doc.qt.io/archives/qt-4.8/signalsandslots.html to get a feeling for that topic.

                      Qt has to stay free or it will die.

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

                        I'd recommend reading the Qt5 version: https://doc.qt.io/qt-5/signalsandslots.html

                        @GastonMelo You really should take the time to go through Qt's documentation. It's full of tutorials, getting started guides and it also explains all the core concepts provided within the framework.

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

                        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