BibleTime
Toggle main menu visibility
Main Page
Related Pages
Namespaces
Namespace List
Namespace Members
All
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
Functions
a
b
c
d
e
f
g
h
i
l
m
n
p
q
r
s
t
v
Variables
a
b
c
d
g
h
i
k
l
m
p
r
s
u
Typedefs
Enumerations
Enumerator
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
~
Functions
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
~
Variables
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
Typedefs
Enumerations
Enumerator
a
b
c
d
e
f
g
h
i
l
m
n
p
r
s
t
u
w
Properties
Related Symbols
Files
File List
File Members
All
a
b
c
e
f
h
i
j
k
l
m
o
p
r
s
t
u
w
Functions
b
c
f
i
j
l
m
o
p
r
t
Variables
Typedefs
Enumerations
Enumerator
Macros
a
b
c
i
l
m
r
s
t
u
w
src
frontend
keychooser
versekeychooser
btversekeymenu.cpp
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-2025 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
#include "
btversekeymenu.h
"
14
15
#include <QMenu>
16
#include <QTimerEvent>
17
#include "../../../util/btconnect.h"
18
19
20
BtVerseKeyMenu::BtVerseKeyMenu
(
QWidget
* parent)
21
:
QMenu
(parent)
22
, m_timerId(0)
23
, m_firstClickLock(true)
24
{
25
BT_CONNECT
(
this
, &QMenu::aboutToShow,
26
[
this
] {
27
m_firstClickLock
=
true
;
28
if
(
m_timerId
) {
29
killTimer(
m_timerId
);
30
m_timerId
= 0;
31
}
32
m_timerId
= startTimer(300);
33
});
34
}
20
BtVerseKeyMenu::BtVerseKeyMenu
(
QWidget
* parent) {
…
}
35
36
void
BtVerseKeyMenu::timerEvent
(QTimerEvent* e) {
37
if
(e->timerId() ==
m_timerId
) {
38
if
(
m_timerId
) {
39
killTimer(
m_timerId
);
40
m_timerId
= 0;
41
}
42
m_firstClickLock
=
false
;
43
}
44
else
{
45
QMenu::timerEvent(e);
46
}
47
}
36
void
BtVerseKeyMenu::timerEvent
(QTimerEvent* e) {
…
}
48
49
void
BtVerseKeyMenu::mouseReleaseEvent
(QMouseEvent* e) {
50
if
(
m_firstClickLock
)
return
;
51
QMenu::mouseReleaseEvent(e);
52
}
49
void
BtVerseKeyMenu::mouseReleaseEvent
(QMouseEvent* e) {
…
}
BT_CONNECT
#define BT_CONNECT(...)
Definition
btconnect.h:20
btversekeymenu.h
BtVerseKeyMenu::m_firstClickLock
bool m_firstClickLock
Definition
btversekeymenu.h:42
BtVerseKeyMenu::timerEvent
void timerEvent(QTimerEvent *event) override
Definition
btversekeymenu.cpp:36
BtVerseKeyMenu::m_timerId
int m_timerId
Definition
btversekeymenu.h:41
BtVerseKeyMenu::BtVerseKeyMenu
BtVerseKeyMenu(QWidget *parent)
Definition
btversekeymenu.cpp:20
BtVerseKeyMenu::mouseReleaseEvent
void mouseReleaseEvent(QMouseEvent *event) override
Definition
btversekeymenu.cpp:49
QMenu
QWidget
Generated by
1.9.8