mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-03-20 07:49:42 +01:00
Updated qocoa.
This commit is contained in:
parent
aacb375483
commit
2597ffb986
src/libtomahawk/thirdparty/Qocoa
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
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#include <AppKit/NSImage.h>
|
||||
#include <QString>
|
||||
#include <QVBoxLayout>
|
||||
#include <QMacCocoaViewContainer>
|
||||
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5,0,0)
|
||||
#include <qmacfunctions.h>
|
||||
#endif
|
||||
|
||||
static inline NSString* fromQString(const QString &string)
|
||||
{
|
||||
const QByteArray utf8 = string.toUtf8();
|
||||
@ -44,11 +49,16 @@ static inline QString toQString(NSString *string)
|
||||
|
||||
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];
|
||||
}
|
||||
|
||||
static inline void setupLayout(void *cocoaView, QWidget *parent)
|
||||
static inline void setupLayout(NSView *cocoaView, QWidget *parent)
|
||||
{
|
||||
parent->setAttribute(Qt::WA_NativeWindow);
|
||||
QVBoxLayout *layout = new QVBoxLayout(parent);
|
||||
|
@ -215,7 +215,7 @@ public:
|
||||
q.data()->accepted();
|
||||
}
|
||||
|
||||
QWeakPointer<QToolbarTabDialog> q;
|
||||
QPointer<QToolbarTabDialog> q;
|
||||
|
||||
NSWindow* prefsWindow;
|
||||
ToolbarDelegate *toolBarDelegate;
|
||||
|
Loading…
x
Reference in New Issue
Block a user