Engauge Digitizer 2
Loading...
Searching...
No Matches
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
8#include "Logger.h"
9#include <QWidget>
10
12 QLineEdit (widget),
13 m_hover (false)
14{
15 LOG4CPP_INFO_S ((*mainCat)) << "DlgEditPointGraphLineEdit::DlgEditPointGraphLineEdit";
16}
17
19{
20 LOG4CPP_INFO_S ((*mainCat)) << "DlgEditPointGraphLineEdit::~DlgEditPointGraphLineEdit";
21}
22
24{
25 m_hover = true;
27}
28
30{
31 m_hover = false;
33}
34
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}
log4cpp::Category * mainCat
Definition Logger.cpp:14
void updateBackground()
Update background given the current state.
virtual void leaveEvent(QEvent *)
Hover exit triggers restoration of the background color.
virtual void enterEvent(QEvent *)
Hover entry triggers clearing of the background color so user does not think of widget as disabled an...
DlgEditPointGraphLineEdit(QWidget *widget=0)
Single constructor.
#define LOG4CPP_INFO_S(logger)
Definition convenience.h:18