Custom QPushButton implementing wordwrap and double-click event support.
More...
|
void | sClickedSimple () |
| Signal emitted when sure that double-click has not been performed.
|
|
void | sClickedDouble () |
| Signal emitted when double-click event is detected.
|
|
|
| BtnPush (QWidget *parent=nullptr) |
|
| BtnPush (const QString &text, int padding=5, QWidget *parent=nullptr) |
|
void | setText (const QString &text) |
| Use to set text of button.
|
|
void | setTimeDoubleClick (int interval=250) |
| Activate "double click" feature by setting interval.
|
|
void | setPadding (int padding) |
| Set padding to use inside button.
|
|
const QString & | getText () const |
| Get button text.
|
|
int | getPadding () const |
| Get current padding to use.
|
|
|
void | paintEvent (QPaintEvent *event) override |
|
QSize | sizeHint () const override |
|
QSize | minimumSizeHint () const override |
|
void | updateGeometryBtn () override |
|
void | updateBtn () override |
|
void | setTextWordWrap (const QString &text) |
| Use to set button text.
|
|
void | paintTextWordWrap (QPainter *painter, const QRect &rect) |
|
QSize | calcSizeHintWordWrap (const QFontMetrics &fm, int width) const |
|
virtual void | updateGeometryBtn ()=0 |
|
virtual void | updateBtn ()=0 |
|
Custom QPushButton implementing wordwrap and double-click event support.
Include with:
#include "toolboxqt/widgets/button.h"
- See also
- tbq::BtnTool
-
tbq::BtnAbstractWordWrap
◆ sClickedDouble
tbq::BtnPush::sClickedDouble |
( |
| ) |
|
|
signal |
◆ sClickedSimple
tbq::BtnPush::sClickedSimple |
( |
| ) |
|
|
signal |
Signal emitted when sure that double-click has not been performed.
This signal will only be emitted if "double-click" feature has been enabled via setTimeDoubleClick().
Note that signal QPushButton::clicked()
will still be emitted and might be better to manage single click event (otherwise, has to wait for double click timer to end to consider simple click).
- See also
- sClickedDouble()
-
setTimeDoubleClick()
◆ setText()
void tbq::BtnPush::setText |
( |
const QString & |
text | ) |
|
Use to set text of button.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
This method is an overload, which simply call setTextWordWrap
method.
- Parameters
-
[in] | text | Text to display inside the button. |
- See also
- getText()
◆ setTimeDoubleClick()
void tbq::BtnPush::setTimeDoubleClick |
( |
int |
interval = 250 | ) |
|
Activate "double click" feature by setting interval.
- Parameters
-
[in] | interval | Interval in milliseconds to consider a double-click event |
- See also
- sClickedDouble(), sClickedSimple()
◆ updateBtn()
void tbq::BtnPush::updateBtn |
( |
| ) |
|
|
overrideprotectedvirtual |
◆ updateGeometryBtn()
void tbq::BtnPush::updateGeometryBtn |
( |
| ) |
|
|
overrideprotectedvirtual |
The documentation for this class was generated from the following files:
- toolboxqt/widgets/button.h
- toolboxqt/widgets/button.cpp