-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdirfiletree.cpp
36 lines (30 loc) · 1.02 KB
/
dirfiletree.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#include <QtGui>
#include <QHeaderView>
#include "dirfiletree.h"
namespace ShowListing{
DirFileTree::DirFileTree(QWidget *parent)
: QTreeWidget(parent)
{
QStringList labels;
labels << tr("Folder") << tr("Size");
QFont curFont(font());
curFont.setPointSizeF(8.5);
setFont(curFont);
QFont hedFont(header()->font());
hedFont.setPointSizeF(6);
header()->setFont(hedFont);
#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
header()->setResizeMode(QHeaderView::Interactive);
#else
header()->setSectionResizeMode(QHeaderView::Interactive);
#endif
setHeaderLabels(labels);
catalogPixmap = QPixmap("://ozturk_developerkit_paste.png");
catalogIcon.addPixmap(catalogPixmap);
folderIcon.addPixmap(style()->standardPixmap(QStyle::SP_DirClosedIcon),
QIcon::Normal, QIcon::Off);
folderIcon.addPixmap(style()->standardPixmap(QStyle::SP_DirOpenIcon),
QIcon::Normal, QIcon::On);
fileIcon.addPixmap(style()->standardPixmap(QStyle::SP_FileIcon));
}
}