Hello all,
I am using Opencv V5 C++ and Qt6
cv::imshow(“Display Window”, image);
How do I setup/modify toolbar?
or opencv qt toolbar Definition?
in source code.
Thank you.
For the built-in Qt toolbar, start with modules/highgui/src/window_QT.cpp in the OpenCV source matching your build. That’s where the Qt HighGUI window is implemented. To modify its toolbar, you’ll need to change OpenCV and rebuild it. For application controls, consider using your own Qt main window and callbacks.
If buttons in a separate control panel would do, check cv::createButton. It adds a button to the Qt control panel, not directly to the image window’s toolbar. The OpenCV Qt HighGUI documentation describes how to show the panel with Ctrl+P.
For the build, configure OpenCV with -DWITH_QT=6 and make sure CMake finds the Qt 6 development packages. Check the CMake configuration summary or cv::getBuildInformation() to confirm that the OpenCV library you’re actually using was built with Qt 6.