[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-devel
Subject: Re: qt newbie
From: "Mahfouf Anne-Marie" <annemahfouf () hotmail ! com>
Date: 2003-02-27 19:48:47
[Download RAW message or body]
Hi,
>void Kapp::selectFile()
> {
> QStringList chosen =
>QFileDialog::getOpenFileNames ();
> if (chosen != "") { // returned string is empty, if
>user pressed "cancel"
> kLineEdit1->setText (chosen);
> }
> }
Two tips :
1) Please don't use
if (chosen != "")
but use instead
if (!chosen.isEmpty());
when you have to test for an empty QString or QStringList.
Read carefully the Qt doc for each class you use, for example for
QStringList, click on the "List all member functions" link which gives you
the inherited member functions as well. Browse through that list and read
the details for functions you think might be related to what you are trying
to do.
The examples are also very helpful.
2) Use http://lxr.kde.org/
Identifier search and type the name of the class you want information on,
like QStringList or KToolBar
You then get a list of KDE files using that class. Click on a cpp file and
browse through the code. Usually, in 2 or 3 clicks I find the information I
am looking for.
Hope that helps,
annma
_________________________________________________________________
Overloaded with spam? With MSN 8, you can filter it out
http://join.msn.com/?page=features/junkmail&pgmarket=en-gb&XAPID=32&DI=1059
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic