Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
8ada1da0
Commit
8ada1da0
authored
Aug 18, 2010
by
Yannick Verdie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
--no commit message
--no commit message
parent
94b58809
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
93 additions
and
9 deletions
+93
-9
window_QT.cpp
modules/highgui/src/window_QT.cpp
+91
-8
window_QT.h
modules/highgui/src/window_QT.h
+2
-1
No files found.
modules/highgui/src/window_QT.cpp
View file @
8ada1da0
...
@@ -1014,7 +1014,7 @@ void GuiReceiver::addButton(QString button_name, int button_type, int initial_bu
...
@@ -1014,7 +1014,7 @@ void GuiReceiver::addButton(QString button_name, int button_type, int initial_bu
{
{
b
=
CvWindow
::
createButtonbar
(
button_name
);
//the bar has the name of the first button attached to it
b
=
CvWindow
::
createButtonbar
(
button_name
);
//the bar has the name of the first button attached to it
//
enablePropertiesButtonEachWindow();
enablePropertiesButtonEachWindow
();
}
else
{
}
else
{
CvBar
*
lastbar
=
(
CvBar
*
)
global_control_panel
->
myLayout
->
itemAt
(
global_control_panel
->
myLayout
->
count
()
-
1
);
CvBar
*
lastbar
=
(
CvBar
*
)
global_control_panel
->
myLayout
->
itemAt
(
global_control_panel
->
myLayout
->
count
()
-
1
);
...
@@ -1460,7 +1460,9 @@ CvWindow::CvWindow(QString arg, int arg2)
...
@@ -1460,7 +1460,9 @@ CvWindow::CvWindow(QString arg, int arg2)
createView
(
mode_display
,
param_ratio_mode
);
createView
(
mode_display
,
param_ratio_mode
);
//4: shortcuts and actions
//4: shortcuts and actions
createActionsandShortcuts
();
createActions
();
createShortcuts
();
//createActionsandShortcuts();
//5: toolBar and statusbar
//5: toolBar and statusbar
if
(
param_gui_mode
==
CV_GUI_EXPANDED
)
if
(
param_gui_mode
==
CV_GUI_EXPANDED
)
...
@@ -1581,6 +1583,7 @@ void CvWindow::displayPropertiesWin()
...
@@ -1581,6 +1583,7 @@ void CvWindow::displayPropertiesWin()
global_control_panel
->
hide
();
global_control_panel
->
hide
();
}
}
/*
void CvWindow::createActionsandShortcuts()
void CvWindow::createActionsandShortcuts()
{
{
vect_QActions.resize(10);
vect_QActions.resize(10);
...
@@ -1637,11 +1640,91 @@ void CvWindow::createActionsandShortcuts()
...
@@ -1637,11 +1640,91 @@ void CvWindow::createActionsandShortcuts()
vect_QActions[9]->setIconVisibleInMenu(true);
vect_QActions[9]->setIconVisibleInMenu(true);
vect_QActions[9]->setShortcut(shortcut_properties_win);
vect_QActions[9]->setShortcut(shortcut_properties_win);
//
if (global_control_panel->myLayout->count() == 0)
if (global_control_panel->myLayout->count() == 0)
//
vect_QActions[9]->setDisabled(true);
vect_QActions[9]->setDisabled(true);
QObject::connect( vect_QActions[9],SIGNAL(triggered()),this, SLOT( displayPropertiesWin() ));
QObject::connect( vect_QActions[9],SIGNAL(triggered()),this, SLOT( displayPropertiesWin() ));
}*/
void
CvWindow
::
createActions
()
{
vect_QActions
.
resize
(
10
);
//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
]
->
setIconVisibleInMenu
(
true
);
QObject
::
connect
(
vect_QActions
[
0
],
SIGNAL
(
triggered
()),
myview
,
SLOT
(
siftWindowOnLeft
()
));
vect_QActions
[
1
]
=
new
QAction
(
QIcon
(
":/right-icon"
),
"Panning right (CTRL+arrowRIGHT)"
,
this
);
vect_QActions
[
1
]
->
setIconVisibleInMenu
(
true
);
QObject
::
connect
(
vect_QActions
[
1
],
SIGNAL
(
triggered
()),
myview
,
SLOT
(
siftWindowOnRight
()
));
vect_QActions
[
2
]
=
new
QAction
(
QIcon
(
":/up-icon"
),
"Panning up (CTRL+arrowUP)"
,
this
);
vect_QActions
[
2
]
->
setIconVisibleInMenu
(
true
);
QObject
::
connect
(
vect_QActions
[
2
],
SIGNAL
(
triggered
()),
myview
,
SLOT
(
siftWindowOnUp
()
));
vect_QActions
[
3
]
=
new
QAction
(
QIcon
(
":/down-icon"
),
"Panning down (CTRL+arrowDOWN)"
,
this
);
vect_QActions
[
3
]
->
setIconVisibleInMenu
(
true
);
QObject
::
connect
(
vect_QActions
[
3
],
SIGNAL
(
triggered
()),
myview
,
SLOT
(
siftWindowOnDown
()
));
vect_QActions
[
4
]
=
new
QAction
(
QIcon
(
":/zoom_x1-icon"
),
"Zoom x1 (CTRL+P)"
,
this
);
vect_QActions
[
4
]
->
setIconVisibleInMenu
(
true
);
QObject
::
connect
(
vect_QActions
[
4
],
SIGNAL
(
triggered
()),
myview
,
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
]
->
setIconVisibleInMenu
(
true
);
QObject
::
connect
(
vect_QActions
[
5
],
SIGNAL
(
triggered
()),
myview
,
SLOT
(
imgRegion
()
));
vect_QActions
[
6
]
=
new
QAction
(
QIcon
(
":/zoom_in-icon"
),
tr
(
"Zoom in (CTRL++)"
),
this
);
vect_QActions
[
6
]
->
setIconVisibleInMenu
(
true
);
QObject
::
connect
(
vect_QActions
[
6
],
SIGNAL
(
triggered
()),
myview
,
SLOT
(
ZoomIn
()
));
vect_QActions
[
7
]
=
new
QAction
(
QIcon
(
":/zoom_out-icon"
),
tr
(
"Zoom out (CTRL+-)"
),
this
);
vect_QActions
[
7
]
->
setIconVisibleInMenu
(
true
);
QObject
::
connect
(
vect_QActions
[
7
],
SIGNAL
(
triggered
()),
myview
,
SLOT
(
ZoomOut
()
));
vect_QActions
[
8
]
=
new
QAction
(
QIcon
(
":/save-icon"
),
tr
(
"Save current image (CTRL+S)"
),
this
);
vect_QActions
[
8
]
->
setIconVisibleInMenu
(
true
);
QObject
::
connect
(
vect_QActions
[
8
],
SIGNAL
(
triggered
()),
myview
,
SLOT
(
saveView
()
));
vect_QActions
[
9
]
=
new
QAction
(
QIcon
(
":/properties-icon"
),
tr
(
"Display properties window (CTRL+P)"
),
this
);
vect_QActions
[
9
]
->
setIconVisibleInMenu
(
true
);
QObject
::
connect
(
vect_QActions
[
9
],
SIGNAL
(
triggered
()),
this
,
SLOT
(
displayPropertiesWin
()
));
if
(
global_control_panel
->
myLayout
->
count
()
==
0
)
vect_QActions
[
9
]
->
setDisabled
(
true
);
}
void
CvWindow
::
createShortcuts
()
{
vect_QShortcuts
.
resize
(
10
);
vect_QShortcuts
[
0
]
=
new
QShortcut
(
shortcut_panning_left
,
this
);
QObject
::
connect
(
vect_QShortcuts
[
0
],
SIGNAL
(
activated
()),
myview
,
SLOT
(
siftWindowOnLeft
()
));
vect_QShortcuts
[
1
]
=
new
QShortcut
(
shortcut_panning_right
,
this
);
QObject
::
connect
(
vect_QShortcuts
[
1
],
SIGNAL
(
activated
()),
myview
,
SLOT
(
siftWindowOnRight
()
));
vect_QShortcuts
[
2
]
=
new
QShortcut
(
shortcut_panning_up
,
this
);
QObject
::
connect
(
vect_QShortcuts
[
2
],
SIGNAL
(
activated
()),
myview
,
SLOT
(
siftWindowOnUp
()
));
vect_QShortcuts
[
3
]
=
new
QShortcut
(
shortcut_panning_down
,
this
);
QObject
::
connect
(
vect_QShortcuts
[
3
],
SIGNAL
(
activated
()),
myview
,
SLOT
(
siftWindowOnDown
()
));
vect_QShortcuts
[
4
]
=
new
QShortcut
(
shortcut_zoom_normal
,
this
);
QObject
::
connect
(
vect_QShortcuts
[
4
],
SIGNAL
(
activated
()),
myview
,
SLOT
(
resetZoom
(
)
));
vect_QShortcuts
[
5
]
=
new
QShortcut
(
shortcut_zoom_imgRegion
,
this
);
QObject
::
connect
(
vect_QShortcuts
[
5
],
SIGNAL
(
activated
()),
myview
,
SLOT
(
imgRegion
(
)
));
vect_QShortcuts
[
6
]
=
new
QShortcut
(
shortcut_zoom_in
,
this
);
QObject
::
connect
(
vect_QShortcuts
[
6
],
SIGNAL
(
activated
()),
myview
,
SLOT
(
ZoomIn
()
));
vect_QShortcuts
[
7
]
=
new
QShortcut
(
shortcut_zoom_out
,
this
);
QObject
::
connect
(
vect_QShortcuts
[
7
],
SIGNAL
(
activated
()),
myview
,
SLOT
(
ZoomOut
()
));
vect_QShortcuts
[
8
]
=
new
QShortcut
(
shortcut_save_img
,
this
);
QObject
::
connect
(
vect_QShortcuts
[
8
],
SIGNAL
(
activated
()),
myview
,
SLOT
(
saveView
(
)
));
vect_QShortcuts
[
9
]
=
new
QShortcut
(
shortcut_properties_win
,
this
);
QObject
::
connect
(
vect_QShortcuts
[
9
],
SIGNAL
(
activated
()),
this
,
SLOT
(
displayPropertiesWin
()
));
}
}
void
CvWindow
::
createToolBar
()
void
CvWindow
::
createToolBar
()
...
@@ -1745,8 +1828,8 @@ void CvWindow::addSlider2(CvWindow* w,QString name, int* value, int count,CvTrac
...
@@ -1745,8 +1828,8 @@ void CvWindow::addSlider2(CvWindow* w,QString name, int* value, int count,CvTrac
myLayout
=
global_control_panel
->
myLayout
;
myLayout
=
global_control_panel
->
myLayout
;
//if first one, enable control panel
//if first one, enable control panel
//
if (myLayout->count() == 0)
if
(
myLayout
->
count
()
==
0
)
//
guiMainThread->enablePropertiesButtonEachWindow();
guiMainThread
->
enablePropertiesButtonEachWindow
();
}
}
myLayout
->
insertLayout
(
myLayout
->
count
(),
t
);
myLayout
->
insertLayout
(
myLayout
->
count
(),
t
);
...
@@ -1771,8 +1854,8 @@ void CvWindow::addSlider(CvWindow* w,QString name, int* value, int count,CvTrack
...
@@ -1771,8 +1854,8 @@ void CvWindow::addSlider(CvWindow* w,QString name, int* value, int count,CvTrack
myLayout
=
global_control_panel
->
myLayout
;
myLayout
=
global_control_panel
->
myLayout
;
//if first one, enable control panel
//if first one, enable control panel
//
if (myLayout->count() == 0)
if
(
myLayout
->
count
()
==
0
)
//
guiMainThread->enablePropertiesButtonEachWindow();
guiMainThread
->
enablePropertiesButtonEachWindow
();
}
}
myLayout
->
insertLayout
(
myLayout
->
count
(),
t
);
myLayout
->
insertLayout
(
myLayout
->
count
(),
t
);
...
...
modules/highgui/src/window_QT.h
View file @
8ada1da0
...
@@ -330,7 +330,8 @@ private:
...
@@ -330,7 +330,8 @@ private:
void
icvLoadButtonbar
(
CvButtonbar
*
t
,
QSettings
*
settings
);
void
icvLoadButtonbar
(
CvButtonbar
*
t
,
QSettings
*
settings
);
void
icvSaveButtonbar
(
CvButtonbar
*
t
,
QSettings
*
settings
);
void
icvSaveButtonbar
(
CvButtonbar
*
t
,
QSettings
*
settings
);
void
createActionsandShortcuts
();
void
createActions
();
void
createShortcuts
();
void
createToolBar
();
void
createToolBar
();
void
createView
(
int
display_mode
,
int
ratio_mode
);
void
createView
(
int
display_mode
,
int
ratio_mode
);
void
createStatusBar
();
void
createStatusBar
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment