BibleTime
btbiblekeywidget.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, https://bibletime.info/
6 *
7 * Copyright 1999-2021 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 <QWidget>
16 
17 #include <QTimer>
18 #include "../../../backend/drivers/cswordbiblemoduleinfo.h"
19 
20 
21 class CSwordVerseKey;
22 class QLineEdit;
23 class QMenu;
24 
25 class BtBibleKeyWidget : public QWidget {
26  Q_OBJECT
27 
28  public:
30  CSwordVerseKey * key,
31  QWidget * parent = nullptr);
32 
33  ~BtBibleKeyWidget() override;
34  bool setKey(CSwordVerseKey* key);
35  void setModule(const CSwordBibleModuleInfo *m = nullptr);
36  bool eventFilter(QObject *o, QEvent *e) override;
37 
38  Q_SIGNALS:
39  void changed(CSwordVerseKey* key);
40 
41  protected:
42  #if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
43  void enterEvent(QEvent * event) override;
44  #else
45  void enterEvent(QEnterEvent * event) override;
46  #endif
47  void leaveEvent(QEvent *event) override;
48  void resizeEvent(QResizeEvent *event) override;
49  void resetDropDownButtons();
50 
51  public Q_SLOTS:
52  void updateText();
53 
54  private: // methods:
55 
56  void populateBookMenu(QMenu & menu);
57  void populateChapterMenu(QMenu & menu);
58  void populateVerseMenu(QMenu & menu);
59 
60  private:
61 
63 
65 
68 
69  bool updatelock;
70  QString oldKey;
72 };
BtBibleKeyWidget(CSwordBibleModuleInfo const *module, CSwordVerseKey *key, QWidget *parent=nullptr)
const CSwordBibleModuleInfo * m_module
void enterEvent(QEnterEvent *event) override
CSwordVerseKey * m_key
~BtBibleKeyWidget() override
bool eventFilter(QObject *o, QEvent *e) override
void resizeEvent(QResizeEvent *event) override
void populateBookMenu(QMenu &menu)
QLineEdit * m_textbox
void setModule(const CSwordBibleModuleInfo *m=nullptr)
void leaveEvent(QEvent *event) override
void populateChapterMenu(QMenu &menu)
void changed(CSwordVerseKey *key)
void populateVerseMenu(QMenu &menu)
bool setKey(CSwordVerseKey *key)
QWidget * m_dropDownButtons
Implementation for Sword Bibles.
CSwordKey implementation for Sword's VerseKey.