+++ /dev/null
-/*
- Copyright (C) 2012 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com
- Author: Kevin Krammer, krake@kdab.com
- Author: Tobias Koenig, tokoe@kdab.com
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation, Inc.,
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-*/
-
-#include "declarativetreeview_p.h"
-
-DeclarativeTreeView::DeclarativeTreeView(QObject *parent)
- : DeclarativeWidgetProxy<TreeView>(parent)
-{
- connectAllSignals(m_proxiedObject, this);
-}
-
-CUSTOM_METAOBJECT(DeclarativeTreeView, TreeView)
+++ /dev/null
-/*
- Copyright (C) 2012 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com
- Author: Kevin Krammer, krake@kdab.com
- Author: Tobias Koenig, tokoe@kdab.com
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation, Inc.,
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-*/
-
-#ifndef DECLARATIVETREEVIEW_P_H
-#define DECLARATIVETREEVIEW_P_H
-
-#include "declarativewidgetproxy_p.h"
-
-#include "objectadaptors_p.h"
-
-class DeclarativeTreeView : public DeclarativeWidgetProxy<TreeView>
-{
- DECLARATIVE_OBJECT
-
- public:
- explicit DeclarativeTreeView(QObject *parent = 0);
-};
-
-#endif
#include "declarativetexteditextension_p.h"
#include "declarativetimeedit_p.h"
#include "declarativetoolbarextension_p.h"
-#include "declarativetreeview_p.h"
#include "declarativevboxlayout_p.h"
#include "declarativewidgetextension.h"
#include <QRadioButton>
#include <QToolBar>
#include <QToolButton>
+#include <QTreeView>
#include <QWebView>
class DeclarativeWidgetsDocument::Private
qmlRegisterType<DeclarativeTabWidgetAttached>();
qmlRegisterType<DeclarativeTextBrowser>("QtGui", 1, 0, "TextBrowser");
qmlRegisterType<DeclarativeTimeEdit>("QtGui", 1, 0, "TimeEdit");
- qmlRegisterType<DeclarativeTreeView>("QtGui", 1, 0, "TreeView");
*/
// objects
qmlRegisterExtendedType<QTextEdit, DeclarativeTextEditExtension>("QtGui", 1, 0, "TextEdit");
qmlRegisterExtendedType<QToolBar, DeclarativeToolBarExtension>("QtGui", 1, 0, "ToolBar");
qmlRegisterExtendedType<QToolButton, DeclarativeWidgetExtension>("QtGui", 1, 0, "ToolButton");
+ qmlRegisterExtendedType<QTreeView, DeclarativeItemViewExtension>("QtGui", 1, 0, "TreeView");
qmlRegisterExtendedType<QWebView, DeclarativeWidgetExtension>("QtGui", 1, 0, "WebView");
qmlRegisterExtendedType<QWidget, DeclarativeWidgetExtension>("QtGui", 1, 0, "Widget");
declarativetexteditextension_p.h \
declarativetimeedit_p.h \
declarativetoolbarextension_p.h \
- declarativetreeview_p.h \
declarativevboxlayout_p.h \
declarativewidgetextension.h \
declarativewidgetproxy_p.h \
declarativetexteditextension.cpp \
declarativetimeedit.cpp \
declarativetoolbarextension.cpp \
- declarativetreeview.cpp \
declarativevboxlayout.cpp \
declarativewidgetextension.cpp \
declarativewidgetsdocument.cpp \
emit selectionModelChanged(selectionModel);
}
-
-// TreeView
-TreeView::TreeView(QWidget *parent)
- : QTreeView(parent)
-{
-}
-
-void TreeView::setModel(QAbstractItemModel *model)
-{
- if (this->model() == model)
- return;
-
- QTreeView::setModel(model);
-
- emit modelChanged(model);
- emit selectionModelChanged(selectionModel());
-}
-
-void TreeView::setSelectionModel(QItemSelectionModel *selectionModel)
-{
- if (this->selectionModel() == selectionModel)
- return;
-
- QTreeView::setSelectionModel(selectionModel);
-
- emit selectionModelChanged(selectionModel);
-}
#include <QMenu>
#include <QPointer>
#include <QTableView>
-#include <QTreeView>
class ColumnView : public QColumnView
{
void selectionModelChanged(QItemSelectionModel*);
};
-class TreeView : public QTreeView
-{
- Q_OBJECT
-
- Q_PROPERTY(QAbstractItemModel* model READ model WRITE setModel NOTIFY modelChanged)
- Q_PROPERTY(QItemSelectionModel* selectionModel READ selectionModel WRITE setSelectionModel NOTIFY selectionModelChanged)
-
- public:
- explicit TreeView(QWidget *parent = 0);
-
- void setModel(QAbstractItemModel *model);
- void setSelectionModel(QItemSelectionModel *selectionModel);
-
- Q_SIGNALS:
- void modelChanged(QAbstractItemModel*);
- void selectionModelChanged(QItemSelectionModel*);
-};
-
#endif