Changeset 94065 in vbox
- Timestamp:
- Mar 2, 2022 8:58:24 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/platform/darwin/VBoxUtils-darwin.cpp
r93115 r94065 16 16 */ 17 17 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: */ 25 19 #include <QMainWindow> 26 20 #include <QApplication> … … 30 24 #include <QPixmap> 31 25 #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: */ 34 37 #include <Carbon/Carbon.h> 35 38 … … 283 286 284 287 CGColorSpaceRef cs = CGColorSpaceCreateDeviceRGB(); 285 CGDataProviderRef dp = CGDataProviderCreateWithData(imageCopy, pImage->bits(), pImage->byteCount(), darwinDataProviderReleaseQImage); 288 CGDataProviderRef dp = CGDataProviderCreateWithData(imageCopy, pImage->bits(), pImage->sizeInBytes(), 289 darwinDataProviderReleaseQImage); 286 290 287 291 CGBitmapInfo bmpInfo = kCGImageAlphaFirst | kCGBitmapByteOrder32Host; … … 322 326 kCGImageAlphaPremultipliedFirst); 323 327 /* Get the CGImageRef from Qt */ 324 CGImageRef qtPixmap = QtMac::toCGImageRef(*pPixmap);328 CGImageRef qtPixmap = pPixmap->toImage().toCGImage(); 325 329 /* Draw the image from Qt & convert the context back to a new CGImageRef. */ 326 330 CGContextDrawImage(ctx, CGRectMake(0, 0, pPixmap->width(), pPixmap->height()), qtPixmap); … … 407 411 qtExtraButton = Qt::RightButton; 408 412 else if (button == 2) 409 qtExtraButton = Qt::Mid Button;413 qtExtraButton = Qt::MiddleButton; 410 414 else if (button == 3) 411 415 qtExtraButton = Qt::XButton1; … … 498 502 qtButtons |= Qt::RightButton; 499 503 if ((buttons & RT_BIT_32(2)) == RT_BIT_32(2)) 500 qtButtons |= Qt::Mid Button;504 qtButtons |= Qt::MiddleButton; 501 505 if ((buttons & RT_BIT_32(3)) == RT_BIT_32(3)) 502 506 qtButtons |= Qt::XButton1; … … 548 552 /******************************************************************************** 549 553 * 550 * Old carbon stuff. Have to convert edsoon!554 * Old carbon stuff. Have to convert soon! 551 555 * 552 556 ********************************************************************************/
Note:
See TracChangeset
for help on using the changeset viewer.