KanoopGuiQt 1.3.0
Qt GUI utility library
Loading...
Searching...
No Matches
lineedit.h
1#ifndef LINEEDIT_H
2#define LINEEDIT_H
3
4#include <QLineEdit>
5#include <Kanoop/gui/libkanoopgui.h>
6
7/**
8 * @brief QLineEdit subclass with foreground and background color helpers.
9 *
10 * LineEdit provides setForegroundColor() and setBackgroundColor() as
11 * convenient alternatives to manual stylesheet construction.
12 */
13class LIBKANOOPGUI_EXPORT LineEdit : public QLineEdit
14{
15 Q_OBJECT
16public:
17 /**
18 * @brief Construct with an optional parent.
19 * @param parent Optional QWidget parent
20 */
21 explicit LineEdit(QWidget *parent = nullptr);
22
23 /**
24 * @brief Construct with initial text.
25 * @param text Initial text content
26 * @param parent Optional QWidget parent
27 */
28 explicit LineEdit(const QString& text, QWidget *parent = nullptr);
29
30 /**
31 * @brief Set the foreground (text) color via a stylesheet.
32 * @param color New foreground color
33 */
34 void setForegroundColor(const QColor& color);
35
36 /**
37 * @brief Set the background color via a stylesheet.
38 * @param color New background color
39 */
40 void setBackgroundColor(const QColor& color);
41
42signals:
43
44};
45
46#endif // LINEEDIT_H
QLineEdit subclass with foreground and background color helpers.
Definition lineedit.h:14
LineEdit(const QString &text, QWidget *parent=nullptr)
Construct with initial text.
void setForegroundColor(const QColor &color)
Set the foreground (text) color via a stylesheet.
LineEdit(QWidget *parent=nullptr)
Construct with an optional parent.
void setBackgroundColor(const QColor &color)
Set the background color via a stylesheet.