mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-09-22 01:25:10 -07:00
Some checks failed
Build Desktop / Configure (push) Has been cancelled
Build Docker Image / amd64 & arm64 (push) Has been cancelled
Build Desktop / Debian 13 (push) Has been cancelled
Build Desktop / Debian 12 (push) Has been cancelled
Build Desktop / Fedora 44 (push) Has been cancelled
Build Desktop / Fedora 43 (push) Has been cancelled
Build Desktop / Servatrice_Debian 12 (push) Has been cancelled
Build Desktop / Ubuntu 26.04 (push) Has been cancelled
Build Desktop / Ubuntu 24.04 (push) Has been cancelled
Build Desktop / Arch (push) Has been cancelled
Build Desktop / macOS 14 (push) Has been cancelled
Build Desktop / macOS 15 (push) Has been cancelled
Build Desktop / macOS 13 Intel (push) Has been cancelled
Build Desktop / macOS 15 Debug (push) Has been cancelled
Build Desktop / Windows 10 (push) Has been cancelled
* Split trice_limits.h into dedicated headers * Updated docstrings
28 lines
1,015 B
C
28 lines
1,015 B
C
/**
|
|
* @file get_text_with_max.h
|
|
* @ingroup UI
|
|
* @brief Custom QInputDialog::getText implementation that allows configuration of the max length
|
|
*/
|
|
|
|
#ifndef GETTEXTWITHMAX_H
|
|
#define GETTEXTWITHMAX_H
|
|
|
|
#include <QLineEdit>
|
|
#include <QWidget>
|
|
#include <libcockatrice/utility/string_limits.h>
|
|
|
|
QString getTextWithMax(QWidget *parent,
|
|
const QString &title,
|
|
const QString &label,
|
|
QLineEdit::EchoMode echo = QLineEdit::Normal,
|
|
const QString &text = QString(),
|
|
bool *ok = nullptr,
|
|
int max = MAX_NAME_LENGTH,
|
|
Qt::WindowFlags flags = Qt::WindowFlags(),
|
|
Qt::InputMethodHints inputMethodHints = Qt::ImhNone);
|
|
static inline QString getTextWithMax(QWidget *parent, const QString &title, const QString &label, int max)
|
|
{
|
|
return getTextWithMax(parent, title, label, QLineEdit::Normal, QString(), nullptr, max);
|
|
}
|
|
|
|
#endif // GETTEXTWITHMAX_H
|