On clicking pushbutton, pages in stacked widget has to slide left once. And on double clicking same pushbutton, pages has to slide right twice. Can anyone please help me to write code for this in qt.
On clicking pushbutton, pages in stacked widget has to slide left once. And on double clicking same pushbutton, pages has to slide right twice. Can anyone please help me to write code for this in qt.
Hi, you can use the clicked() signal of the QPushButton, but you will have to overload the mouseEvent() for your button and check QEvent::MouseButtonDblClick because there is no signal on double click.
Ginsengelf
Another possibility is to use a QTimer in the slot that responds to the clicked() signal. When the first click occurs, start the timer for some short timeout - 250 ms or so (you can determine the actual double-click interval for your OS using QApplication::doubleClickInterval() ). When the second click comes, if the timer is still running then you stop it and slide two pages because the second click has come within the double-click interval. If the timer has timed out, the response has been slower than a double-click, so you slide one page. (Implement the "slide one page" slot for the QTimer::timeOut() signal).
<=== The Great Pumpkin says ===>
Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.
Bookmarks