Cockatrice 2026-10-19-Development-3.1.2-beta.2
A virtual tabletop for multiplayer card games
Loading...
Searching...
No Matches
get_text_with_max.h
Go to the documentation of this file.
1
6
7#ifndef GETTEXTWITHMAX_H
8#define GETTEXTWITHMAX_H
9
10#include <QLineEdit>
11#include <QString>
13#include <qnamespace.h>
14
15class QWidget;
16
17QString getTextWithMax(QWidget *parent,
18 const QString &title,
19 const QString &label,
20 QLineEdit::EchoMode echo = QLineEdit::Normal,
21 const QString &text = QString(),
22 bool *ok = nullptr,
23 int max = MAX_NAME_LENGTH,
24 Qt::WindowFlags flags = Qt::WindowFlags(),
25 Qt::InputMethodHints inputMethodHints = Qt::ImhNone);
26static inline QString getTextWithMax(QWidget *parent, const QString &title, const QString &label, int max)
27{
28 return getTextWithMax(parent, title, label, QLineEdit::Normal, QString(), nullptr, max);
29}
30
31#endif // GETTEXTWITHMAX_H
QString getTextWithMax(QWidget *parent, const QString &title, const QString &label, QLineEdit::EchoMode mode, const QString &text, bool *ok, int max, Qt::WindowFlags flags, Qt::InputMethodHints inputMethodHints)
Definition get_text_with_max.cpp:7
constexpr int MAX_NAME_LENGTH
Max size for short strings, like names and things that are generally a single phrase.
Definition string_limits.h:9