Merge pull request #9498 from saskatchewancatch:i9403

pull/9548/head
Alexander Alekhin 8 years ago
commit 7b4f323b8b
  1. 10
      modules/highgui/src/window_QT.cpp

@ -672,33 +672,23 @@ CV_IMPL void cvSetTrackbarPos(const char* name_bar, const char* window_name, int
CV_IMPL void cvSetTrackbarMax(const char* name_bar, const char* window_name, int maxval) CV_IMPL void cvSetTrackbarMax(const char* name_bar, const char* window_name, int maxval)
{
if (maxval >= 0)
{ {
QPointer<CvTrackbar> t = icvFindTrackBarByName(name_bar, window_name); QPointer<CvTrackbar> t = icvFindTrackBarByName(name_bar, window_name);
if (t) if (t)
{ {
int minval = t->slider->minimum();
maxval = (maxval>minval)?maxval:minval;
t->slider->setMaximum(maxval); t->slider->setMaximum(maxval);
} }
} }
}
CV_IMPL void cvSetTrackbarMin(const char* name_bar, const char* window_name, int minval) CV_IMPL void cvSetTrackbarMin(const char* name_bar, const char* window_name, int minval)
{
if (minval >= 0)
{ {
QPointer<CvTrackbar> t = icvFindTrackBarByName(name_bar, window_name); QPointer<CvTrackbar> t = icvFindTrackBarByName(name_bar, window_name);
if (t) if (t)
{ {
int maxval = t->slider->maximum();
minval = (maxval<minval)?maxval:minval;
t->slider->setMinimum(minval); t->slider->setMinimum(minval);
} }
} }
}
/* assign callback for mouse events */ /* assign callback for mouse events */

Loading…
Cancel
Save