Engauge Digitizer
2
Dlg
DlgEditPointGraphLineEdit.cpp
Go to the documentation of this file.
1
/******************************************************************************************************
2
* (C) 2016 markummitchell@github.com. This file is part of Engauge Digitizer, which is released *
3
* under GNU General Public License version 2 (GPLv2) or (at your option) any later version. See file *
4
* LICENSE or go to gnu.org/licenses for details. Distribution requires prior written permission. *
5
******************************************************************************************************/
6
7
#include "
DlgEditPointGraphLineEdit.h
"
8
#include "
Logger.h
"
9
#include <QWidget>
10
11
DlgEditPointGraphLineEdit::DlgEditPointGraphLineEdit
(QWidget *widget) :
12
QLineEdit (widget),
13
m_hover (false)
14
{
15
LOG4CPP_INFO_S
((*
mainCat
)) <<
"DlgEditPointGraphLineEdit::DlgEditPointGraphLineEdit"
;
16
}
17
18
DlgEditPointGraphLineEdit::~DlgEditPointGraphLineEdit
()
19
{
20
LOG4CPP_INFO_S
((*
mainCat
)) <<
"DlgEditPointGraphLineEdit::~DlgEditPointGraphLineEdit"
;
21
}
22
23
void
DlgEditPointGraphLineEdit::enterEvent
(QEvent *)
24
{
25
m_hover =
true
;
26
updateBackground
();
27
}
28
29
void
DlgEditPointGraphLineEdit::leaveEvent
(QEvent *)
30
{
31
m_hover =
false
;
32
updateBackground
();
33
}
34
35
void
DlgEditPointGraphLineEdit::updateBackground
()
36
{
37
QString color = (m_hover || !text().isEmpty() ? QString (
"white"
) : QString (
"#d3d3d3"
));
38
QString style = QString (
"QLineEdit { background-color: %1; }"
).arg (color);
39
setStyleSheet (style);
40
}
DlgEditPointGraphLineEdit::enterEvent
virtual void enterEvent(QEvent *)
Hover entry triggers clearing of the background color so user does not think of widget as disabled an...
Definition:
DlgEditPointGraphLineEdit.cpp:22
DlgEditPointGraphLineEdit::DlgEditPointGraphLineEdit
DlgEditPointGraphLineEdit(QWidget *widget=0)
Single constructor.
Definition:
DlgEditPointGraphLineEdit.cpp:10
DlgEditPointGraphLineEdit.h
Logger.h
LOG4CPP_INFO_S
#define LOG4CPP_INFO_S(logger)
Definition:
convenience.h:18
DlgEditPointGraphLineEdit::~DlgEditPointGraphLineEdit
~DlgEditPointGraphLineEdit()
Definition:
DlgEditPointGraphLineEdit.cpp:17
mainCat
log4cpp::Category * mainCat
Definition:
Logger.cpp:14
DlgEditPointGraphLineEdit::leaveEvent
virtual void leaveEvent(QEvent *)
Hover exit triggers restoration of the background color.
Definition:
DlgEditPointGraphLineEdit.cpp:28
DlgEditPointGraphLineEdit::updateBackground
void updateBackground()
Update background given the current state.
Definition:
DlgEditPointGraphLineEdit.cpp:34
Generated on Sat Jan 4 2020 12:00:00 for Engauge Digitizer by
1.8.16