June 24, 2011

Adi Adi
Lab Rat
206 posts

How to check QStringList is Empty?

 

Hi All

How to check wether QStringList is empty?

Regards
Indrajeet

2 replies

June 24, 2011

SimonL SimonL
Lab Rat
46 posts

isEmpty()
http://developer.qt.nokia.com/doc/qt-4.7/qlist.html#id-8e5f8d2a-6dd7-4934-8e04-1327fc7d9ac8
IT is included from QList rather then QStringList sometimes its worth hitting the button to look at all the classes members and methods as the api only provides detail for that class not the classes it extends from

June 24, 2011

jim_kaiser jim_kaiser
Lab Rat
144 posts

@Indrajeet: If you are not already using it, I highly recommend you to start using the Qt Assistant, or if you’re using QtCreator, go to the help button on the bottom of the left bar. There you can get information about the whole API. And if you just go to the QStringList page, it should take you a few seconds to find the isEmpty() function. In this case, maybe you did look at the documentation of QStringList, but didn’t see the function because the base class (QList) has the isEmpty() function since a QStringList is just a QList<QString> (this is shown right at the top of each class’ page). You can get help here. But, you have to make an effort to solve relatively simple problems yourself.

 
  ‹‹ QtGUI::QApplication and QtCore::QCoreApplication::init() ?      header file reference problem??? ››

You must log in to post a reply. Not a member yet? Register here!