diff --git a/forms/projectsettingseditor.ui b/forms/projectsettingseditor.ui index fbcaa312..05598b8f 100644 --- a/forms/projectsettingseditor.ui +++ b/forms/projectsettingseditor.ui @@ -21,7 +21,7 @@ - 4 + 0 diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 0a88c34b..ee127f36 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -1665,6 +1665,13 @@ void MainWindow::duplicate() { void MainWindow::copy() { auto focused = QApplication::focusWidget(); if (focused) { + // Allow copying text from selectable QLabels. + auto label = dynamic_cast(focused); + if (label && !label->selectedText().isEmpty()) { + setClipboardData(label->selectedText()); + return; + } + QString objectName = focused->objectName(); if (objectName == "graphicsView_currentMetatileSelection") { // copy the current metatile selection as json data diff --git a/src/ui/projectsettingseditor.cpp b/src/ui/projectsettingseditor.cpp index 13b6198f..d67bcc82 100644 --- a/src/ui/projectsettingseditor.cpp +++ b/src/ui/projectsettingseditor.cpp @@ -650,9 +650,7 @@ void ProjectSettingsEditor::addNewGlobalConstantsFilepath() { void ProjectSettingsEditor::addGlobalConstantsFilepath(const QString &filepath) { auto filepathLabel = new QLabel(filepath, this); filepathLabel->setFrameStyle(QFrame::Panel | QFrame::Raised); - filepathLabel->setTextInteractionFlags(Qt::TextSelectableByMouse); // TODO: This doesn't allow Copy shortcut from the keyboard to work - - // TODO: Tool tips + filepathLabel->setTextInteractionFlags(Qt::TextSelectableByMouse); int newRow = ui->gridLayout_GlobalConstantsFiles->rowCount(); ui->gridLayout_GlobalConstantsFiles->addWidget(filepathLabel, newRow, 0); @@ -693,10 +691,9 @@ void ProjectSettingsEditor::addNewGlobalConstant() { } void ProjectSettingsEditor::addGlobalConstant(const QString &name, const QString &expression) { - // TODO: Tool tips auto nameLabel = new QLabel(name, this); nameLabel->setFrameStyle(QFrame::Panel | QFrame::Raised); - nameLabel->setTextInteractionFlags(Qt::TextSelectableByMouse); // TODO: This doesn't allow Copy shortcut from the keyboard to work + nameLabel->setTextInteractionFlags(Qt::TextSelectableByMouse); auto expressionLineEdit = new QLineEdit(expression, this);