[vlc-commits] Qt: ExtToolButton: set delay relatively to dblclick's
Francois Cartegnie
git at videolan.org
Thu Apr 21 15:39:33 CEST 2011
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Thu Apr 21 15:38:22 2011 +0200| [6680329869bef667441cff9816aadf5c327c8338] | committer: Francois Cartegnie
Qt: ExtToolButton: set delay relatively to dblclick's
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=6680329869bef667441cff9816aadf5c327c8338
---
modules/gui/qt4/util/customwidgets.cpp | 4 +++-
modules/gui/qt4/util/customwidgets.hpp | 2 +-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/modules/gui/qt4/util/customwidgets.cpp b/modules/gui/qt4/util/customwidgets.cpp
index 5042c41..90c7791 100644
--- a/modules/gui/qt4/util/customwidgets.cpp
+++ b/modules/gui/qt4/util/customwidgets.cpp
@@ -36,6 +36,7 @@
#include <QKeyEvent>
#include <QWheelEvent>
#include <QPixmap>
+#include <QApplication>
#include <vlc_keys.h>
QFramelessButton::QFramelessButton( QWidget *parent )
@@ -415,7 +416,8 @@ SpinningIcon::~SpinningIcon()
QToolButtonExt::QToolButtonExt(QWidget *parent, int ms ): longClick( false )
{
setAutoRepeat( true );
- setAutoRepeatDelay( ms );
+ /* default to twice the doubleclick delay */
+ setAutoRepeatDelay( ( ms > 0 )? ms : 2 * QApplication::doubleClickInterval() );
setAutoRepeatInterval( 100 );
connect( this, SIGNAL(released()), this, SLOT(releasedSlot()) );
}
diff --git a/modules/gui/qt4/util/customwidgets.hpp b/modules/gui/qt4/util/customwidgets.hpp
index e4301b3..82bef59 100644
--- a/modules/gui/qt4/util/customwidgets.hpp
+++ b/modules/gui/qt4/util/customwidgets.hpp
@@ -52,7 +52,7 @@ class QToolButtonExt : public QToolButton
{
Q_OBJECT
public:
- QToolButtonExt( QWidget *parent = 0, int ms = 1000 );
+ QToolButtonExt( QWidget *parent = 0, int ms = 0 );
private:
bool longClick;
private slots:
More information about the vlc-commits
mailing list