qt/ledset/gqt.h
2022-08-25 18:43:03 +08:00

34 lines
730 B
C++

#ifndef GLABEL_H
#define GLABEL_H
#include <QVBoxLayout>
#include <QLabel>
template<class T>
class Wgt{
public:
T *wgt;
Wgt(T *wgt = nullptr){
this->wgt = wgt;
};
inline Wgt* margin(int a){
wgt->setMargin(a);
return this;
}
};
class VBox : public QVBoxLayout{
public:
inline VBox(QWidget *parent=nullptr) : QVBoxLayout(parent){}
inline VBox(QBoxLayout *boxLayout){
boxLayout->addLayout(this);
};
};
class Label : public QLabel, public Wgt<Label>{
public:
explicit Label(QWidget *parent=nullptr, Qt::WindowFlags f=Qt::WindowFlags());
explicit Label(const QString &text, QWidget *parent=nullptr, Qt::WindowFlags f=Qt::WindowFlags());
};
#endif // GLABEL_H