Remove dependency on Qt Mac Extras

Change-Id: Id4d394974e87d7844c02c18f3c98957036503d7f
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Tor Arne Vestbø
2019-03-11 15:44:11 +01:00
parent 14a4709f83
commit 14dc38eea0
4 changed files with 6 additions and 7 deletions

View File

@@ -9,7 +9,6 @@ macos {
$$PWD/touchbar_mac.mm \
$$PWD/touchbar_appdelegate_mac.mm
QT += macextras
LIBS += -framework Foundation -framework AppKit
} else {
SOURCES += $$PWD/touchbar.cpp

View File

@@ -29,8 +29,6 @@
#include <utils/utilsicons.h>
#include <QtMac>
#import <AppKit/NSButton.h>
#import <AppKit/NSCustomTouchBarItem.h>
#import <AppKit/NSImage.h>
@@ -145,8 +143,12 @@ static NSImage *iconToTemplateNSImage(const QIcon &icon)
{
// touch bar icons are max 18-22 pts big. our are always 22 pts big.
const QPixmap pixmap = icon.pixmap(22);
NSImage *image = QtMac::toNSImage(pixmap);
// toNSImage ignores devicePixelRatio, so fixup after the fact
CGImageRef cgImage = pixmap.toImage().toCGImage();
NSImage *image = [[NSImage alloc] initWithCGImage:cgImage size:NSZeroSize];
CFRelease(cgImage);
// The above code ignores devicePixelRatio, so fixup after the fact
const CGFloat userWidth = pixmap.width() / pixmap.devicePixelRatio();
const CGFloat userHeight = pixmap.height() / pixmap.devicePixelRatio();
image.size = CGSizeMake(userWidth, userHeight); // scales the image

View File

@@ -69,7 +69,6 @@ FORMS += docsettingspage.ui \
osx {
DEFINES += QTC_MAC_NATIVE_HELPVIEWER
QT += macextras
HEADERS += macwebkithelpviewer.h
OBJECTIVE_SOURCES += macwebkithelpviewer.mm
LIBS += -framework WebKit -framework AppKit

View File

@@ -37,7 +37,6 @@
#include <QHelpEngine>
#include <QStyle>
#include <QTimer>
#include <QtMac>
#include <QToolTip>
#include <QUrl>
#include <QVBoxLayout>