KPropertiesDialog needs a fix

Rafael Fernández López ereslibre at kde.org
Fri Dec 28 13:09:58 GMT 2007


Hi Tobias and all,

>> I don't like that patch at all, as it breaks the design of the PageView
>> completely and moves that class into the direction of KJanusWidget, a
>> class with a lot of 'if case X do this, otherwise do that' where nobody
>> was able to maintain that class anylonger... don't let's do the same
>> mistake!!!

Well, I don't think this patch _BREAKS_ the design of PageView. It  
doesn't actually harm its design. What I think that we can agree is  
that if you use QTabBar it will be really hard to keep system  
consistency.

QTabWidget is meant for that purpose, and it should be used. What I  
can also say about this, is that the "tabbed" case is always a  
"special" case which doesn't fit very well with the design, as you said:

bool KPageView::showPageHeader() const
{
     Q_D(const KPageView);
   FaceType faceType = d->faceType;

   if ( faceType == Auto )
     faceType = d->detectAutoFace();

   if ( faceType == Tabbed ) {
     return false;
   } else {
     return !d->titleWidget->text().isEmpty();
   }
}

More special examples...

Qt::Alignment KPageView::viewPosition() const
{
     Q_D(const KPageView);
   FaceType faceType = d->faceType;

   if ( faceType == Auto )
     faceType = d->detectAutoFace();

   if ( faceType == Plain || faceType == Tabbed )
     return Qt::AlignTop;
   else
     return Qt::AlignLeft;
}

even more... So I can say: the cases I added are not "OMG THE WORLD IS  
GONNA END TOMORROW !!". So, taking in count that it really makes the  
system consistent with a dialog that will be so used as the properties  
dialog and that it just looked broken, is a nice step forward.

If you have a better way of doing this (well I did this the cleaner  
way I could, and I also fixed some bugs on my way...), do so, but I  
really think the way I have done this is really straight forward and  
clear, and we already had special cases for the tabbed face type, as I  
already have pointed out.


Bye and thanks
Rafael Fernández López.






More information about the kde-core-devel mailing list