[Kde-pim] [patch] Conversion from K3ListView to Qt4 native QTreeWidget

Thomas McGuire Thomas.McGuire at gmx.net
Sun Mar 30 20:45:50 BST 2008


Hi,

On Saturday 29 March 2008, Szymon Stefanek wrote:
> I'm planning to apply to GSoC as a student. One of the tasks in my
> application would be helping in the port of the Qt3 compatibility
> widgets to Qt4 native ones in kmail.
>
> I've just given it a first try on a very simple kmail widget.
> The patch against the current trunk is attached.
>
> Can anybody take a look at it, try it out, and possibly commit ?
Thanks for the patch, good work!
I tested it and it worked fine, just a couple of minor points:

- No need for slotAccountListItemClicked(), you can write  
> connect( mAccountList, SIGNAL(itemClicked(QTreeWidgetItem *,int)),
>          this, SLOT(slotApplicableAccountsChanged()) ); 

- Instead of connecting to itemClicked() in the above case, connect to 
  itemChanged(), which will also catch changing the checked state with the
  spacebar
- Don't include qtreewidget.h in the header file, instead forward-declare it 
  like it was done with K3ListView. This speeds up compiling, as other files 
  which include kmfilterdlg.h don't automatically include qtreewidget.h then.
  Only include qtreewidget.h in the cpp file.
- Don't use Hungarion notation, like pHeader. We only use mFoo for member 
  variables, but nothing else.
- Coding style: Yes, the coding style of KDEPIM seems strange at first, but 
  nevertheless it should be consistent. That includes spaces at the inside of 
  parenthesis (so it would be new QTreeWidgetItem( 0 ) instead of new  
  QTreeWidgetItem(0), for example.
  Also, most of the time, the opening brace ({) is put on the same line as the 
  the if/for/whatever statement.

I've committed the patch (with the minor changes above) in revision 791936[1]. 
Again, thanks for the patch.

Regards,
Thomas

[1] http://websvn.kde.org/?view=rev&revision=791936
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 194 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20080330/a61e2983/attachment.sig>
-------------- next part --------------
_______________________________________________
KDE PIM mailing list kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/


More information about the kde-pim mailing list