5 * th9x - http://code.google.com/p/th9x
6 * er9x - http://code.google.com/p/er9x
7 * gruvin9x - http://code.google.com/p/gruvin9x
9 * License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License version 2 as
13 * published by the Free Software Foundation.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
21 #ifndef _SLIDERWIDGET_H_
22 #define _SLIDERWIDGET_H_
28 class SliderWidget
: public QSlider
34 explicit SliderWidget(QWidget
* parent
= 0):
37 m_toolTip
= tr("<p>Value (input): <b>%1</b></p>") % tr("Right-double-click to reset to center.");
42 bool event(QEvent
*event
)
44 if (event
->type() == QEvent::ToolTip
) {
45 QHelpEvent
* helpEvent
= static_cast<QHelpEvent
*>(event
);
47 QToolTip::showText(helpEvent
->globalPos(), m_toolTip
.arg(this->value()));
51 return QWidget::event(event
);
54 void mousePressEvent(QMouseEvent
* event
)
56 if (event
->button() == Qt::RightButton
&& event
->type() == QEvent::MouseButtonDblClick
) {
61 QSlider::mousePressEvent(event
);
67 #endif // _SLIDERWIDGET_H_