• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdeedu API Reference
  • KDE Home
  • Contact Us
 

Analitza

  • sources
  • kde-4.12
  • kdeedu
  • analitza
  • analitzagui
variablesmodel.h
Go to the documentation of this file.
1 /*************************************************************************************
2  * Copyright (C) 2007 by Aleix Pol <aleixpol@kde.org> *
3  * *
4  * This program is free software; you can redistribute it and/or *
5  * modify it under the terms of the GNU General Public License *
6  * as published by the Free Software Foundation; either version 2 *
7  * of the License, or (at your option) any later version. *
8  * *
9  * This program is distributed in the hope that it will be useful, *
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12  * GNU General Public License for more details. *
13  * *
14  * You should have received a copy of the GNU General Public License *
15  * along with this program; if not, write to the Free Software *
16  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA *
17  *************************************************************************************/
18 
19 #ifndef VARIABLESMODEL_H
20 #define VARIABLESMODEL_H
21 
22 #include <QAbstractTableModel>
23 #include "analitzaguiexport.h"
24 
25 namespace Analitza
26 {
27 class Variables;
28 class Expression;
29 
38 class ANALITZAGUI_EXPORT VariablesModel : public QAbstractTableModel
39 {
40  Q_OBJECT
41  Q_PROPERTY(Analitza::Variables* variables READ variables WRITE setVariables)
42  public:
44  explicit VariablesModel(QObject *parent=0);
45  VariablesModel(Analitza::Variables* v, QObject *parent=0);
46  void setVariables(Analitza::Variables* v);
47 
48  virtual QFlags< Qt::ItemFlag > flags(const QModelIndex& index) const;
49  bool setData(const QModelIndex& index, const QVariant& value, int role=Qt::EditRole);
50  QVariant data( const QModelIndex &index, int role=Qt::DisplayRole) const;
51  QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const;
52  int rowCount(const QModelIndex &parent) const;
53  int columnCount(const QModelIndex &) const { return 2; }
54 
55  void insertVariable(const QString& name, const Analitza::Expression& value);
56  void setEditable(bool ed) { m_editable=ed; }
57 
58  Analitza::Variables* variables() const { return m_vars; }
59  public slots:
61  void updateInformation();
62 
63  private:
64  Analitza::Variables *m_vars;
65  bool m_editable;
66 };
67 
68 }
69 #endif
analitzaguiexport.h
ANALITZAGUI_EXPORT
#define ANALITZAGUI_EXPORT
Definition: analitzaguiexport.h:28
Analitza::VariablesModel::columnCount
int columnCount(const QModelIndex &) const
Definition: variablesmodel.h:53
Analitza::VariablesModel
Is a model class that has a relation of all operators string with their VariableType.
Definition: variablesmodel.h:38
Analitza::VariablesModel::variables
Analitza::Variables * variables() const
Definition: variablesmodel.h:58
QAbstractTableModel
Analitza::VariablesModel::setEditable
void setEditable(bool ed)
Definition: variablesmodel.h:56
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:35:21 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

Analitza

Skip menu "Analitza"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Modules
  • Related Pages

kdeedu API Reference

Skip menu "kdeedu API Reference"
  • Analitza
  •     lib
  • kalgebra
  • kalzium
  •   libscience
  • kanagram
  • kig
  •   lib
  • klettres
  • kstars
  • libkdeedu
  •   keduvocdocument
  • marble
  • parley
  • rocs
  •   App
  •   RocsCore
  •   VisualEditor
  •   stepcore

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal