简短文件名
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
#include "base.h"
|
||||
#include <QLabel>
|
||||
#include <QPushButton>
|
||||
|
||||
BasePage::BasePage(AppContext* ctx, QWidget* parent)
|
||||
: QWidget(parent), m_ctx(ctx)
|
||||
{
|
||||
setObjectName("pageRoot");
|
||||
setStyleSheet(QString("QWidget#pageRoot{background-color:%1;}").arg(C::BG));
|
||||
}
|
||||
|
||||
QLabel* BasePage::label(const QString& text, int px, const QString& color, bool bold, QWidget* parent)
|
||||
{
|
||||
QLabel* l = new QLabel(text, parent);
|
||||
l->setStyleSheet(QString("color:%1;font-size:%2px;%3").arg(color).arg(px)
|
||||
.arg(bold ? "font-weight:700;" : ""));
|
||||
return l;
|
||||
}
|
||||
|
||||
QPushButton* BasePage::button(const QString& text, const QString& variant, QWidget* parent)
|
||||
{
|
||||
QPushButton* b = new QPushButton(text, parent);
|
||||
if (!variant.isEmpty())
|
||||
b->setProperty("variant", variant);
|
||||
return b;
|
||||
}
|
||||
Reference in New Issue
Block a user