Updates default stylesheet and demo app
This commit is contained in:
@@ -14,13 +14,41 @@ IconTitleWidget::IconTitleWidget(const QIcon& icon, const QString& title, QWidge
|
||||
setLayout(l);
|
||||
|
||||
_iconLabel = new QLabel();
|
||||
if (!icon.isNull())
|
||||
_iconLabel->setPixmap(icon.pixmap(16, 16));
|
||||
l->addWidget(_iconLabel);
|
||||
|
||||
_titleLabel = new QLabel();
|
||||
_titleLabel->setText(title);
|
||||
l->addWidget(_titleLabel, 1);
|
||||
|
||||
setIcon(icon);
|
||||
setTitle(title);
|
||||
}
|
||||
|
||||
void IconTitleWidget::setIcon(const QIcon& icon)
|
||||
{
|
||||
if (icon.isNull())
|
||||
{
|
||||
_iconLabel->setPixmap(QPixmap());
|
||||
_iconLabel->setVisible(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
_iconLabel->setPixmap(icon.pixmap(16, 16));
|
||||
_iconLabel->setVisible(true);
|
||||
}
|
||||
}
|
||||
|
||||
void IconTitleWidget::setTitle(const QString& title)
|
||||
{
|
||||
if (title.isEmpty())
|
||||
{
|
||||
_titleLabel->setText(QString());
|
||||
_titleLabel->setVisible(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
_titleLabel->setText(title);
|
||||
_titleLabel->setVisible(true);
|
||||
}
|
||||
}
|
||||
|
||||
void IconTitleWidget::polishUpdate()
|
||||
|
||||
Reference in New Issue
Block a user