Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Ben Boeckel
QtTesting
Commits
ca088972
Commit
ca088972
authored
May 02, 2012
by
Benjamin Long
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix QToolButton translator, and remove useless qDebug.
parent
4d42969a
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
10 deletions
+21
-10
pqAbstractButtonEventTranslator.cxx
pqAbstractButtonEventTranslator.cxx
+16
-7
pqAbstractButtonEventTranslator.h
pqAbstractButtonEventTranslator.h
+5
-0
pqEventDispatcher.cxx
pqEventDispatcher.cxx
+0
-2
pqTestUtility.cxx
pqTestUtility.cxx
+0
-1
No files found.
pqAbstractButtonEventTranslator.cxx
View file @
ca088972
...
...
@@ -45,6 +45,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
pqAbstractButtonEventTranslator
::
pqAbstractButtonEventTranslator
(
QObject
*
p
)
:
pqWidgetEventTranslator
(
p
)
{
this
->
LastMouseEvent
=
0
;
}
bool
pqAbstractButtonEventTranslator
::
translateEvent
(
QObject
*
Object
,
QEvent
*
Event
,
bool
&
/*Error*/
)
...
...
@@ -52,7 +53,6 @@ bool pqAbstractButtonEventTranslator::translateEvent(QObject* Object, QEvent* Ev
QAbstractButton
*
const
object
=
qobject_cast
<
QAbstractButton
*>
(
Object
);
if
(
!
object
)
return
false
;
switch
(
Event
->
type
())
{
case
QEvent
::
KeyPress
:
...
...
@@ -67,6 +67,7 @@ bool pqAbstractButtonEventTranslator::translateEvent(QObject* Object, QEvent* Ev
case
QEvent
::
MouseButtonPress
:
{
QMouseEvent
*
const
e
=
static_cast
<
QMouseEvent
*>
(
Event
);
this
->
LastMouseEvent
=
e
;
QPushButton
*
pushButton
=
qobject_cast
<
QPushButton
*>
(
object
);
if
(
pushButton
&&
e
->
button
()
==
Qt
::
LeftButton
&&
...
...
@@ -87,6 +88,9 @@ bool pqAbstractButtonEventTranslator::translateEvent(QObject* Object, QEvent* Ev
break
;
case
QEvent
::
Timer
:
{
if
(
this
->
LastMouseEvent
&&
this
->
LastMouseEvent
->
type
()
==
QEvent
::
MouseButtonPress
)
{
QToolButton
*
tButton
=
qobject_cast
<
QToolButton
*>
(
object
);
if
(
tButton
&&
tButton
->
popupMode
()
==
QToolButton
::
DelayedPopup
)
...
...
@@ -94,10 +98,12 @@ bool pqAbstractButtonEventTranslator::translateEvent(QObject* Object, QEvent* Ev
emit
recordEvent
(
object
,
"longActivate"
,
""
);
}
}
}
break
;
case
QEvent
::
MouseButtonRelease
:
{
QMouseEvent
*
const
e
=
static_cast
<
QMouseEvent
*>
(
Event
);
this
->
LastMouseEvent
=
e
;
if
(
e
->
button
()
==
Qt
::
LeftButton
&&
object
->
rect
().
contains
(
e
->
pos
()))
{
onActivate
(
object
);
...
...
@@ -124,10 +130,13 @@ void pqAbstractButtonEventTranslator::onActivate(QAbstractButton* actualObject)
const
bool
new_value
=
!
actualObject
->
isChecked
();
emit
recordEvent
(
object
,
"set_boolean"
,
new_value
?
"true"
:
"false"
);
}
else
if
(
tb
&&
tb
->
actions
().
count
()
<
2
)
else
if
(
tb
)
{
if
(
!
tb
->
menu
())
{
emit
recordEvent
(
tb
,
"activate"
,
""
);
}
}
else
{
emit
recordEvent
(
object
,
"activate"
,
""
);
...
...
pqAbstractButtonEventTranslator.h
View file @
ca088972
...
...
@@ -33,6 +33,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef _pqAbstractButtonEventTranslator_h
#define _pqAbstractButtonEventTranslator_h
// Qt includes
#include <QMouseEvent>
#include "pqWidgetEventTranslator.h"
class
QAbstractButton
;
...
...
@@ -58,6 +61,8 @@ private:
pqAbstractButtonEventTranslator
&
operator
=
(
const
pqAbstractButtonEventTranslator
&
);
void
onActivate
(
QAbstractButton
*
);
QMouseEvent
*
LastMouseEvent
;
};
#endif // !_pqAbstractButtonEventTranslator_h
...
...
pqEventDispatcher.cxx
View file @
ca088972
...
...
@@ -155,7 +155,6 @@ void pqEventDispatcher::setTimeStep(int value)
//-----------------------------------------------------------------------------
void
pqEventDispatcher
::
run
(
bool
value
)
{
qDebug
()
<<
"Dispatcher"
<<
value
;
this
->
PlayBackPaused
=
!
value
;
if
(
value
)
{
...
...
@@ -251,7 +250,6 @@ bool pqEventDispatcher::playEvents(pqEventSource& source, pqEventPlayer& player)
QObject
::
disconnect
(
QAbstractEventDispatcher
::
instance
(),
SIGNAL
(
awake
()),
this
,
SLOT
(
awake
()));
qDebug
()
<<
"About to Stop Dispatcher"
;
return
this
->
PlayBackStatus
;
}
...
...
pqTestUtility.cxx
View file @
ca088972
...
...
@@ -193,7 +193,6 @@ bool pqTestUtility::playTests(const QStringList& filenames)
}
this
->
PlayingTest
=
false
;
qDebug
()
<<
"About to stop TestUtility"
;
emit
this
->
stopped
();
return
success
;
}
...
...
Write
Preview
Markdown
is supported
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