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"
31class QHeightModel : public QStringListModel {
34 QHash<int, QByteArray> roleNames() const override
36 QHash<int, QByteArray> roles;
37 roles.insert(Qt::DisplayRole, "modelHeight");
45 height = 50 + 50. * qrand() / RAND_MAX ;
47 QStringList sl = stringList();
48 sl << QString::number(height);
54 QStringList sl = stringList();
62int main(int argc, char *argv[])
64 QGuiApplication a(argc, argv);
66 QQuickView *view = new QQuickView();
67 view->setResizeMode(QQuickView::SizeRootObjectToView);
70 QStringList heightList;
71 heightList << "100" << "50" << "125";
72 model.setStringList(heightList);
74 QStringListModel listModel;
75 listModel.setStringList(QStringList() << QString());
77 view->rootContext()->setContextProperty("listModel", &listModel);
78 view->rootContext()->setContextProperty("vjModel", &model);
80 view->setSource(QUrl::fromLocalFile(testDataDir() + "/" TEST_DIR "/verticaljournaltry.qml"));
83 view->resize(530, 400);
85 QObject::connect(view->rootObject(), SIGNAL(add(int)), &model, SLOT(add(int)));
86 QObject::connect(view->rootObject(), SIGNAL(remove()), &model, SLOT(remove()));
91#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