OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
aNiceLineEditWidget.h
Go to the documentation of this file.
1/*
2 * File: aNiceLineEditWidget.h
3 * Package: akWidgets
4 *
5 * Created on: April 02, 2021
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 <qwidget.h>
21
22class QHBoxLayout;
23class QKeyEvent;
24
25namespace ak {
26 class aLineEditWidget;
27 class aLabelWidget;
28
29 class UICORE_API_EXPORT aNiceLineEditWidget : public QWidget, public aWidget {
30 Q_OBJECT
31 public:
32 aNiceLineEditWidget(const QString & _initialText, const QString & _infoLabelText);
33 virtual ~aNiceLineEditWidget();
34
35 // #######################################################################################################
36
37 // Base class functions
38
40 virtual QWidget * widget(void) override;
41
42 // #######################################################################################################
43
44 void setText(const QString & _text);
45 void setErrorState(bool _error);
46 void setInfoLabelText(const QString & _text);
47
50 void setErrorStateIsForeground(bool _isForeground);
51
52 QString text(void) const;
53 QString infoLabelText(void) const;
54
55 private Q_SLOTS:
56 void slotCursorPositionChanged(int, int);
57 void slotSelectionChanged();
58 void slotKeyPressed(QKeyEvent * _event);
59 void slotKeyReleased(QKeyEvent * _event);
60 void slotEditingFinished(void);
61 void slotTextChanged(const QString & _text);
62 void slotReturnPressed();
63
64 Q_SIGNALS:
65 void cursorPositionChanged(int, int);
67 void keyPressed(QKeyEvent *);
68 void keyReleased(QKeyEvent *);
70 void textChanged(const QString & _text);
72
73 private:
74 QHBoxLayout * m_layout;
75 aLineEditWidget * m_lineEdit;
76 aLabelWidget * m_label;
77 };
78}
#define UICORE_API_EXPORT
Definition globalDataTypes.h:20
Definition aLabelWidget.h:26
This class combines the functionallity of a QTextEdit and a ak::ui::core::aWidget.
Definition aLineEditWidget.h:30
Definition aNiceLineEditWidget.h:29
void keyPressed(QKeyEvent *)
void cursorPositionChanged(int, int)
void textChanged(const QString &_text)
void keyReleased(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