Results 1 to 4 of 4

Thread: setPixmap cause assertion?

  1. #1
    Join Date
    Jun 2006
    Posts
    32
    Thanks
    1
    Thanked 1 Time in 1 Post

    Default setPixmap cause assertion?

    Hi all,

    I have a QDialog derived class and in the constructor i load pixmap onto a QLabel
    Qt Code:
    1. QPixmap lqpm;
    2. sLcgsDir.sprintf("%s\\UI\\Images",getenv("IGTS_DATA_FOLDER_PATH"));
    3. lqpm.load(sLcgsDir+"\\welcome_IGTS.jpg");
    4. mainPixmapLabel->setPixmap(lqpm);
    To copy to clipboard, switch view to plain text mode 

    this dialog is the mainwidget of the application , and when i close it to exit the application i get into an assertion in dbgDel.cpp on this line

    Qt Code:
    1. _ASSERTE(_BLOCK_TYPE_IS_VALID(pHead->nBlockUse));
    To copy to clipboard, switch view to plain text mode 

    if i comment the load , or load an empty Pixmap the assertion does not happen.

    Can you please assist?

    I use QT 3.3.5 On WinXP

    Thanks
    Yariv

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: setPixmap cause assertion?

    What is the value of sLcgsDir when you get that assertion? What does QPixmap::load() return?

    Could you post the backtrace?

  3. #3
    Join Date
    Jun 2006
    Posts
    32
    Thanks
    1
    Thanked 1 Time in 1 Post

    Default Re: setPixmap cause assertion?

    I get the assertion when exiting the application

    Qt Code:
    1. HEAP[CPDM.exe]: Invalid Address specified to RtlValidateHeap( 02E70000, 02FD9108 )
    2. Unhandled exception at 0x7c901230 in CPDM.exe: User breakpoint.
    3. First-chance exception at 0x1020a752 (msvcr71d.dll) in CPDM.exe: 0xC0000005: Access violation reading location 0x05fa92b0.
    4. Unhandled exception at 0x1020a752 (msvcr71d.dll) in CPDM.exe: 0xC0000005: Access violation reading location 0x05fa92b0.
    To copy to clipboard, switch view to plain text mode 

    the value of sLcgsDir is a valid path , QPixmap::load() returns true , the pixmap displays ok
    The problem is when exititing the application there is an assertion.

    If i remark the QPixmap::load() command or load an empty pixmap , i don't recive this assertion on exit

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: setPixmap cause assertion?

    The backtrace is too short to judge anything from it. Perhaps you should compile your application in debug mode and try again to get more info?

    Either you destruct something twice or corrupt the heap in some way, or there's some problem in the way Qt handles that image. Does it crash when you load some other image?

Similar Threads

  1. QDrag setPixmap failed with "XBM" format
    By alfa_wu in forum Qt Programming
    Replies: 2
    Last Post: 2nd May 2007, 02:32
  2. QLabel not resize in setPixmap()
    By xgoan in forum Newbie
    Replies: 3
    Last Post: 23rd October 2006, 12:21
  3. QTreeWidget - setPixmap???
    By durbrak in forum Qt Programming
    Replies: 12
    Last Post: 10th October 2006, 06:57
  4. QTreeWidget, double-clicks and assertion errors
    By Byngl in forum Qt Programming
    Replies: 1
    Last Post: 13th September 2006, 14:29
  5. ASSERT(Failed assertion in Qt == Qt bug)
    By 0xBulbizarre in forum Qt Programming
    Replies: 1
    Last Post: 20th March 2006, 19:06

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.