Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 3

Qt-interest Archive, December 2006
QListWidget->clear() segmentation fault


Message 1 in thread

         Hello all!
I have following code:

    if ( contactListTree->count() > 0)
        contactListTree->clear();

where:

contactListTree = QLIstWidget;

But after I try to run it it segfaults. can anyone tell me why?
Qt-4.2.2


-- 
 [ signature omitted ] 

Message 2 in thread

On 11.12.06 17:49:02, Albert Valiev wrote:
> I have following code:
> 
>    if ( contactListTree->count() > 0)
>        contactListTree->clear();
> 
> where:
> 
> contactListTree = QLIstWidget;
> 
> But after I try to run it it segfaults. can anyone tell me why?

Not without some more information, we need a backtrace and a small
self-contained example that demonstrates the problem.

A wild guess would be that clear deletes the items, and one of the item
pointers was earlier deleted by you, without removing it from the
listview...

Andreas

-- 
 [ signature omitted ] 

Message 3 in thread

On Mon, 2006-12-11 at 17:49 +0300, Albert Valiev wrote:

>          Hello all!
> I have following code:
> 
>     if ( contactListTree->count() > 0)
>         contactListTree->clear();
> 
> where:
> 
> contactListTree = QLIstWidget;
> 
> But after I try to run it it segfaults. can anyone tell me why? 
> Qt-4.2.2
> 
> 
> -- 
> With Best regards, Albert R. Valiev
> ---------------------------------------------------
> ALT Linux Team [www.altlinux.ru]

Is contactListTree a valid address?

-- 
 [ signature omitted ]