简体   繁体   English

qt:在一个gui窗口中同时包含opencv和opengl子窗口

[英]qt : Containing both opencv and opengl subwindows within one gui window

Recently I want to write a gui application, and its appearance is shown below: 最近我想编写一个gui应用程序,其外观如下所示: 在此处输入图片说明

I used MFC before to write normal gui applications, but I have never used qt to write gui applications. 我以前使用MFC编写普通的gui应用程序,但从未使用qt编写gui应用程序。 But this time I want to use qt, so i'm wondering is there any way to implement such interface, integrating with opengl and opencv subwindows within one application. 但是这次我想使用qt,所以我想知道是否有任何方法可以实现这样的接口,并在一个应用程序中与opengl和opencv子窗口集成。
Please give me some directions on: 请给我一些指示:
1. Which kind of widget can I draw opengl and opencv subwindows in my application? 1.我可以在应用程序中绘制opengl和opencv子窗口哪种控件
2. Is there any way to do event handling in those subwindows respectively? 2.有什么方法可以分别在这些子窗口中进行事件处理?
3. How does qt support for opengl and opencv integration? 3. Qt如何支持opengl和opencv集成?

There should be no problem. 应该没有问题。 In fact, I've used openCV and OpenGL in different projects, but I don't see any problem. 实际上,我在不同的项目中使用过openCV和OpenGL,但是我看不到任何问题。

You have to convert opencv cv::Mat to QImage (see various posts on the problem on StackOverflow) and then draw on a QLabel or a subclass of it. 您必须将opencv cv :: Mat转换为QImage(请参阅有关StackOverflow的问题的各种文章),然后使用QLabel或其子类。
For openGL there are special classes: http://qt-project.org/doc/qt-5/qtgui-index.html#opengl-and-opengl-es-integration 对于openGL,有一些特殊的类: http : //qt-project.org/doc/qt-5/qtgui-index.html#opengl-and-opengl-es-integration

You should use event handling as usual in Qt (signal-slot, you know). 您应该像往常一样在Qt(信号槽)中使用事件处理。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM