Text Shadows in QLabel Snippets: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
//Easy way to add shadows to text in QLabel <br /> //include headers <QGraphicsDropShadowEffect> | //Easy way to add shadows to text in QLabel<br />//include headers <QGraphicsDropShadowEffect&gt; | ||
// For an example we have QLabel called userName<br /> // set blur to 0, and setOffset to 1,1 and color for smooth look must be little butter darker then text color | // For an example we have QLabel called userName<br />// set blur to 0, and setOffset to 1,1 and color for smooth look must be little butter darker then text color | ||
<code> QGraphicsDropShadowEffect *effect = new QGraphicsDropShadowEffect(this);<br /> effect->setBlurRadius(0);<br /> effect->setColor(QColor("#EEEEEE&quot;));<br /> effect->setOffset(1,1);<br /> ui->userName->setGraphicsEffect(effect);</code> |
Revision as of 09:52, 24 February 2015
//Easy way to add shadows to text in QLabel
//include headers <QGraphicsDropShadowEffect>
// For an example we have QLabel called userName
// set blur to 0, and setOffset to 1,1 and color for smooth look must be little butter darker then text color
QGraphicsDropShadowEffect *effect = new QGraphicsDropShadowEffect(this);<br /> effect->setBlurRadius(0);<br /> effect->setColor(QColor("#EEEEEE&quot;));<br /> effect->setOffset(1,1);<br /> ui->userName->setGraphicsEffect(effect);