Goodbye KJanusWidget
Tobias Koenig
tokoe at kde.org
Fri Jun 2 18:11:16 BST 2006
Hi,
after some weeks of discussion with Vir and several nightly hours
of coding I want to introduce the successor of KJanusWidget:
KPageView & Co
Attached are the header files (I know some APIdox are missing) which
should give an insight on the functionality of the new classes.
The biggest change is that we have now two classes KPageView and KPageWidget.
Like in Qt, the KPageView takes a QAbstractItemModel (or here a subclass
of KPageModel) and presents the data in a Plain, List, Tree or Tabbed
view.
KPageWidget is the convinience class which has methods like addPage,
addSubPage and insertPage. It makes use of KPageWidgetModel internally.
KPageDialog is the successor of KDialogBase and uses a KPageWidget
internally, also I plan to allow the usage of a custom KPageView.
During porting all the code to KPageView/KPageDialog I also cleaned up
the KDialog class, removed deprecated methods, changed method names to
be more consistent and stripped down the ctor.
This change will cause a lot of porting in all the other kde modules,
but it's definitely worth to get out of the parameter hell.
For kdelibs I've already a ported version on my local harddisc.
Example:
MyDialog::MyDialog( QWidget *parent )
: KDialog( parent, i18n("configure"), false, Ok | Cancel | User1, Ok, true,
i18n( "Test" )
{
}
would be rewritten as
MyDialog::MyDialog( QWidget *parent )
: KDialog( parent )
{
setCaption( i18n("configure") );
setModal( false ); // is it still needed with Qt4?
setButtons( Ok | Cancel | User1, i18n( "Test" ) );
setDefaultButton( Ok );
enableButtonSeparator( true );
}
although it's more to write we should remeber at Matthias' talk where he
said "Code is written once, but read many times"
So can I merge my local changes with current SVN trunk/kdelibs?
Ciao,
Tobias
--
Separate politics from religion and economy!
The Council of the European Union is an undemocratic and illegal institution!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kdialog.h
Type: text/x-chdr
Size: 23584 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20060602/ba9c1a25/attachment.h>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kpagedialog.h
Type: text/x-chdr
Size: 6822 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20060602/ba9c1a25/attachment-0001.h>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kpagemodel.h
Type: text/x-chdr
Size: 2272 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20060602/ba9c1a25/attachment-0002.h>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kpageview.h
Type: text/x-chdr
Size: 3851 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20060602/ba9c1a25/attachment-0003.h>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kpagewidget.h
Type: text/x-chdr
Size: 4146 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20060602/ba9c1a25/attachment-0004.h>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kpagewidgetmodel.h
Type: text/x-chdr
Size: 4804 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20060602/ba9c1a25/attachment-0005.h>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20060602/ba9c1a25/attachment.sig>
More information about the kde-core-devel
mailing list