KJanusWidget and Model-View (was: Re: KDialog / KDialogBase)

Matthias Kretz kretz at kde.org
Sat Dec 31 10:34:26 GMT 2005


Hi!

It's been a long time since I worked on KSettings::* but back then 
KDialogBase/KJanusWidget were the reason for some major headaches and 
unnecessary complicated code. (I could have reimplemented all the needed 
functionality from KDialogBase and KCMultiDialog, but I also wanted to avoid 
code duplication.)

Wouldn't it be possible to use the Qt4 Model-View interfaces for the dialogs. 
Just a short sketch:

class KDialogView : public QAbstractItemView
This shows a standart KDE Dialog and uses the model to determine whether it 
needs to show a tree or an iconview for navigating the pages (and perhaps, if 
there's only one page, not showing any navigation). The page widgets, icon, 
name and all that are available through the standard QAbstractItemModel::data 
method.

In addition to KDialogView there can be a KDialogWidget that provides the 
insertPage functions for users that don't want to implement a Model to 
populate the dialog.

This way we get a lot more flexibility (for example with regard to creating a 
sort order in the navigation view - this took a lot of code in KSettings::*) 
while still keeping the simple interface.

I'd be happy to do it, but I won't until I get KDE multimedia in shape.

On Thursday 29 December 2005 13:30, Olivier Goffart wrote:
> Hi
>
> Is there a reason why KDialog and KDialogBase are two separated class ?
>
> maybe they can be merged  (keep only KDialog ?)
>
> should i try it ?
>
> (and for consistency,  FooBase is supposed to be the base of Foo , and not
> the opposite (see KConfigBase))

-- 
C'ya
        Matthias
________________________________________________________
Matthias Kretz (Germany)                            <><
http://Vir.homelinux.org/
MatthiasKretz at gmx.net, kretz at kde.org,
Matthias.Kretz at urz.uni-heidelberg.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20051231/67774350/attachment.sig>


More information about the kde-core-devel mailing list