May 16, 2011

luggi luggi
Lab Rat
59 posts

[SOLVED] Remove entire QStringList

 

Hello

How can I remove all objects of a QStringList. I tried it with a while-loop like this:

  1. while( myStringList[0] != NULL)
  2.     {
  3.         myStringList.removeLast();
  4.     }

I always encountered runtime errors. Compiling was no problem.

Thx for help!

2 replies

May 16, 2011

Zlatomir Zlatomir
Robot Herder
327 posts

Use the clear() member function of QList.

May 16, 2011

luggi luggi
Lab Rat
59 posts

That’s it, haven’t seen the wood for the trees. Thx!

 
  ‹‹ “Solved”How to display pictures (jpg, png) in thumbnail view using QML?      [solved] Preventing binding-loops is inconvenient ››

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