Qt - debugging Linux and Windows

pull/13383/head
Yannick Verdie 15 years ago
parent 4d67fc266c
commit c77e8fc638
  1. 11
      CMakeLists.txt
  2. 4
      cvconfig.h.cmake
  3. 2
      modules/highgui/include/opencv2/highgui/highgui_c.h
  4. 15
      modules/highgui/src/window.cpp
  5. 8
      modules/highgui/src/window_QT.cpp

@ -509,20 +509,21 @@ endif()
set(WITH_QT OFF CACHE BOOL "Build with Qt Backend support")
set(WITH_QT_OPENGL OFF CACHE BOOL "Add OpenGL extension to Qt")
#set(HAVE_QT 0)
#set(HAVE_QT_OPENGL 0)
set(HAVE_QT 0)
set(HAVE_QT_OPENGL 0)
if (WITH_QT)
find_package(Qt4)
if (QT4_FOUND)
set(HAVE_QT 1)
#add_definitions(-DHAVE_QT)
#set_property(DIRECTORY PROPERTY COMPILE_DEFINITIONS "HAVE_QT")
add_definitions(-DHAVE_QT)#We need to define te macro this way, using cvconfig.h.cmake does not work
find_package (OpenGL QUIET)
if (NOT WIN32) #WIN32 always detect OpenGL, so I disabled it.
if (QT_QTOPENGL_FOUND AND OPENGL_FOUND)
set(HAVE_QT_OPENGL 1)
#add_definitions(-DHAVE_QT_OPENGL)
add_definitions(-DHAVE_QT_OPENGL)
endif()
endif()
endif()
endif()

@ -161,10 +161,10 @@
#cmakedefine HAVE_EIGEN2
/* Qt bindings */
#cmakedefine HAVE_QT
//#cmakedefine HAVE_QT
/* Qt bindings use OpenGL */
#cmakedefine HAVE_HAVE_QT_OPENGL
//#cmakedefine HAVE_QT_OPENGL
/* NVidia Cuda Runtime API*/
#cmakedefine HAVE_CUDA

@ -81,7 +81,7 @@ enum {CV_GUI_EXPANDED = 0x00000000, CV_GUI_NORMAL = 0x00000010};
//and alpha= 0 <-> 0xFF (not transparent <-> transparent)
CVAPI(CvFont) cvFont_Qt(const char* nameFont, int pointSize CV_DEFAULT(-1), CvScalar color CV_DEFAULT(cvScalarAll(0)), int weight CV_DEFAULT(CV_FONT_NORMAL), int style CV_DEFAULT(CV_STYLE_NORMAL), int spacing CV_DEFAULT(0));
CVAPI(void) cvAddText( CvArr* img, const char* text, CvPoint org, CvFont *arg2);
CVAPI(void) cvAddText(const CvArr* img, const char* text, CvPoint org, CvFont *arg2);
CVAPI(void) cvDisplayOverlay(const char* name, const char* text, int delayms);
CVAPI(void) cvDisplayStatusBar(const char* name, const char* text, int delayms);

@ -365,7 +365,7 @@ CV_IMPL int cvStartWindowThread()
//-------- Qt ---------
CV_IMPL void cvAddText( const CvArr*, const char*, CvPoint org, CvFont font)
CV_IMPL void cvAddText( const CvArr*, const char*, CvPoint org, CvFont* font)
{
CV_NO_GUI_ERROR("cvAddText");
}
@ -375,12 +375,7 @@ CV_IMPL void cvDisplayStatusBar(const char* name, const char* arg2, int arg3)
CV_NO_GUI_ERROR("cvDisplayStatusBar");
}
CV_IMPL void cvDisplayStatusBar(const char* name, const char* arg2, int arg3)
{
CV_NO_GUI_ERROR("cvDisplayStatusBar");
}
CV_IMPL void cvCreateOpenGLCallback(const char* name, cvOpenGLCallback callback, void* param)
CV_IMPL void cvCreateOpenGLCallback(const char*, void (*)(void*), void*, double, double, double)
{
CV_NO_GUI_ERROR("createOpenGLCallback");
}
@ -390,9 +385,10 @@ CV_IMPL void cvDisplayOverlay(const char* name, const char* text, int delayms)
CV_NO_GUI_ERROR("cvNamedWindow");
}
CV_IMPL void cvStartLoop(int (*pt2Func)(int argc, char *argv[]), int argc, char* argv[])
CV_IMPL int cvStartLoop(int (*pt2Func)(int argc, char *argv[]), int argc, char* argv[])
{
CV_NO_GUI_ERROR("cvStartLoop");
return -1;
}
CV_IMPL void cvStopLoop()
@ -410,9 +406,10 @@ CV_IMPL void cvLoadWindowParameterss(const char* name)
CV_NO_GUI_ERROR("cvLoadWindowParameters");
}
CV_IMPL void cvCreateButton(const char* arg1, const char* arg2, cvButtonCallback on_change, const char* name, void* userdata)
CV_IMPL int cvCreateButton(const char*, void (*)(int, void*), void*, int, int)
{
CV_NO_GUI_ERROR("cvCreateButton");
return -1;
}

@ -82,7 +82,7 @@ CV_IMPL CvFont cvFont_Qt(const char* nameFont, int pointSize,CvScalar color,int
CV_IMPL void cvAddText( CvArr* img, const char* text, CvPoint org, CvFont* font)
CV_IMPL void cvAddText(const CvArr* img, const char* text, CvPoint org, CvFont* font)
{
if (!guiMainThread)
@ -1988,7 +1988,11 @@ void ViewPort::setMouseCallBack(CvMouseCallback m, void* param)
void ViewPort::setOpenGLCallback(CvOpenGLCallback func,void* userdata, double angle_arg, double zmin_arg, double zmax_arg)
{
#if defined( HAVE_QT_OPENGL )//all this section -> not tested
//avoid unreferenced formal parameter warning with vs 2008
//http://msdn.microsoft.com/en-en/library/26kb9fy0%28VS.80%29.aspx
func;userdata;angle_arg;zmin_arg;zmax_arg;
#if defined( HAVE_QT_OPENGL )
on_openGL_draw3D = func;
on_openGL_param = userdata;

Loading…
Cancel
Save