[Kde-imaging] Proposed enhancement to KIPIPlugins::ImagesList

Andi Clemens andi.clemens at gmx.net
Tue Dec 9 10:57:06 CET 2008


I think it is ok... I will commit it.

The only thing I need to change were the following lines:

    d->addButton    = new QPushButton;
    d->removeButton = new QPushButton;

to

    d->addButton    = new QPushButton(this);
    d->removeButton = new QPushButton(this);

In Qt4, you normally don't need a parent at all, it will be mapped anyway when 
adding to a layout. I usually don't provide parents to Layout and Widgets, 
because it is easier for me to read it that way.

QPushButton* someBtn = new QPushButton;
QLayout* someLayout = new QLayout;
someLayout->addWidget(someBtn);
setLayout(someLayout);

But since we use switch later on and in case of "NoButtons" don't add the 
buttons to a layout, I need to set a parent in ctor of the buttons, otherwise 
we have a memory leak.

About the plainWidget: Right now the only plugin that uses it (and maybe the 
only one that ever will) is RemoveRedEyes. Since I use buttons on the right, 
I think it is ok to skip the plainWidget as you mentioned in 'NoButtons' 
mode.

Andi


On Monday 08 December 2008 23:22:43 Luka Renko wrote:
> On Monday 08 December 2008 22:04:38 Luka Renko wrote:
> > Great. Will work on this tonight/tomorrow.
>
> OK, the change was really trivial, so this is the patch. Please review.
>
> The only thing I was not sure was what to do with plainPage widget in
> NoButtons mode - I have decided to not use it (not put anywhere on grid).
> Does anybody use that at all?
>
> I tested Flickr, GPSSync and my new SmugMug plugin, but I could not test
> RedEyes, as I do not have opencv library - will do tomorrow (or if somebody
> else can do it). I think that there are no users outside
> extragear/graphics/kipi-plugins (correct me if I am wrong).
>
> Regards,
> Luka



More information about the Kde-imaging mailing list