multi deploy
other qt6 patches
This commit is contained in:
@@ -26,11 +26,18 @@ LogView::Category::Category() {
|
||||
}
|
||||
|
||||
|
||||
void LogView::Category::makeIcon(QSize size, QSize size_icon) {
|
||||
void LogView::Category::makeIcon(QSize size, QSize size_icon, qreal ratio) {
|
||||
icon_image = QImage();
|
||||
if (!image.isNull())
|
||||
icon_image = image.scaled(size, Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
|
||||
QPixmap px = QPixmap::fromImage(image.scaled(size_icon, Qt::IgnoreAspectRatio, Qt::SmoothTransformation));
|
||||
if (!image.isNull()) {
|
||||
icon_image = image.scaled(size * ratio, Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0)
|
||||
icon_image.setDevicePixelRatio(ratio);
|
||||
#endif
|
||||
}
|
||||
QPixmap px = QPixmap::fromImage(image.scaled(size_icon * ratio, Qt::IgnoreAspectRatio, Qt::SmoothTransformation));
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0)
|
||||
px.setDevicePixelRatio(ratio);
|
||||
#endif
|
||||
icon.addPixmap(px, QIcon::Active);
|
||||
icon.addPixmap(px, QIcon::Disabled);
|
||||
icon.addPixmap(px, QIcon::Normal);
|
||||
@@ -119,7 +126,11 @@ void LogView::registerCategory(const QString & label, QRegularExpression regexp,
|
||||
c.text_brush = text_brush;
|
||||
c.background = background;
|
||||
c.bold = bold;
|
||||
c.makeIcon(iconImageSize(), preferredIconSize(1., this));
|
||||
c.makeIcon(iconImageSize(), preferredIconSize(1., this)
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0)
|
||||
, devicePixelRatioF()
|
||||
#endif
|
||||
);
|
||||
categories.append(c);
|
||||
ui->comboCategory->addItem(c.icon, label, QVariant(regexp));
|
||||
}
|
||||
@@ -204,7 +215,11 @@ void LogView::changeEvent(QEvent * e) {
|
||||
ui->labelIconSearch->setFixedSize(preferredIconSize(1.2, this));
|
||||
QSize is = iconImageSize(), is_i = preferredIconSize(1., this);
|
||||
for (int i = 0; i < categories.size(); ++i)
|
||||
categories[i].makeIcon(is, is_i);
|
||||
categories[i].makeIcon(is, is_i
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0)
|
||||
, devicePixelRatioF()
|
||||
#endif
|
||||
);
|
||||
} break;
|
||||
default: break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user