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

kalgebra

  • sources
  • kde-4.14
  • kdeedu
  • kalgebra
  • src
functionedit.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 FUNCTIONEDIT_H
20 #define FUNCTIONEDIT_H
21 
22 #include <QLabel>
23 #include <QWidget>
24 #include <QPushButton>
25 #include <QComboBox>
26 
27 #include <KColorCombo>
28 #include <KLineEdit>
29 
30 class KTabWidget;
31 namespace Analitza
32 {
33 class Variables;
34 class Expression;
35 class PlotsView2D;
36 class PlotsModel;
37 class PlaneCurve;
38 class ExpressionEdit;
39 }
40 
46 class FunctionEdit : public QWidget
47 {
48 Q_OBJECT
49 public:
51  explicit FunctionEdit(QWidget *parent=0);
52 
54  ~FunctionEdit();
55 
57  Analitza::Expression expression() const;
58 
59  Analitza::PlaneCurve* createFunction() const;
60 
62  void setFunction(const QString &newText);
63 
65  QColor color() const { return m_color->color(); }
66 
68  void setColor(const QColor &newColor);
69 
71  bool editing() const { return m_modmode; }
72 
74  void setEditing(bool m);
75 
77  void setName(const QString& name) { m_name->setText(name); }
78 
80  QString name() const { return m_name->text(); }
81 
83  void setVariables(Analitza::Variables* v) { m_vars=v; }
84 
85  Analitza::Variables* variables() const { return m_vars; }
86 
87  void setOptionsShown(bool shown);
88 
89  virtual void resizeEvent(QResizeEvent* ev);
90 
91 public slots:
93  void clear();
94 
95 signals:
97  void accept();
98 
100  void removeEditingPlot();
101 
102 private slots:
103  void edit();
104  void ok();
105  void colorChange(int);
106  void updateUplimit();
107  void updateDownlimit();
108 
109 private:
110  void setState(const QString& text, bool negative);
111  void focusInEvent(QFocusEvent*);
112 
113  Analitza::ExpressionEdit *m_func;
114  Analitza::ExpressionEdit *m_uplimit, *m_downlimit;
115  double m_calcUplimit, m_calcDownlimit;
116  KLineEdit *m_name;
117  QPushButton *m_ok;
118  QLabel *m_valid;
119  QLabel *m_validIcon;
120  Analitza::PlotsView2D *m_graph;
121  KColorCombo *m_color;
122  Analitza::PlotsModel *m_funcsModel;
123  Analitza::Variables* m_vars;
124 
125  bool m_modmode;
126  KTabWidget* m_viewTabs;
127  QPushButton* m_remove;
128 };
129 
130 #endif
FunctionEdit::setOptionsShown
void setOptionsShown(bool shown)
Definition: functionedit.cpp:308
QResizeEvent
QWidget
FunctionEdit::FunctionEdit
FunctionEdit(QWidget *parent=0)
Constructor.
Definition: functionedit.cpp:47
FunctionEdit::~FunctionEdit
~FunctionEdit()
Destructor.
Definition: functionedit.cpp:140
FunctionEdit::expression
Analitza::Expression expression() const
Retrieves the resulting expression text.
Definition: functionedit.cpp:303
FunctionEdit::setEditing
void setEditing(bool m)
Sets whether we are editing or adding a function.
Definition: functionedit.cpp:319
FunctionEdit::clear
void clear()
Clears the dialog.
Definition: functionedit.cpp:143
FunctionEdit::removeEditingPlot
void removeEditingPlot()
asks the currently edited plot to be removed.
QString
QColor
FunctionEdit::accept
void accept()
Tells that the result has been accepted.
FunctionEdit
The FunctionEdit dialog provides a way to specify functions.
Definition: functionedit.h:46
FunctionEdit::setName
void setName(const QString &name)
Sets a name to the function.
Definition: functionedit.h:77
FunctionEdit::resizeEvent
virtual void resizeEvent(QResizeEvent *ev)
Definition: functionedit.cpp:313
FunctionEdit::color
QColor color() const
Retrieves the selected color for the function.
Definition: functionedit.h:65
FunctionEdit::variables
Analitza::Variables * variables() const
Definition: functionedit.h:85
QPushButton
FunctionEdit::setVariables
void setVariables(Analitza::Variables *v)
Sets the variables class to be used with the graph functions.
Definition: functionedit.h:83
FunctionEdit::setFunction
void setFunction(const QString &newText)
Sets an expression text to the ExpressionEdit widget.
Definition: functionedit.cpp:150
FunctionEdit::createFunction
Analitza::PlaneCurve * createFunction() const
Definition: functionedit.cpp:291
FunctionEdit::setColor
void setColor(const QColor &newColor)
Sets the selected color for the function.
Definition: functionedit.cpp:156
FunctionEdit::name
QString name() const
Retrieves a name for the function.
Definition: functionedit.h:80
QLabel
QObject::parent
QObject * parent() const
QFocusEvent
FunctionEdit::editing
bool editing() const
Returns whether we are editing or adding a function.
Definition: functionedit.h:71
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:11:49 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kalgebra

Skip menu "kalgebra"
  • Main Page
  • Namespace List
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdeedu API Reference

Skip menu "kdeedu API Reference"
  • Analitza
  •     lib
  • kalgebra
  • kalzium
  •   libscience
  • kanagram
  • kig
  •   lib
  • klettres
  • 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