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
44a65a73
Commit
44a65a73
authored
Jan 05, 2007
by
Clinton Stimpson
Browse files
BUG: Use pqEventDispatcher::processEventsAndWait() in a few more places.
parent
bef14c55
Changes
2
Hide whitespace changes
Inline
Side-by-side
pqPythonEventSource.cxx
View file @
44a65a73
...
...
@@ -378,7 +378,7 @@ void pqPythonEventSource::setContent(const QString& path)
QString
pqPythonEventSource
::
getProperty
(
QString
&
object
,
const
QString
&
prop
)
{
// ensure other tasks have been completed
QCoreApplication
::
processEvents
(
);
pqEventDispatcher
::
processEvents
AndWait
(
1
);
QVariant
ret
;
QObject
*
qobject
=
pqObjectNaming
::
GetObject
(
object
);
...
...
@@ -407,7 +407,7 @@ void pqPythonEventSource::setProperty(QString& object, QString& prop,
const
QString
&
value
)
{
// ensure other tasks have been completed
QCoreApplication
::
processEvents
(
);
pqEventDispatcher
::
processEvents
AndWait
(
1
);
QVariant
ret
;
QObject
*
qobject
=
pqObjectNaming
::
GetObject
(
object
);
...
...
@@ -434,7 +434,7 @@ void pqPythonEventSource::threadSetProperty()
QStringList
pqPythonEventSource
::
getChildren
(
QString
&
object
)
{
// ensure other tasks have been completed
QCoreApplication
::
processEvents
(
);
pqEventDispatcher
::
processEvents
AndWait
(
1
);
QStringList
ret
;
QObject
*
qobject
=
pqObjectNaming
::
GetObject
(
object
);
...
...
pqThreadedEventSource.cxx
View file @
44a65a73
...
...
@@ -37,9 +37,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <QWaitCondition>
#include <QThread>
#include <QString>
#include <QEventLoop>
#include <QEvent>
#include <QApplication>
#include "pqEventDispatcher.h"
class
pqThreadedEventSource
::
pqInternal
:
public
QThread
{
...
...
@@ -48,7 +47,7 @@ public:
pqInternal
(
pqThreadedEventSource
&
source
)
:
Source
(
source
),
ShouldStop
(
0
),
GotEvent
(
false
)
GotEvent
(
0
)
{
}
...
...
@@ -60,10 +59,9 @@ public:
pqThreadedEventSource
&
Source
;
QWaitCondition
WaitCondition
;
QEventLoop
Loop
;
QAtomic
ShouldStop
;
bool
GotEvent
;
QAtomic
GotEvent
;
QString
CurrentObject
;
QString
CurrentCommand
;
QString
CurrentArgument
;
...
...
@@ -88,12 +86,13 @@ int pqThreadedEventSource::getNextEvent(
QString
&
command
,
QString
&
arguments
)
{
if
(
!
this
->
Internal
->
GotEvent
==
true
)
{
while
(
!
this
->
Internal
->
GotEvent
)
{
// wait for the other thread to post an event, while
// we keep the GUI alive.
this
->
Internal
->
Loop
.
exec
(
);
}
pqEventDispatcher
::
processEventsAndWait
(
1000
);
}
object
=
this
->
Internal
->
CurrentObject
;
command
=
this
->
Internal
->
CurrentCommand
;
...
...
@@ -119,10 +118,6 @@ void pqThreadedEventSource::relayEvent(QString object, QString command, QString
this
->
Internal
->
CurrentCommand
=
command
;
this
->
Internal
->
CurrentArgument
=
arguments
;
this
->
Internal
->
GotEvent
=
true
;
if
(
this
->
Internal
->
Loop
.
isRunning
())
{
this
->
Internal
->
Loop
.
quit
();
}
}
...
...
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