[PATCH] RFC: Changing the language of individual KDE programs

David Faure faure at kde.org
Wed Mar 28 11:43:04 BST 2007


On Wednesday 28 March 2007, Krzysztof Lichota wrote:
> David Faure napisaƂ(a):
> > On Wednesday 28 March 2007, Krzysztof Lichota wrote:
> >>> Oh, this is Qt3/kde3 code. I hope QVariant can contain the type
> >>> of data you want to put into it then...
> >> I do not see the option to put arbitrary pointer in QVariant in Qt3
> >> docs.
> > 
> > OK I think the Qt3 way would be to just have a QMap in the dialog
> > that associates the button with whatever it needs to be associated
> > with. Then you don't need this void* usage and this extra class
> > [which even pollutes the header that you want to make public :)]. I
> > strongly recomment a QMap<QPushButton*, SomeStruct> to avoid the
> > new/deletes and risks of memleaks.
> 
> Mapping from pushbutton to struct is only part of the problem. The other
> part is how to identify which button was pushed? clicked() signal does
> not carry this information.

Calling sender() from the slot. (if the slot is only called by a signal, never directly!)

-- 
David Faure, faure at kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).




More information about the kde-core-devel mailing list