How can I create a signal, when a QList is not empty?
So when I append an item, the signal should be emitted.
How can I create a signal, when a QList is not empty?
So when I append an item, the signal should be emitted.
where are you stuck? It should be very easy. Check QList::isEmpty() and emit the signal.
So you tell me I manually have to check, if my QList is empty. In other words: every append should then emit the signal.
But is there no automatic way to connect this append to a signal?
there is no automatic way to have a qlist emit a signal. It isnt even a QObject so has no ability to 'emit'.
And why would every append have to emit a signal? Check for size()==1, then signal. It's a trivial problem...
Last edited by amleto; 2nd November 2011 at 20:38. Reason: empty -> size == 1
If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.
Bookmarks