I would like to inherit from "QDoubleSpinBox" and add some functionality and add to MainWindow. the code like this compiles fine, but i don't know how to add it/place it on via code MainWindow along the other elements in designer.
.h file:
class DoubleSpinner : public QDoubleSpinBox
{
Q_OBJECT
public:
DoubleSpinner (QDoubleSpinBox *parent = nullptr);
~DoubleSpinner(){}
//Message();
private:
};
.cpp file:
DoubleSpinner::DoubleSpinner (QDoubleSpinBox *parent) : QDoubleSpinBox(parent)
{
}
mainwindow.cpp
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
ui->lineEdit->setText("0.0001");
//DoubleSpinner ds = new DoubleSpinner;
}
MainWindow::~MainWindow()
{
delete ui;
}