June 2018
Intermediate to advanced
348 pages
8h 45m
English
As the label class has been implemented, we need to implement the dialog class to place all of the widgets and handle all of the signals emitted from the my_QLabel object. Let's start with the dialog.h header file:
#include <QDialog>
class my_QLabel;
class QLabel;
class Dialog : public QDialog
{
Q_OBJECT
public:
explicit Dialog(QWidget *parent = 0);
~Dialog();
private slots:
void Mouse_CurrentPosition();
void Mouse_Pressed();
void Mouse_Left();
private:
void initializeWidgets();
my_QLabel *label_MouseArea;
QLabel *label_Mouse_CurPos;
QLabel *label_MouseEvents;
};
Here, we are creating a Dialog class inherited from QDialog, defined under the <QDialog> library. The classes QLabel and my_QLabel are forward declared ...