File indexing completed on 2024-05-12 04:20:06
0001 /** 0002 * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved. 0003 * 0004 * This file is part of the KD Chart library. 0005 * 0006 * SPDX-License-Identifier: GPL-2.0-or-later 0007 */ 0008 0009 #include <QApplication> 0010 #include <KChartChart> 0011 #include <KChartBarDiagram> 0012 0013 0014 //class ChartWidget : public QWidget { 0015 // Q_OBJECT 0016 //public: 0017 // explicit ChartWidget(QWidget* parent=0) 0018 // : QWidget(parent) 0019 // { 0020 0021 // m_model.insertRows( 0, 2, QModelIndex() ); 0022 // m_model.insertColumns( 0, 3, QModelIndex() ); 0023 // for (int row = 0; row < 3; ++row) { 0024 // for (int column = 0; column < 3; ++column) { 0025 // QModelIndex index = m_model.index(row, column, QModelIndex()); 0026 // m_model.setData(index, QVariant(row+1 * column) ); 0027 // } 0028 // } 0029 0030 // KChart::BarDiagram* diagram = new KChart::BarDiagram; 0031 // diagram->setModel(&m_model); 0032 0033 // m_chart.coordinatePlane()->replaceDiagram(diagram); 0034 0035 // QVBoxLayout* l = new QVBoxLayout(this); 0036 // l->addWidget(&m_chart); 0037 // setLayout(l); 0038 // m_timer = new QTimer(this); 0039 // connect( m_timer, SIGNAL(timeout()), 0040 // this, SLOT(slotTimeout()) ); 0041 // m_timer->start( 200 ); 0042 // } 0043 0044 //private Q_SLOTS: 0045 // void slotTimeout() { 0046 // QModelIndex index = m_model.index( 0, 1, QModelIndex()); 0047 // qreal value = ( m_model.data( index ).toInt() % 24 ) +1; 0048 // m_model.setData( index, value ); 0049 // } 0050 0051 //private: 0052 // KChart::Chart m_chart; 0053 // QStandardItemModel m_model; 0054 // QTimer *m_timer; 0055 //}; 0056 0057 #include "mainwindow.h" 0058 0059 int main( int argc, char** argv ) { 0060 QApplication app( argc, argv ); 0061 0062 //ChartWidget w; 0063 MainWindow w; 0064 w.show(); 0065 0066 return app.exec(); 0067 } 0068 0069 //#include "main.moc"