[libcalamaresui] Document ClickableLabel

This commit is contained in:
Adriaan de Groot 2020-05-18 10:32:25 +02:00
parent f67d8ef162
commit 8d4c7767d4

View File

@ -17,12 +17,19 @@
* along with Calamares. If not, see <http://www.gnu.org/licenses/>. * along with Calamares. If not, see <http://www.gnu.org/licenses/>.
*/ */
#ifndef CLICKABLELABEL_H #ifndef LIBCALAMARESUI_CLICKABLELABEL_H
#define CLICKABLELABEL_H #define LIBCALAMARESUI_CLICKABLELABEL_H
#include <QLabel> #include <QLabel>
#include <QTime> #include <QElapsedTimer>
/** @brief A Label where the whole label area is clickable
*
* When clicking anywhere on the Label (text, background, whatever)
* the signal clicked() is emitted. Use this as a buddy for radio
* buttons or other clickable things where you want mouse interaction
* with the label, to be the same as mouse interaction with the control.
*/
class ClickableLabel : public QLabel class ClickableLabel : public QLabel
{ {
Q_OBJECT Q_OBJECT
@ -39,7 +46,7 @@ protected:
virtual void mouseReleaseEvent( QMouseEvent* event ) override; virtual void mouseReleaseEvent( QMouseEvent* event ) override;
private: private:
QTime m_time; QElapsedTimer m_time;
}; };
#endif // CLICKABLELABEL_H #endif // LIBCALAMARESUI_CLICKABLELABEL_H