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. Intercept event click or signal not present help me
QtWS25 Last Chance

Intercept event click or signal not present help me

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 3 Posters 662 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.
  • Nio74N Offline
    Nio74N Offline
    Nio74
    wrote on last edited by aha_1980
    #1

    Good morning I'm trying to understand how this project works:

    REPRaptor

    In Maiinwindow.ui there is a "Connect" button but I can not understand in its mainwindow.cpp where its click event is intercepted or its signal. Any expert can take a look? it's 4 days that I study day and night but nothing to do.

    1 Reply Last reply
    0
    • KillerSmathK Offline
      KillerSmathK Offline
      KillerSmath
      wrote on last edited by mrjj
      #2

      @Nio74
      Are you talking about theconnectBtnclick signal ?

      The connection of connectBtn signal has made in Ui Designer File and called frommainwindow.cppwhenui->setupUi(this)is called

      http://doc.qt.io/qt-5/designer-using-a-ui-file.html <- Read more

      You need to understand that a design ui file is converted from xml syntax to C++ syntax when you application is built.

      You can see the preview of c++ convertion code on designer tool: <QT Folder><Qt Version><Compiler Version>\bin\designer

        1. open the ui file with designer tool
        1. at top menu, click on Form Button and after on View Code Button

      0_1529213320281_viewcode.png

      @Computer Science Student - Brazil
      Web Developer and Researcher
      “Sometimes it’s the people no one imagines anything of who do the things that no one can imagine.” - Alan Turing

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

        Hi
        Adding to @KillerSmath nice explanation,
        in the setupUI(this)
        the call QMetaObject::connectSlotsByName(MainWindow);
        makes auto connections.
        It expects the slot to be name in with the syntax
        on_widgetname_signal

        However, in this case its not bound by auto but as KillerSmath says in Designer
        You can view them directly with the Signals and Slots editor (tab) ( In Creators Designer)

        alt text

        1 Reply Last reply
        3
        • Nio74N Offline
          Nio74N Offline
          Nio74
          wrote on last edited by
          #4

          Thanks you were quick and very good to answer me thank you very kind...

          1 Reply Last reply
          2

          • Login

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