--nextPart1155340.oU2lUkSbs1 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hi Christian, as this is only MHO about KJanusWidget and friends I'm CCing core-devel. On Monday 03 April 2006 12:42, Christian Ehrlicher wrote: > Since I'm relativly new to kde my only work on kdelibs is to make them > compile on win32 and wipe out all qt3-stuff (and do some courois checkins > from time to time ;) ). > If you want, I can take a look at KJanusWidget... if you tell me what I > have to do. Well, I can't exactly tell you what to do, only where to start. my motivation for the changes =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D When writing kdelibs/kutils/ksettings, especially the Dialog class, I had t= o=20 circumvent the limitations of KJanusWidget and add new methods to it in ord= er=20 to achieve what I wanted. The task could be described with the following=20 (abstract) use case: =2D collect dialog pages that come with some kind of hierarchy information =2D if there's only one dialog page -> create a simple dialog showing only that page =2D if there's a flat hierarchy of pages -> create a dialog with an iconview on the left to select the pages =2D if there's a tree hierarchy of pages -> create a dialog with a treeview on the left to select the pages =2D some time later new pages need to be added (because the user activated = a new=20 component); too avoid confusion the pages should appear always at the same= =20 position in the treeview (or iconview) the problems with KJanusWidget =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D in short: the class does too much while providing too little flexibility 1. You cannot add pages and then later decide what presentation you want, t= he=20 "Face" has to be decided on on construction. (Feels like the Face enum=20 selects a different class with the same methods, and those methods don't ev= en=20 make sense for all Face settings. I think it'd be more logical if there wer= e=20 a common base class and subclasses to implement those Faces - but see below= =20 for another idea.) 2. The creation of tree hierarchies has a cumbersome API. One has to identi= fy=20 pages using names and stringlists of those names. 3. Because of (2.) there's no way to insert pages at a predefined position.= =20 You can only append pages to the end of a level. Example: A |-x |-z C |-x There's no way to create A |-x |-z B |-x C |-x without creating a whole new dialog. (which is what KSettings::Dialog does) Idea for a new KJanusWidget =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D short version: use Qt4's Interview =2D> KJanusView and KJanusWidget split Tasks: 1. identify needed roles to extend Qt::ItemDataRole 1.a) The model returns all data to let KJanusView see whether a navigation = is=20 needed and whether that needs to be a TreeView. (It should always be possib= le=20 to override no nav. with IconView and TreeView representation and IconView= =20 with TreeView.) 1.b) The model returns data to fill the navigation. Most of the predefined= =20 roles can be used for that, simply by setting the model on the navigation=20 view. I think especially the possibility to use the Qt::CheckStateRole is=20 interesting to make KSettings::Dialog more usable. 1.c) Additional roles could be: PageWidgetRole The widget to be shown in the dialog PageHeaderRole The header above the page widget 2. Write an (abstract?) base class to ease development of dialog models and= to=20 be used internally in KJanusWidget. 3. Write KJanusView that can use either an IconView or a TreeView to displa= y=20 the navigation and that shows the according widget using the PageWidgetRole= =20 on selection of a page in the view. 4. Write KJanusWidget that has an interface like the current KJanusWidget b= ut=20 uses KJanusView internally and that doesn't necessarily decide on the Face = on=20 construction. =2D-=20 C'ya Matthias ________________________________________________________ Matthias Kretz (Germany) <>< http://Vir.homelinux.org/ MatthiasKretz@gmx.net, kretz@kde.org, Matthias.Kretz@urz.uni-heidelberg.de --nextPart1155340.oU2lUkSbs1 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (GNU/Linux) iD8DBQBEMRmQyg4WnCj6OIoRAjGOAKC4kLZvFFcOCn1Ooz+FyU7owkCeWwCglO+P XuEPgKIs5SVEcw2Uy3jEcis= =x6zN -----END PGP SIGNATURE----- --nextPart1155340.oU2lUkSbs1--