Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

My own viewfinder for QCamera



  • I need implement in my app the still image capture. But it must not take and save entire image - but only even square from frame center. Therefore I need make visible only square part in viewfinder. Or at least draw yellow square over it. In docs I read next sentence:

    For advanced usage (like processing viewfinder frames as they come, to detect objects or patterns), you can also derive from QAbstractVideoSurface and set that as the viewfinder for the QCamera object. In this case you will need to render the viewfinder image yourself.

    I do not see quite clear - is this required if I just need draw something over QCameraViewfinder. If yes - then I need more description of how to "render the viewfinder image" by myself. Did anybody investigate this case? Is there any sample application showing how to render viewfinder? In supplied examples I only found simple apps with catching camera - but they do not render viewfinder.


  • Lifetime Qt Champion

    @Gourmet said in My own viewfinder for QCamera:

    I just need draw something over QCameraViewfinder

    You could simply put a transparent widget over view finder and draw on it.



  • @jsulm I thought about this. Did you implement this by yourself or just think too?

    Without visible result it QtDesigner it is not so easy to implement. Therefore I have another question. In camera example it has QCameraViewfinder widget on the UI form. But there is no such Designer plugin. It is not available in Designer widgets palette. How did they do this? Manually edited UI file? Or they... have this plugin but do not provide it with Qt?


  • Lifetime Qt Champion

    @Gourmet I guess they used the "Promote to ..." function in designer.



  • @jsulm hm... I have my own 25 Designer plugins with complex widgets but forget about this option.


Log in to reply