See Q_IMPORT_PLUGIN().
babu198649 (6th March 2008)
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.
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
babu198649 (6th March 2008)
Bookmarks