mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-11 04:43:56 -07:00
[Move refactor] Reparent orphan classes (#6236)
* Move orphaned classes to their correct parent folders. --------- Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
This commit is contained in:
parent
1ef07309d6
commit
d9c65d4ae0
143 changed files with 171 additions and 169 deletions
|
|
@ -1,32 +0,0 @@
|
|||
#include "get_text_with_max.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)
|
||||
{
|
||||
auto *dialog = new QInputDialog(parent, flags);
|
||||
dialog->setWindowTitle(title);
|
||||
dialog->setLabelText(label);
|
||||
dialog->setTextValue(text);
|
||||
dialog->setTextEchoMode(mode);
|
||||
dialog->setInputMethodHints(inputMethodHints);
|
||||
|
||||
// find the qlineedit that this dialog holds, there should be only one
|
||||
dialog->findChild<QLineEdit *>()->setMaxLength(max);
|
||||
|
||||
const int ret = dialog->exec();
|
||||
if (ok != nullptr) {
|
||||
*ok = !!ret;
|
||||
}
|
||||
if (ret) {
|
||||
return dialog->textValue();
|
||||
} else {
|
||||
return QString();
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue