Results 1 to 5 of 5

Thread: Help with sliders

  1. #1
    Join Date
    Nov 2006
    Posts
    29
    Thanks
    3
    Thanked 3 Times in 3 Posts

    Default Help with sliders

    Hi.
    I have made my own sliders (without subclassing QAbstractSlider), using QGraphicsView to draw the sliders.

    I must have missed something, or done something very wrong, because when I connect the sliders to rotate on the 3D sudoku board in my application, the board rotates just fine, but the sliders does not follow the mouse very well. They sort of "hang" after.

    I know it can be hard to help, since I cannot post the code of the sudoku board, but if thought that maybe there could be something in my code that is obviously wrong.

    Thanks a lot
    Attached Files Attached Files

  2. #2
    Join Date
    Aug 2006
    Location
    Bangalore,India
    Posts
    419
    Thanks
    37
    Thanked 53 Times in 40 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: Help with sliders

    I didn't get any sort of hang while trying your code. But the feeling of losing mouse can be because of the following.
    QSlider remembers the slider position when the actual sliding begins(mouse press) When the mouse is moved away from geometry of slider, the head position is restored and the sliding continues only when the mouse cursor gets backs to the original mouse press position(it seems it looks for same x or y, not necessarily the exact point).

    OTOH your implentation just stops slider from moving and doesn't restore the pos. Therefore the mouse cursor keeps moving away from slider as and when you exceed the geometry.

    I might not be 100% right since i haven't looked at QSlider code. That might help you
    The biggest difference between time and space is that you can't reuse time.
    -- Merrick Furst

  3. #3
    Join Date
    Nov 2006
    Posts
    29
    Thanks
    3
    Thanked 3 Times in 3 Posts

    Unhappy Re: Help with sliders

    I did not understand what you meant earlier, but I guess you ran my example on Qt 4.3, while I only had Qt 4.2.2 at that time...

    It was not exactly that problem I was trying to describe, but now I need help with that too, because in Qt 4.2.2 the Slider-head would move to the position on the circle nearest the mouse, no matter where the mouse was...

    Is it possible to maintain this, even in Qt 4.3:
    That no matter where the mouse is (even if it is outside of geometry boundaries), the little dot will be placed on the position nearest the mouse?

    What I was trying to explain earlier, was that when the slider is connected to my 3D board (and only then), when I move the little dot on the slider, it does not follow for a second, and then "jumps" right to the position on the circle, nearest the mouse...
    It is "un-smooth" :P

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Help with sliders

    Does the "un-smooth" behaviour remain when the slider is not connected to anything?

  5. #5
    Join Date
    Nov 2006
    Posts
    29
    Thanks
    3
    Thanked 3 Times in 3 Posts

    Default Re: Help with sliders

    No, it doesn't. That is what annoys me.
    The only time it does, is when It is connected to a function that updates the 3D board variables, and then calls updateGL() on it.

Similar Threads

  1. Multiple styles for sliders
    By Lele in forum Qt Programming
    Replies: 2
    Last Post: 27th October 2006, 16:08
  2. QScrollBar: custom slider's size ?
    By deweyjew in forum Qt Programming
    Replies: 1
    Last Post: 9th May 2006, 09:57
  3. Scroll bar with two sliders?
    By Morea in forum Newbie
    Replies: 3
    Last Post: 9th May 2006, 06:51

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.