QPrintPreviewDialog and QPrintDialog documentation issue

Discuss anything related to product development
Post Reply
seasoned_geek
Posts: 254
Joined: Thu Jun 11 2020 12:18 pm

QPrintPreviewDialog and QPrintDialog documentation issue

Post by seasoned_geek »

Neither of these classes state what happens with the ownership of object pointed to by QPrinter * passed in constructor.

https://www.copperspice.com/docs/cs_api/class_qprintpreviewdialog.html#ae66d852b5d53214cc1188ad557858536
https://www.copperspice.com/docs/cs_api/class_qprintdialog.html#ae6c360c77aa86aa9c6ac1ce43f744c24

It's important to know this because if ownership of non-parented object does get transferred then said object cannot be created on the stack. It appears QPrintPreviewDialog attempts to take ownership, which leads to this.

Code: Select all

free(): double free detected in tcache 2
Post Reply