OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
aLineEditWidget.h
Go to the documentation of this file.
1/*
2 * File: aLineEditWidget.h
3 * Package: akWidgets
4 *
5 * Created on: March 10, 2020
6 * Author: Alexander Kuester
7 * Copyright (c) 2022 Alexander Kuester
8 * This file is part of the uiCore component.
9 * This file is subject to the terms and conditions defined in
10 * file 'LICENSE', which is part of this source code package.
11 */
12
13#pragma once
14
15// AK header
17#include <akWidgets/aWidget.h>
18
19// Qt header
20#include <qlineedit.h> // Base class
21
22// Forward declaration
23class QKeyEvent;
24class QFocusEvent;
25
26namespace ak {
27
29 class UICORE_API_EXPORT aLineEditWidget : public QLineEdit, public aWidget
30 {
31 Q_OBJECT
32 public:
35 aLineEditWidget(QWidget * _parent = (QWidget *) nullptr);
36
40 aLineEditWidget(const QString & _text, QWidget * _parent = (QWidget *) nullptr);
41
43 virtual ~aLineEditWidget();
44
45 // #######################################################################################################
46
47 // Event handling
48
49 virtual bool eventFilter(QObject * _obj, QEvent * _event) override;
50
52 virtual void keyPressEvent(QKeyEvent * _event) override;
53
54 virtual void keyReleaseEvent(QKeyEvent *event) override;
55
56 virtual void focusInEvent(QFocusEvent * _event) override;
57 virtual void focusOutEvent(QFocusEvent * _event) override;
58
59 // #######################################################################################################
60
61 // Base class functions
62
64 virtual QWidget * widget(void) override;
65
66 // #######################################################################################################
67
68 // Setter
69
70 void setErrorState(bool _error);
71
74 void setErrorStateIsForeground(bool _isForeground);
75
76 void setIgnoreTabulator(bool _ignore) { m_ignoreTabulator = _ignore; }
77
78 // #######################################################################################################
79
80 // Getter
81
82 bool ignoreTabulator(void) const { return m_ignoreTabulator; }
83
84 Q_SIGNALS:
85 void keyPressed(QKeyEvent *);
86 void keyReleased(QKeyEvent *);
88 //void returnPressed(void);
89 void tabPressed();
90 void focused(void);
91 void focusLost(void);
92
93 private Q_SLOTS:
94 void slotEditingFinished();
95
96 private:
97 bool m_isError;
98 bool m_errorIsForeground;
99 bool m_ignoreTabulator;
100 QString m_text;
101
102 aLineEditWidget(const aLineEditWidget &) = delete;
103 aLineEditWidget & operator = (const aLineEditWidget &) = delete;
104
105 };
106}
#define UICORE_API_EXPORT
Definition globalDataTypes.h:20
This class combines the functionallity of a QTextEdit and a ak::ui::core::aWidget.
Definition aLineEditWidget.h:30
void focusLost(void)
void keyReleased(QKeyEvent *)
bool ignoreTabulator(void) const
Definition aLineEditWidget.h:82
void setIgnoreTabulator(bool _ignore)
Definition aLineEditWidget.h:76
void keyPressed(QKeyEvent *)
This class provides a interface that represents a widget. Every class derived from this class must be...
Definition aWidget.h:27
Definition uiAPI.h:45