class Clock_me : public QObject
{
Q_OBJECT
public:
Clock_me(QObject* parent = nullptr);
void create_clock(QWidget &widget);
void update_clock();
public slots:
void handleButton();
private:
QLabel *label;
QPushButton *button;
QString TimeString;
};
Clock_me::Clock_me(QObject* parent)
:Qbject(parent)
{
label = new QLabel();
button = new QPushButton("MMM dd HH:mm:ss",);
connect(&button, &QPushButton::clicked, this, &Clock_me::handleButton);
}
void Clock_me::handleButton() {
qDebug() << "Button clicked!";
}