From c15cac1cbace353884ca71b863f4c439c0b81d80 Mon Sep 17 00:00:00 2001 From: itayc0hen Date: Fri, 6 Dec 2019 19:52:08 +0200 Subject: [PATCH] Make labels selectable by mouse --- src/dialogs/EditInstructionDialog.ui | 3 + src/dialogs/preferences/AsmOptionsWidget.ui | 23 +++- src/widgets/Dashboard.cpp | 1 + src/widgets/Dashboard.ui | 131 +++++++++++++++++++- src/widgets/RegistersWidget.cpp | 1 + 5 files changed, 157 insertions(+), 2 deletions(-) diff --git a/src/dialogs/EditInstructionDialog.ui b/src/dialogs/EditInstructionDialog.ui index 99881dfe..035de602 100644 --- a/src/dialogs/EditInstructionDialog.ui +++ b/src/dialogs/EditInstructionDialog.ui @@ -72,6 +72,9 @@ Unknown Instruction + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse + diff --git a/src/dialogs/preferences/AsmOptionsWidget.ui b/src/dialogs/preferences/AsmOptionsWidget.ui index 8e7cc9c8..cc669fbb 100644 --- a/src/dialogs/preferences/AsmOptionsWidget.ui +++ b/src/dialogs/preferences/AsmOptionsWidget.ui @@ -28,7 +28,7 @@ - 0 + 1 @@ -81,6 +81,9 @@ Tabs in assembly (asm.tabs): + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse + @@ -108,6 +111,9 @@ Syntax (asm.syntax): + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse + @@ -129,6 +135,9 @@ Tabs before assembly (asm.tabs.off): + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse + @@ -136,6 +145,9 @@ Show Disassembly as: + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse + @@ -242,6 +254,9 @@ Show comments: + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse + @@ -259,6 +274,9 @@ Column to align comments (asm.cmt.col): + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse + @@ -372,6 +390,9 @@ Number of bytes to display (asm.nbytes): + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse + diff --git a/src/widgets/Dashboard.cpp b/src/widgets/Dashboard.cpp index 9bdf3a9e..ed369020 100644 --- a/src/widgets/Dashboard.cpp +++ b/src/widgets/Dashboard.cpp @@ -113,6 +113,7 @@ void Dashboard::updateContents() QLabel *label = new QLabel(this); label->setText(lib); label->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred); + label->setTextInteractionFlags(Qt::TextSelectableByMouse); ui->verticalLayout_2->addWidget(label); } diff --git a/src/widgets/Dashboard.ui b/src/widgets/Dashboard.ui index 38ddebb9..0c020356 100644 --- a/src/widgets/Dashboard.ui +++ b/src/widgets/Dashboard.ui @@ -56,7 +56,7 @@ 0 0 1055 - 980 + 982 @@ -115,6 +115,9 @@ OVERVIEW + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse + @@ -136,6 +139,9 @@ Info + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse + @@ -171,6 +177,9 @@ File: + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse + @@ -197,6 +206,9 @@ Format: + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse + @@ -223,6 +235,9 @@ Mode: + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse + @@ -249,6 +264,9 @@ Size: + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse + @@ -262,6 +280,9 @@ Type: + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse + @@ -288,6 +309,9 @@ Class: + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse + @@ -314,6 +338,9 @@ Language: + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse + @@ -340,6 +367,9 @@ Bits: + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse + @@ -395,6 +425,9 @@ FD: + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse + @@ -421,6 +454,9 @@ Base addr: + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse + @@ -447,6 +483,9 @@ Virtual addr: + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse + @@ -473,6 +512,9 @@ Canary: + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse + @@ -499,6 +541,9 @@ Crypto: + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse + @@ -525,6 +570,9 @@ NX bit: + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse + @@ -551,6 +599,9 @@ PIC: + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse + @@ -577,6 +628,9 @@ Static: + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse + @@ -590,6 +644,9 @@ Relro: + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse + @@ -642,6 +699,9 @@ Architecture: + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse + @@ -668,6 +728,9 @@ Machine: + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse + @@ -694,6 +757,9 @@ OS: + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse + @@ -720,6 +786,9 @@ Subsystem: + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse + @@ -746,6 +815,9 @@ Stripped: + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse + @@ -772,6 +844,9 @@ Relocs: + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse + @@ -798,6 +873,9 @@ Endianness: + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse + @@ -824,6 +902,9 @@ Compiled: + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse + @@ -850,6 +931,9 @@ Compiler: + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse + @@ -949,6 +1033,9 @@ Hashes + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse + @@ -963,6 +1050,9 @@ Libraries + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse + @@ -996,6 +1086,9 @@ MD5: + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse + @@ -1022,6 +1115,9 @@ SHA1: + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse + @@ -1054,6 +1150,9 @@ Entropy: + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse + @@ -1083,6 +1182,9 @@ Analysis info + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse + @@ -1104,6 +1206,9 @@ Functions: + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse + @@ -1127,6 +1232,9 @@ X-Refs: + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse + @@ -1150,6 +1258,9 @@ Calls: + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse + @@ -1173,6 +1284,9 @@ Strings: + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse + @@ -1196,6 +1310,9 @@ Symbols: + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse + @@ -1219,6 +1336,9 @@ Imports: + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse + @@ -1242,6 +1362,9 @@ Analysis coverage: + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse + @@ -1265,6 +1388,9 @@ Code size: + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse + @@ -1288,6 +1414,9 @@ Coverage percent: + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse + diff --git a/src/widgets/RegistersWidget.cpp b/src/widgets/RegistersWidget.cpp index 8de7db13..394bdcc3 100644 --- a/src/widgets/RegistersWidget.cpp +++ b/src/widgets/RegistersWidget.cpp @@ -65,6 +65,7 @@ void RegistersWidget::setRegisterGrid() // check if we already filled this grid space with label/value if (!registerLayout->itemAtPosition(i, col)) { registerLabel = new QLabel; + registerLabel->setTextInteractionFlags(Qt::TextSelectableByMouse); registerLabel->setAlignment(Qt::AlignRight | Qt::AlignVCenter); registerLabel->setMaximumWidth(60); registerLabel->setStyleSheet("font-weight: bold; font-family: mono;");