BibleTime
bttextbrowser.h
Go to the documentation of this file.
1 /*********
2 *
3 * In the name of the Father, and of the Son, and of the Holy Spirit.
4 *
5 * This file is part of BibleTime's source code, http://www.bibletime.info/
6 *
7 * Copyright 1999-2020 by the BibleTime developers.
8 * The BibleTime source code is licensed under the GNU General Public License
9 * version 2.0.
10 *
11 **********/
12 
13 #pragma once
14 
15 #include <QTextBrowser>
16 
17 #include <QPoint>
18 
19 
20 /**
21 * \brief A QTextBrowser subclass which adds the ability to start drags for
22  references.
23 */
24 class BtTextBrowser: public QTextBrowser {
25 
26  Q_OBJECT
27 
28 public: // methods:
29 
30  BtTextBrowser(QWidget * parent = nullptr);
31 
32 protected: // methods:
33 
34  void keyPressEvent(QKeyEvent * event) override;
35  void mousePressEvent(QMouseEvent * event) override;
36  void mouseMoveEvent(QMouseEvent * event) override;
37  void mouseReleaseEvent(QMouseEvent * event) override;
38 
39 private: // fields:
40 
41  QPoint m_startPos;
42  bool m_readyToStartDrag = false;
43 
44 }; /* class BtTextBrowser */
A QTextBrowser subclass which adds the ability to start drags for references.
Definition: bttextbrowser.h:24
bool m_readyToStartDrag
Definition: bttextbrowser.h:42
BtTextBrowser(QWidget *parent=nullptr)
void mouseReleaseEvent(QMouseEvent *event) override
void mouseMoveEvent(QMouseEvent *event) override
QPoint m_startPos
Definition: bttextbrowser.h:41
void mousePressEvent(QMouseEvent *event) override
void keyPressEvent(QKeyEvent *event) override