2 * Copyright (C) 2013 Canonical, Ltd.
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19#include <QGuiApplication>
21#include <QtQml/qqml.h>
22#include <QStringListModel>
25#include <QGuiApplication>
27#include "verticaljournal.h"
29class QHeightModel : public QStringListModel {
32 QHash<int, QByteArray> roleNames() const
34 QHash<int, QByteArray> roles;
35 roles.insert(Qt::DisplayRole, "modelHeight");
43 height = 50 + 50. * qrand() / RAND_MAX ;
45 QStringList sl = stringList();
46 sl << QString::number(height);
52 QStringList sl = stringList();
60int main(int argc, char *argv[])
62 QGuiApplication a(argc, argv);
64 QQuickView *view = new QQuickView();
65 view->setResizeMode(QQuickView::SizeRootObjectToView);
66 view->engine()->addImportPath(BUILT_PLUGINS_DIR);
69 QStringList heightList;
70 heightList << "100" << "50" << "125";
71 model.setStringList(heightList);
73 QStringListModel listModel;
74 listModel.setStringList(QStringList() << QString());
76 view->rootContext()->setContextProperty("listModel", &listModel);
77 view->rootContext()->setContextProperty("vjModel", &model);
79 view->setSource(QUrl::fromLocalFile(DASHVIEWSTEST_FOLDER "/verticaljournaltry.qml"));
82 view->resize(530, 400);
84 QObject::connect(view->rootObject(), SIGNAL(add(int)), &model, SLOT(add(int)));
85 QObject::connect(view->rootObject(), SIGNAL(remove()), &model, SLOT(remove()));
90#include "verticaljournaltry.moc"
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list