diff --git a/modules/highgui/src/window_QT.cpp b/modules/highgui/src/window_QT.cpp index 9fc022b5c2f5ef1af29d44c104c2cfac9bdc0a94..c544bb121e121ce7030271e89734938fc96442da 100755 --- a/modules/highgui/src/window_QT.cpp +++ b/modules/highgui/src/window_QT.cpp @@ -2311,6 +2311,7 @@ QWidget* DefaultViewPort::getWidget() void DefaultViewPort::setMouseCallBack(CvMouseCallback m, void* param) { on_mouse = m; + on_mouse_param = param; } @@ -3358,7 +3359,9 @@ void GlFuncTab_QT::generateBitmapFont(const std::string& family, int height, int __BEGIN__; #ifndef Q_WS_WIN - glXUseXFont(font.handle(), start, count, base); + font.setStyleStrategy(QFont::OpenGLCompatible); + if (font.handle()) + glXUseXFont(font.handle(), start, count, base); #else SelectObject(hDC, font.handle()); if (!wglUseFontBitmaps(hDC, start, count, base)) diff --git a/samples/cpp/point_cloud.cpp b/samples/cpp/point_cloud.cpp index 0b3474621781766830f969ac1b7482016a9a9981..76bb31c8e64103fe184bbaabcb4270307f61a78b 100644 --- a/samples/cpp/point_cloud.cpp +++ b/samples/cpp/point_cloud.cpp @@ -27,7 +27,7 @@ public: private: int mouse_dx_; int mouse_dy_; - + double yaw_; double pitch_; Point3d pos_; @@ -35,7 +35,7 @@ private: TickMeter tm_; static const int step_; int frame_; - + GlCamera camera_; GlArrays pointCloud_; string fps_; @@ -189,7 +189,7 @@ int main(int argc, const char* argv[]) namedWindow(windowName, WINDOW_OPENGL); resizeWindow(windowName, 400, 400); - + PointCloudRenderer renderer(points, imgLeftColor, scale); createTrackbar("Fov", windowName, &renderer.fov_, 100); @@ -198,7 +198,7 @@ int main(int argc, const char* argv[]) while (true) { - int key = waitKey(1); + int key = waitKey(10); if (key >= 0) key = key & 0xff; @@ -302,9 +302,9 @@ void PointCloudRenderer::update(int key, double aspect) const Point3d leftVec(-1.0, 0.0, 0.0); const double posStep = 0.1; - + const double mouseStep = 0.001; - + camera_.setPerspectiveProjection(30.0 + fov_ / 100.0 * 40.0, aspect, 0.1, 1000.0); yaw_ += mouse_dx_ * mouseStep; @@ -332,7 +332,7 @@ void PointCloudRenderer::update(int key, double aspect) ostringstream ostr; ostr << "FPS: " << step_ / tm_.getTimeSec(); fps_ = ostr.str(); - + frame_ = 0; tm_.reset(); }