Ios: Fix compilation with Qt4

Change-Id: I6505d158d2456bc63572e274b47dcef486ca241d
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
This commit is contained in:
Eike Ziller
2013-10-02 18:13:22 +02:00
parent 44dd2b6bdf
commit ccf968c05c
6 changed files with 42 additions and 18 deletions

View File

@@ -31,7 +31,7 @@
#include <projectexplorer/runconfiguration.h> #include <projectexplorer/runconfiguration.h>
#include <qt4projectmanager/qmakerunconfigurationfactory.h> #include <qt4projectmanager/qmakerunconfigurationfactory.h>
#include <qcompilerdetection.h> #include <utils/qtcoverride.h>
namespace ProjectExplorer { namespace ProjectExplorer {
class RunControl; class RunControl;
@@ -50,25 +50,25 @@ class IosRunConfigurationFactory : public Qt4ProjectManager::QmakeRunConfigurati
public: public:
explicit IosRunConfigurationFactory(QObject *parent = 0); explicit IosRunConfigurationFactory(QObject *parent = 0);
Q_DECL_OVERRIDE QString displayNameForId(const Core::Id id) const; QString displayNameForId(const Core::Id id) const QTC_OVERRIDE;
Q_DECL_OVERRIDE QList<Core::Id> availableCreationIds(ProjectExplorer::Target *parent) const; QList<Core::Id> availableCreationIds(ProjectExplorer::Target *parent) const QTC_OVERRIDE;
Q_DECL_OVERRIDE bool canCreate(ProjectExplorer::Target *parent, const Core::Id id) const; bool canCreate(ProjectExplorer::Target *parent, const Core::Id id) const QTC_OVERRIDE;
Q_DECL_OVERRIDE ProjectExplorer::RunConfiguration *create(ProjectExplorer::Target *parent, ProjectExplorer::RunConfiguration *create(ProjectExplorer::Target *parent,
const Core::Id id); const Core::Id id) QTC_OVERRIDE;
Q_DECL_OVERRIDE bool canRestore(ProjectExplorer::Target *parent, const QVariantMap &map) const; bool canRestore(ProjectExplorer::Target *parent, const QVariantMap &map) const QTC_OVERRIDE;
Q_DECL_OVERRIDE ProjectExplorer::RunConfiguration *restore(ProjectExplorer::Target *parent, ProjectExplorer::RunConfiguration *restore(ProjectExplorer::Target *parent,
const QVariantMap &map); const QVariantMap &map) QTC_OVERRIDE;
Q_DECL_OVERRIDE bool canClone(ProjectExplorer::Target *parent, bool canClone(ProjectExplorer::Target *parent,
ProjectExplorer::RunConfiguration *source) const; ProjectExplorer::RunConfiguration *source) const QTC_OVERRIDE;
Q_DECL_OVERRIDE ProjectExplorer::RunConfiguration *clone(ProjectExplorer::Target *parent, ProjectExplorer::RunConfiguration *clone(ProjectExplorer::Target *parent,
ProjectExplorer::RunConfiguration *source); ProjectExplorer::RunConfiguration *source) QTC_OVERRIDE;
Q_DECL_OVERRIDE bool canHandle(ProjectExplorer::Target *t) const; bool canHandle(ProjectExplorer::Target *t) const QTC_OVERRIDE;
Q_DECL_OVERRIDE QList<ProjectExplorer::RunConfiguration *> runConfigurationsForNode(ProjectExplorer::Target *t, QList<ProjectExplorer::RunConfiguration *> runConfigurationsForNode(ProjectExplorer::Target *t,
ProjectExplorer::Node *n); ProjectExplorer::Node *n) QTC_OVERRIDE;
private: private:
ProjectExplorer::RunConfiguration *doCreate(ProjectExplorer::Target *parent, const Core::Id id); ProjectExplorer::RunConfiguration *doCreate(ProjectExplorer::Target *parent, const Core::Id id);
ProjectExplorer::RunConfiguration *doRestore(ProjectExplorer::Target *parent, ProjectExplorer::RunConfiguration *doRestore(ProjectExplorer::Target *parent,

View File

@@ -7,7 +7,7 @@ include(../../../../qtcreator.pri)
# Prevent from popping up in the dock when launched. # Prevent from popping up in the dock when launched.
# We embed the Info.plist file, so the application doesn't need to # We embed the Info.plist file, so the application doesn't need to
# be a bundle. # be a bundle.
QMAKE_LFLAGS += -sectcreate __TEXT __info_plist $$shell_quote($$PWD/Info.plist) \ QMAKE_LFLAGS += -sectcreate __TEXT __info_plist \"$$PWD/Info.plist\" \
-fobjc-link-runtime -fobjc-link-runtime
LIBS += \ LIBS += \

View File

@@ -8,7 +8,11 @@
#import <AppKit/AppKit.h> #import <AppKit/AppKit.h>
#import "iphonesimulator.h" #import "iphonesimulator.h"
#include <QLibrary> #include <QLibrary>
#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
#include <QApplication>
#else
#include <QGuiApplication> #include <QGuiApplication>
#endif
#include <QString> #include <QString>
#include <QStringList> #include <QStringList>
@@ -21,7 +25,12 @@
* Runs the iPhoneSimulator backed by a main runloop. * Runs the iPhoneSimulator backed by a main runloop.
*/ */
int main (int argc, char *argv[]) { int main (int argc, char *argv[]) {
#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
QApplication a(argc, argv);
#else
QGuiApplication a(argc, argv); QGuiApplication a(argc, argv);
#endif
//NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; //NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];

View File

@@ -41,6 +41,7 @@
namespace Ios { namespace Ios {
namespace Internal { namespace Internal {
class DevInfoSession;
class IosDeviceManagerPrivate; class IosDeviceManagerPrivate;
} // namespace Internal } // namespace Internal
@@ -84,6 +85,7 @@ private slots:
void checkPendingLookups(); void checkPendingLookups();
private: private:
friend class Internal::IosDeviceManagerPrivate; friend class Internal::IosDeviceManagerPrivate;
friend class Internal::DevInfoSession;
IosDeviceManager(QObject *parent = 0); IosDeviceManager(QObject *parent = 0);
Internal::IosDeviceManagerPrivate *d; Internal::IosDeviceManagerPrivate *d;
}; };

View File

@@ -8,7 +8,7 @@ CONFIG += console
# Prevent from popping up in the dock when launched. # Prevent from popping up in the dock when launched.
# We embed the Info.plist file, so the application doesn't need to # We embed the Info.plist file, so the application doesn't need to
# be a bundle. # be a bundle.
QMAKE_LFLAGS += -sectcreate __TEXT __info_plist $$shell_quote($$PWD/Info.plist) QMAKE_LFLAGS += -sectcreate __TEXT __info_plist \"$$PWD/Info.plist\"
CONFIG -= app_bundle CONFIG -= app_bundle
LIBS += -framework CoreFoundation -framework CoreServices -framework IOKit -lssl -lbz2 -framework Security -framework SystemConfiguration LIBS += -framework CoreFoundation -framework CoreServices -framework IOKit -lssl -lbz2 -framework Security -framework SystemConfiguration

View File

@@ -26,7 +26,12 @@
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
** **
****************************************************************************/ ****************************************************************************/
#include <qglobal.h>
#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
#include <QApplication>
#else
#include <QGuiApplication> #include <QGuiApplication>
#endif
#include <QTextStream> #include <QTextStream>
#include <QDebug> #include <QDebug>
#include <QXmlStreamWriter> #include <QXmlStreamWriter>
@@ -81,7 +86,11 @@ IosTool::IosTool(QObject *parent):
outFile(), outFile(),
out(&outFile) out(&outFile)
{ {
#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
outFile.open(stdout, QIODevice::WriteOnly, QFile::DontCloseHandle);
#else
outFile.open(stdout, QIODevice::WriteOnly, QFileDevice::DontCloseHandle); outFile.open(stdout, QIODevice::WriteOnly, QFileDevice::DontCloseHandle);
#endif
out.setAutoFormatting(true); out.setAutoFormatting(true);
out.setCodec("UTF-8"); out.setCodec("UTF-8");
} }
@@ -376,7 +385,11 @@ void IosTool::errorMsg(const QString &msg)
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
QApplication a(argc, argv);
#else
QGuiApplication a(argc, argv); QGuiApplication a(argc, argv);
#endif
IosTool tool; IosTool tool;
tool.run(QCoreApplication::arguments()); tool.run(QCoreApplication::arguments());
int res = a.exec(); int res = a.exec();