summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/corelib/global/qcompilerdetection.h2
-rw-r--r--src/corelib/kernel/qvariant_p.h2
-rw-r--r--src/gui/kernel/qwindow.cpp5
-rw-r--r--src/gui/kernel/qwindow.h30
-rw-r--r--src/gui/opengl/qopenglvertexarrayobject.cpp27
-rw-r--r--src/gui/opengl/qopenglvertexarrayobject.h1
-rw-r--r--src/plugins/platforms/android/src/qandroidplatformintegration.cpp10
-rw-r--r--src/plugins/platforms/android/src/qandroidplatformintegration.h2
-rw-r--r--src/plugins/platforms/cocoa/qnsview.mm6
9 files changed, 60 insertions, 25 deletions
diff --git a/src/corelib/global/qcompilerdetection.h b/src/corelib/global/qcompilerdetection.h
index 548eebd3ad..b685c1fe0d 100644
--- a/src/corelib/global/qcompilerdetection.h
+++ b/src/corelib/global/qcompilerdetection.h
@@ -467,7 +467,7 @@
# if __INTEL_COMPILER < 1200
# define Q_NO_TEMPLATE_FRIENDS
# endif
-# if defined(_CHAR16T) || __cplusplus >= 201103L
+# if __cplusplus >= 201103L
# define Q_COMPILER_VARIADIC_MACROS
# if __INTEL_COMPILER >= 1200
# define Q_COMPILER_AUTO_TYPE
diff --git a/src/corelib/kernel/qvariant_p.h b/src/corelib/kernel/qvariant_p.h
index 04b9d92f55..4ec049e20d 100644
--- a/src/corelib/kernel/qvariant_p.h
+++ b/src/corelib/kernel/qvariant_p.h
@@ -224,7 +224,7 @@ class QVariantIsNull
public:
static const bool Value = (sizeof(test<T>(0)) == sizeof(Yes));
};
-#elif defined(Q_CC_MSVC) && _MSC_VER >= 1400 // MSVC 2005, 2008 version: no decltype, but 'sealed' classes (>=2010 has decltype)
+#elif defined(Q_CC_MSVC) && _MSC_VER >= 1400 && !defined(Q_CC_INTEL) // MSVC 2005, 2008 version: no decltype, but 'sealed' classes (>=2010 has decltype)
template<typename T>
class HasIsNullMethod {
struct Yes { char unused[1]; };
diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp
index eff057c4cb..392407d86d 100644
--- a/src/gui/kernel/qwindow.cpp
+++ b/src/gui/kernel/qwindow.cpp
@@ -933,7 +933,6 @@ bool QWindow::isActive() const
/*!
\property QWindow::contentOrientation
\brief the orientation of the window's contents
- \since 5.1
This is a hint to the window manager in case it needs to display
additional content like popups, dialogs, status bars, or similar
@@ -1190,7 +1189,6 @@ void QWindow::setHeight(int arg)
/*!
\property QWindow::minimumWidth
\brief the minimum width of the window's geometry
- \since 5.1
*/
void QWindow::setMinimumWidth(int w)
{
@@ -1200,7 +1198,6 @@ void QWindow::setMinimumWidth(int w)
/*!
\property QWindow::minimumHeight
\brief the minimum height of the window's geometry
- \since 5.1
*/
void QWindow::setMinimumHeight(int h)
{
@@ -1233,7 +1230,6 @@ void QWindow::setMaximumSize(const QSize &size)
/*!
\property QWindow::maximumWidth
\brief the maximum width of the window's geometry
- \since 5.1
*/
void QWindow::setMaximumWidth(int w)
{
@@ -1243,7 +1239,6 @@ void QWindow::setMaximumWidth(int w)
/*!
\property QWindow::maximumHeight
\brief the maximum height of the window's geometry
- \since 5.1
*/
void QWindow::setMaximumHeight(int h)
{
diff --git a/src/gui/kernel/qwindow.h b/src/gui/kernel/qwindow.h
index efdfd497a6..ca261ff7ce 100644
--- a/src/gui/kernel/qwindow.h
+++ b/src/gui/kernel/qwindow.h
@@ -110,14 +110,14 @@ class Q_GUI_EXPORT QWindow : public QObject, public QSurface
Q_PROPERTY(int y READ y WRITE setY NOTIFY yChanged)
Q_PROPERTY(int width READ width WRITE setWidth NOTIFY widthChanged)
Q_PROPERTY(int height READ height WRITE setHeight NOTIFY heightChanged)
- Q_PROPERTY(int minimumWidth READ minimumWidth WRITE setMinimumWidth NOTIFY minimumWidthChanged REVISION 1)
- Q_PROPERTY(int minimumHeight READ minimumHeight WRITE setMinimumHeight NOTIFY minimumHeightChanged REVISION 1)
- Q_PROPERTY(int maximumWidth READ maximumWidth WRITE setMaximumWidth NOTIFY maximumWidthChanged REVISION 1)
- Q_PROPERTY(int maximumHeight READ maximumHeight WRITE setMaximumHeight NOTIFY maximumHeightChanged REVISION 1)
+ Q_PROPERTY(int minimumWidth READ minimumWidth WRITE setMinimumWidth NOTIFY minimumWidthChanged)
+ Q_PROPERTY(int minimumHeight READ minimumHeight WRITE setMinimumHeight NOTIFY minimumHeightChanged)
+ Q_PROPERTY(int maximumWidth READ maximumWidth WRITE setMaximumWidth NOTIFY maximumWidthChanged)
+ Q_PROPERTY(int maximumHeight READ maximumHeight WRITE setMaximumHeight NOTIFY maximumHeightChanged)
Q_PROPERTY(bool visible READ isVisible WRITE setVisible NOTIFY visibleChanged)
Q_PROPERTY(bool active READ isActive NOTIFY activeChanged REVISION 1)
Q_PROPERTY(Visibility visibility READ visibility WRITE setVisibility NOTIFY visibilityChanged REVISION 1)
- Q_PROPERTY(Qt::ScreenOrientation contentOrientation READ contentOrientation WRITE reportContentOrientationChange NOTIFY contentOrientationChanged REVISION 1)
+ Q_PROPERTY(Qt::ScreenOrientation contentOrientation READ contentOrientation WRITE reportContentOrientationChange NOTIFY contentOrientationChanged)
Q_PROPERTY(qreal opacity READ opacity WRITE setOpacity NOTIFY opacityChanged REVISION 1)
public:
@@ -286,12 +286,12 @@ public Q_SLOTS:
void setWidth(int arg);
void setHeight(int arg);
- Q_REVISION(1) void setMinimumWidth(int w);
- Q_REVISION(1) void setMinimumHeight(int h);
- Q_REVISION(1) void setMaximumWidth(int w);
- Q_REVISION(1) void setMaximumHeight(int h);
+ void setMinimumWidth(int w);
+ void setMinimumHeight(int h);
+ void setMaximumWidth(int w);
+ void setMaximumHeight(int h);
- void alert(int msec);
+ Q_REVISION(1) void alert(int msec);
Q_SIGNALS:
void screenChanged(QScreen *screen);
@@ -304,15 +304,15 @@ Q_SIGNALS:
void widthChanged(int arg);
void heightChanged(int arg);
- Q_REVISION(1) void minimumWidthChanged(int arg);
- Q_REVISION(1) void minimumHeightChanged(int arg);
- Q_REVISION(1) void maximumWidthChanged(int arg);
- Q_REVISION(1) void maximumHeightChanged(int arg);
+ void minimumWidthChanged(int arg);
+ void minimumHeightChanged(int arg);
+ void maximumWidthChanged(int arg);
+ void maximumHeightChanged(int arg);
void visibleChanged(bool arg);
Q_REVISION(1) void visibilityChanged(QWindow::Visibility visibility);
Q_REVISION(1) void activeChanged();
- Q_REVISION(1) void contentOrientationChanged(Qt::ScreenOrientation orientation);
+ void contentOrientationChanged(Qt::ScreenOrientation orientation);
void focusObjectChanged(QObject *object);
diff --git a/src/gui/opengl/qopenglvertexarrayobject.cpp b/src/gui/opengl/qopenglvertexarrayobject.cpp
index e450fe708f..eb7a42f749 100644
--- a/src/gui/opengl/qopenglvertexarrayobject.cpp
+++ b/src/gui/opengl/qopenglvertexarrayobject.cpp
@@ -118,6 +118,9 @@ public:
void destroy();
void bind();
void release();
+ void _q_contextAboutToBeDestroyed();
+
+ Q_DECLARE_PUBLIC(QOpenGLVertexArrayObject)
GLuint vao;
@@ -141,12 +144,22 @@ public:
bool QOpenGLVertexArrayObjectPrivate::create()
{
+ if (vao) {
+ qWarning("QOpenGLVertexArrayObject::create() VAO is already created");
+ return false;
+ }
+
+ Q_Q(QOpenGLVertexArrayObject);
+ if (context)
+ QObject::disconnect(context, SIGNAL(aboutToBeDestroyed()), q, SLOT(_q_contextAboutToBeDestroyed()));
+
QOpenGLContext *ctx = QOpenGLContext::currentContext();
if (!ctx) {
qWarning("QOpenGLVertexArrayObject::create() requires a valid current OpenGL context");
return false;
}
context = ctx;
+ QObject::connect(context, SIGNAL(aboutToBeDestroyed()), q, SLOT(_q_contextAboutToBeDestroyed()));
#if defined(QT_OPENGL_ES_2)
if (ctx->hasExtension("GL_OES_vertex_array_object")) {
@@ -197,8 +210,16 @@ void QOpenGLVertexArrayObjectPrivate::destroy()
case NotSupported:
break;
}
- vao = 0;
#endif
+ vao = 0;
+}
+
+/*!
+ \internal
+*/
+void QOpenGLVertexArrayObjectPrivate::_q_contextAboutToBeDestroyed()
+{
+ destroy();
}
void QOpenGLVertexArrayObjectPrivate::bind()
@@ -327,7 +348,7 @@ QOpenGLVertexArrayObject::~QOpenGLVertexArrayObject()
Q_D(QOpenGLVertexArrayObject);
QOpenGLContext *oldContext = 0;
- if (d->context && d->context != ctx) {
+ if (d->context && ctx && d->context != ctx) {
oldContext = ctx;
if (d->context->makeCurrent(oldContext->surface())) {
ctx = d->context;
@@ -471,3 +492,5 @@ void QOpenGLVertexArrayObject::release()
*/
QT_END_NAMESPACE
+
+#include "moc_qopenglvertexarrayobject.cpp"
diff --git a/src/gui/opengl/qopenglvertexarrayobject.h b/src/gui/opengl/qopenglvertexarrayobject.h
index 569aeea730..8369497660 100644
--- a/src/gui/opengl/qopenglvertexarrayobject.h
+++ b/src/gui/opengl/qopenglvertexarrayobject.h
@@ -102,6 +102,7 @@ public:
private:
Q_DISABLE_COPY(QOpenGLVertexArrayObject)
Q_DECLARE_PRIVATE(QOpenGLVertexArrayObject)
+ Q_PRIVATE_SLOT(d_func(), void _q_contextAboutToBeDestroyed())
QOpenGLVertexArrayObject(QOpenGLVertexArrayObjectPrivate &dd);
};
diff --git a/src/plugins/platforms/android/src/qandroidplatformintegration.cpp b/src/plugins/platforms/android/src/qandroidplatformintegration.cpp
index f0630b5224..91ad2b368f 100644
--- a/src/plugins/platforms/android/src/qandroidplatformintegration.cpp
+++ b/src/plugins/platforms/android/src/qandroidplatformintegration.cpp
@@ -216,6 +216,16 @@ QPlatformServices *QAndroidPlatformIntegration::services() const
return m_androidPlatformServices;
}
+QVariant QAndroidPlatformIntegration::styleHint(StyleHint hint) const
+{
+ switch (hint) {
+ case ShowIsFullScreen:
+ return true;
+ default:
+ return QPlatformIntegration::styleHint(hint);
+ }
+}
+
static const QLatin1String androidThemeName("android");
QStringList QAndroidPlatformIntegration::themeNames() const
{
diff --git a/src/plugins/platforms/android/src/qandroidplatformintegration.h b/src/plugins/platforms/android/src/qandroidplatformintegration.h
index 8da9fb2ff4..6cc191701d 100644
--- a/src/plugins/platforms/android/src/qandroidplatformintegration.h
+++ b/src/plugins/platforms/android/src/qandroidplatformintegration.h
@@ -112,6 +112,8 @@ public:
QPlatformNativeInterface *nativeInterface() const;
QPlatformServices *services() const;
+ QVariant styleHint(StyleHint hint) const;
+
QStringList themeNames() const;
QPlatformTheme *createPlatformTheme(const QString &name) const;
diff --git a/src/plugins/platforms/cocoa/qnsview.mm b/src/plugins/platforms/cocoa/qnsview.mm
index f811c0e9b4..66a1b95ad8 100644
--- a/src/plugins/platforms/cocoa/qnsview.mm
+++ b/src/plugins/platforms/cocoa/qnsview.mm
@@ -916,6 +916,7 @@ static QTouchDevice *touchDevice = 0;
ulong timestamp = [nsevent timestamp] * 1000;
ulong nativeModifiers = [nsevent modifierFlags];
Qt::KeyboardModifiers modifiers = [QNSView convertKeyModifiers: nativeModifiers];
+ NSString *charactersIgnoringModifiers = [nsevent charactersIgnoringModifiers];
NSString *characters = [nsevent characters];
// [from Qt 4 impl] There is no way to get the scan code from carbon. But we cannot
@@ -930,7 +931,10 @@ static QTouchDevice *touchDevice = 0;
QChar ch = QChar::ReplacementCharacter;
int keyCode = Qt::Key_unknown;
if ([characters length] != 0) {
- ch = QChar([characters characterAtIndex:0]);
+ if ((modifiers & Qt::MetaModifier) && ([charactersIgnoringModifiers length] != 0))
+ ch = QChar([charactersIgnoringModifiers characterAtIndex:0]);
+ else
+ ch = QChar([characters characterAtIndex:0]);
keyCode = [self convertKeyCode:ch];
}