Fixed compiler warning in StyledLabel

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@8382 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2015-06-06 12:58:14 +00:00
parent b88f4058a8
commit 72085de44b
2 changed files with 13 additions and 2 deletions

View File

@ -34,10 +34,17 @@ StyledLabel::StyledLabel(const QString &text, QWidget *parent)
{ {
} }
int StyledLabel::fontSizeFactor()
{
return mFontSizeFactor;
}
void StyledLabel::setFontSizeFactor(int factor) void StyledLabel::setFontSizeFactor(int factor)
{ {
mFontSizeFactor = factor;
QFont f = font(); QFont f = font();
qreal fontSize = factor * f.pointSizeF() / 100; qreal fontSize = mFontSizeFactor * f.pointSizeF() / 100;
f.setPointSizeF(fontSize); f.setPointSizeF(fontSize);
setFont(f); setFont(f);
} }

View File

@ -27,13 +27,17 @@
class StyledLabel : public QLabel class StyledLabel : public QLabel
{ {
Q_OBJECT Q_OBJECT
Q_PROPERTY(int fontSizeFactor WRITE setFontSizeFactor) Q_PROPERTY(int fontSizeFactor READ fontSizeFactor WRITE setFontSizeFactor)
public: public:
StyledLabel(QWidget *parent = NULL); StyledLabel(QWidget *parent = NULL);
StyledLabel(const QString &text, QWidget *parent = NULL); StyledLabel(const QString &text, QWidget *parent = NULL);
int fontSizeFactor();
void setFontSizeFactor(int factor); void setFontSizeFactor(int factor);
private:
int mFontSizeFactor;
}; };
#endif #endif