Commit 66803298 authored by Francois Cartegnie's avatar Francois Cartegnie

Qt: ExtToolButton: set delay relatively to dblclick's

parent ef77c313
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
#include <QKeyEvent> #include <QKeyEvent>
#include <QWheelEvent> #include <QWheelEvent>
#include <QPixmap> #include <QPixmap>
#include <QApplication>
#include <vlc_keys.h> #include <vlc_keys.h>
QFramelessButton::QFramelessButton( QWidget *parent ) QFramelessButton::QFramelessButton( QWidget *parent )
...@@ -415,7 +416,8 @@ SpinningIcon::~SpinningIcon() ...@@ -415,7 +416,8 @@ SpinningIcon::~SpinningIcon()
QToolButtonExt::QToolButtonExt(QWidget *parent, int ms ): longClick( false ) QToolButtonExt::QToolButtonExt(QWidget *parent, int ms ): longClick( false )
{ {
setAutoRepeat( true ); setAutoRepeat( true );
setAutoRepeatDelay( ms ); /* default to twice the doubleclick delay */
setAutoRepeatDelay( ( ms > 0 )? ms : 2 * QApplication::doubleClickInterval() );
setAutoRepeatInterval( 100 ); setAutoRepeatInterval( 100 );
connect( this, SIGNAL(released()), this, SLOT(releasedSlot()) ); connect( this, SIGNAL(released()), this, SLOT(releasedSlot()) );
} }
......
...@@ -52,7 +52,7 @@ class QToolButtonExt : public QToolButton ...@@ -52,7 +52,7 @@ class QToolButtonExt : public QToolButton
{ {
Q_OBJECT Q_OBJECT
public: public:
QToolButtonExt( QWidget *parent = 0, int ms = 1000 ); QToolButtonExt( QWidget *parent = 0, int ms = 0 );
private: private:
bool longClick; bool longClick;
private slots: private slots:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment