VirtualBox

Changeset 94065 in vbox


Ignore:
Timestamp:
Mar 2, 2022 8:58:24 PM (3 years ago)
Author:
vboxsync
Message:

FE/Qt: qt6: The QtMac header is gone in qt6, so use QPixmap::toImage+QImage::toCGImage (5.5 or earlier); QImage::byteCount -> QImage::sizeInBytes (5.10); Qt::MidButton -> Qt::MiddleButton. bugref:9898

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/platform/darwin/VBoxUtils-darwin.cpp

    r93115 r94065  
    1616 */
    1717
    18 #include "VBoxUtils-darwin.h"
    19 #include "VBoxCocoaHelper.h"
    20 #include "UICocoaApplication.h"
    21 
    22 #include <iprt/mem.h>
    23 #include <iprt/assert.h>
    24 
     18/* Qt includes: */
    2519#include <QMainWindow>
    2620#include <QApplication>
     
    3024#include <QPixmap>
    3125#include <QContextMenuEvent>
    32 #include <QtMac>
    33 
     26
     27/* GUI includes: */
     28#include "VBoxUtils-darwin.h"
     29#include "VBoxCocoaHelper.h"
     30#include "UICocoaApplication.h"
     31
     32/* Other VBox includes: */
     33#include <iprt/mem.h>
     34#include <iprt/assert.h>
     35
     36/* System includes: */
    3437#include <Carbon/Carbon.h>
    3538
     
    283286
    284287    CGColorSpaceRef cs = CGColorSpaceCreateDeviceRGB();
    285     CGDataProviderRef dp = CGDataProviderCreateWithData(imageCopy, pImage->bits(), pImage->byteCount(), darwinDataProviderReleaseQImage);
     288    CGDataProviderRef dp = CGDataProviderCreateWithData(imageCopy, pImage->bits(), pImage->sizeInBytes(),
     289                                                        darwinDataProviderReleaseQImage);
    286290
    287291    CGBitmapInfo bmpInfo = kCGImageAlphaFirst | kCGBitmapByteOrder32Host;
     
    322326                                              kCGImageAlphaPremultipliedFirst);
    323327    /* Get the CGImageRef from Qt */
    324     CGImageRef qtPixmap = QtMac::toCGImageRef(*pPixmap);
     328    CGImageRef qtPixmap = pPixmap->toImage().toCGImage();
    325329    /* Draw the image from Qt & convert the context back to a new CGImageRef. */
    326330    CGContextDrawImage(ctx, CGRectMake(0, 0, pPixmap->width(), pPixmap->height()), qtPixmap);
     
    407411        qtExtraButton = Qt::RightButton;
    408412    else if (button == 2)
    409         qtExtraButton = Qt::MidButton;
     413        qtExtraButton = Qt::MiddleButton;
    410414    else if (button == 3)
    411415        qtExtraButton = Qt::XButton1;
     
    498502        qtButtons |= Qt::RightButton;
    499503    if ((buttons & RT_BIT_32(2)) == RT_BIT_32(2))
    500         qtButtons |= Qt::MidButton;
     504        qtButtons |= Qt::MiddleButton;
    501505    if ((buttons & RT_BIT_32(3)) == RT_BIT_32(3))
    502506        qtButtons |= Qt::XButton1;
     
    548552/********************************************************************************
    549553 *
    550  * Old carbon stuff. Have to converted soon!
     554 * Old carbon stuff. Have to convert soon!
    551555 *
    552556 ********************************************************************************/
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