PDA

View Full Version : QSplitter taking parenthood over its widgets



mak_user
5th April 2011, 22:25
I have custom made class that inherits QListView. I am creating object of this class with:

list = new QCustomList(this);
form the widget, lets say widget1.

Then this custom list is list is added to a QSplitter. When I try to get parentWidget from the custom widget I get that QSplitter is a parent. I keep m_parent at object creation to debug and this is what I get:
widget1(0xa032ee8) = QSplitter(0xa035608)
first pointer is m_parent and second is QCustomList->parentWidget()(the same is with parent()).

Is this behavior normal?
Should QSplitter really stole parenthood?
Is this happenings with other classes?

I have no problem in development. I am using m_parent and everything works fine. I am just curious to get answer on my questions.

wysota
5th April 2011, 22:40
Is this behavior normal?
Yes.

Should QSplitter really stole parenthood?
Yes.

Is this happenings with other classes?
Yes.