Skip to content

Commit 7fb3965

Browse files
committed
update: versioninfo copy fix code
1 parent 84fac11 commit 7fb3965

File tree

2 files changed

+8
-13
lines changed

2 files changed

+8
-13
lines changed

src/dialogs/VersionInfoDialog.cpp

+8-11
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,6 @@ VersionInfoDialog::VersionInfoDialog(QWidget *parent)
5757

5858
ui->rightTreeWidget->addAction(copyActionRightTreewidget);
5959
ui->rightTreeWidget->addAction(selAllActionRightTreewidget);
60-
61-
contextMenu = new QMenu(this);
6260
}
6361

6462
VersionInfoDialog::~VersionInfoDialog() {}
@@ -68,21 +66,20 @@ void VersionInfoDialog::CopyTreeWidgetSelection(QTreeWidget *t)
6866
const int keyColumnIndex = 0, valueColumnIndex = 1;
6967
QString vinfo, row;
7068

71-
for (QTreeWidgetItem *x : t->selectedItems()) {
72-
row = x->text(keyColumnIndex) + " = " + x->text(valueColumnIndex) + "\n";
73-
vinfo.append(row);
69+
QTreeWidgetItemIterator it(t);
70+
71+
while (*it) {
72+
if ((*it)->isSelected()) {
73+
row = (*it)->text(keyColumnIndex) + " = " + (*it)->text(valueColumnIndex) + "\n";
74+
vinfo.append(row);
75+
}
76+
it++;
7477
}
7578

7679
QClipboard *clipboard = QApplication::clipboard();
7780
clipboard->setText(vinfo.trimmed());
7881
}
7982

80-
void VersionInfoDialog::contextMenuEvent(QContextMenuEvent *event)
81-
{
82-
contextMenu->exec(event->globalPos());
83-
event->accept();
84-
}
85-
8683
void VersionInfoDialog::fillVersionInfo()
8784
{
8885
RzCoreLocked core(Core());

src/dialogs/VersionInfoDialog.h

-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ private slots:
2828
QAction *selAllActionLeftTreewidget = nullptr;
2929
QAction *selAllActionRightTreewidget = nullptr;
3030

31-
void contextMenuEvent(QContextMenuEvent *event) override;
32-
3331
private:
3432
std::unique_ptr<Ui::VersionInfoDialog> ui;
3533
CutterCore *core;

0 commit comments

Comments
 (0)