File indexing completed on 2024-10-13 03:39:00

0001 /*
0002     This file is part of the proxy model test suite.
0003 
0004     SPDX-FileCopyrightText: 2009 Stephen Kelly <steveire@gmail.com>
0005 
0006     SPDX-License-Identifier: LGPL-2.1-or-later
0007 */
0008 
0009 #include "reparentingpmwidget.h"
0010 
0011 #include <QSplitter>
0012 #include <QTreeView>
0013 #include <QVBoxLayout>
0014 
0015 #include "dynamictreemodel.h"
0016 #include "dynamictreewidget.h"
0017 #include "scriptablereparentingwidget.h"
0018 
0019 ReparentingProxyModelWidget::ReparentingProxyModelWidget(QWidget *parent)
0020     : QWidget(parent)
0021 {
0022     QVBoxLayout *layout = new QVBoxLayout(this);
0023 
0024     QSplitter *vSplitter = new QSplitter(this);
0025     layout->addWidget(vSplitter);
0026 
0027     m_rootModel = new DynamicTreeModel(this);
0028 
0029     DynamicTreeWidget *dynamicTreeWidget = new DynamicTreeWidget(m_rootModel, vSplitter);
0030     dynamicTreeWidget->setInitialTree(
0031         QLatin1String("- 1"
0032                       "- 2"
0033                       "- - 3"
0034                       "- - - 4"
0035                       "- 5"
0036                       "- 6"
0037                       "- 7"));
0038 
0039     new ScriptableReparentingWidget(m_rootModel, vSplitter);
0040 }
0041 
0042 #include "moc_reparentingpmwidget.cpp"