Fix namespaced build on iOS

Change-Id: I682fabe8891e0325e6545b4499a59af4ad584c41
Reviewed-by: Mike Krus <mike.krus@kdab.com>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
bb10
Jake Petroules 2016-09-18 18:40:13 -07:00
parent 8b2f91e328
commit 04cb6e2754
19 changed files with 58 additions and 24 deletions

View File

@ -49,6 +49,8 @@
#include <QtDebug>
QT_BEGIN_NAMESPACE
class QIOSPaintDevice : public QOpenGLPaintDevice
{
public:

View File

@ -48,6 +48,8 @@
#import <OpenGLES/ES2/glext.h>
#import <QuartzCore/CAEAGLLayer.h>
QT_BEGIN_NAMESPACE
Q_LOGGING_CATEGORY(lcQpaGLContext, "qt.qpa.glcontext");
QIOSContext::QIOSContext(QOpenGLContext *context)
@ -314,3 +316,4 @@ bool QIOSContext::isSharing() const
#include "moc_qioscontext.cpp"
QT_END_NAMESPACE

View File

@ -43,10 +43,10 @@
#include <QtCore/qeventloop.h>
#include <qpa/qplatformdialoghelper.h>
QT_BEGIN_NAMESPACE
Q_FORWARD_DECLARE_OBJC_CLASS(UIViewController);
QT_BEGIN_NAMESPACE
class QIOSFileDialog : public QPlatformFileDialogHelper
{
public:

View File

@ -74,6 +74,8 @@ QT_END_NAMESPACE
+ (id)currentFirstResponder;
@end
QT_BEGIN_NAMESPACE
class FirstResponderCandidate : public QScopedValueRollback<UIResponder *>
{
public:
@ -84,4 +86,6 @@ private:
static UIResponder *s_firstResponderCandidate;
};
QT_END_NAMESPACE
#endif // QIOSGLOBAL_H

View File

@ -114,6 +114,8 @@ int infoPlistValue(NSString* key, int defaultValue)
return value ? [value intValue] : defaultValue;
}
QT_END_NAMESPACE
// -------------------------------------------------------------------------
@interface QtFirstResponderEvent : UIEvent
@ -164,6 +166,8 @@ int infoPlistValue(NSString* key, int defaultValue)
}
@end
QT_BEGIN_NAMESPACE
FirstResponderCandidate::FirstResponderCandidate(UIResponder *responder)
: QScopedValueRollback<UIResponder *>(s_firstResponderCandidate, responder)
{

View File

@ -51,13 +51,13 @@ const char kImePlatformDataInputView[] = "inputView";
const char kImePlatformDataInputAccessoryView[] = "inputAccessoryView";
const char kImePlatformDataReturnKeyType[] = "returnKeyType";
QT_BEGIN_NAMESPACE
@class QIOSLocaleListener;
@class QIOSKeyboardListener;
@class QIOSTextInputResponder;
@protocol KeyboardState;
QT_BEGIN_NAMESPACE
struct KeyboardState
{
KeyboardState() :

View File

@ -97,14 +97,14 @@ static QUIView *focusView()
@interface QIOSKeyboardListener : UIGestureRecognizer <UIGestureRecognizerDelegate> {
@private
QIOSInputContext *m_context;
QT_PREPEND_NAMESPACE(QIOSInputContext) *m_context;
}
@property BOOL hasDeferredScrollToCursor;
@end
@implementation QIOSKeyboardListener
- (id)initWithQIOSInputContext:(QIOSInputContext *)context
- (id)initWithQIOSInputContext:(QT_PREPEND_NAMESPACE(QIOSInputContext) *)context
{
if (self = [super initWithTarget:self action:@selector(gestureStateChanged:)]) {
@ -291,6 +291,8 @@ static QUIView *focusView()
// -------------------------------------------------------------------------
QT_BEGIN_NAMESPACE
Qt::InputMethodQueries ImeState::update(Qt::InputMethodQueries properties)
{
if (!properties)
@ -713,3 +715,5 @@ QLocale QIOSInputContext::locale() const
{
return QLocale(QString::fromNSString([[NSLocale currentLocale] objectForKey:NSLocaleIdentifier]));
}
QT_END_NAMESPACE

View File

@ -43,11 +43,11 @@
#include <QtCore/qeventloop.h>
#include <qpa/qplatformdialoghelper.h>
QT_BEGIN_NAMESPACE
Q_FORWARD_DECLARE_OBJC_CLASS(UIAlertController);
Q_FORWARD_DECLARE_OBJC_CLASS(UIAlertAction);
QT_BEGIN_NAMESPACE
class QIOSMessageDialog : public QPlatformMessageDialogHelper
{
public:

View File

@ -65,7 +65,7 @@ void invalidateCache(QAccessibleInterface *iface)
// when items get added or removed from the screen
foreach (QWindow *win, QGuiApplication::topLevelWindows()) {
if (win && win->handle()) {
QIOSWindow *window = static_cast<QIOSWindow*>(win->handle());
QT_PREPEND_NAMESPACE(QIOSWindow) *window = static_cast<QT_PREPEND_NAMESPACE(QIOSWindow) *>(win->handle());
window->clearAccessibleCache();
}
}

View File

@ -176,6 +176,8 @@ static QIOSScreen* qtPlatformScreenFor(UIScreen *uiScreen)
// -------------------------------------------------------------------------
QT_BEGIN_NAMESPACE
/*!
Returns the model identifier of the device.

View File

@ -42,19 +42,23 @@
#include <QtCore/qstring.h>
#include <QtGui/qevent.h>
QT_BEGIN_NAMESPACE
class QIOSInputContext;
QT_END_NAMESPACE
@interface QIOSTextInputResponder : UIResponder <UITextInputTraits, UIKeyInput, UITextInput>
{
@private
QIOSInputContext *m_inputContext;
QInputMethodQueryEvent *m_configuredImeState;
QT_PREPEND_NAMESPACE(QIOSInputContext) *m_inputContext;
QT_PREPEND_NAMESPACE(QInputMethodQueryEvent) *m_configuredImeState;
QString m_markedText;
BOOL m_inSendEventToFocusObject;
BOOL m_inSelectionChange;
}
- (id)initWithInputContext:(QIOSInputContext *)context;
- (id)initWithInputContext:(QT_PREPEND_NAMESPACE(QIOSInputContext) *)context;
- (BOOL)needsKeyboardReconfigure:(Qt::InputMethodQueries)updatedProperties;
- (void)notifyInputDelegate:(Qt::InputMethodQueries)updatedProperties;

View File

@ -163,7 +163,7 @@
@implementation QIOSTextInputResponder
- (id)initWithInputContext:(QIOSInputContext *)inputContext
- (id)initWithInputContext:(QT_PREPEND_NAMESPACE(QIOSInputContext) *)inputContext
{
if (!(self = [self init]))
return self;

View File

@ -38,12 +38,17 @@
****************************************************************************/
#import <UIKit/UIKit.h>
#include <QtCore/QtGlobal>
QT_BEGIN_NAMESPACE
class QIOSScreen;
QT_END_NAMESPACE
@interface QIOSViewController : UIViewController
- (id)initWithQIOSScreen:(QIOSScreen *)screen;
- (id)initWithQIOSScreen:(QT_PREPEND_NAMESPACE(QIOSScreen) *)screen;
- (void)updateProperties;
#ifndef Q_OS_TVOS

View File

@ -58,7 +58,7 @@
@interface QIOSViewController () {
@public
QPointer<QIOSScreen> m_screen;
QPointer<QT_PREPEND_NAMESPACE(QIOSScreen)> m_screen;
BOOL m_updatingProperties;
QMetaObject::Connection m_focusWindowChangeConnection;
}
@ -126,7 +126,7 @@
{
Q_UNUSED(subview);
QIOSScreen *screen = self.qtViewController->m_screen;
QT_PREPEND_NAMESPACE(QIOSScreen) *screen = self.qtViewController->m_screen;
// The 'window' property of our view is not valid until the window
// has been shown, so we have to access it through the QIOSScreen.
@ -229,7 +229,7 @@
@implementation QIOSViewController
- (id)initWithQIOSScreen:(QIOSScreen *)screen
- (id)initWithQIOSScreen:(QT_PREPEND_NAMESPACE(QIOSScreen) *)screen
{
if (self = [self init]) {
m_screen = screen;

View File

@ -48,10 +48,10 @@
class QIOSContext;
class QIOSWindow;
QT_BEGIN_NAMESPACE
@class QUIView;
QT_BEGIN_NAMESPACE
class QIOSWindow : public QObject, public QPlatformWindow
{
Q_OBJECT

View File

@ -54,6 +54,8 @@
#include <QtDebug>
QT_BEGIN_NAMESPACE
QIOSWindow::QIOSWindow(QWindow *window)
: QPlatformWindow(window)
, m_view([[QUIView alloc] initWithQIOSWindow:this])

View File

@ -63,7 +63,7 @@
QAccessibleCache *cache = QAccessibleCache::instance();
QMacAccessibilityElement *element = cache->elementForId(anId);
QT_MANGLE_NAMESPACE(QMacAccessibilityElement) *element = cache->elementForId(anId);
if (!element) {
Q_ASSERT(QAccessible::accessibleInterface(anId));
element = [[self alloc] initWithId:anId withAccessibilityContainer: view];

View File

@ -44,14 +44,18 @@
#include <qpa/qwindowsysteminterface.h>
QT_BEGIN_NAMESPACE
class QIOSWindow;
QT_END_NAMESPACE
@class QIOSViewController;
@interface QUIView : UIView
{
@public
QIOSWindow *m_qioswindow;
QT_PREPEND_NAMESPACE(QIOSWindow) *m_qioswindow;
@private
QHash<UITouch *, QWindowSystemInterface::TouchPoint> m_activeTouches;
int m_nextTouchId;
@ -60,7 +64,7 @@ class QIOSWindow;
NSMutableArray *m_accessibleElements;
};
- (id)initWithQIOSWindow:(QIOSWindow *)window;
- (id)initWithQIOSWindow:(QT_PREPEND_NAMESPACE(QIOSWindow) *)window;
- (void)sendUpdatedExposeEvent;
- (BOOL)isActiveWindow;
@end

View File

@ -59,7 +59,7 @@
return [CAEAGLLayer class];
}
- (id)initWithQIOSWindow:(QIOSWindow *)window
- (id)initWithQIOSWindow:(QT_PREPEND_NAMESPACE(QIOSWindow) *)window
{
if (self = [self initWithFrame:window->geometry().toCGRect()])
m_qioswindow = window;
@ -524,7 +524,7 @@
- (QWindow *)qwindow
{
if ([self isKindOfClass:[QUIView class]]) {
if (QIOSWindow *w = static_cast<QUIView *>(self)->m_qioswindow)
if (QT_PREPEND_NAMESPACE(QIOSWindow) *w = static_cast<QUIView *>(self)->m_qioswindow)
return w->window();
}
return nil;