Results 1 to 4 of 4

Thread: static compiled app, does not load image at runtime

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: staic compiled app, does not load image at runtime

    J-P Nurmi

  2. The following user says thank you to jpn for this useful post:

    babu198649 (6th March 2008)

  3. #2
    Join Date
    Nov 2007
    Posts
    291
    Thanks
    85
    Thanked 1 Time in 1 Post

    Default Re: staic compiled app, does not load image at runtime

    thanks jpn
    i have read in other threads that creating objects in stack(like QWidget w) causes crash. but some of the classes such as QPixmap ,QPalette ,et.c , even if they are created on the stack does not crash ,why.

  4. #3
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: staic compiled app, does not load image at runtime

    Quote Originally Posted by babu198649 View Post
    i have read in other threads that creating objects in stack(like QWidget w) causes crash. but some of the classes such as QPixmap ,QPalette ,et.c , even if they are created on the stack does not crash ,why.
    It's not that straight-forward at all. It's perfectly valid to allocate for example the main window in main() and modal dialogs on the stack. Why? Both are QWidgets.

    QObjects organize themselves in object trees. A parent takes ownership of its children and automatically deletes them when the parent is deleted. This would cause problems if children were allocated on the stack because they would (depending on the allocation order) end up being deleted twice; 1) by their parent and 2) by normal C++ rules when going out of scope. However, neither QPixmap, QPalette nor other implicitly shared classes are QObjects.
    J-P Nurmi

  5. The following user says thank you to jpn for this useful post:

    babu198649 (6th March 2008)

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
  •  
Qt is a trademark of The Qt Company.