mirror of
https://github.com/opencv/opencv.git
synced 2026-07-30 07:43:03 +04:00
highgui: add property WND_PROP_VISIBLE
checks whether the window exists and is visible. On QT closing a window merley hides it, so the common hack for checking whether a window exists exists = cv2.getWindowProperty(.., 0) >= 0 does not work.
This commit is contained in:
@@ -138,6 +138,20 @@ double cvGetRatioWindow_QT(const char* name)
|
||||
return result;
|
||||
}
|
||||
|
||||
double cvGetPropVisible_QT(const char* name) {
|
||||
if (!guiMainThread)
|
||||
CV_Error( CV_StsNullPtr, "NULL guiReceiver (please create a window)" );
|
||||
|
||||
double result = 0;
|
||||
|
||||
QMetaObject::invokeMethod(guiMainThread,
|
||||
"getWindowVisible",
|
||||
autoBlockingConnection(),
|
||||
Q_RETURN_ARG(double, result),
|
||||
Q_ARG(QString, QString(name)));
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
void cvSetRatioWindow_QT(const char* name,double prop_value)
|
||||
{
|
||||
@@ -903,6 +917,16 @@ double GuiReceiver::getPropWindow(QString name)
|
||||
return (double) w->getPropWindow();
|
||||
}
|
||||
|
||||
double GuiReceiver::getWindowVisible(QString name)
|
||||
{
|
||||
QPointer<CvWindow> w = icvFindWindowByName(name);
|
||||
|
||||
if (!w)
|
||||
return 0;
|
||||
|
||||
return (double) w->isVisible();
|
||||
}
|
||||
|
||||
|
||||
void GuiReceiver::setPropWindow(QString name, double arg2)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user