I subclassed a QPushButton and in the constructor I changed the text of QPushButton however the text does not change in the actual button any suggestions on why the text is not changing ?
#ifndef QCUSTOMPUSHBUTTON
#define QCUSTOMPUSHBUTTON
#include "QObject"
#include "QPushButton"
{
Q_OBJECT
public:
{
this->setText("testing123");
}
signals:
void DoubleClick();
protected:
virtual void mouseDoubleClickEvent
(QMouseEvent *) override
{
emit DoubleClick();
}
};
#endif // QCUSTOMPUSHBUTTON
#ifndef QCUSTOMPUSHBUTTON
#define QCUSTOMPUSHBUTTON
#include "QObject"
#include "QPushButton"
class QCustomPushBtton : public QPushButton
{
Q_OBJECT
public:
QCustomPushBtton(QWidget *parent=0):QPushButton(parent)
{
this->setText("testing123");
}
signals:
void DoubleClick();
protected:
virtual void mouseDoubleClickEvent(QMouseEvent *) override
{
emit DoubleClick();
}
};
#endif // QCUSTOMPUSHBUTTON
To copy to clipboard, switch view to plain text mode
Bookmarks