File indexing completed on 2024-05-12 04:20:05

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 #ifndef MAINWINDOW_H
0010 #define MAINWINDOW_H
0011 
0012 #include "ui_mainwindow.h"
0013 #include <TableModel.h>
0014 #include <KChartDataValueAttributes>
0015 
0016 namespace KChart {
0017     class Chart;
0018     class BarDiagram;
0019 }
0020 
0021 class MainWindow : public QWidget, private Ui::MainWindow
0022 {
0023     Q_OBJECT
0024 
0025 public:
0026     MainWindow( QWidget* parent = nullptr );
0027 
0028 private Q_SLOTS:
0029     void on_scopeOneBarRB_toggled(  bool checked );
0030     void on_scopeBarDatasetSB_valueChanged( int i );
0031     void on_scopeBarItemSB_valueChanged(    int i );
0032     void on_scopeDatasetRB_toggled( bool checked );
0033     void on_scopeDatasetSB_valueChanged( int i );
0034     void on_scopeCommonRB_toggled( bool checked );
0035 
0036     void on_paintValuesCB_toggled( bool checked );
0037 
0038     void on_fontCombo_currentIndexChanged( const QString & text );
0039     void on_relativeSizeSB_valueChanged( int i );
0040     void on_minimumSizeSB_valueChanged(  int i );
0041     void on_rotationSB_valueChanged( int i );
0042 
0043     void on_posPosCombo_currentIndexChanged(   const QString & text );
0044     void on_posAlignCombo_currentIndexChanged( const QString & text );
0045     void on_posPadHoriSB_valueChanged( int i );
0046     void on_posPadVertSB_valueChanged( int i );
0047     void on_negPosCombo_currentIndexChanged(   const QString & text );
0048     void on_negAlignCombo_currentIndexChanged( const QString & text );
0049     void on_negPadHoriSB_valueChanged( int i );
0050     void on_negPadVertSB_valueChanged( int i );
0051 
0052     void on_labelLE_textEdited(  const QString & text );
0053     void on_prefixLE_textEdited( const QString & text );
0054     void on_suffixLE_textEdited( const QString & text );
0055 
0056 private:
0057     const QModelIndex currentIndex() const;
0058     const KChart::DataValueAttributes attributes() const;
0059     const char* positionToScreenName( const KChart::Position& pos ) const;
0060     const Qt::Alignment alignmentFromScreeName( const QString& name ) const;
0061     const QString alignmentToScreenName( const Qt::Alignment& align ) const;
0062     void populateWidgets();
0063     void setAttributes( const KChart::DataValueAttributes& da );
0064 
0065     KChart::Chart* m_chart;
0066     KChart::BarDiagram* m_bars;
0067     TableModel m_model;
0068 };
0069 
0070 
0071 #endif /* MAINWINDOW_H */
0072