mardi 14 octobre 2014

create slider with MouseMoveEvent


Vote count:

0




I have got QDialog wich parent is MainWindow. I have MyButton which is subclass of QPushButton.



class MyButton : public QPushButton{
Q_OBJECT
public:
explicit MyButton(const QString& str, QWidget *parent = 0);
double value;
signals:
void valueChanged();


There are MyButtonss in QDialog. I want the functionality of MyButton be like this:


If I press MyButton and move mouse to left(or right) the value decreases(increases) and valueChanged signal emits. Value should change even if mouse cursor is not already over QDialog. If cursor reachs boundary of MainWindow cursor position is set to the center of MainWindow and value still changing. So 'MyButton' is like slider with infinite interval. Is it possible to do it?



asked 1 min ago

lnk

84






create slider with MouseMoveEvent

Aucun commentaire:

Enregistrer un commentaire