tests: Add iOS support to nativewindow helper

Pick-to: 6.6
Change-Id: I3e22423734d25acb2ef04d22a1647874c2d10420
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
This commit is contained in:
Tor Arne Vestbø 2023-08-02 16:02:18 +02:00
parent 774095ed9a
commit 6a633221f3

View File

@ -6,6 +6,10 @@
#if defined(Q_OS_MACOS) #if defined(Q_OS_MACOS)
# include <AppKit/AppKit.h> # include <AppKit/AppKit.h>
# define VIEW_BASE NSView
#elif defined(Q_OS_IOS)
# include <UIKit/UIKit.h>
# define VIEW_BASE UIView
#elif defined(Q_OS_WIN) #elif defined(Q_OS_WIN)
# include <winuser.h> # include <winuser.h>
#endif #endif
@ -24,16 +28,16 @@ public:
QRect geometry() const; QRect geometry() const;
private: private:
#if defined(Q_OS_MACOS) #if defined(Q_OS_MACOS) || defined(Q_OS_IOS)
NSView *m_handle = nullptr; VIEW_BASE *m_handle = nullptr;
#elif defined(Q_OS_WIN) #elif defined(Q_OS_WIN)
HWND m_handle = nullptr; HWND m_handle = nullptr;
#endif #endif
}; };
#if defined(Q_OS_MACOS) #if defined(Q_OS_MACOS) || defined(Q_OS_IOS)
@interface View : NSView @interface View : VIEW_BASE
@end @end
@implementation View @implementation View