summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/corelib/statemachine/qabstracttransition.cpp15
-rw-r--r--src/corelib/statemachine/qabstracttransition.h6
-rw-r--r--src/corelib/statemachine/qabstracttransition_p.h1
-rw-r--r--src/corelib/statemachine/qstatemachine.cpp1
-rw-r--r--src/opengl/qglframebufferobject.cpp6
-rw-r--r--src/opengl/qpixmapdata_gl.cpp7
-rw-r--r--src/opengl/qwindowsurface_gl.cpp7
7 files changed, 35 insertions, 8 deletions
diff --git a/src/corelib/statemachine/qabstracttransition.cpp b/src/corelib/statemachine/qabstracttransition.cpp
index 3be3b73..670aa7d 100644
--- a/src/corelib/statemachine/qabstracttransition.cpp
+++ b/src/corelib/statemachine/qabstracttransition.cpp
@@ -67,6 +67,8 @@ QT_BEGIN_NAMESPACE
targetStates() function returns the targets of the transition. The machine()
function returns the state machine that the transition is part of.
+ The triggered() signal is emitted when the transition has been triggered.
+
Transitions can cause animations to be played. Use the addAnimation()
function to add an animation to the transition.
@@ -139,6 +141,12 @@ QState *QAbstractTransitionPrivate::sourceState() const
return qobject_cast<QState*>(parent);
}
+void QAbstractTransitionPrivate::emitTriggered()
+{
+ Q_Q(QAbstractTransition);
+ emit q->triggered();
+}
+
/*!
Constructs a new QAbstractTransition object with the given \a sourceState.
*/
@@ -333,6 +341,13 @@ QList<QAbstractAnimation*> QAbstractTransition::animations() const
*/
/*!
+ \fn QAbstractTransition::triggered()
+
+ This signal is emitted when the transition has been triggered (after
+ onTransition() has been called).
+*/
+
+/*!
\reimp
*/
bool QAbstractTransition::event(QEvent *e)
diff --git a/src/corelib/statemachine/qabstracttransition.h b/src/corelib/statemachine/qabstracttransition.h
index 83899ce..9ba1f11 100644
--- a/src/corelib/statemachine/qabstracttransition.h
+++ b/src/corelib/statemachine/qabstracttransition.h
@@ -89,6 +89,12 @@ public:
QList<QAbstractAnimation*> animations() const;
#endif
+Q_SIGNALS:
+#if !defined(Q_MOC_RUN) && !defined(qdoc)
+private: // can only be emitted by QAbstractTransition
+#endif
+ void triggered();
+
protected:
virtual bool eventTest(QEvent *event) = 0;
diff --git a/src/corelib/statemachine/qabstracttransition_p.h b/src/corelib/statemachine/qabstracttransition_p.h
index f0b9bb3..784832d 100644
--- a/src/corelib/statemachine/qabstracttransition_p.h
+++ b/src/corelib/statemachine/qabstracttransition_p.h
@@ -78,6 +78,7 @@ public:
void callOnTransition(QEvent *e);
QState *sourceState() const;
QStateMachine *machine() const;
+ void emitTriggered();
QList<QPointer<QAbstractState> > targetStates;
diff --git a/src/corelib/statemachine/qstatemachine.cpp b/src/corelib/statemachine/qstatemachine.cpp
index 7a34e4b..04cce50 100644
--- a/src/corelib/statemachine/qstatemachine.cpp
+++ b/src/corelib/statemachine/qstatemachine.cpp
@@ -498,6 +498,7 @@ void QStateMachinePrivate::executeTransitionContent(QEvent *event, const QList<Q
qDebug() << q_func() << ": triggering" << t;
#endif
QAbstractTransitionPrivate::get(t)->callOnTransition(event);
+ QAbstractTransitionPrivate::get(t)->emitTriggered();
}
}
diff --git a/src/opengl/qglframebufferobject.cpp b/src/opengl/qglframebufferobject.cpp
index 7f229e2..eacf5bb 100644
--- a/src/opengl/qglframebufferobject.cpp
+++ b/src/opengl/qglframebufferobject.cpp
@@ -935,8 +935,7 @@ QPaintEngine *QGLFramebufferObject::paintEngine() const
*/
bool QGLFramebufferObject::hasOpenGLFramebufferObjects()
{
- if (!QGLContext::currentContext())
- QGLWidget dmy; // needed to detect and init the QGLExtensions object
+ QGLExtensions::init();
return (QGLExtensions::glExtensions & QGLExtensions::FramebufferObject);
}
@@ -1098,8 +1097,7 @@ bool QGLFramebufferObject::isBound() const
*/
bool QGLFramebufferObject::hasOpenGLFramebufferBlit()
{
- if (!QGLContext::currentContext())
- QGLWidget dmy; // needed to detect and init the QGLExtensions object
+ QGLExtensions::init();
return (QGLExtensions::glExtensions & QGLExtensions::FramebufferBlit);
}
diff --git a/src/opengl/qpixmapdata_gl.cpp b/src/opengl/qpixmapdata_gl.cpp
index 5e73ef5..f745aae 100644
--- a/src/opengl/qpixmapdata_gl.cpp
+++ b/src/opengl/qpixmapdata_gl.cpp
@@ -114,8 +114,11 @@ QGLPixmapData::~QGLPixmapData()
QGLWidget *shareWidget = qt_gl_share_widget();
if (!shareWidget)
return;
- QGLShareContextScope ctx(shareWidget->context());
- glDeleteTextures(1, &m_textureId);
+
+ if (m_textureId) {
+ QGLShareContextScope ctx(shareWidget->context());
+ glDeleteTextures(1, &m_textureId);
+ }
}
bool QGLPixmapData::isValid() const
diff --git a/src/opengl/qwindowsurface_gl.cpp b/src/opengl/qwindowsurface_gl.cpp
index 50d0ae7..3a7a07e 100644
--- a/src/opengl/qwindowsurface_gl.cpp
+++ b/src/opengl/qwindowsurface_gl.cpp
@@ -184,11 +184,13 @@ QGLGraphicsSystem::QGLGraphicsSystem()
class QGLGlobalShareWidget
{
public:
- QGLGlobalShareWidget() : widget(0) {}
+ QGLGlobalShareWidget() : widget(0), initializing(false) {}
QGLWidget *shareWidget() {
- if (!widget && !cleanedUp) {
+ if (!initializing && !widget && !cleanedUp) {
+ initializing = true;
widget = new QGLWidget;
+ initializing = false;
}
return widget;
}
@@ -204,6 +206,7 @@ public:
private:
QGLWidget *widget;
+ bool initializing;
};
bool QGLGlobalShareWidget::cleanedUp = false;