~ubuntu-branches/ubuntu/trusty/bibletime/trusty

« back to all changes in this revision

Viewing changes to src/frontend/keychooser/versekeychooser/btversekeymenu.cpp

  • Committer: Package Import Robot
  • Author(s): Dmitrijs Ledkovs, Jonathan Marsden, Dmitrijs Ledkovs
  • Date: 2012-04-14 18:11:50 UTC
  • mfrom: (1.3.7)
  • Revision ID: package-import@ubuntu.com-20120414181150-17l2liq7bl7oaxjz
Tags: 2.9.1-1
[ Jonathan Marsden ]
* New upstream version 2.9.1
* debian/patches/*: Remove all patches (incorporated upstream)
* debian/control: bibletime now depends on a matching version of
  bibletime-data.

[ Dmitrijs Ledkovs ]
* Add more strict alternative build-dependency on the libqt4-dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
9
9
 
10
10
#include "frontend/keychooser/versekeychooser/btversekeymenu.h"
11
11
 
12
 
#include <QDebug>
13
12
#include <QMenu>
14
13
#include <QMouseEvent>
15
14
#include <QTimerEvent>
16
15
 
17
16
 
18
17
BtVerseKeyMenu::BtVerseKeyMenu(QWidget* parent)
19
 
        : QMenu(parent),
20
 
        m_timerId(0),
21
 
        m_firstClickLock(true) {
22
 
    qDebug() << "BtVerseKeyMenu::BtVerseKeyMenu";
23
 
    QObject::connect(this, SIGNAL(aboutToShow()), this, SLOT(startFirstClickDelayTimer()));
 
18
        : QMenu(parent)
 
19
        , m_timerId(0)
 
20
        , m_firstClickLock(true)
 
21
{
 
22
    connect(this, SIGNAL(aboutToShow()),
 
23
            this, SLOT(startFirstClickDelayTimer()));
24
24
}
25
25
 
26
26
void BtVerseKeyMenu::startFirstClickDelayTimer() {
27
 
    //qDebug() << "BtVerseKeyMenu::startFirstClickDelayTimer";
28
27
    m_firstClickLock = true;
29
28
    killTimer(m_timerId);
30
29
    m_timerId = startTimer(300);
32
31
 
33
32
void BtVerseKeyMenu::timerEvent(QTimerEvent* e) {
34
33
    if (e->timerId() == m_timerId) {
35
 
        //qDebug() << "BtVerseKeyMenu::timerEvent";
36
34
        killTimer(m_timerId);
37
35
        m_firstClickLock = false;
38
36
    }
42
40
}
43
41
 
44
42
void BtVerseKeyMenu::mouseReleaseEvent(QMouseEvent* e) {
45
 
    //qDebug() << "BtVerseKeyMenu::mouseReleaseEvent";
46
43
    if (m_firstClickLock) return;
47
 
    //qDebug() << "BtVerseKeyMenu::mouseReleaseEvent 2";
48
44
    QMenu::mouseReleaseEvent(e);
49
45
}