JKQTPlotter trunk/v5.0.0
an extensive Qt5+Qt6 Plotter framework (including a feature-richt plotter widget, a speed-optimized, but limited variant and a LaTeX equation renderer!), written fully in C/C++ and without external dependencies
Loading...
Searching...
No Matches
jkqtmathtextlabel.h
1/*
2 Copyright (c) 2008-2024 Jan W. Krieger (<jan@jkrieger.de>)
3 with contributions from: Razi Alavizadeh
4
5
6
7 This software is free software: you can redistribute it and/or modify
8 it under the terms of the GNU Lesser General Public License (LGPL) as published by
9 the Free Software Foundation, either version 2.1 of the License, or
10 (at your option) any later version.
11
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU Lesser General Public License (LGPL) for more details.
16
17 You should have received a copy of the GNU Lesser General Public License (LGPL)
18 along with this program. If not, see <http://www.gnu.org/licenses/>.
19*/
20
21
22
23#ifndef JKQTMATHTEXTLABEL_H
24#define JKQTMATHTEXTLABEL_H
25
26#include "jkqtmathtext/jkqtmathtext_imexport.h"
27#include "jkqtmathtext/jkqtmathtext.h"
28#include <QWidget>
29#include <QLabel>
30
31
32
33/*! \brief A QLabel-derived class that draws an equation with LaTeX markup using JKQTMathText
34 \ingroup jkqtmathtext_widgets
35
36 \see JKQTMathText
37*/
39 Q_OBJECT
40 public:
41 explicit JKQTMathTextLabel(QWidget* parent=nullptr);
43
44 /** \brief returns the internal JKQTMathText instance used for drawing
45 *
46 * Use this function to set the font, font size and other properties of the used renderer.
47 */
49 /** \brief set the equation to draw */
50 void setMath(const QString& text, bool doRepaint=true);
51 protected:
53 QString lastText;
54 QPixmap buffer;
57
58 void paintEvent(QPaintEvent * event);
59};
60
61
62#endif // JKQTMATHTEXTLABEL_H
63
this class parses a mathematical markup string and can then draw the contained text/equation onto a Q...
Definition jkqtmathtext.h:192
A QLabel-derived class that draws an equation with LaTeX markup using JKQTMathText.
Definition jkqtmathtextlabel.h:38
JKQTMathText * m_mathText
Definition jkqtmathtextlabel.h:52
void paintEvent(QPaintEvent *event)
virtual ~JKQTMathTextLabel()
QPixmap buffer
Definition jkqtmathtextlabel.h:54
bool repaintDo
Definition jkqtmathtextlabel.h:55
JKQTMathTextLabel(QWidget *parent=nullptr)
void setMath(const QString &text, bool doRepaint=true)
set the equation to draw
QString lastText
Definition jkqtmathtextlabel.h:53
JKQTMathText * getMathText() const
returns the internal JKQTMathText instance used for drawing
#define JKQTMATHTEXT_LIB_EXPORT
Definition jkqtmathtext_imexport.h:108