-
Notifications
You must be signed in to change notification settings - Fork 124
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Using setstylesheet once will create new objects Change-Id: I8126113766f9b1881b2b3825dc1985c6eea9b854
- Loading branch information
haruyukilxz
committed
Jul 4, 2018
1 parent
eb9ea57
commit 052b6b2
Showing
12 changed files
with
105 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<RCC> | ||
<qresource prefix="/"> | ||
<file>qss/frame.qss</file> | ||
</qresource> | ||
</RCC> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#include "tipswidget.h" | ||
|
||
#include <QPainter> | ||
|
||
TipsWidget::TipsWidget(QWidget *parent) : QFrame(parent) | ||
{ | ||
|
||
} | ||
|
||
void TipsWidget::setText(const QString &text) | ||
{ | ||
m_text = text; | ||
|
||
setFixedSize(fontMetrics().width(text) + 6, fontMetrics().height()); | ||
} | ||
|
||
void TipsWidget::paintEvent(QPaintEvent *event) | ||
{ | ||
QFrame::paintEvent(event); | ||
|
||
QPainter painter(this); | ||
|
||
QPen pen(Qt::white); | ||
painter.setPen(pen); | ||
|
||
QTextOption option; | ||
option.setAlignment(Qt::AlignCenter); | ||
painter.drawText(rect(), m_text, option); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#ifndef TIPSWIDGET_H | ||
#define TIPSWIDGET_H | ||
|
||
#include <QFrame> | ||
|
||
class TipsWidget : public QFrame | ||
{ | ||
Q_OBJECT | ||
public: | ||
explicit TipsWidget(QWidget *parent = nullptr); | ||
|
||
void setText(const QString &text); | ||
|
||
protected: | ||
void paintEvent(QPaintEvent *event) override; | ||
|
||
private: | ||
QString m_text; | ||
}; | ||
|
||
#endif // TIPSWIDGET_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#MainPanel[position='0'] { | ||
padding: 0 0px; | ||
border-top: none; | ||
} | ||
|
||
#MainPanel[position='1'] { | ||
padding: 0px 0; | ||
border-right: none; | ||
} | ||
|
||
#MainPanel[position='2'] { | ||
padding:0 0px; | ||
border-bottom: none; | ||
} | ||
|
||
#MainPanel[position='3'] { | ||
padding: 0px 0; | ||
border-left: none; | ||
} |