comparison widgets/SelectableLabel.h @ 1414:fa986b91d77f

Merge from branch fix-static-analysis
author Chris Cannam
date Wed, 09 Jan 2019 15:24:51 +0000
parents 05d614f6e46d
children
comparison
equal deleted inserted replaced
1413:0930a27ebea2 1414:fa986b91d77f
11 published by the Free Software Foundation; either version 2 of the 11 published by the Free Software Foundation; either version 2 of the
12 License, or (at your option) any later version. See the file 12 License, or (at your option) any later version. See the file
13 COPYING included with this distribution for more information. 13 COPYING included with this distribution for more information.
14 */ 14 */
15 15
16 #ifndef _SELECTABLE_LABEL_H_ 16 #ifndef SV_SELECTABLE_LABEL_H
17 #define _SELECTABLE_LABEL_H_ 17 #define SV_SELECTABLE_LABEL_H
18 18
19 #include <QLabel> 19 #include <QLabel>
20 20
21 class SelectableLabel : public QLabel 21 class SelectableLabel : public QLabel
22 { 22 {
38 public slots: 38 public slots:
39 void setSelected(bool); 39 void setSelected(bool);
40 void toggle(); 40 void toggle();
41 41
42 protected: 42 protected:
43 virtual void mousePressEvent(QMouseEvent *e); 43 void mousePressEvent(QMouseEvent *e) override;
44 virtual void mouseReleaseEvent(QMouseEvent *e); 44 void mouseReleaseEvent(QMouseEvent *e) override;
45 virtual void mouseDoubleClickEvent(QMouseEvent *e); 45 void mouseDoubleClickEvent(QMouseEvent *e) override;
46 virtual void enterEvent(QEvent *); 46 void enterEvent(QEvent *) override;
47 virtual void leaveEvent(QEvent *); 47 void leaveEvent(QEvent *) override;
48 void setupStyle(); 48 void setupStyle();
49 QString m_selectedText; 49 QString m_selectedText;
50 QString m_unselectedText; 50 QString m_unselectedText;
51 bool m_selected; 51 bool m_selected;
52 bool m_swallowRelease; 52 bool m_swallowRelease;