[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    Re: ANNOUNCE: DialogBase and KAboutDialog in kdelibs/kdeui
From:       Harri Porten <porten () tu-harburg ! de>
Date:       1999-07-07 15:32:03
[Download RAW message or body]

Mirko Sucker wrote:
> 
> Hello,
> like we discussed on LinuxTag in Kaiserslautern, I added two classes to the KDE
> user interface library:
> 
> ° DialogBase (dialogbase.h, dialogbase.cpp):
> 
> A class that manages common tasks required for writing up-to-date dialogs. It
> provides "OK", "Apply" and "Cancel" buttons, tooltips, quickhelp, a link to
> show the help window, some frames and general geometry management. To use it,
> simply create a widget that suits as the main part of the dialog, set its
> minimum size and hand it over to a DialogBase object as the dialogs "main

I have yet to look at example applications but wouldn't it work using
sizeHint() ? One of the postive effects of converting code to Qt 2.0 was
the chance to kick out all the setMinimumSize() calls and let the
geometry managment figure out the sizes on its own ? (Just speculating
since I haven't read trough the code intensely enough)

> widget". Mostly it is not needed to derive a own dialog class.
> 
> ° KAboutDialog (kaboutdialog.h, kaboutdialog.cpp):
> 
> A general about dialog for KDE apps, providing logos, displays for author,
> maintainer, an arbitrary number of contributors and  email and homepage URLs.
> Again, to use it, only a sequence of calls is needed, no new class.

I bet you have developed these classes for Qt 1.x originally. Since you
are assigning the function parameters to QStrings anyway and want to
make them Unicode safe you should consider replacing most of the "const
char*" to "const QString&". The following code

KAboutContributor::setName(const char* n)
{
  if(n==0)
    {
      name->setText("");
    } else {
      name->setText(n);
    }
}

would then be reduced to

KAboutContributor::setName(const QString& n)
{
  name->setText(n);
}

:)

> ---------
> I have an example for both (KAboutDialog is a DialogBase) called
> kaboutdialog_test.cc, is there a place to put it?

Please put it in (someone already suggested kdelibs/kdetest)

Harri.

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic