VirtualBox

Changeset 76867 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Jan 17, 2019 3:53:20 PM (6 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9241: VirtualBox Manager: Chooser pane: Sync D&D pixmap painting between machine and group items; global item doesn't need one.

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  
    376376QPixmap UIChooserItemGlobal::toPixmap()
    377377{
    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());
    386379}
    387380
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserItemGroup.cpp

    r76606 r76867  
    2525#include <QStyleOptionGraphicsItem>
    2626#include <QGraphicsProxyWidget>
     27#include <QWindow>
    2728
    2829/* GUI includes: */
     
    881882{
    882883    /* 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);
    886888    QPainter painter(&pixmap);
    887     painter.setRenderHint(QPainter::Antialiasing);
    888889    QStyleOptionGraphicsItem options;
    889     options.rect = QRect(QPoint(0, 0), minimumSize);
     890    options.rect = QRect(QPoint(0, 0), actualSize);
    890891    paint(&painter, &options);
    891892    return pixmap;
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette