Skip to content

Commit cfb7e22

Browse files
committed
array settings editor review fixes
1 parent 4956010 commit cfb7e22

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

ui/settingsview.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,9 @@ class BINARYNINJAUIAPI ArrayStringSettingEditor : public QWidget
175175
QSet<QString> m_defaultValueSet;
176176
bool m_readOnly = false;
177177
bool m_reorderable = false;
178+
// When the schema supplies an enum, existing rows are read-only and added
179+
// values must be members of the enum (enforced in onAddClicked).
180+
bool m_restrictToEnum = false;
178181
QVBoxLayout* m_rowLayout = nullptr;
179182
QWidget* m_addRowWidget = nullptr;
180183
QLineEdit* m_addLineEdit = nullptr;
@@ -185,14 +188,19 @@ class BINARYNINJAUIAPI ArrayStringSettingEditor : public QWidget
185188
int m_dropIndicatorY = -1;
186189
QPoint m_dragStartPos;
187190
int m_dragSourceIndex = -1;
191+
// Bumped whenever the row set is rebuilt (setValues/clearRows). A drag
192+
// captures the current value and dropEvent aborts if it changed during the
193+
// nested drag event loop (e.g. an external settings repopulate).
194+
unsigned m_revision = 0;
195+
int m_dragRevision = -1;
188196

189197
QLineEdit* addRowInputField() const;
190198
void clearRows();
191199
QString currentAddText() const;
192200
void appendRow(const QString& text);
193201
void updateTabOrder();
194202
int rowIndexAtY(int y) const;
195-
QToolButton* findRowGrip(QWidget* row) const;
203+
void removeRowWidget(QWidget* row, bool restoreFocus);
196204

197205
private Q_SLOTS:
198206
void onAddClicked();

0 commit comments

Comments
 (0)