Skip to content
Qt 6.11 is out! See what's new in the release blog
  • Problem with widgets in minimal integration of opencv

    Unsolved General and Desktop amm
    7
    0 Votes
    7 Posts
    1k Views
    B
    Oh, dear, the problem has nothing to do with opencv or video capture. If you add a frame to your QLabel like webcamLabel->setFrameShape(QFrame::Box); You will see that's your QLabel above other widgets, so blocking their mouse events. About the "responsive" top part, that's because QVBoxLayout has default 9px margins. If you add layout->setContentsMargins(0, 0, 0, 0); Then they'll be not responsive at all. So the problem can be easily solved after you learn how to properly use layouts to arrange the widgets and not let anyone block others. I think you are just copying the code from somewhere else, right? The orignal example probably doesn't use ui file and only has an empty window. In your case, I would suggest that don't create the layout and the label in the cpp file, but in the ui file with all the other widgets.