New KPluginSelector. Finished.

David Faure faure at kde.org
Fri May 16 22:00:26 BST 2008


On Friday 16 May 2008, Rafael =?iso-8859-15?q?Fern=E1ndez_L=F3pez?= wrote:
> Hi again,
> 
> > +    , checkBox(new QCheckBox)
> > +    , pushButton(new KPushButton)
> > Any reason why you're not passing this as parent object instead of the
> > explicit delete in the destructor?
> 
> Oops, yes. If setting a parent (for example itemView()), the widget is drawn 
> on the top left corner of it. Letting them non-parented.
> 
> I could set the parent anyway and set the flag to not draw themselves, but 
> that's more code and hacky.

I would hide() them, yes.
(unless explicitely hiding them makes it more tricky to use them in the items).

> So I will let them as they are, with no parent. 

But then they appear in QApplication::topLevelWidgets()....
OK that's minor, but it makes hacks appear at the wrong place :-)

> QModelIndex's model() method returns a "const QAbstractItemModel*". 

Ah, right. If there's no way to get the model from elsewhere then the cast is needed, yes.
I wish QModelIndex had a non-const model(), I needed this before too.

-- 
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