mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-03-21 17:34:57 -05:00
Focus name edit for new items
This commit is contained in:
parent
eb5046a9d6
commit
87c45e2b32
|
|
@ -4,9 +4,11 @@
|
|||
#include "ui-helpers.hpp"
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
#include <QAction>
|
||||
#include <QMenu>
|
||||
#include <QLayout>
|
||||
#include <QMenu>
|
||||
#include <QTimer>
|
||||
|
||||
Q_DECLARE_METATYPE(advss::Item *);
|
||||
|
||||
|
|
@ -330,6 +332,13 @@ void ItemSettingsDialog::NameChanged(const QString &text)
|
|||
SetNameWarning("");
|
||||
}
|
||||
|
||||
void ItemSettingsDialog::showEvent(QShowEvent *)
|
||||
{
|
||||
if (_showNameEmptyWarning && _name->text().isEmpty()) {
|
||||
_name->setFocus(Qt::OtherFocusReason);
|
||||
}
|
||||
}
|
||||
|
||||
void ItemSettingsDialog::SetNameWarning(const QString warn)
|
||||
{
|
||||
if (warn.isEmpty()) {
|
||||
|
|
|
|||
|
|
@ -52,6 +52,7 @@ private slots:
|
|||
void NameChanged(const QString &);
|
||||
|
||||
protected:
|
||||
virtual void showEvent(QShowEvent *) override;
|
||||
void SetNameWarning(const QString);
|
||||
|
||||
QLineEdit *_name;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user