Warning, file /graphics/kdiagram/examples/demo/main.cpp was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001 /** 0002 * Copyright (C) 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved. 0003 * 0004 * This file is part of the KD Chart library. 0005 * 0006 * This program is free software; you can redistribute it and/or 0007 * modify it under the terms of the GNU General Public License as 0008 * published by the Free Software Foundation; either version 2 of 0009 * the License, or (at your option) any later version. 0010 * 0011 * This program is distributed in the hope that it will be useful, 0012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 0013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 0014 * GNU General Public License for more details. 0015 * 0016 * You should have received a copy of the GNU General Public License 0017 * along with this program. If not, see <https://www.gnu.org/licenses/>. 0018 */ 0019 0020 #include <QApplication> 0021 #include <KChartChart> 0022 #include <KChartBarDiagram> 0023 0024 0025 //class ChartWidget : public QWidget { 0026 // Q_OBJECT 0027 //public: 0028 // explicit ChartWidget(QWidget* parent=0) 0029 // : QWidget(parent) 0030 // { 0031 0032 // m_model.insertRows( 0, 2, QModelIndex() ); 0033 // m_model.insertColumns( 0, 3, QModelIndex() ); 0034 // for (int row = 0; row < 3; ++row) { 0035 // for (int column = 0; column < 3; ++column) { 0036 // QModelIndex index = m_model.index(row, column, QModelIndex()); 0037 // m_model.setData(index, QVariant(row+1 * column) ); 0038 // } 0039 // } 0040 0041 // KChart::BarDiagram* diagram = new KChart::BarDiagram; 0042 // diagram->setModel(&m_model); 0043 0044 // m_chart.coordinatePlane()->replaceDiagram(diagram); 0045 0046 // QVBoxLayout* l = new QVBoxLayout(this); 0047 // l->addWidget(&m_chart); 0048 // setLayout(l); 0049 // m_timer = new QTimer(this); 0050 // connect( m_timer, SIGNAL(timeout()), 0051 // this, SLOT(slotTimeout()) ); 0052 // m_timer->start( 200 ); 0053 // } 0054 0055 //private Q_SLOTS: 0056 // void slotTimeout() { 0057 // QModelIndex index = m_model.index( 0, 1, QModelIndex()); 0058 // qreal value = ( m_model.data( index ).toInt() % 24 ) +1; 0059 // m_model.setData( index, value ); 0060 // } 0061 0062 //private: 0063 // KChart::Chart m_chart; 0064 // QStandardItemModel m_model; 0065 // QTimer *m_timer; 0066 //}; 0067 0068 #include "mainwindow.h" 0069 0070 int main( int argc, char** argv ) { 0071 QApplication app( argc, argv ); 0072 0073 //ChartWidget w; 0074 MainWindow w; 0075 w.show(); 0076 0077 return app.exec(); 0078 } 0079 0080 //#include "main.moc"