mirror of
https://gitee.com/drabel/LibQQt.git
synced 2025-01-04 10:18:44 +08:00
44 lines
1.0 KiB
C++
Executable File
44 lines
1.0 KiB
C++
Executable File
#include "qqttreeview.h"
|
|
#include "ui_qqttreeview.h"
|
|
#include <QFile>
|
|
|
|
QQTTreeView::QQTTreeView(QWidget *parent) :
|
|
QTreeView(parent),
|
|
ui(new Ui::QQTTreeView)
|
|
{
|
|
ui->setupUi(this);
|
|
|
|
setSelectionMode(QAbstractItemView::SingleSelection);
|
|
setSelectionBehavior(QAbstractItemView::SelectRows);
|
|
setEditTriggers(QAbstractItemView::NoEditTriggers);
|
|
#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
|
|
header()->setResizeMode(QHeaderView::ResizeToContents);
|
|
#else
|
|
header()->setSectionResizeMode(QHeaderView::ResizeToContents);
|
|
#endif
|
|
|
|
#ifdef __MIPS_LINUX__
|
|
setFocusPolicy(Qt::NoFocus);
|
|
#endif
|
|
|
|
QFont fnt(font());
|
|
fnt.setPointSize(16);
|
|
setFont(fnt);
|
|
}
|
|
|
|
QQTTreeView::~QQTTreeView()
|
|
{
|
|
delete ui;
|
|
}
|
|
|
|
|
|
void QQTTreeView::drawRow(QPainter *painter, const QStyleOptionViewItem &options, const QModelIndex &index) const
|
|
{
|
|
return QTreeView::drawRow(painter, options, index);
|
|
}
|
|
|
|
void QQTTreeView::drawBranches(QPainter *painter, const QRect &rect, const QModelIndex &index) const
|
|
{
|
|
return QTreeView::drawBranches(painter, rect, index);
|
|
}
|