Commit 9eea2a5f authored by Yannick Verdie's avatar Yannick Verdie

working on QT change/get win property (stylesheet for cvTrackBar fixed !!!)

parent d264907f
...@@ -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})
......
...@@ -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();
......
...@@ -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 *
......
...@@ -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
{ {
......
...@@ -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;
......
This diff is collapsed.
...@@ -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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment