Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 4

Qt-interest Archive, February 2007
QSlider - Mac behavior different than Windows and Linux


Message 1 in thread

So here's a slider:

-------------------||---------------------

If you click at the x:

------------------||---------x-----------

the slider moves to the position:

----------------------------||-----------

On a mac this emits the signal: sliderPressed() and when you release
the button it emits sliderReleased.  So you don't have to click on the
handle, but on Linux and Windows this is not the case.  I can think of
ways to fix this but I was wondering if this is the intended behavior
or a bug.

Thanks a lot...

(Forgive the ascii art, I hope it comes through.)

-Willy

--
 [ signature omitted ] 

Message 2 in thread

After a short google. About sliders for macs one example:
http://www.blueshoes.org/en/javascript/slider/

#  User can change the value in 6 ways:

   1. slide
   2. click arrow left/right
   3. click somewhere into the slider
   4. enter a value into the field
   5. use an api function to set a value
   6. use your mouse wheel (internet explorer only)

So this seems to be normal behaviour for macs (3).
I don't have a non-Qt program on my linus machine with a 
slider, but I suppose this is not the normal linux behaviour.

Qt usually tries to follow the native style guides on the
different platforms. I bet that what you found is intended.


Guido
 


On Wed, Feb 14, 2007 at 05:24:17PM -0500, Willy P wrote:
> So here's a slider:
> 
> -------------------||---------------------
> 
> If you click at the x:
> 
> ------------------||---------x-----------
> 
> the slider moves to the position:
> 
> ----------------------------||-----------
> 
> On a mac this emits the signal: sliderPressed() and when you release
> the button it emits sliderReleased.  So you don't have to click on the
> handle, but on Linux and Windows this is not the case.  I can think of
> ways to fix this but I was wondering if this is the intended behavior
> or a bug.
> 
> Thanks a lot...
> 
> (Forgive the ascii art, I hope it comes through.)
> 
> -Willy
> 
> --
> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with 
> "unsubscribe" in the subject or the body.
> List archive and information: http://lists.trolltech.com/qt-interest/

--
 [ signature omitted ] 

Message 3 in thread

On 2/14/07, Willy P <willy.lists@xxxxxxxxx> wrote:
> So here's a slider:
>
> -------------------||---------------------
>
> If you click at the x:
>
> ------------------||---------x-----------
>
> the slider moves to the position:
>
> ----------------------------||-----------
>
> On a mac this emits the signal: sliderPressed() and when you release
> the button it emits sliderReleased.  So you don't have to click on the
> handle, but on Linux and Windows this is not the case.  I can think of
> ways to fix this but I was wondering if this is the intended behavior
> or a bug.

As Guido said, it looks like Qt is simply following the native
platform behavior. On Windows, clicking a native slider (off the
handle) does not immediately move the slider to the mouse press
position. It just moves it by a certain increment (10% maybe). If you
hold the mouse button down, the slider continues to move by increments
until it reaches the mouse position. Qt sliders on Windows do the same
thing.

-- 
 [ signature omitted ] 

Message 4 in thread

Andrew Medico wrote:
> On 2/14/07, Willy P <willy.lists@xxxxxxxxx> wrote:
>> So here's a slider:
>>
>> -------------------||---------------------
>>
>> If you click at the x:
>>
>> ------------------||---------x-----------
>>
>> the slider moves to the position:
>>
>> ----------------------------||-----------
>>
>> On a mac this emits the signal: sliderPressed() and when you release
>> the button it emits sliderReleased.  So you don't have to click on the
>> handle, but on Linux and Windows this is not the case.  I can think of
>> ways to fix this but I was wondering if this is the intended behavior
>> or a bug.
> 
> As Guido said, it looks like Qt is simply following the native
> platform behavior. On Windows, clicking a native slider (off the
> handle) does not immediately move the slider to the mouse press
> position. It just moves it by a certain increment (10% maybe). If you
> hold the mouse button down, the slider continues to move by increments
> until it reaches the mouse position. Qt sliders on Windows do the same
> thing.
> 
With Linux, clicking on the slider causes the handle to move by a set 
amount called the page increment/decrement. This value can be set.

--
 [ signature omitted ] 

Message 5 in thread

Willy P wrote:
> So here's a slider:
> 
> -------------------||---------------------
> 
> If you click at the x:
> 
> ------------------||---------x-----------
> 
> the slider moves to the position:
> 
> ----------------------------||-----------
> 
> On a mac this emits the signal: sliderPressed() and when you release
> the button it emits sliderReleased.  So you don't have to click on the
> handle, but on Linux and Windows this is not the case.  I can think of
> ways to fix this but I was wondering if this is the intended behavior
> or a bug.
> 
> Thanks a lot...
> 
> (Forgive the ascii art, I hope it comes through.)
> 
> -Willy

Hi Willy,

I posted the same problem some months ago. Here's the thread:

http://lists.trolltech.com/qt-interest/2006-11/msg00363.html


What worked for me was the hint given by Girish Ramakrishnan:

>Create a style proxy
>(http://doc.trolltech.com/qq/qq09-q-and-a.html#style) and return
>Qt::LeftButton for the style hint QStyle::SH_Slider_AbsoluteSetButtons.

Not very intuitive, to say the least ;) I think the argument of "native
platform behavior" really doesn't count here because in some situations
(e.g. using the slider to set the position in audio/video playback)
move-by-increment doesn't make sense.

Btw, the mentioned style hint was added in 4.2.


hth
M

--
 [ signature omitted ]