Results 1 to 7 of 7

Thread: d_func problem

  1. #1
    Join Date
    Nov 2010
    Posts
    8
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default d_func problem

    Hi,All.
    I got the problem when subclassing QListWidgetPrivate.
    Qt Code:
    1. #include <private/qlistwidget_p.h>
    2. ...
    3. QItemSelectionModel::SelectionFlags QListWidgetPrivateEx::selectionCommand(const QModelIndex &index,const QEvent *event) const
    4. {
    5. Q_D(const QAbstractItemView);
    6. ...
    7. }
    To copy to clipboard, switch view to plain text mode 

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

  2. #2
    Join Date
    Apr 2010
    Posts
    769
    Thanks
    1
    Thanked 94 Times in 86 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: d_func problem

    You've neglected to include some other header file needed by qlistwidget_p.h that contains the definition of 'd_func'.

  3. #3
    Join Date
    Nov 2010
    Posts
    8
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: d_func problem

    what's that file?

  4. #4
    Join Date
    Apr 2010
    Posts
    769
    Thanks
    1
    Thanked 94 Times in 86 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: d_func problem

    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.

  5. #5
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: d_func problem

    I think they are in QtGlobal.h

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,017 Times in 4,793 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: d_func problem

    Why would you even want to subclass QListWidgetPrivate?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  7. #7
    Join Date
    Nov 2010
    Posts
    8
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: d_func problem

    sorry, wait please. I'm changing post.
    Last edited by cookieki; 8th November 2010 at 09:38.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.