BibleTime
|
#include <cscrollbutton.h>
Signals | |
void | change_requested (int count) |
Indicates a change the user made by moving the mouse. More... | |
void | lock () |
The lock() signal is emitted when the button grabs the mouse and enters the locked state. More... | |
void | unlock () |
The unlock() signal is emitted when the button releases the leaves the locked state. More... | |
Public Member Functions | |
CScrollButton (QWidget *parent=nullptr) | |
Protected Member Functions | |
void | mouseMoveEvent (QMouseEvent *e) override |
void | mousePressEvent (QMouseEvent *e) override |
Grabs the mouse on left button click and emits lock(). More... | |
void | mouseReleaseEvent (QMouseEvent *e) override |
If the mouse is grabbed and we release the left mouse button, releases the mouse and emits unlock(). More... | |
Protected Attributes | |
bool | m_isLocked |
Indicates whether the button is in locked state or not. More... | |
float | m_movement |
The amount the mouse moved. More... | |
This Class implements the direct chooser button used in the KeyChooser Widget.
Definition at line 28 of file cscrollbutton.h.
CScrollButton::CScrollButton | ( | QWidget * | parent = nullptr | ) |
Definition at line 22 of file cscrollbutton.cpp.
|
signal |
Indicates a change the user made by moving the mouse.
count | the number of items to be changed in the KeyChooser ComboBox. |
Referenced by CScrollerWidgetSet::CScrollerWidgetSet(), and mouseMoveEvent().
|
signal |
The lock() signal is emitted when the button grabs the mouse and enters the locked state.
Referenced by CScrollerWidgetSet::CScrollerWidgetSet(), and mousePressEvent().
|
overrideprotected |
Definition at line 45 of file cscrollbutton.cpp.
References change_requested(), m_isLocked, and m_movement.
|
overrideprotected |
Grabs the mouse on left button click and emits lock().
Definition at line 28 of file cscrollbutton.cpp.
References lock(), and m_isLocked.
|
overrideprotected |
If the mouse is grabbed and we release the left mouse button, releases the mouse and emits unlock().
Definition at line 36 of file cscrollbutton.cpp.
References m_isLocked, m_movement, and unlock().
|
signal |
The unlock() signal is emitted when the button releases the leaves the locked state.
Referenced by CScrollerWidgetSet::CScrollerWidgetSet(), and mouseReleaseEvent().
|
protected |
Indicates whether the button is in locked state or not.
If the button is in the locked state, this means the mouse is grabbed and any mouse move events invoke calculation about whether to emit the change_requested() signal.
Definition at line 76 of file cscrollbutton.h.
Referenced by mouseMoveEvent(), mousePressEvent(), and mouseReleaseEvent().
|
protected |
The amount the mouse moved.
This is saved so slow movements of mice can still be tracked and yet not emitting a change for every smallest movement of the mouse.
Definition at line 84 of file cscrollbutton.h.
Referenced by mouseMoveEvent(), and mouseReleaseEvent().