mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-07-31 11:20:22 +02:00
Updated qocoa.
This commit is contained in:
14
src/libtomahawk/thirdparty/Qocoa/qocoa_mac.h
vendored
14
src/libtomahawk/thirdparty/Qocoa/qocoa_mac.h
vendored
@@ -24,10 +24,15 @@ THE SOFTWARE.
|
|||||||
#define QCOCOA_MAC_H
|
#define QCOCOA_MAC_H
|
||||||
|
|
||||||
#import <Cocoa/Cocoa.h>
|
#import <Cocoa/Cocoa.h>
|
||||||
|
#include <AppKit/NSImage.h>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QVBoxLayout>
|
#include <QVBoxLayout>
|
||||||
#include <QMacCocoaViewContainer>
|
#include <QMacCocoaViewContainer>
|
||||||
|
|
||||||
|
#if QT_VERSION >= QT_VERSION_CHECK(5,0,0)
|
||||||
|
#include <qmacfunctions.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
static inline NSString* fromQString(const QString &string)
|
static inline NSString* fromQString(const QString &string)
|
||||||
{
|
{
|
||||||
const QByteArray utf8 = string.toUtf8();
|
const QByteArray utf8 = string.toUtf8();
|
||||||
@@ -44,11 +49,16 @@ static inline QString toQString(NSString *string)
|
|||||||
|
|
||||||
static inline NSImage* fromQPixmap(const QPixmap &pixmap)
|
static inline NSImage* fromQPixmap(const QPixmap &pixmap)
|
||||||
{
|
{
|
||||||
CGImageRef cgImage = pixmap.toMacCGImageRef();
|
#if QT_VERSION < QT_VERSION_CHECK(5,0,0)
|
||||||
|
CGImageRef cgImage = pixmap.toMacCGImageRef();
|
||||||
|
#else
|
||||||
|
CGImageRef cgImage = QtMac::toCGImageRef(pixmap);
|
||||||
|
#endif
|
||||||
|
|
||||||
return [[[NSImage alloc] initWithCGImage:cgImage size:NSZeroSize] autorelease];
|
return [[[NSImage alloc] initWithCGImage:cgImage size:NSZeroSize] autorelease];
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void setupLayout(void *cocoaView, QWidget *parent)
|
static inline void setupLayout(NSView *cocoaView, QWidget *parent)
|
||||||
{
|
{
|
||||||
parent->setAttribute(Qt::WA_NativeWindow);
|
parent->setAttribute(Qt::WA_NativeWindow);
|
||||||
QVBoxLayout *layout = new QVBoxLayout(parent);
|
QVBoxLayout *layout = new QVBoxLayout(parent);
|
||||||
|
@@ -215,7 +215,7 @@ public:
|
|||||||
q.data()->accepted();
|
q.data()->accepted();
|
||||||
}
|
}
|
||||||
|
|
||||||
QWeakPointer<QToolbarTabDialog> q;
|
QPointer<QToolbarTabDialog> q;
|
||||||
|
|
||||||
NSWindow* prefsWindow;
|
NSWindow* prefsWindow;
|
||||||
ToolbarDelegate *toolBarDelegate;
|
ToolbarDelegate *toolBarDelegate;
|
||||||
|
Reference in New Issue
Block a user