Manage Perspectives - perspectives list cosmetics

- Disable in-place name edition
- Use double click to edit perspective
To match the behavior of similar lists.
This commit is contained in:
Alejandro Martinez
2024-05-15 14:12:57 -03:00
parent f1bb83f302
commit cfb8c2f6da
2 changed files with 6 additions and 0 deletions

View File

@@ -53,6 +53,7 @@ PerspectiveDialog::PerspectiveDialog(QWidget *parent, AbstractView *tabView) : Q
perspectiveTable->setShowGrid(false);
perspectiveTable->setSelectionMode(QAbstractItemView::SingleSelection);
perspectiveTable->setSelectionBehavior(QAbstractItemView::SelectRows);
perspectiveTable->setEditTriggers(QAbstractItemView::NoEditTriggers);
perspectiveTable->setAcceptDrops(true);
//perspectiveTable->setDropIndicatorShown(true);
@@ -121,6 +122,7 @@ PerspectiveDialog::PerspectiveDialog(QWidget *parent, AbstractView *tabView) : Q
connect(perspectiveTable, SIGNAL(currentItemChanged(QTableWidgetItem*,QTableWidgetItem*)), this, SLOT(perspectiveSelected()));
connect(perspectiveTable, SIGNAL(chartMoved(GcChartWindow*)), this, SLOT(perspectiveSelected())); // just reset the chart list
connect(perspectiveTable, SIGNAL(itemChanged(QTableWidgetItem*)), this, SLOT(perspectiveNameChanged(QTableWidgetItem*))); // user edit
connect(perspectiveTable, SIGNAL(itemDoubleClicked(QTableWidgetItem*)), this, SLOT(editPerspectiveClicked())); // Double click -> edit
connect(editButton, SIGNAL(clicked(bool)), this, SLOT(editPerspectiveClicked()));
connect(importPerspective, SIGNAL(clicked(bool)), this, SLOT(importPerspectiveClicked()));

View File

@@ -162,7 +162,11 @@ WebPageWindow::WebPageWindow(Context *context) : GcChartWindow(context), context
view->settings()->setAttribute(QWebEngineSettings::LocalContentCanAccessRemoteUrls, true);
view->settings()->setAttribute(QWebEngineSettings::LocalStorageEnabled, true);
#if QT_VERSION < 0x060000
view->setPage(new simpleWebPage());
#else
view->setPage(new QWebEnginePage(new QWebEngineProfile("Default")));
#endif
view->setContentsMargins(0,0,0,0);
view->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
view->setAcceptDrops(false);