Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-27672

QSlider doesnt set by mouse click in ceter position

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Out of scope
    • Icon: P4: Low P4: Low
    • None
    • 4.7.3
    • None
    • Qt 4.8 and 5.0 on: Windows 7, Windows XP, Ubuntu 12.04

      I create 3 state QSlider with range (-1, 0, 1)
      When I try to set its position by mouse clicking, it sets only in -1 and 1.
      Please, add something like this:

      void ThreeStateSlider::mousePressEvent ( QMouseEvent * event ){
      QSlider::mousePressEvent(event);
      const int middle = (this->height() / 2);
      const int deviation = this->height() / ((this->maximum() - this->minimum() + 1) * 2);
      const int lowMid = middle - deviation;
      const int highMid = middle + deviation;
      const int y = event->pos().y();
      if ((y >= lowMid) && (y <= highMid))

      { this->setSliderPosition(0); }

      }

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            Unassigned Unassigned
            sacha_d Александр Думановский
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes