Commit 6314cd28 authored by Yannick Verdie's avatar Yannick Verdie

New functions with QT GUI:

- fix zoom offset of 0.5
- fix CMake problem with QT detection
- Code optimisation
parent 2dcad1eb
......@@ -498,9 +498,19 @@ set(HAVE_QT 0)
set(HAVE_QT_OPENGL 0)
set(AUTOSWITCH_QT 0)#uses to disable QT
#set the booleans
find_package(Qt4)# QUIET)
if (QT4_FOUND AND AUTOSWITCH_QT)
set(WITH_QT ON CACHE BOOL "Build with QT Backend support")
find_package (OPENGL QUIET)
if (QT_QTOPENGL_FOUND AND OPENGL_FOUND)
set(WITH_QT_OPENGL ON CACHE BOOL "Add OpenGL extention to QT")
endif()
endif()
#test if QT Bool is true
if (WITH_QT)
set(HAVE_QT 1)
add_definitions(-DHAVE_QT=1)
......@@ -515,11 +525,11 @@ if (QT4_FOUND AND AUTOSWITCH_QT)
endif()
endif()
#if (QT_QTOPENGL_FOUND)
# set(WITH_QT_OPENGL ON CACHE BOOL "add OpenGL extention to QT")
# set(HAVE_QT_OPENGL 1)
# add_definitions(-DOPENCV_GL=1)
#endif()
if (WITH_QT_OPENGL)
message(STATUS "OpenGL for QT enable")
set(HAVE_QT_OPENGL 1)
add_definitions(-DOPENCV_GL=1)
endif()
endif()
############################### TBB ################################
......
This diff is collapsed.
......@@ -180,6 +180,15 @@ private:
enum type_mouse_event {mouse_up = 0, mouse_down = 1, mouse_dbclick = 2, mouse_move = 3};
static const int tableMouseButtons[][3]={
{CV_EVENT_LBUTTONUP,CV_EVENT_RBUTTONUP,CV_EVENT_MBUTTONUP}, //mouse_up
{CV_EVENT_LBUTTONDOWN,CV_EVENT_RBUTTONDOWN,CV_EVENT_MBUTTONDOWN}, //mouse_down
{CV_EVENT_LBUTTONDBLCLK,CV_EVENT_RBUTTONDBLCLK,CV_EVENT_MBUTTONDBLCLK}, //mouse_dbclick
{CV_EVENT_MOUSEMOVE,CV_EVENT_MOUSEMOVE,CV_EVENT_MOUSEMOVE} //mouse_move
};
class ViewPort : public QGraphicsView
{
Q_OBJECT
......@@ -207,6 +216,8 @@ public slots:
void siftWindowOnUp() ;
void siftWindowOnDown();
void resizeEvent ( QResizeEvent * );
int heightForWidth(int w) const;
bool hasHeightForWidth() const;
private:
Qt::AspectRatioMode modeRatio;
......@@ -244,6 +255,8 @@ private:
void draw2D(QPainter *painter);
void drawStatusBar();
void controlImagePosition();
void icvmouseHandler(QMouseEvent *event, type_mouse_event category, int &cv_event, int &flags);
void icvmouseProcessing(QPointF pt, int cv_event, int flags);
#if defined(OPENCV_GL)
void draw3D();
......@@ -257,6 +270,7 @@ private slots:
};
//here css for trackbar
/* from http://thesmithfam.org/blog/2010/03/10/fancy-qslider-stylesheet */
static const QString str_Trackbar_css = QString("")
......
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