qTox  Version: nightly | Commit: bc751c8e1cac455f9690654fcfe0f560d2d7dfdd
passwordedit.h
Go to the documentation of this file.
1 /*
2  Copyright © 2019 by The qTox Project Contributors
3 
4  This file is part of qTox, a Qt-based graphical interface for Tox.
5 
6  qTox is libre software: you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation, either version 3 of the License, or
9  (at your option) any later version.
10 
11  qTox is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with qTox. If not, see <http://www.gnu.org/licenses/>.
18 */
19 
20 #pragma once
21 
22 #include <QAction>
23 #include <QLineEdit>
24 
25 class PasswordEdit : public QLineEdit
26 {
27  Q_OBJECT
28 public:
29  explicit PasswordEdit(QWidget* parent);
30  ~PasswordEdit();
31 
32 protected:
33  virtual void showEvent(QShowEvent* event);
34  virtual void hideEvent(QHideEvent* event);
35 
36 private:
37  class EventHandler : QObject
38  {
39  public:
40  QVector<QAction*> actions;
41 
42  EventHandler();
43  ~EventHandler();
44  void updateActions();
45  bool eventFilter(QObject* obj, QEvent* event);
46  };
47 
48  void registerHandler();
49  void unregisterHandler();
50 
51 private:
52  QAction* action;
53 
55 };
PasswordEdit::EventHandler::updateActions
void updateActions()
PasswordEdit::EventHandler::EventHandler
EventHandler()
PasswordEdit::eventHandler
static EventHandler * eventHandler
Definition: passwordedit.h:54
PasswordEdit::EventHandler
Definition: passwordedit.h:37
PasswordEdit::EventHandler::eventFilter
bool eventFilter(QObject *obj, QEvent *event)
PasswordEdit::PasswordEdit
PasswordEdit(QWidget *parent)
Definition: passwordedit.cpp:33
PasswordEdit::EventHandler::actions
QVector< QAction * > actions
Definition: passwordedit.h:40
PasswordEdit::~PasswordEdit
~PasswordEdit()
Definition: passwordedit.cpp:46
PasswordEdit::registerHandler
void registerHandler()
Definition: passwordedit.cpp:51
PasswordEdit::action
QAction * action
Definition: passwordedit.h:52
PasswordEdit::unregisterHandler
void unregisterHandler()
Definition: passwordedit.cpp:61
PasswordEdit::EventHandler::~EventHandler
~EventHandler()
PasswordEdit
Definition: passwordedit.h:25
PasswordEdit::showEvent
virtual void showEvent(QShowEvent *event)
Definition: passwordedit.cpp:76
PasswordEdit::hideEvent
virtual void hideEvent(QHideEvent *event)
Definition: passwordedit.cpp:84