Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Intercept event click or signal not present help me



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



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


  • Lifetime Qt Champion

    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



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


Log in to reply