Connect opencv to qtcreator - qt

I have VC++ & opencv code and I want to design GUI to it using qtcreator.
First of all, I included the libraries to the project and it ran without any errors.
Now, what should I do after this?
How can I add the code into main.cpp file in the project?
should I change every opencv code to Q... like IpImage to QImage?

Install the VS-addin it will hook the.pro file to a gui editor automatically

About connecting OpenCV to Qt GUI classes , here is an example code QtOpenCV 1 . It takes content ipmage ,IIRC converts into rgb32 and paints it over a QWidget in paintEvent(QPaintEvent*);

Related

How to create a custom module in Qt and use it like Qt += mymodule?

I have created some custom widgets which I can use in my projects by directly using source files or by compiling them to libraries and then using them in my project but I am wondering if I can make a module MyWidgets and use it like Qt += mywidgets, is it even possible? if yes how can I make one?
I have searched the internet for a full day but I did not find any step by step guide showing how to make a custom module.
I have found this article but it doesn't show how to actually make a sample module and build it.

draw chart in Qwidget

I want to draw a simple line chart in my QWidget application. I found this link, but when I add `
#QT += charts
to my .pro file, an error appear that :
Unknown module(s) in QT: charts
You may use QCustomPlot. It's free (GPL), simple (just 2 files), fast and well-documented.
You may use Qt Charts (it is free, qt blog), but you need cloning git repository and building the project manually. Git repository you can find here.

Qt Linguist: translation of text changed dynamically in tr()

I am using qt linguist and qt 5.2. I have a problem that when I add something to .ui files I can see it after lupdate in ts file but when I change name of this button dynamically in my code like:
ui->label->setText(tr("foo"));
I can't see it in ts file, is it possible to make translation in that case? How I can do this?
Basically, tr() can be detected anywhere in the codes.For ui files, linguist would detect the changes immediately, however in codes I encounterd the same problem.
Based on my experience, try to reBuilt/qmake it.
(I am using Qt4.8 & 5.1.)

where is the source code of qt designer default widgets

I want to create a qt designer plugin that behaves like the builtin QTreeWidget but i cant find the source code used to create any of the built in widgets. Help will be appreciated.
In my Qt installation (4.7.1), the designer plugin source code can be found in
<QTDIR>/tools/designer/src/plugins

disable QT highgui output

I have compiled OpenCV with QT.
I'm now facing an error which I'm almost certain is related to QT and I would like to output it using the old-fashioned highgui, without the QT interface.
Is this possible?
cvNamedWindow( ``myWindow'', ``CV_WINDOW_NORMAL`` );
will display the windows without any Qt decorations, if you don't want any Qt to be used at all you need to rebuild openCV without Qt
As of 2021 and OpenCV versions 4x (and maybe less), you can disable Qt Decorations associating flags like below:
cv2.namedWindow("main1", cv2.WINDOW_GUI_NORMAL | cv2.WINDOW_AUTOSIZE)
You can check all flags here.

Resources