mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-08-30 05:06:14 -05:00
Add option to set placeholder text when asking for input
This commit is contained in:
@@ -75,7 +75,7 @@ std::optional<std::string> NonModalMessageDialog::GetInput()
|
||||
show();
|
||||
|
||||
// Trigger resize
|
||||
_inputEdit->setPlainText("");
|
||||
_inputEdit->setPlainText(_inputEdit->toPlainText());
|
||||
|
||||
exec();
|
||||
this->deleteLater();
|
||||
@@ -85,6 +85,12 @@ std::optional<std::string> NonModalMessageDialog::GetInput()
|
||||
return {};
|
||||
}
|
||||
|
||||
void NonModalMessageDialog::SetInput(const QString &input)
|
||||
{
|
||||
assert(_type == Type::INPUT);
|
||||
_inputEdit->setPlainText(input);
|
||||
}
|
||||
|
||||
void NonModalMessageDialog::YesClicked()
|
||||
{
|
||||
_answer = QMessageBox::Yes;
|
||||
|
||||
@@ -19,7 +19,8 @@ public:
|
||||
NonModalMessageDialog(const QString &message, bool question);
|
||||
QMessageBox::StandardButton ShowMessage();
|
||||
std::optional<std::string> GetInput();
|
||||
Type GetType() { return _type; }
|
||||
Type GetType() const { return _type; }
|
||||
void SetInput(const QString &);
|
||||
|
||||
private slots:
|
||||
void YesClicked();
|
||||
|
||||
Reference in New Issue
Block a user