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
9eea2a5f
Commit
9eea2a5f
authored
Jun 12, 2010
by
Yannick Verdie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
working on QT change/get win property (stylesheet for cvTrackBar fixed !!!)
parent
d264907f
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
48 additions
and
16 deletions
+48
-16
CMakeLists.txt
modules/highgui/CMakeLists.txt
+2
-1
highgui.hpp
modules/highgui/include/opencv2/highgui/highgui.hpp
+6
-0
highgui_c.h
modules/highgui/include/opencv2/highgui/highgui_c.h
+10
-11
precomp.hpp
modules/highgui/src/precomp.hpp
+12
-0
window.cpp
modules/highgui/src/window.cpp
+7
-0
window_QT.cpp
modules/highgui/src/window_QT.cpp
+0
-0
window_QT.h
modules/highgui/src/window_QT.h
+11
-4
No files found.
modules/highgui/CMakeLists.txt
View file @
9eea2a5f
...
@@ -59,6 +59,7 @@ set(highgui_srcs
...
@@ -59,6 +59,7 @@ set(highgui_srcs
set
(
highgui_hdrs src/precomp.hpp src/utils.hpp
)
set
(
highgui_hdrs src/precomp.hpp src/utils.hpp
)
#YV
set
(
lib_hdr_names highgui_c.h highgui.hpp
)
set
(
lib_hdr_names highgui_c.h highgui.hpp
)
set
(
highgui_ext_hdrs
)
set
(
highgui_ext_hdrs
)
foreach
(
h
${
lib_hdr_names
}
)
foreach
(
h
${
lib_hdr_names
}
)
...
@@ -73,7 +74,7 @@ if(WIN32)
...
@@ -73,7 +74,7 @@ if(WIN32)
#SET(QT_USE_QTXML 1)
#SET(QT_USE_QTXML 1)
INCLUDE
(
${
QT_USE_FILE
}
)
INCLUDE
(
${
QT_USE_FILE
}
)
SET
(
_MOC_HEADERS src/window_QT.h
)
SET
(
_MOC_HEADERS src/window_QT.h
)
QT4_WRAP_CPP
(
_MOC_OUTFILES
${
_MOC_HEADERS
}
)
QT4_WRAP_CPP
(
_MOC_OUTFILES
${
_MOC_HEADERS
}
)
set
(
HIGHGUI_LIBRARIES
${
HIGHGUI_LIBRARIES
}
${
QT_LIBRARIES
}
)
set
(
HIGHGUI_LIBRARIES
${
HIGHGUI_LIBRARIES
}
${
QT_LIBRARIES
}
)
...
...
modules/highgui/include/opencv2/highgui/highgui.hpp
View file @
9eea2a5f
...
@@ -56,6 +56,12 @@ namespace cv
...
@@ -56,6 +56,12 @@ namespace cv
enum
{
WINDOW_AUTOSIZE
=
1
};
enum
{
WINDOW_AUTOSIZE
=
1
};
//YV
//-----------New for QT
//CV_EXPORTS void information(const string& name, const string& text, int delayms);
//------------
CV_EXPORTS
void
namedWindow
(
const
string
&
winname
,
int
flags
CV_DEFAULT
(
WINDOW_AUTOSIZE
)
);
CV_EXPORTS
void
namedWindow
(
const
string
&
winname
,
int
flags
CV_DEFAULT
(
WINDOW_AUTOSIZE
)
);
CV_EXPORTS
void
destroyWindow
(
const
string
&
winname
);
CV_EXPORTS
void
destroyWindow
(
const
string
&
winname
);
CV_EXPORTS
int
startWindowThread
();
CV_EXPORTS
int
startWindowThread
();
...
...
modules/highgui/include/opencv2/highgui/highgui_c.h
View file @
9eea2a5f
...
@@ -56,6 +56,11 @@ extern "C" {
...
@@ -56,6 +56,11 @@ extern "C" {
/****************************************************************************************\
/****************************************************************************************\
* Basic GUI functions *
* Basic GUI functions *
\****************************************************************************************/
\****************************************************************************************/
//YV
//-----------New for QT
//CVAPI(void) cvInformation(const char* name, const char* text, int delayms);
//----------------------
/* this function is used to set some external parameters in case of X Window */
/* this function is used to set some external parameters in case of X Window */
CVAPI
(
int
)
cvInitSystem
(
int
argc
,
char
**
argv
);
CVAPI
(
int
)
cvInitSystem
(
int
argc
,
char
**
argv
);
...
@@ -76,10 +81,13 @@ enum
...
@@ -76,10 +81,13 @@ enum
CV_WINDOW_FULLSCREEN
=
1
CV_WINDOW_FULLSCREEN
=
1
};
};
/* Set and Get Property of the window */
/* Set and Get Property of the window */
CVAPI
(
void
)
cvSetWindowProperty
(
const
char
*
name
,
int
prop_id
,
double
prop_value
);
CVAPI
(
void
)
cvSetWindowProperty
(
const
char
*
name
,
int
prop_id
,
double
prop_value
);
CVAPI
(
double
)
cvGetWindowProperty
(
const
char
*
name
,
int
prop_id
);
CVAPI
(
double
)
cvGetWindowProperty
(
const
char
*
name
,
int
prop_id
);
CVAPI
(
void
)
cvInformation
(
const
char
*
name
,
const
char
*
text
,
int
delayms
);
/* display image within window (highgui windows remember their content) */
/* display image within window (highgui windows remember their content) */
CVAPI
(
void
)
cvShowImage
(
const
char
*
name
,
const
CvArr
*
image
);
CVAPI
(
void
)
cvShowImage
(
const
char
*
name
,
const
CvArr
*
image
);
...
@@ -200,17 +208,8 @@ CVAPI(void) cvConvertImage( const CvArr* src, CvArr* dst, int flags CV_DEFAULT(0
...
@@ -200,17 +208,8 @@ CVAPI(void) cvConvertImage( const CvArr* src, CvArr* dst, int flags CV_DEFAULT(0
/* wait for key event infinitely (delay<=0) or for "delay" milliseconds */
/* wait for key event infinitely (delay<=0) or for "delay" milliseconds */
CVAPI
(
int
)
cvWaitKey
(
int
delay
CV_DEFAULT
(
0
));
CVAPI
(
int
)
cvWaitKey
(
int
delay
CV_DEFAULT
(
0
));
//YV
void
cvInformation
(
const
char
*
name
,
const
char
*
text
,
int
delay
);
#if defined (HAVE_QT)
class
CvWindow
;
class
ViewPort
;
struct
CvTrackbar
;
CVAPI
(
int
)
cvStartLoop
(
int
(
*
pt2Func
)(
int
argc
,
char
*
argv
[]),
int
argc
,
char
*
argv
[]);
CVAPI
(
void
)
cvStopLoop
();
CVAPI
(
void
)
cvInformation
(
const
char
*
name
,
const
char
*
text
,
int
delay
);
CvTrackbar
*
icvFindTrackbarByName
(
const
char
*
name_trackbar
,
const
char
*
name_window
);
#endif
/****************************************************************************************\
/****************************************************************************************\
* Working with Video Files and Cameras *
* Working with Video Files and Cameras *
...
...
modules/highgui/src/precomp.hpp
View file @
9eea2a5f
...
@@ -171,6 +171,18 @@ void cvChangeMode_GTK(const char* name, double prop_value);
...
@@ -171,6 +171,18 @@ void cvChangeMode_GTK(const char* name, double prop_value);
void
cvChangeMode_CARBON
(
const
char
*
name
,
double
prop_value
);
void
cvChangeMode_CARBON
(
const
char
*
name
,
double
prop_value
);
void
cvChangeMode_QT
(
const
char
*
name
,
double
prop_value
);
void
cvChangeMode_QT
(
const
char
*
name
,
double
prop_value
);
//#if defined (HAVE_QT)
//class CvWindow;
//class ViewPort;
//struct CvTrackbar;
////new functions available to the users
//#include "highgui_QT_extension.h"
////new functions hidden to the users
//CvTrackbar* icvFindTrackbarByName( const char* name_trackbar, const char* name_window );
//#endif
/*namespace cv
/*namespace cv
{
{
...
...
modules/highgui/src/window.cpp
View file @
9eea2a5f
...
@@ -131,6 +131,13 @@ double getWindowProperty(const string& winname, int prop_id)
...
@@ -131,6 +131,13 @@ double getWindowProperty(const string& winname, int prop_id)
return
cvGetWindowProperty
(
winname
.
c_str
(),
prop_id
);
return
cvGetWindowProperty
(
winname
.
c_str
(),
prop_id
);
}
}
/*
void information(const string& name, const string& text, int delayms)
{
cvInformation(name.c_str(),text.c_str(), delayms);
}
* */
void
imshow
(
const
string
&
winname
,
const
Mat
&
img
)
void
imshow
(
const
string
&
winname
,
const
Mat
&
img
)
{
{
CvMat
_img
=
img
;
CvMat
_img
=
img
;
...
...
modules/highgui/src/window_QT.cpp
View file @
9eea2a5f
This diff is collapsed.
Click to expand it.
modules/highgui/src/window_QT.h
View file @
9eea2a5f
...
@@ -37,6 +37,9 @@
...
@@ -37,6 +37,9 @@
//the use of this software, even if advised of the possibility of such damage.
//the use of this software, even if advised of the possibility of such damage.
//--------------------Google Code 2010 -- Yannick Verdie--------------------//
//--------------------Google Code 2010 -- Yannick Verdie--------------------//
#ifndef __OPENCV_HIGHGUI_QT_H__
#define __OPENCV_HIGHGUI_QT_H__
#include "precomp.hpp"
#include "precomp.hpp"
...
@@ -63,15 +66,15 @@
...
@@ -63,15 +66,15 @@
#include <QLabel>
#include <QLabel>
#include <QIODevice>
#include <QIODevice>
//Macro here
//Macro here
#define CV_MODE_NORMAL 0
#define CV_MODE_NORMAL 0
#define CV_MODE_OPENGL 1
#define CV_MODE_OPENGL 1
//end macro
//end macro
//Here declare everything
class
CvWindow
;
//need a .h to allow QT to use MOC (in order to use signal, slots, etc)
class
ViewPort
;
//class CvTrackbar;
class
GuiReceiver
:
public
QObject
class
GuiReceiver
:
public
QObject
{
{
...
@@ -95,6 +98,8 @@ public slots:
...
@@ -95,6 +98,8 @@ public slots:
void
displayInfo
(
QString
name
,
QString
text
,
int
delayms
);
void
displayInfo
(
QString
name
,
QString
text
,
int
delayms
);
void
refreshEvents
();
void
refreshEvents
();
void
timeOut
();
void
timeOut
();
void
toggleFullScreen
(
QString
name
,
double
flags
);
double
isFullScreen
(
QString
name
);
};
};
class
CvTrackbar
:
public
QHBoxLayout
class
CvTrackbar
:
public
QHBoxLayout
...
@@ -263,3 +268,5 @@ static const QString str_Trackbar_css = QString("")
...
@@ -263,3 +268,5 @@ static const QString str_Trackbar_css = QString("")
+
"border: 1px solid #aaa;"
+
"border: 1px solid #aaa;"
+
"border-radius: 4px;"
+
"border-radius: 4px;"
+
"}"
;
+
"}"
;
#endif
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