On Wed, Oct 10, 2012 at 7:51 AM, Patryk Małek <[email protected]> wrote: > Hello, > > I have just encountered a problem, where I do not need a certain UI element > e.g. QPushButton and I would like to remove it but since I have connected it > with several slots (e.g. clicked(), released() etc. ) I now have several > references of this button in my code. > > How can I remove all of this efficiently ? Do I have to remove it all > manually ? > > > > kind regards, > Patryk Małek > > > > > _______________________________________________ > Qt-creator mailing list > [email protected] > http://lists.qt-project.org/mailman/listinfo/qt-creator >
Two things. (1) This is a question for qt-interest; this list is for issues concerning the IDE itself, not the toolkit. (2) If signal connections are the only references you have, there's no concern -- QObjects (QPushButton is one, of course) disconnect themselves from everything automatically on delete. If you have other pointers hanging around, consider QPointer; this is Qt's smart pointer class that automatically zeroes itself when its referent is deleted. /s/ Adam _______________________________________________ Qt-creator mailing list [email protected] http://lists.qt-project.org/mailman/listinfo/qt-creator
