Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Ben Boeckel
QtTesting
Commits
6961b47b
Commit
6961b47b
authored
Apr 17, 2007
by
Clinton Stimpson
Browse files
BUG: Do wait on GUI thread, not python thread.
parent
b2748280
Changes
2
Hide whitespace changes
Inline
Side-by-side
pqPythonEventSource.cxx
View file @
6961b47b
...
...
@@ -215,7 +215,25 @@ QtTesting_wait(PyObject* /*self*/, PyObject* args)
return
NULL
;
}
pqEventDispatcher
::
processEventsAndWait
(
ms
);
if
(
Instance
&&
QThread
::
currentThread
()
!=
QApplication
::
instance
()
->
thread
())
{
QMetaObject
::
invokeMethod
(
Instance
,
"threadWait"
,
Qt
::
QueuedConnection
,
Q_ARG
(
int
,
ms
)
);
if
(
!
Instance
->
waitForGUI
())
{
PyErr_SetString
(
PyExc_ValueError
,
"error waiting"
);
return
NULL
;
}
}
else
if
(
QThread
::
currentThread
()
==
QApplication
::
instance
()
->
thread
())
{
pqPythonEventSource
::
wait
(
ms
);
}
else
{
PyErr_SetString
(
PyExc_AssertionError
,
"pqPythonEventSource not defined"
);
return
NULL
;
}
return
Py_BuildValue
(
const_cast
<
char
*>
(
""
));
}
...
...
@@ -561,3 +579,14 @@ QString pqPythonEventSource::invokeMethod(QString& object, QString& method)
return
ret
.
toString
();
}
void
pqPythonEventSource
::
threadWait
(
int
ms
)
{
this
->
wait
(
ms
);
this
->
guiAcknowledge
();
}
void
pqPythonEventSource
::
wait
(
int
ms
)
{
pqEventDispatcher
::
processEventsAndWait
(
ms
);
}
pqPythonEventSource.h
View file @
6961b47b
...
...
@@ -52,6 +52,7 @@ public:
static
void
setProperty
(
QString
&
object
,
QString
&
prop
,
const
QString
&
value
);
static
QStringList
getChildren
(
QString
&
object
);
static
QString
invokeMethod
(
QString
&
object
,
QString
&
method
);
static
void
wait
(
int
ms
);
protected:
virtual
void
run
();
...
...
@@ -61,6 +62,7 @@ protected slots:
void
threadSetProperty
();
void
threadGetChildren
();
void
threadInvokeMethod
();
void
threadWait
(
int
);
private:
class
pqInternal
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment