Intercept event click or signal not present help me
-
Good morning I'm trying to understand how this project works:
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 theconnectBtn
click signal ?The connection of connectBtn signal has made in
Ui Designer File
and called frommainwindow.cpp
whenui->setupUi(this)
is calledhttp://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
-
- open the ui file with designer tool
-
- at top menu, click on Form Button and after on View Code Button
-
-
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_signalHowever, 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)