1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97
|
From: Victor Westerhuis <VJ.Westerhuis@student.han.nl>
Date: Fri, 9 Sep 2022 11:07:35 +0200
Subject: Build highgui module with QT support
Removes the dependency on the removed non-free Milky icon set. Four
directional arrows are replaced by standard Qt icons. The other icons
are replaced by corresponding icons from the freedesktop.org Icon Naming
Specification.
modules/highgui/src/window_QT.cpp | 22 +++++++++++-----------
modules/highgui/src/window_QT.qrc | 11 -----------
2 files changed, 11 insertions(+), 22 deletions(-)
diff --git a/modules/highgui/src/window_QT.cpp b/modules/highgui/src/window_QT.cpp
index eba3599..97a4db5 100644
@@ -2037,47 +2037,47 @@ void CvWindow::createActions()
QWidget* view = myView->getWidget();
//if the shortcuts are changed in window_QT.h, we need to update the tooltip manually
- vect_QActions[0] = new QAction(QIcon(":/left-icon"), "Panning left (CTRL+arrowLEFT)", this);
+ vect_QActions[0] = new QAction(style()->standardIcon(QStyle::SP_ArrowLeft), "Panning left (CTRL+arrowLEFT)", this);
vect_QActions[0]->setIconVisibleInMenu(true);
QObject::connect(vect_QActions[0], SIGNAL(triggered()), view, SLOT(siftWindowOnLeft()));
- vect_QActions[1] = new QAction(QIcon(":/right-icon"), "Panning right (CTRL+arrowRIGHT)", this);
+ vect_QActions[1] = new QAction(style()->standardIcon(QStyle::SP_ArrowRight), "Panning right (CTRL+arrowRIGHT)", this);
vect_QActions[1]->setIconVisibleInMenu(true);
QObject::connect(vect_QActions[1], SIGNAL(triggered()), view, SLOT(siftWindowOnRight()));
- vect_QActions[2] = new QAction(QIcon(":/up-icon"), "Panning up (CTRL+arrowUP)", this);
+ vect_QActions[2] = new QAction(style()->standardIcon(QStyle::SP_ArrowUp), "Panning up (CTRL+arrowUP)", this);
vect_QActions[2]->setIconVisibleInMenu(true);
QObject::connect(vect_QActions[2], SIGNAL(triggered()), view, SLOT(siftWindowOnUp()));
- vect_QActions[3] = new QAction(QIcon(":/down-icon"), "Panning down (CTRL+arrowDOWN)", this);
+ vect_QActions[3] = new QAction(style()->standardIcon(QStyle::SP_ArrowDown), "Panning down (CTRL+arrowDOWN)", this);
vect_QActions[3]->setIconVisibleInMenu(true);
QObject::connect(vect_QActions[3], SIGNAL(triggered()), view, SLOT(siftWindowOnDown()) );
- vect_QActions[4] = new QAction(QIcon(":/zoom_x1-icon"), "Zoom x1 (CTRL+P)", this);
+ vect_QActions[4] = new QAction(QIcon::fromTheme("zoom-original"), "Zoom x1 (CTRL+P)", this);
vect_QActions[4]->setIconVisibleInMenu(true);
QObject::connect(vect_QActions[4], SIGNAL(triggered()), view, SLOT(resetZoom()));
- vect_QActions[5] = new QAction(QIcon(":/imgRegion-icon"), tr("Zoom x%1 (see label) (CTRL+X)").arg(threshold_zoom_img_region), this);
+ vect_QActions[5] = new QAction(QIcon::fromTheme("zoom-fit-best"), tr("Zoom x%1 (see label) (CTRL+X)").arg(threshold_zoom_img_region), this);
vect_QActions[5]->setIconVisibleInMenu(true);
QObject::connect(vect_QActions[5], SIGNAL(triggered()), view, SLOT(imgRegion()));
- vect_QActions[6] = new QAction(QIcon(":/zoom_in-icon"), "Zoom in (CTRL++)", this);
+ vect_QActions[6] = new QAction(QIcon::fromTheme("zoom-in"), "Zoom in (CTRL++)", this);
vect_QActions[6]->setIconVisibleInMenu(true);
QObject::connect(vect_QActions[6], SIGNAL(triggered()), view, SLOT(ZoomIn()));
- vect_QActions[7] = new QAction(QIcon(":/zoom_out-icon"), "Zoom out (CTRL+-)", this);
+ vect_QActions[7] = new QAction(QIcon::fromTheme("zoom-out"), "Zoom out (CTRL+-)", this);
vect_QActions[7]->setIconVisibleInMenu(true);
QObject::connect(vect_QActions[7], SIGNAL(triggered()), view, SLOT(ZoomOut()));
- vect_QActions[8] = new QAction(QIcon(":/save-icon"), "Save current image (CTRL+S)", this);
+ vect_QActions[8] = new QAction(QIcon::fromTheme("document-save"), "Save current image (CTRL+S)", this);
vect_QActions[8]->setIconVisibleInMenu(true);
QObject::connect(vect_QActions[8], SIGNAL(triggered()), view, SLOT(saveView()));
- vect_QActions[9] = new QAction(QIcon(":/copy_clipbrd-icon"), "Copy image to clipboard (CTRL+C)", this);
+ vect_QActions[9] = new QAction(QIcon::fromTheme("edit-copy"), "Copy image to clipboard (CTRL+C)", this);
vect_QActions[9]->setIconVisibleInMenu(true);
QObject::connect(vect_QActions[9], SIGNAL(triggered()), view, SLOT(copy2Clipbrd()));
- vect_QActions[10] = new QAction(QIcon(":/properties-icon"), "Display properties window (CTRL+P)", this);
+ vect_QActions[10] = new QAction(QIcon::fromTheme("document-properties"), "Display properties window (CTRL+P)", this);
vect_QActions[10]->setIconVisibleInMenu(true);
QObject::connect(vect_QActions[10], SIGNAL(triggered()), this, SLOT(displayPropertiesWin()));
diff --git a/modules/highgui/src/window_QT.qrc b/modules/highgui/src/window_QT.qrc
index efdd8c2..f7e6f37 100644
@@ -1,16 +1,5 @@
<RCC>
<qresource prefix="/">
- <file alias="left-icon">files_Qt/Milky/48/28.png</file>
- <file alias="right-icon">files_Qt/Milky/48/23.png</file>
- <file alias="up-icon">files_Qt/Milky/48/19.png</file>
- <file alias="down-icon">files_Qt/Milky/48/24.png</file>
- <file alias="zoom_x1-icon">files_Qt/Milky/48/27.png</file>
- <file alias="imgRegion-icon">files_Qt/Milky/48/61.png</file>
- <file alias="zoom_in-icon">files_Qt/Milky/48/106.png</file>
- <file alias="zoom_out-icon">files_Qt/Milky/48/107.png</file>
- <file alias="save-icon">files_Qt/Milky/48/7.png</file>
- <file alias="copy_clipbrd-icon">files_Qt/Milky/48/43.png</file>
- <file alias="properties-icon">files_Qt/Milky/48/38.png</file>
<file alias="stylesheet-trackbar">files_Qt/stylesheet_trackbar.qss</file>
</qresource>
</RCC>
|