Skip to content
Snippets Groups Projects

[+]New class

Merged konstantin.kukharenko requested to merge features-3063 into develop
3 unresolved threads

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
1 #include "CustomLineHeightLabel.h"
2 #include "AppStyleSheetHandler.h"
3
4 CustomLineHeightLabel::CustomLineHeightLabel(QWidget *a_parent)
5 :QLabel (a_parent)
6 {
7 }
8
9 void CustomLineHeightLabel::setText(const QString &text)
10 {
11 if(m_HightLine.isEmpty())m_HightLine = "100";
12 QString textToHtml = QString("<p style = 'line-height:%1;'>").arg(m_HightLine);
  • 2 #define CUSTOMLINEHEIGHTLABEL_H
    3
    4 #include <QLabel>
    5
    6 class CustomLineHeightLabel: public QLabel
    7 {
    8 public:
    9 explicit CustomLineHeightLabel(QWidget *a_parent = Q_NULLPTR);
    10
    11 void setText(const QString &text);
    12 void setObjectName(const QString &name);
    13
    14 void updateStyleSheets();
    15
    16 private:
    17 QString m_HightLine;
  • added 1 commit

    Compare with previous version

  • 14 QLabel::setText(textToHtml);
    15
    16 }
    17
    18 void CustomLineHeightLabel::setObjectName(const QString &name)
    19 {
    20 QObject::setObjectName(name);
    21
    22 updateStyleSheets();
    23 }
    24
    25 void CustomLineHeightLabel::updateStyleSheets()
    26 {
    27
    28 StyleSheatSearchPar searchPar;
    29 searchPar.widgetName = "#"+ parent()->objectName() + " #" + this->objectName();
  • added 1 commit

    Compare with previous version

  • mentioned in commit d267abce

  • Please register or sign in to reply
    Loading