I am trying to extend the Qt example FlowLayout to include the insertWidgetAt(int position, QWidget* w) method.
I wrote (borrowed the code from QBoxLayout):
//public:
void FlowLayout
::insertWidgetAt(int pos,
QWidget *w
){ addChildWidget(w);
insertItem(pos,QLayoutPrivate::createWidgetItem(this, w)); //***
invalidate();
}
//private:
void FlowLayout
::insertItem(int pos,
QLayoutItem *item
){ itemList.insert(pos,item);
}
//public:
void FlowLayout::insertWidgetAt(int pos,QWidget *w){
addChildWidget(w);
insertItem(pos,QLayoutPrivate::createWidgetItem(this, w)); //***
invalidate();
}
//private:
void FlowLayout::insertItem(int pos,QLayoutItem *item){
itemList.insert(pos,item);
}
To copy to clipboard, switch view to plain text mode
At the line marked with //***, gcc gives "incomplete type `QLayoutPrivate' used in nested name specifier" error. What should I do to implement the method?
Bookmarks