0

I have a problem with Qt 5.5 and QTreeView. qtreeview.h (Yes, it's from Qt folder) has compiler error:

fatal error: QTreeViewPrivate: No such file or directory.

My Qt5.5 library doesn't know about QTreeViewPrivate, but qtreeview.h needs it. Every simple code like this QTreeWidget *fileList = new QTreeWidget(); or else linked to QTreeView makes my complier angry! Maybe it's some bug? Where is QTreeViewPrivate ?

demonplus
  • 5,613
  • 12
  • 49
  • 68
Paolo
  • 104
  • 4
  • 2
    If you are not compiling Qt you should not need private implementations. If you do I would file a bug at qt.io. – drescherjm Feb 01 '16 at 15:58
  • Well, I'm not compliing Qt, I'm beginer, all I wanna is to use treewidget, but this error makes me sad ( maybe I need other headers without private implementations – Paolo Feb 01 '16 at 18:10

3 Answers3

0

Check if you added the correct library to your project file:

QT += widgets

See documentation: http://doc.qt.io/qt-5/qtreeview.html

RvdK
  • 19,580
  • 4
  • 64
  • 107
0

Check if you added the correct Qt folder path to your project.

In project properties, c/c++ general libraries.

RealityTS
  • 1
  • 4
  • path is correct, other features works good, but when some .h-file links to Private ( TreeViewPrivate, TableViewPrivate, etc.) error occurs – Paolo Feb 01 '16 at 15:39
0

Well, I found the solution. To use QTableWidget that no need QTableViewPrivate's header I edit qtableview.h in my Qt folder, I replased #include <QTreeViewPrivate> to class QTreeViewPrivate;. Now code works fine!

Paolo
  • 104
  • 4