mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-03-06 15:46:13 -05:00
Merge pull request #1814 from torresam/rename-autoselect
UI: Autoselect text on scene/source rename
This commit is contained in:
@@ -258,6 +258,8 @@ OBSBasic::OBSBasic(QWidget *parent)
|
||||
ui->scenes->setAttribute(Qt::WA_MacShowFocusRect, false);
|
||||
ui->sources->setAttribute(Qt::WA_MacShowFocusRect, false);
|
||||
|
||||
ui->scenes->setItemDelegate(new SceneRenameDelegate(ui->scenes));
|
||||
|
||||
auto displayResize = [this]() {
|
||||
struct obs_video_info ovi;
|
||||
|
||||
@@ -7192,3 +7194,17 @@ bool OBSBasic::ReplayBufferActive()
|
||||
return false;
|
||||
return outputHandler->ReplayBufferActive();
|
||||
}
|
||||
|
||||
SceneRenameDelegate::SceneRenameDelegate(QObject *parent)
|
||||
: QStyledItemDelegate(parent)
|
||||
{
|
||||
}
|
||||
|
||||
void SceneRenameDelegate::setEditorData(QWidget *editor,
|
||||
const QModelIndex &index) const
|
||||
{
|
||||
QStyledItemDelegate::setEditorData(editor, index);
|
||||
QLineEdit *lineEdit = qobject_cast<QLineEdit*>(editor);
|
||||
if (lineEdit)
|
||||
lineEdit->selectAll();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user