Changeset 76867 in vbox for trunk/src/VBox
- Timestamp:
- Jan 17, 2019 3:53:20 PM (6 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserItemGlobal.cpp
r76606 r76867 376 376 QPixmap UIChooserItemGlobal::toPixmap() 377 377 { 378 /* Ask item to paint itself into pixmap: */ 379 const QSize minimumSize = minimumSizeHint().toSize(); 380 QPixmap pixmap(minimumSize); 381 QPainter painter(&pixmap); 382 QStyleOptionGraphicsItem options; 383 options.rect = QRect(QPoint(0, 0), minimumSize); 384 paint(&painter, &options); 385 return pixmap; 378 AssertFailedReturn(QPixmap()); 386 379 } 387 380 -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserItemGroup.cpp
r76606 r76867 25 25 #include <QStyleOptionGraphicsItem> 26 26 #include <QGraphicsProxyWidget> 27 #include <QWindow> 27 28 28 29 /* GUI includes: */ … … 881 882 { 882 883 /* Ask item to paint itself into pixmap: */ 883 QSize minimumSize = minimumSizeHintForProup(false).toSize(); 884 QPixmap pixmap(minimumSize); 885 pixmap.fill(Qt::transparent); 884 qreal dDpr = gpManager->windowHandle()->devicePixelRatio(); 885 QSize actualSize = size().toSize(); 886 QPixmap pixmap(actualSize * dDpr); 887 pixmap.setDevicePixelRatio(dDpr); 886 888 QPainter painter(&pixmap); 887 painter.setRenderHint(QPainter::Antialiasing);888 889 QStyleOptionGraphicsItem options; 889 options.rect = QRect(QPoint(0, 0), minimumSize);890 options.rect = QRect(QPoint(0, 0), actualSize); 890 891 paint(&painter, &options); 891 892 return pixmap;
Note:
See TracChangeset
for help on using the changeset viewer.