Skip to content

highgui Qt backend waitKey(0) does not return after all windows closed #20822

@huangqinjin

Description

@huangqinjin
System information (version)
  • OpenCV => 4.5.3
  • Operating System / Platform => openSUSE Tumbleweed
  • Compiler => gcc 11.2
Steps to reproduce

Build OpenCV with Qt backend.

cmake .. -DBUILD_LIST=highgui -DWITH_QT=ON -DWITH_GTK=OFF -DHIGHGUI_ENABLE_PLUGINS=OFF

Run minimal program:

#include <opencv2/highgui.hpp>

int main()
{
    cv::Mat img(200, 200, CV_8UC1);
    cv::imshow("img", img);
    cv::waitKey(0);
}

Close the window though close button, waitKey() does not return.

Issue submission checklist
  • I report the issue, it's not a question
  • I checked the problem with documentation, FAQ, open issues,
    forum.opencv.org, Stack Overflow, etc and have not found solution
  • I updated to latest OpenCV version and the issue is still there
  • There is reproducer code and related data files: videos, images, onnx, etc

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions