[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: KSelectAction troubles
From:       Simon Hausmann <shaus () helios ! med ! Uni-Magdeburg ! DE>
Date:       2000-03-01 8:36:55
[Download RAW message or body]



On Tue, 29 Feb 2000, Lotzi Boloni wrote:

> 
>   Hi guys
> 
>   I was just converting some menus in konsole to KSelectAction, and I
> found two missing functionality. 
> 
> 1. The ability to add separators in selections. For example there was a
> separation between /tiny,small,medium,large,huge/ and /linux/ and
> /custom/. There may be some more cases like this, especially for
> separating the custom field (or whatever grouping: Blue pokemons form Pink
> pokemons). 
> 
>    Suggestion: allow a special list element, for example the empty string
> to be a separator and it would act as such both in menus and toolbars. 

Sounds like a good idea IMHO.


> 2. There is no way of setting the current item without triggering the
> signal. For example when I want to set if the current size is "80x25" (the
> user happened to resize it by hand that way) I check the menu item, but
> that triggers the signal, that triggers the detection again ---> infinite
> cycle. Yes, I can break it using an external boolean, but it would be nice
> to have:
> 
>    KSelectAction::setCurrentItem(int index, bool emitSignal=TRUE);

I think the concept of setCurrentItem is to behave exactly as if the user
did the action (of setting the current item) .

A hack way is to do something like:

action->blockSignals( true );
action->setCurrentItem( item );
action->blockSignals( false );

..or, if it is just for the initial state (after reading from some KConfig
for example) : allocate the KSelectAction without specifying the
receiver/slot in the constructor, call setCurrentItem (->the signal has no
slots connected) and to connect to the activated() signal afterwards.

>    
>    I volunteer to do both, if the big guys agree. 

... which brings us back to the issue: What's the status of
QAction regarding libqt? Will it be in Qt2.1? What are TT's plans with
QAction?

Ciao,
 Simon

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic