Initial commit
This commit is contained in:
commit
f38ff5fbc2
18 changed files with 1016 additions and 0 deletions
21
QtGui/QtGuiApplication.h
Normal file
21
QtGui/QtGuiApplication.h
Normal file
|
@ -0,0 +1,21 @@
|
|||
#import "QtCoreApplication.h"
|
||||
|
||||
#include <QGuiApplication>
|
||||
|
||||
@interface QtGuiApplication: QtCoreApplication
|
||||
@property (readonly) QGuiApplication *qGuiApplication;
|
||||
@property (copy) OFString *applicationDisplayName;
|
||||
@property (copy) OFString *desktopFileName;
|
||||
@property Qt::LayoutDirection layoutDirection;
|
||||
@property (readonly, copy) OFString *platformName;
|
||||
@property (readonly) QScreen *primaryScreen;
|
||||
@property bool quitOnLastWindowClosed;
|
||||
@property QIcon windowIcon;
|
||||
|
||||
- initWithQGuiApplication: (QGuiApplication*)qGuiApplication;
|
||||
- (double)devicePixelRatio;
|
||||
- (bool)isSavingSession;
|
||||
- (bool)isSessionRestored;
|
||||
- (OFString*)sessionID;
|
||||
- (OFString*)sessionKey;
|
||||
@end
|
110
QtGui/QtGuiApplication.mm
Normal file
110
QtGui/QtGuiApplication.mm
Normal file
|
@ -0,0 +1,110 @@
|
|||
#import "QtGuiApplication.h"
|
||||
|
||||
#import "helpers.h"
|
||||
|
||||
#include <QIcon>
|
||||
|
||||
@implementation QtGuiApplication
|
||||
- initWithQCoreApplication: (QCoreApplication*)qCoreApplication
|
||||
{
|
||||
OF_INVALID_INIT_METHOD
|
||||
}
|
||||
|
||||
- initWithQGuiApplication: (QGuiApplication*)qGuiApplication
|
||||
{
|
||||
return [super initWithQCoreApplication: qGuiApplication];
|
||||
}
|
||||
|
||||
- (QGuiApplication*)qGuiApplication
|
||||
{
|
||||
return qobject_cast<QGuiApplication*>(_qObject);
|
||||
}
|
||||
|
||||
- (OFString*)applicationDisplayName
|
||||
{
|
||||
return QToOFString([self qGuiApplication]->applicationDisplayName());
|
||||
}
|
||||
|
||||
- (void)setApplicationDisplayName: (OFString*)applicationDisplayName
|
||||
{
|
||||
[self qGuiApplication]->setApplicationDisplayName(
|
||||
OFToQString(applicationDisplayName));
|
||||
}
|
||||
|
||||
- (OFString*)desktopFileName
|
||||
{
|
||||
return QToOFString([self qGuiApplication]->desktopFileName());
|
||||
}
|
||||
|
||||
- (void)setDesktopFileName: (OFString*)desktopFileName
|
||||
{
|
||||
[self qGuiApplication]->setDesktopFileName(
|
||||
OFToQString(desktopFileName));
|
||||
}
|
||||
|
||||
- (double)devicePixelRatio
|
||||
{
|
||||
return [self qGuiApplication]->devicePixelRatio();
|
||||
}
|
||||
|
||||
- (bool)isSavingSession
|
||||
{
|
||||
return [self qGuiApplication]->isSavingSession();
|
||||
}
|
||||
|
||||
- (bool)isSessionRestored
|
||||
{
|
||||
return [self qGuiApplication]->isSessionRestored();
|
||||
}
|
||||
|
||||
- (Qt::LayoutDirection)layoutDirection
|
||||
{
|
||||
return [self qGuiApplication]->layoutDirection();
|
||||
}
|
||||
|
||||
- (void)setLayoutDirection: (Qt::LayoutDirection)layoutDirection
|
||||
{
|
||||
[self qGuiApplication]->setLayoutDirection(layoutDirection);
|
||||
}
|
||||
|
||||
- (OFString*)platformName
|
||||
{
|
||||
return QToOFString([self qGuiApplication]->platformName());
|
||||
}
|
||||
|
||||
- (QScreen*)primaryScreen
|
||||
{
|
||||
return [self qGuiApplication]->primaryScreen();
|
||||
}
|
||||
|
||||
- (bool)quitOnLastWindowClosed
|
||||
{
|
||||
return [self qGuiApplication]->quitOnLastWindowClosed();
|
||||
}
|
||||
|
||||
- (void)setQuitOnLastWindowClosed: (bool)quitOnLastWindowClosed
|
||||
{
|
||||
[self qGuiApplication]->setQuitOnLastWindowClosed(
|
||||
quitOnLastWindowClosed);
|
||||
}
|
||||
|
||||
- (OFString*)sessionID
|
||||
{
|
||||
return QToOFString([self qGuiApplication]->sessionId());
|
||||
}
|
||||
|
||||
- (OFString*)sessionKey
|
||||
{
|
||||
return QToOFString([self qGuiApplication]->sessionKey());
|
||||
}
|
||||
|
||||
- (QIcon)windowIcon
|
||||
{
|
||||
return [self qGuiApplication]->windowIcon();
|
||||
}
|
||||
|
||||
- (void)setWindowIcon: (QIcon)windowIcon
|
||||
{
|
||||
[self qGuiApplication]->setWindowIcon(windowIcon);
|
||||
}
|
||||
@end
|
Loading…
Add table
Add a link
Reference in a new issue