PDA

View Full Version : d_func problem



cookieki
8th November 2010, 07:27
Hi,All.
I got the problem when subclassing QListWidgetPrivate.


#include <private/qlistwidget_p.h>
...
QItemSelectionModel::SelectionFlags QListWidgetPrivateEx::selectionCommand(const QModelIndex &index,const QEvent *event) const
{
Q_D(const QAbstractItemView);
...
}


compiler(vs2003) shows error.
'd_func': identifier not found, even with argument-dependent lookup
What's the problem?

SixDegrees
8th November 2010, 07:55
You've neglected to include some other header file needed by qlistwidget_p.h that contains the definition of 'd_func'.

cookieki
8th November 2010, 07:57
what's that file?

SixDegrees
8th November 2010, 08:13
I have no idea. Private implementations have no documentation in Qt. Grep around in the include directories where you found the private file you're using and see if you can locate where this particular d_func is defined.

Note that deriving from private implementations isn't something you should normally attempt. I assumed you knew what you were doing when you decided to go down that road. If you didn't, you should rethink your approach.

tbscope
8th November 2010, 08:50
I think they are in QtGlobal.h

wysota
8th November 2010, 08:51
Why would you even want to subclass QListWidgetPrivate?

cookieki
8th November 2010, 09:28
sorry, wait please. I'm changing post.