fixed some build related problems
[qsqlmon.git] / libqf / libqfgui / gui / widgets / qfprototypedobjecttreemodel / qfprototypedobjecttreeview.cpp
blobd9d57217179be4887ca8641ca97fb24942a401c3
2 //
3 // Author: Frantisek Vacek <fanda.vacek@volny.cz>, (C) 2010
4 //
5 // Copyright: See COPYING file that comes with this distribution
6 //
8 #include "qfprototypedobjecttreeview.h"
10 #include <qfprototypedobjectdelegate.h>
12 #include <QKeyEvent>
13 #include <QHeaderView>
15 #include <qflogcust.h>
17 //=================================================
18 // QFPrototypedObjectTreeView
19 //=================================================
20 QFPrototypedObjectTreeView::QFPrototypedObjectTreeView(QWidget *parent)
21 : QFTreeView(parent)
23 setItemDelegate(new QFPrototypedObjectDelegate(this));
24 //setStyleSheet("QTreeView { alternate-background-color: yellow; }");
25 header()->setStretchLastSection(false);
28 QFPrototypedObjectTreeView::~QFPrototypedObjectTreeView()
32 void QFPrototypedObjectTreeView::keyPressEvent(QKeyEvent *e)
34 qfLogFuncFrame();
35 QFTreeView::keyPressEvent(e);
36 if(e->key() == Qt::Key_Return || (e->key() == Qt::Key_Enter && e->modifiers() == Qt::KeypadModifier)) {
37 e->accept();
39 qfTrash() << "\t accepted:" << e->isAccepted();
42 void QFPrototypedObjectTreeView::reset()
44 qfLogFuncFrame();
45 QFTreeView::reset();
46 setExpandedRecursively(QModelIndex());
47 header()->resizeSections(QHeaderView::ResizeToContents);