0
点赞
收藏
分享

微信扫一扫

量化交易之QT篇 - TQZLabel - 自定义QLabel


// TQZLabel.h

#ifndef TQZLABEL_H
#define TQZLABEL_H

#include <QLabel>

class TQZLabel : public QLabel
{
    Q_OBJECT
public:
    explicit TQZLabel(const QString &text, QWidget *parent = nullptr);

signals:

};

#endif // TQZLABEL_H

// TQZLabel.cpp

#include "TQZLabel.h"

TQZLabel::TQZLabel(const QString &text, QWidget *parent) : QLabel(text, parent)
{
//    this->setStyleSheet("background-color: blue; color: white; font-size: 18px;");
    this->setStyleSheet("color: white; font-size: 18px;");

    QFont font("宋体", 15, QFont::Medium);
    this->setFont(font);
}

举报

相关推荐

0 条评论