reorganized folder structure in root directory (there are now distinct folders for INCLUDE, STATIC, DYNAMIC libs and examples moved to the folder examples)

This commit is contained in:
Jan W. Krieger 2018-12-28 17:46:47 +01:00
parent 9d43cd67cf
commit 5beed78563
269 changed files with 37951 additions and 37768 deletions

View File

@ -1,6 +1,7 @@
TEMPLATE = subdirs TEMPLATE = subdirs
SUBDIRS += jkqtplotterlib \ SUBDIRS += jkqtplotterlib \
jkqtplotterlib_sharedlib \
jkqtmathtext_simpletest \ jkqtmathtext_simpletest \
jkqtplot_test \ jkqtplot_test \
jkqtplotter_simpletest \ jkqtplotter_simpletest \
@ -8,31 +9,33 @@ SUBDIRS += jkqtplotterlib \
jkqtfastplotter_test jkqtfastplotter_test
jkqtplotterlib.file = lib/jkqtplotterlib.pro jkqtplotterlib.file = staticlib/jkqtplotterlib.pro
jkqtmathtext_simpletest.subdir = test/jkqtmathtext_simpletest jkqtplotterlib_sharedlib.file = sharedlib/jkqtplotterlib_sharedlib.pro
jkqtmathtext_simpletest.subdir = examples/jkqtmathtext_simpletest
jkqtmathtext_simpletest.depends = jkqtplotterlib jkqtmathtext_simpletest.depends = jkqtplotterlib
jkqtmathtext_test.subdir = test/jkqtmathtext_test jkqtmathtext_test.subdir = examples/jkqtmathtext_test
jkqtmathtext_test.depends = jkqtplotterlib jkqtmathtext_test.depends = jkqtplotterlib
jkqtplot_test.subdir = test/jkqtplot_test jkqtplot_test.subdir = examples/jkqtplot_test
jkqtplot_test.depends = jkqtplotterlib jkqtplot_test.depends = jkqtplotterlib
jkqtplotter_simpletest.file = test/simpletest/jkqtplotter_simpletest.pro jkqtplotter_simpletest.file = examples/simpletest/jkqtplotter_simpletest.pro
jkqtplotter_simpletest.depends = jkqtplotterlib jkqtplotter_simpletest.depends = jkqtplotterlib
test_multiplot.file = test/test_multiplot/test_multiplot.pro test_multiplot.file = examples/test_multiplot/test_multiplot.pro
test_multiplot.depends = jkqtplotterlib test_multiplot.depends = jkqtplotterlib
jkqtfastplotter_test.file = $$PWD/test/jkqtfastplotter_test/jkqtfastplotter_test.pro jkqtfastplotter_test.file = $$PWD/examples/jkqtfastplotter_test/jkqtfastplotter_test.pro
jkqtfastplotter_test.depends = jkqtplotterlib jkqtfastplotter_test.depends = jkqtplotterlib
defineTest(addSimpleTest) { defineTest(addSimpleTest) {
test_name = $$1 test_name = $$1
SUBDIRS += jkqtplotter_simpletest_$${test_name} SUBDIRS += jkqtplotter_simpletest_$${test_name}
jkqtplotter_simpletest_$${test_name}.file = test/simpletest_$${test_name}/jkqtplotter_simpletest_$${test_name}.pro jkqtplotter_simpletest_$${test_name}.file = examples/simpletest_$${test_name}/jkqtplotter_simpletest_$${test_name}.pro
jkqtplotter_simpletest_$${test_name}.depends = jkqtplotterlib jkqtplotter_simpletest_$${test_name}.depends = jkqtplotterlib
export (jkqtplotter_simpletest_$${test_name}.file) export (jkqtplotter_simpletest_$${test_name}.file)

View File

@ -1,8 +1,8 @@
# JKQtPlotter # JKQtPlotter
This is an extensive library of function/data plotter classes for Qt (>= 4.7, tested with Qt up to 5.11). This is an extensive library of function/data plotter classes for Qt (>= 4.7, tested with Qt up to 5.11).
This software is licensed under the term of the GNU Lesser General Public License 2.1 This software is licensed under the term of the [GNU Lesser General Public License 2.1
(LGPL 2.1) or above. (LGPL 2.1)](https://github.com/jkriege2/JKQtPlotter/blob/master/LICENSE) or above.
## Continuous Integration Status ## Continuous Integration Status
[![Build status](https://ci.appveyor.com/api/projects/status/vq2o9pfi97isxm2a/branch/master?svg=true)](https://ci.appveyor.com/project/jkriege2/jkqtplotter/branch/master) [![Build status](https://ci.appveyor.com/api/projects/status/vq2o9pfi97isxm2a/branch/master?svg=true)](https://ci.appveyor.com/project/jkriege2/jkqtplotter/branch/master)
@ -11,6 +11,11 @@ This software is licensed under the term of the GNU Lesser General Public Licens
## Screenshots ## Screenshots
[Screenshots directory](https://github.com/jkriege2/JKQtPlotter/tree/master/screenshots) [Screenshots directory](https://github.com/jkriege2/JKQtPlotter/tree/master/screenshots)
## Building
Building instructions can be found here:
- include necessary files into QMake project: [`./lib/*.pri`](https://github.com/jkriege2/JKQtPlotter/tree/master/lib)
- build a static library: [`./staticlib/*.pro`](https://github.com/jkriege2/JKQtPlotter/tree/master/staticlib)
- build a shared library (DLL): [`./sharedlib/*.pro`](https://github.com/jkriege2/JKQtPlotter/tree/master/sharedlib)
## Examples ## Examples
This section assembles some simple examples of usage. This section assembles some simple examples of usage.
@ -21,49 +26,49 @@ All test-projects are Qt-projects that use qmake to build. You can load them int
| Screenshot | Description | Notes | | Screenshot | Description | Notes |
|:-------------:| ------------- | ------------- | |:-------------:| ------------- | ------------- |
| [![](https://raw.githubusercontent.com/jkriege2/JKQtPlotter/master/screenshots/jkqtplotter_simpletest1_small.png)](https://github.com/jkriege2/JKQtPlotter/tree/master/test/simpletest) | [Very Basic Example (Line Graph)](https://github.com/jkriege2/JKQtPlotter/tree/master/test/simpletest) | `JKQTPxyLineGraph`<br/>C++-style QVector arrays of data | | [![](https://raw.githubusercontent.com/jkriege2/JKQtPlotter/master/screenshots/jkqtplotter_simpletest1_small.png)](https://github.com/jkriege2/JKQtPlotter/tree/master/examples/simpletest) | [Very Basic Example (Line Graph)](https://github.com/jkriege2/JKQtPlotter/tree/master/examples/simpletest) | `JKQTPxyLineGraph`<br/>C++-style QVector arrays of data |
| [![](https://raw.githubusercontent.com/jkriege2/JKQtPlotter/master/screenshots/jkqtplotter_simpletest_speed_small.png)](https://github.com/jkriege2/JKQtPlotter/tree/master/test/simpletest_speed) | [Line Graph with Live Data / Speed Test](https://github.com/jkriege2/JKQtPlotter/tree/master/test/simpletest_speed) | `JKQTPxyLineGraph`<br/>external `std::array<double,N>` data, not owned by datastore<br/>live-data, measure plotting speed<br/>tipps to increas plotting speed | | [![](https://raw.githubusercontent.com/jkriege2/JKQtPlotter/master/screenshots/jkqtplotter_simpletest_speed_small.png)](https://github.com/jkriege2/JKQtPlotter/tree/master/examples/simpletest_speed) | [Line Graph with Live Data / Speed Test](https://github.com/jkriege2/JKQtPlotter/tree/master/examples/simpletest_speed) | `JKQTPxyLineGraph`<br/>external `std::array<double,N>` data, not owned by datastore<br/>live-data, measure plotting speed<br/>tipps to increas plotting speed |
| [![](https://raw.githubusercontent.com/jkriege2/JKQtPlotter/master/screenshots/jkqtplotter_simpletest_symbols_and_styles_small.png)](https://github.com/jkriege2/JKQtPlotter/tree/master/test/simpletest_symbols_and_styles) | [Line Graph with Different Symbols and Line Styles](https://github.com/jkriege2/JKQtPlotter/tree/master/test/simpletest_symbols_and_styles) | `JKQTPxyLineGraph`<br/>C++ vector of data<br/>setting line styles and symbol styles<br/>automatic graph coloring | | [![](https://raw.githubusercontent.com/jkriege2/JKQtPlotter/master/screenshots/jkqtplotter_simpletest_symbols_and_styles_small.png)](https://github.com/jkriege2/JKQtPlotter/tree/master/examples/simpletest_symbols_and_styles) | [Line Graph with Different Symbols and Line Styles](https://github.com/jkriege2/JKQtPlotter/tree/master/examples/simpletest_symbols_and_styles) | `JKQTPxyLineGraph`<br/>C++ vector of data<br/>setting line styles and symbol styles<br/>automatic graph coloring |
| [![](https://raw.githubusercontent.com/jkriege2/JKQtPlotter/master/screenshots/jkqtplotter_simpletest_stepplots_small.png)](https://github.com/jkriege2/JKQtPlotter/tree/master/test/simpletest_stepplots) | [Step Line Plots in Different Styles](https://github.com/jkriege2/JKQtPlotter/tree/master/test/simpletest_stepplots) | `JKQTPstepHorizontalGraph` (and `JKQTPxyLineGraph`)<br/>C++ vector of data<br/>different step modes, filled and line-only | | [![](https://raw.githubusercontent.com/jkriege2/JKQtPlotter/master/screenshots/jkqtplotter_simpletest_stepplots_small.png)](https://github.com/jkriege2/JKQtPlotter/tree/master/examples/simpletest_stepplots) | [Step Line Plots in Different Styles](https://github.com/jkriege2/JKQtPlotter/tree/master/examples/simpletest_stepplots) | `JKQTPstepHorizontalGraph` (and `JKQTPxyLineGraph`)<br/>C++ vector of data<br/>different step modes, filled and line-only |
| [![](https://raw.githubusercontent.com/jkriege2/JKQtPlotter/master/screenshots/jkqtplotter_simpletest_symbols_and_errors_small.png)](https://github.com/jkriege2/JKQtPlotter/tree/master/test/simpletest_symbols_and_errors) | [Simple Line/Symbol Graph With Errorbars](https://github.com/jkriege2/JKQtPlotter/tree/master/test/simpletest_symbols_and_errors) | `JKQTPxyLineErrorGraph`<br/>C-style arrays of data | | [![](https://raw.githubusercontent.com/jkriege2/JKQtPlotter/master/screenshots/jkqtplotter_simpletest_symbols_and_errors_small.png)](https://github.com/jkriege2/JKQtPlotter/tree/master/examples/simpletest_symbols_and_errors) | [Simple Line/Symbol Graph With Errorbars](https://github.com/jkriege2/JKQtPlotter/tree/master/examples/simpletest_symbols_and_errors) | `JKQTPxyLineErrorGraph`<br/>C-style arrays of data |
| [![](https://raw.githubusercontent.com/jkriege2/JKQtPlotter/master/screenshots/jkqtplotter_simpletest_errorbarstyles_small.png)](https://github.com/jkriege2/JKQtPlotter/tree/master/test/simpletest_errorbarstyles) | [Different Types of Error Indicators](https://github.com/jkriege2/JKQtPlotter/tree/master/test/simpletest_errorbarstyles) | `JKQTPxyLineErrorGraph`<br/>different styles of error indicators for x- and y-errors<br>C++-style QVector for data<br/>styling error indicators<br/>moving key and formatting plotter grid | | [![](https://raw.githubusercontent.com/jkriege2/JKQtPlotter/master/screenshots/jkqtplotter_simpletest_errorbarstyles_small.png)](https://github.com/jkriege2/JKQtPlotter/tree/master/examples/simpletest_errorbarstyles) | [Different Types of Error Indicators](https://github.com/jkriege2/JKQtPlotter/tree/master/examples/simpletest_errorbarstyles) | `JKQTPxyLineErrorGraph`<br/>different styles of error indicators for x- and y-errors<br>C++-style QVector for data<br/>styling error indicators<br/>moving key and formatting plotter grid |
| [![](https://raw.githubusercontent.com/jkriege2/JKQtPlotter/master/screenshots/jkqtplotter_simpletest_barchart_small.png)](https://github.com/jkriege2/JKQtPlotter/tree/master/test/simpletest_barchart) | [Simple Bar Charts](https://github.com/jkriege2/JKQtPlotter/tree/master/test/simpletest_barchart) | `JKQTPbarVerticalGraph`<br/>C-style arrays of data | | [![](https://raw.githubusercontent.com/jkriege2/JKQtPlotter/master/screenshots/jkqtplotter_simpletest_barchart_small.png)](https://github.com/jkriege2/JKQtPlotter/tree/master/examples/simpletest_barchart) | [Simple Bar Charts](https://github.com/jkriege2/JKQtPlotter/tree/master/examples/simpletest_barchart) | `JKQTPbarVerticalGraph`<br/>C-style arrays of data |
| [![](https://raw.githubusercontent.com/jkriege2/JKQtPlotter/master/screenshots/JKQTPbarVerticalGraphStacked_small.png)<br>![](https://raw.githubusercontent.com/jkriege2/JKQtPlotter/master/screenshots/JKQTPbarHorizontalGraphStacked_small.png)](https://github.com/jkriege2/JKQtPlotter/tree/master/test/simpletest_stackedbars) | [Stacked Bar Charts](https://github.com/jkriege2/JKQtPlotter/tree/master/test/simpletest_stackedbars) | `JKQTPbarVerticalStackableGraph`, `JKQTPbarHorizontalStackableGraph`<br/>C++-style vectors of data | | [![](https://raw.githubusercontent.com/jkriege2/JKQtPlotter/master/screenshots/JKQTPbarVerticalGraphStacked_small.png)<br>![](https://raw.githubusercontent.com/jkriege2/JKQtPlotter/master/screenshots/JKQTPbarHorizontalGraphStacked_small.png)](https://github.com/jkriege2/JKQtPlotter/tree/master/examples/simpletest_stackedbars) | [Stacked Bar Charts](https://github.com/jkriege2/JKQtPlotter/tree/master/examples/simpletest_stackedbars) | `JKQTPbarVerticalStackableGraph`, `JKQTPbarHorizontalStackableGraph`<br/>C++-style vectors of data |
| [![](https://raw.githubusercontent.com/jkriege2/JKQtPlotter/master/screenshots/jkqtplotter_simpletest_filledgraphs_small.png)](https://github.com/jkriege2/JKQtPlotter/tree/master/test/simpletest_filledgraphs) | [Filled Curve Plots](https://github.com/jkriege2/JKQtPlotter/tree/master/test/simpletest_filledgraphs) | `JKQTPbarVerticalGraph`<br/>setting/altering data in `JKQTPdatstore` directly<br/> transparent plots<br/>calculating histograms | | [![](https://raw.githubusercontent.com/jkriege2/JKQtPlotter/master/screenshots/jkqtplotter_simpletest_filledgraphs_small.png)](https://github.com/jkriege2/JKQtPlotter/tree/master/examples/simpletest_filledgraphs) | [Filled Curve Plots](https://github.com/jkriege2/JKQtPlotter/tree/master/examples/simpletest_filledgraphs) | `JKQTPbarVerticalGraph`<br/>setting/altering data in `JKQTPdatstore` directly<br/> transparent plots<br/>calculating histograms |
| [![](https://raw.githubusercontent.com/jkriege2/JKQtPlotter/master/screenshots/jkqtplotter_simpletest_impulsesplot_small.png)](https://github.com/jkriege2/JKQtPlotter/tree/master/test/simpletest_impulsesplot) | [Impulse Plots](https://github.com/jkriege2/JKQtPlotter/tree/master/test/simpletest_impulsesplot) | `JKQTPimpulsesVerticalGraph` and `JKQTPimpulsesHorizontalGraph`<br/>C++-style QVector as plot data | | [![](https://raw.githubusercontent.com/jkriege2/JKQtPlotter/master/screenshots/jkqtplotter_simpletest_impulsesplot_small.png)](https://github.com/jkriege2/JKQtPlotter/tree/master/examples/simpletest_impulsesplot) | [Impulse Plots](https://github.com/jkriege2/JKQtPlotter/tree/master/examples/simpletest_impulsesplot) | `JKQTPimpulsesVerticalGraph` and `JKQTPimpulsesHorizontalGraph`<br/>C++-style QVector as plot data |
| [![](https://raw.githubusercontent.com/jkriege2/JKQtPlotter/master/screenshots/jkqtplotter_simpletest_paramscatterplot_small.png)](https://github.com/jkriege2/JKQtPlotter/tree/master/test/simpletest_paramscatterplot) | [Scatter Graph with Parametrized Symbols/Colors](https://github.com/jkriege2/JKQtPlotter/tree/master/test/simpletest_paramscatterplot) | `JKQTPxyParametrizedScatterGraph`<br/>C++-style QVector as plot data<br/>modify scatter/points/line-graph properties by data | | [![](https://raw.githubusercontent.com/jkriege2/JKQtPlotter/master/screenshots/jkqtplotter_simpletest_paramscatterplot_small.png)](https://github.com/jkriege2/JKQtPlotter/tree/master/examples/simpletest_paramscatterplot) | [Scatter Graph with Parametrized Symbols/Colors](https://github.com/jkriege2/JKQtPlotter/tree/master/examples/simpletest_paramscatterplot) | `JKQTPxyParametrizedScatterGraph`<br/>C++-style QVector as plot data<br/>modify scatter/points/line-graph properties by data |
| [![](https://raw.githubusercontent.com/jkriege2/JKQtPlotter/master/screenshots/jkqtplotter_simpletest_paramscatterplot_image_small.png)](https://github.com/jkriege2/JKQtPlotter/tree/master/test/simpletest_paramscatterplot_image) | [Draw an Artistic Image with a Parametrized Scatter Graph](https://github.com/jkriege2/JKQtPlotter/tree/master/test/simpletest_paramscatterplot_image) | `JKQTPxyParametrizedScatterGraph`<br/>C++-style QVector as plot data<br/>rectangular arrangement of scatters<br/>generative computer graphics | | [![](https://raw.githubusercontent.com/jkriege2/JKQtPlotter/master/screenshots/jkqtplotter_simpletest_paramscatterplot_image_small.png)](https://github.com/jkriege2/JKQtPlotter/tree/master/examples/simpletest_paramscatterplot_image) | [Draw an Artistic Image with a Parametrized Scatter Graph](https://github.com/jkriege2/JKQtPlotter/tree/master/examples/simpletest_paramscatterplot_image) | `JKQTPxyParametrizedScatterGraph`<br/>C++-style QVector as plot data<br/>rectangular arrangement of scatters<br/>generative computer graphics |
| [![](https://raw.githubusercontent.com/jkriege2/JKQtPlotter/master/screenshots/jkqtplotter_simpletest_parametriccurve_small.png)](https://github.com/jkriege2/JKQtPlotter/tree/master/test/simpletest_parametriccurve) | [Plotting Parametric Curves](https://github.com/jkriege2/JKQtPlotter/tree/master/test/simpletest_parametriccurve) | `JKQTPxyLineGraph` and `JKQTPxyParametrizedScatterGraph`<br/>C++-style QVector as plot data<br/>parametric curve plotting | | [![](https://raw.githubusercontent.com/jkriege2/JKQtPlotter/master/screenshots/jkqtplotter_simpletest_parametriccurve_small.png)](https://github.com/jkriege2/JKQtPlotter/tree/master/examples/simpletest_parametriccurve) | [Plotting Parametric Curves](https://github.com/jkriege2/JKQtPlotter/tree/master/examples/simpletest_parametriccurve) | `JKQTPxyLineGraph` and `JKQTPxyParametrizedScatterGraph`<br/>C++-style QVector as plot data<br/>parametric curve plotting |
| [![](https://raw.githubusercontent.com/jkriege2/JKQtPlotter/master/screenshots/jkqtplotter_simpletest_functionplot_small.png)](https://github.com/jkriege2/JKQtPlotter/tree/master/test/simpletest_functionplot) | [Plotting Mathematical Functions as Line Graphs](https://github.com/jkriege2/JKQtPlotter/tree/master/test/simpletest_functionplot) | `JKQTPxFunctionLineGraph` <br/>diretly plotting C/C++-functions | | [![](https://raw.githubusercontent.com/jkriege2/JKQtPlotter/master/screenshots/jkqtplotter_simpletest_functionplot_small.png)](https://github.com/jkriege2/JKQtPlotter/tree/master/examples/simpletest_functionplot) | [Plotting Mathematical Functions as Line Graphs](https://github.com/jkriege2/JKQtPlotter/tree/master/examples/simpletest_functionplot) | `JKQTPxFunctionLineGraph` <br/>diretly plotting C/C++-functions |
[![](https://raw.githubusercontent.com/jkriege2/JKQtPlotter/master/screenshots/jkqtplotter_simpletest_parsedfunctionplot_small.png)](https://github.com/jkriege2/JKQtPlotter/tree/master/test/simpletest_parsedfunctionplot) | [Plotting Parsed Mathematical Functions as Line Graphs](https://github.com/jkriege2/JKQtPlotter/tree/master/test/simpletest_parsedfunctionplot) | `JKQTPxParsedFunctionLineGraph` <br/>plotting functions with the internal math equation parser/evaluator | [![](https://raw.githubusercontent.com/jkriege2/JKQtPlotter/master/screenshots/jkqtplotter_simpletest_parsedfunctionplot_small.png)](https://github.com/jkriege2/JKQtPlotter/tree/master/examples/simpletest_parsedfunctionplot) | [Plotting Parsed Mathematical Functions as Line Graphs](https://github.com/jkriege2/JKQtPlotter/tree/master/examples/simpletest_parsedfunctionplot) | `JKQTPxParsedFunctionLineGraph` <br/>plotting functions with the internal math equation parser/evaluator |
### Styling the Plot, Keys, Axes, ... ### Styling the Plot, Keys, Axes, ...
| Screenshot | Description | Notes | | Screenshot | Description | Notes |
|:-------------:| ------------- | ------------- | |:-------------:| ------------- | ------------- |
| [![](https://raw.githubusercontent.com/jkriege2/JKQtPlotter/master/screenshots/jkqtplotter_simpletest_logaxes_small.png)](https://github.com/jkriege2/JKQtPlotter/tree/master/test/simpletest_logaxes) | [logarithmic axes](https://github.com/jkriege2/JKQtPlotter/tree/master/test/simpletest_logaxes) | `JKQTPxyLineGraph` and `JKQTPgeoText`<br/>C++ vector of data<br/>logarithmic axes and styling<br/>plot line styles<br/>internal LaTeX parser<br/>add commenting text to a graph | | [![](https://raw.githubusercontent.com/jkriege2/JKQtPlotter/master/screenshots/jkqtplotter_simpletest_logaxes_small.png)](https://github.com/jkriege2/JKQtPlotter/tree/master/examples/simpletest_logaxes) | [logarithmic axes](https://github.com/jkriege2/JKQtPlotter/tree/master/examples/simpletest_logaxes) | `JKQTPxyLineGraph` and `JKQTPgeoText`<br/>C++ vector of data<br/>logarithmic axes and styling<br/>plot line styles<br/>internal LaTeX parser<br/>add commenting text to a graph |
| [![](https://raw.githubusercontent.com/jkriege2/JKQtPlotter/master/screenshots/jkqtplotter_simpletest_dateaxes_small.png)<br>![](https://raw.githubusercontent.com/jkriege2/JKQtPlotter/master/screenshots/jkqtplotter_simpletest_dateaxes_dates_small.png)<br>![](https://raw.githubusercontent.com/jkriege2/JKQtPlotter/master/screenshots/jkqtplotter_simpletest_dateaxes_timeaxis_small.png)](https://github.com/jkriege2/JKQtPlotter/tree/master/test/simpletest_dateaxes) | [date/time axes](https://github.com/jkriege2/JKQtPlotter/tree/master/test/simpletest_dateaxes) | `JKQTPxyLineGraph` and `JKQTPfilledVerticalRangeGraph`<br/>C++ vector of data<br/>date/time axes<br/>plot min/max range graph<br/>internal LaTeX parser<br/>data from CSV files | | [![](https://raw.githubusercontent.com/jkriege2/JKQtPlotter/master/screenshots/jkqtplotter_simpletest_dateaxes_small.png)<br>![](https://raw.githubusercontent.com/jkriege2/JKQtPlotter/master/screenshots/jkqtplotter_simpletest_dateaxes_dates_small.png)<br>![](https://raw.githubusercontent.com/jkriege2/JKQtPlotter/master/screenshots/jkqtplotter_simpletest_dateaxes_timeaxis_small.png)](https://github.com/jkriege2/JKQtPlotter/tree/master/examples/simpletest_dateaxes) | [date/time axes](https://github.com/jkriege2/JKQtPlotter/tree/master/examples/simpletest_dateaxes) | `JKQTPxyLineGraph` and `JKQTPfilledVerticalRangeGraph`<br/>C++ vector of data<br/>date/time axes<br/>plot min/max range graph<br/>internal LaTeX parser<br/>data from CSV files |
### Image data Plots ### Image data Plots
| Screenshot | Description | Notes | | Screenshot | Description | Notes |
|:-------------:| ------------- | ------------- | |:-------------:| ------------- | ------------- |
| [![](https://raw.githubusercontent.com/jkriege2/JKQtPlotter/master/screenshots/jkqtplotter_simpletest_rgbimageplot_qt_small.png)](https://github.com/jkriege2/JKQtPlotter/tree/master/test/simpletest_rgbimageplot_qt) | [`QImage` as a Graph](https://github.com/jkriege2/JKQtPlotter/tree/master/test/simpletest_rgbimageplot_qt) | `JKQTPImage`<br/>`QImage` drawn onto a plot with arbitrary scaling) | | [![](https://raw.githubusercontent.com/jkriege2/JKQtPlotter/master/screenshots/jkqtplotter_simpletest_rgbimageplot_qt_small.png)](https://github.com/jkriege2/JKQtPlotter/tree/master/examples/simpletest_rgbimageplot_qt) | [`QImage` as a Graph](https://github.com/jkriege2/JKQtPlotter/tree/master/examples/simpletest_rgbimageplot_qt) | `JKQTPImage`<br/>`QImage` drawn onto a plot with arbitrary scaling) |
| [![](https://raw.githubusercontent.com/jkriege2/JKQtPlotter/master/screenshots/jkqtplotter_simpletest_imageplot_small.png)](https://github.com/jkriege2/JKQtPlotter/tree/master/test/simpletest_imageplot) | [Basic 1-channel Raw C Image Plot](https://github.com/jkriege2/JKQtPlotter/tree/master/test/simpletest_imageplot) | `JKQTPColumnMathImage`<br/>image data copied from C-style row-major array into a single column of the internal datastore<br>Describes several options of the image plotting classes (different ways of color coding, what to do with data above/below the limits etc.) | | [![](https://raw.githubusercontent.com/jkriege2/JKQtPlotter/master/screenshots/jkqtplotter_simpletest_imageplot_small.png)](https://github.com/jkriege2/JKQtPlotter/tree/master/examples/simpletest_imageplot) | [Basic 1-channel Raw C Image Plot](https://github.com/jkriege2/JKQtPlotter/tree/master/examples/simpletest_imageplot) | `JKQTPColumnMathImage`<br/>image data copied from C-style row-major array into a single column of the internal datastore<br>Describes several options of the image plotting classes (different ways of color coding, what to do with data above/below the limits etc.) |
| [![](https://raw.githubusercontent.com/jkriege2/JKQtPlotter/master/screenshots/jkqtplotter_simpletest_imageplot_modifier_small.png)](https://github.com/jkriege2/JKQtPlotter/tree/master/test/simpletest_imageplot_modifier) | [Modifier-Feature of Image Plots](https://github.com/jkriege2/JKQtPlotter/tree/master/test/simpletest_imageplot_modifier) | `JKQTPColumnMathImage`<br/>image data copied from C-style row-major array into a single column of the internal datastore<br>Image is modified by a second image to display two data dimensions at the same time | | [![](https://raw.githubusercontent.com/jkriege2/JKQtPlotter/master/screenshots/jkqtplotter_simpletest_imageplot_modifier_small.png)](https://github.com/jkriege2/JKQtPlotter/tree/master/examples/simpletest_imageplot_modifier) | [Modifier-Feature of Image Plots](https://github.com/jkriege2/JKQtPlotter/tree/master/examples/simpletest_imageplot_modifier) | `JKQTPColumnMathImage`<br/>image data copied from C-style row-major array into a single column of the internal datastore<br>Image is modified by a second image to display two data dimensions at the same time |
| [![](https://raw.githubusercontent.com/jkriege2/JKQtPlotter/master/screenshots/jkqtplotter_simpletest_imageplot_nodatastore_small.png)](https://github.com/jkriege2/JKQtPlotter/tree/master/test/simpletest_imageplot_nodatastore) | [Basic 1-channel Raw C Image Plot<br>without the internal datastore](https://github.com/jkriege2/JKQtPlotter/tree/master/test/simpletest_imageplot_nodatastore) | `JKQTPMathImage`<br/>image data in a C-style row-major array, not using internal datastore | | [![](https://raw.githubusercontent.com/jkriege2/JKQtPlotter/master/screenshots/jkqtplotter_simpletest_imageplot_nodatastore_small.png)](https://github.com/jkriege2/JKQtPlotter/tree/master/examples/simpletest_imageplot_nodatastore) | [Basic 1-channel Raw C Image Plot<br>without the internal datastore](https://github.com/jkriege2/JKQtPlotter/tree/master/examples/simpletest_imageplot_nodatastore) | `JKQTPMathImage`<br/>image data in a C-style row-major array, not using internal datastore |
| [![](https://raw.githubusercontent.com/jkriege2/JKQtPlotter/master/screenshots/jkqtplotter_simpletest_imageplot_opencv_small.png)](https://github.com/jkriege2/JKQtPlotter/tree/master/test/simpletest_imageplot_opencv) | [1-channel OpenCV cv::Mat Image Plot](https://github.com/jkriege2/JKQtPlotter/tree/master/test/simpletest_imageplot_opencv) | `JKQTPColumnMathImage`<br/>image data copied from OpenCV cv::Mat-structure into a single column of the internal datastore | | [![](https://raw.githubusercontent.com/jkriege2/JKQtPlotter/master/screenshots/jkqtplotter_simpletest_imageplot_opencv_small.png)](https://github.com/jkriege2/JKQtPlotter/tree/master/examples/simpletest_imageplot_opencv) | [1-channel OpenCV cv::Mat Image Plot](https://github.com/jkriege2/JKQtPlotter/tree/master/examples/simpletest_imageplot_opencv) | `JKQTPColumnMathImage`<br/>image data copied from OpenCV cv::Mat-structure into a single column of the internal datastore |
| [![](https://raw.githubusercontent.com/jkriege2/JKQtPlotter/master/screenshots/jkqtplotter_simpletest_rgbimageplot_opencv_small.png)](https://github.com/jkriege2/JKQtPlotter/tree/master/test/simpletest_rgbimageplot_opencv) | [RGB OpenCV cv::Mat Image Plot](https://github.com/jkriege2/JKQtPlotter/tree/master/test/simpletest_rgbimageplot_opencv) | `JKQTPColumnRGBMathImage`<br/>image data copied from OpenCV cv::Mat-structure into three columns of the internal datastore | | [![](https://raw.githubusercontent.com/jkriege2/JKQtPlotter/master/screenshots/jkqtplotter_simpletest_rgbimageplot_opencv_small.png)](https://github.com/jkriege2/JKQtPlotter/tree/master/examples/simpletest_rgbimageplot_opencv) | [RGB OpenCV cv::Mat Image Plot](https://github.com/jkriege2/JKQtPlotter/tree/master/examples/simpletest_rgbimageplot_opencv) | `JKQTPColumnRGBMathImage`<br/>image data copied from OpenCV cv::Mat-structure into three columns of the internal datastore |
### GUI Tools and Plot Layout ### GUI Tools and Plot Layout
| Screenshot | Description | Notes | | Screenshot | Description | Notes |
|:-------------:| ------------- | ------------- | |:-------------:| ------------- | ------------- |
| [![](https://raw.githubusercontent.com/jkriege2/JKQtPlotter/master/screenshots/test_multiplot_small.png)](https://github.com/jkriege2/JKQtPlotter/tree/master/test/test_multiplot) | [Layouting Several Plots](https://github.com/jkriege2/JKQtPlotter/tree/master/test/test_multiplot) | Combining plots in Qt Layouts<br/>linking plot axes<br>copy data from a `std::map` int the datastore<br>print plots/print preview | | [![](https://raw.githubusercontent.com/jkriege2/JKQtPlotter/master/screenshots/test_multiplot_small.png)](https://github.com/jkriege2/JKQtPlotter/tree/master/examples/test_multiplot) | [Layouting Several Plots](https://github.com/jkriege2/JKQtPlotter/tree/master/examples/test_multiplot) | Combining plots in Qt Layouts<br/>linking plot axes<br>copy data from a `std::map` int the datastore<br>print plots/print preview |
### Tools and Special Features ### Tools and Special Features
| Screenshot | Description | Notes | | Screenshot | Description | Notes |
|:-------------:| ------------- | ------------- | |:-------------:| ------------- | ------------- |
| [![](https://raw.githubusercontent.com/jkriege2/JKQtPlotter/master/screenshots/jkqtmathtext_simpletest_small.png)](https://github.com/jkriege2/JKQtPlotter/tree/master/test/jkqtmathtext_simpletest) | [JKQTMathText: LaTeX Renderer](https://github.com/jkriege2/JKQtPlotter/tree/master/test/jkqtmathtext_simpletest) | | | [![](https://raw.githubusercontent.com/jkriege2/JKQtPlotter/master/screenshots/jkqtmathtext_simpletest_small.png)](https://github.com/jkriege2/JKQtPlotter/tree/master/examples/jkqtmathtext_simpletest) | [JKQTMathText: LaTeX Renderer](https://github.com/jkriege2/JKQtPlotter/tree/master/examples/jkqtmathtext_simpletest) | |

View File

@ -31,7 +31,7 @@ build:
configuration: configuration:
- release - release
# - debug - debug
install: install:
- IF %VSVER% GTR 14 ( - IF %VSVER% GTR 14 (

View File

@ -1,9 +1,9 @@
#include <QApplication> #include <QApplication>
#include "testmain.h" #include "testmain.h"
int main(int argc, char *argv[]) { int main(int argc, char *argv[]) {
QApplication a(argc, argv); QApplication a(argc, argv);
TestMain w; TestMain w;
w.show(); w.show();
return a.exec(); return a.exec();
} }

View File

@ -1,35 +1,39 @@
# ------------------------------------------------- # -------------------------------------------------
# Project created by QtCreator 2010-06-13T12:40:50 # Project created by QtCreator 2010-06-13T12:40:50
# ------------------------------------------------- # -------------------------------------------------
TARGET = JKQTFastPlotter_test TARGET = JKQTFastPlotter_test
TEMPLATE = app TEMPLATE = app
SOURCES += jkqtfastplotter_test.cpp \ SOURCES += jkqtfastplotter_test.cpp \
testmain.cpp testmain.cpp
HEADERS += testmain.h HEADERS += testmain.h
RCC_DIR = .rccs RCC_DIR = .rccs
CONFIG += qt windows CONFIG += qt windows
QT += core gui opengl QT += core gui opengl
UI_DIR = .uics UI_DIR = .uics
OBJECTS_DIR = .objs OBJECTS_DIR = .objs
MOC_DIR = .mocs MOC_DIR = .mocs
DESTDIR = ./ DESTDIR = ./
DEFINES += DEBUG_TIMING DEFINES += DEBUG_TIMING
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets printsupport greaterThan(QT_MAJOR_VERSION, 4): QT += widgets printsupport
# include JKQtPlotter library # include JKQtPlotter library
DEPENDPATH += . ../../lib DEPENDPATH += . ../../lib
INCLUDEPATH += ../../lib INCLUDEPATH += ../../lib
CONFIG (debug, debug|release):LIBS += -L../../lib/debug -ljkqtplotterlib CONFIG (debug, debug|release) {
CONFIG (release):LIBS += -L../../lib/release -ljkqtplotterlib LIBS += -L../../staticlib/debug -ljkqtplotterlib_debug
} else {
LIBS += -L../../staticlib/release -ljkqtplotterlib
}
message("LIBS = $$LIBS")

View File

Before

Width:  |  Height:  |  Size: 35 KiB

After

Width:  |  Height:  |  Size: 35 KiB

View File

Before

Width:  |  Height:  |  Size: 457 KiB

After

Width:  |  Height:  |  Size: 457 KiB

View File

@ -1,186 +1,186 @@
#include "testmain.h" #include "testmain.h"
#include <QCheckBox> #include <QCheckBox>
#include <QtGui> #include <QtGui>
TestMain::TestMain(QWidget *parent) : TestMain::TestMain(QWidget *parent) :
QWidget(parent) QWidget(parent)
{ {
imageRed=(double*)calloc(IMAGE_N*IMAGE_N, sizeof(double)); imageRed=(double*)calloc(IMAGE_N*IMAGE_N, sizeof(double));
imageGreen=(double*)calloc(IMAGE_N*IMAGE_N, sizeof(double)); imageGreen=(double*)calloc(IMAGE_N*IMAGE_N, sizeof(double));
imageBlue=(double*)calloc(IMAGE_N*IMAGE_N, sizeof(double)); imageBlue=(double*)calloc(IMAGE_N*IMAGE_N, sizeof(double));
image=(double*)calloc(IMAGE_N*IMAGE_N, sizeof(double)); image=(double*)calloc(IMAGE_N*IMAGE_N, sizeof(double));
ovrl=(bool*)calloc(IMAGE_N*IMAGE_N, sizeof(bool)); ovrl=(bool*)calloc(IMAGE_N*IMAGE_N, sizeof(bool));
x=(double*)calloc(N1, sizeof(double)); x=(double*)calloc(N1, sizeof(double));
y1=(double*)calloc(N1, sizeof(double)); y1=(double*)calloc(N1, sizeof(double));
y2=(double*)calloc(N1, sizeof(double)); y2=(double*)calloc(N1, sizeof(double));
y3=(double*)calloc(N1, sizeof(double)); y3=(double*)calloc(N1, sizeof(double));
QGridLayout* gl=new QGridLayout(this); QGridLayout* gl=new QGridLayout(this);
setLayout(gl); setLayout(gl);
QTabWidget* t=new QTabWidget(this); QTabWidget* t=new QTabWidget(this);
gl->addWidget(t,0,0); gl->addWidget(t,0,0);
QWidget* w=new QWidget(this); QWidget* w=new QWidget(this);
gl=new QGridLayout(w); gl=new QGridLayout(w);
w->setLayout(gl); w->setLayout(gl);
JKQTFastPlotter* pl1=new JKQTFastPlotter(w); JKQTFastPlotter* pl1=new JKQTFastPlotter(w);
pl1->set_maintainAspectRatio(true); pl1->set_maintainAspectRatio(true);
gl->addWidget(pl1, 0, 0); gl->addWidget(pl1, 0, 0);
JKQTFastPlotter* pl2=new JKQTFastPlotter(w); JKQTFastPlotter* pl2=new JKQTFastPlotter(w);
pl2->setMaximumWidth(100); pl2->setMaximumWidth(100);
pl2->set_synchronizeY(pl1); pl2->set_synchronizeY(pl1);
pl2->set_yAxisLabelVisible(false); pl2->set_yAxisLabelVisible(false);
pl2->set_plotBorderLeft(10); pl2->set_plotBorderLeft(10);
pl2->set_plotBorderRight(2); pl2->set_plotBorderRight(2);
w->connect(pl1, SIGNAL(replotting()), pl2, SLOT(update_plot())); w->connect(pl1, SIGNAL(replotting()), pl2, SLOT(update_plot()));
gl->addWidget(pl2, 0, 1); gl->addWidget(pl2, 0, 1);
JKQTFastPlotter* pl3=new JKQTFastPlotter(w); JKQTFastPlotter* pl3=new JKQTFastPlotter(w);
pl3->set_synchronizeX(pl1); pl3->set_synchronizeX(pl1);
w->connect(pl1, SIGNAL(replotting()), pl3, SLOT(update_plot())); w->connect(pl1, SIGNAL(replotting()), pl3, SLOT(update_plot()));
gl->addWidget(pl3, 1, 0); gl->addWidget(pl3, 1, 0);
xx.clear(); xx.clear();
yy.clear(); yy.clear();
for (int i=0; i<N1; i++) { for (int i=0; i<N1; i++) {
x[i]=(i+1)*XMAX/(double)N1; x[i]=(i+1)*XMAX/(double)N1;
xx.push_back(x[i]); xx.push_back(x[i]);
yy.push_back(sin(0.5*M_PI*x[i])+2.0); yy.push_back(sin(0.5*M_PI*x[i])+2.0);
std::cout<<xx[i]<<", "<<yy[i]<<std::endl; std::cout<<xx[i]<<", "<<yy[i]<<std::endl;
y1[i]=i*XMAX/(double)N1; y1[i]=i*XMAX/(double)N1;
y2[i]=log(x[i]); y2[i]=log(x[i]);
y3[i]=log10(x[i]); y3[i]=log10(x[i]);
} }
JKQTFPVBarPlot* p1=new JKQTFPVBarPlot(pl1, N1, x, y1); JKQTFPVBarPlot* p1=new JKQTFPVBarPlot(pl1, N1, x, y1);
JKQTFPLinePlot* p2=new JKQTFPLinePlot(pl1, N1, x, y2, QColor("blue")); JKQTFPLinePlot* p2=new JKQTFPLinePlot(pl1, N1, x, y2, QColor("blue"));
JKQTFPLinePlot* p3=new JKQTFPLinePlot(pl1, N1, x, y3, QColor("darkgreen")); JKQTFPLinePlot* p3=new JKQTFPLinePlot(pl1, N1, x, y3, QColor("darkgreen"));
JKQTFPLinePlot* pv=new JKQTFPLinePlot(pl1, &xx, &yy, QColor("black"), Qt::SolidLine, 3); JKQTFPLinePlot* pv=new JKQTFPLinePlot(pl1, &xx, &yy, QColor("black"), Qt::SolidLine, 3);
img=QImage("lena.png"); img=QImage("lena.png");
JKQTFPQImagePlot* p4=new JKQTFPQImagePlot(pl2, &img, 0, 10, 0, 10); JKQTFPQImagePlot* p4=new JKQTFPQImagePlot(pl2, &img, 0, 10, 0, 10);
for (int x=0; x<IMAGE_N; x++) { for (int x=0; x<IMAGE_N; x++) {
for (int y=0; y<IMAGE_N; y++) { for (int y=0; y<IMAGE_N; y++) {
image[y*IMAGE_N+x]=IMAGE_N*(1.1+sin(sqrt((x-50)*(x-50)+(y-50)*(y-50)))); image[y*IMAGE_N+x]=IMAGE_N*(1.1+sin(sqrt((x-50)*(x-50)+(y-50)*(y-50))));
if (x>50 && y>50) image[y*IMAGE_N+x]=0; if (x>50 && y>50) image[y*IMAGE_N+x]=0;
if (x<50 && y<50) image[y*IMAGE_N+x]=50; if (x<50 && y<50) image[y*IMAGE_N+x]=50;
if (abs(x-(IMAGE_N-y))<4) ovrl[y*IMAGE_N+x]=true; else ovrl[y*IMAGE_N+x]=false; if (abs(x-(IMAGE_N-y))<4) ovrl[y*IMAGE_N+x]=true; else ovrl[y*IMAGE_N+x]=false;
} }
} }
JKQTFPimagePlot* p5=new JKQTFPimagePlot(pl3, image, JKQTFP_double, IMAGE_N, IMAGE_N, 0, 10, 0, 10, JKQTFP_GRAY); JKQTFPimagePlot* p5=new JKQTFPimagePlot(pl3, image, JKQTFP_double, IMAGE_N, IMAGE_N, 0, 10, 0, 10, JKQTFP_GRAY);
QColor col=QColor("red"); QColor col=QColor("red");
col.setAlpha(127); col.setAlpha(127);
JKQTFPimageOverlayPlot* p5o=new JKQTFPimageOverlayPlot(pl3, ovrl, IMAGE_N, IMAGE_N, 0, 10, 0, 10, col); JKQTFPimageOverlayPlot* p5o=new JKQTFPimageOverlayPlot(pl3, ovrl, IMAGE_N, IMAGE_N, 0, 10, 0, 10, col);
JKQTFPXRangePlot* p6=new JKQTFPXRangePlot(pl1, 2.25, 7.75); JKQTFPXRangePlot* p6=new JKQTFPXRangePlot(pl1, 2.25, 7.75);
p6->set_fillStyle(Qt::SolidPattern); p6->set_fillStyle(Qt::SolidPattern);
JKQTFPQScaleBarXPlot* sb=new JKQTFPQScaleBarXPlot(pl1, 1, QString("%1 mm")); JKQTFPQScaleBarXPlot* sb=new JKQTFPQScaleBarXPlot(pl1, 1, QString("%1 mm"));
pl1->addPlot(p6); pl1->addPlot(p6);
pl1->addPlot(p1); pl1->addPlot(p1);
pl1->addPlot(p2); pl1->addPlot(p2);
pl1->addPlot(p3); pl1->addPlot(p3);
pl1->addPlot(pv); pl1->addPlot(pv);
pl1->addPlot(sb); pl1->addPlot(sb);
pl2->addPlot(p4); pl2->addPlot(p4);
pl3->addPlot(p5); pl3->addPlot(p5);
pl3->addPlot(p5o); pl3->addPlot(p5o);
pl3->setObjectName("pl3"); pl3->setObjectName("pl3");
QComboBox* spin=new QComboBox(w); QComboBox* spin=new QComboBox(w);
spin->addItems(JKQTFPimagePlot_getPalettes()); spin->addItems(JKQTFPimagePlot_getPalettes());
gl->addWidget(spin, 2,0); gl->addWidget(spin, 2,0);
connect(spin, SIGNAL(currentIndexChanged(int)), p5, SLOT(set_palette(int))); connect(spin, SIGNAL(currentIndexChanged(int)), p5, SLOT(set_palette(int)));
QComboBox* scale=new QComboBox(w); QComboBox* scale=new QComboBox(w);
scale->addItem("TopLeft"); scale->addItem("TopLeft");
scale->addItem("TopRight"); scale->addItem("TopRight");
scale->addItem("BottomLeft"); scale->addItem("BottomLeft");
scale->addItem("BottomRight"); scale->addItem("BottomRight");
gl->addWidget(scale, 3,0); gl->addWidget(scale, 3,0);
connect(scale, SIGNAL(currentIndexChanged(int)), sb, SLOT(set_position(int))); connect(scale, SIGNAL(currentIndexChanged(int)), sb, SLOT(set_position(int)));
t->addTab(w, tr("Basic Test")); t->addTab(w, tr("Basic Test"));
w=new QWidget(this); w=new QWidget(this);
gl=new QGridLayout(w); gl=new QGridLayout(w);
w->setLayout(gl); w->setLayout(gl);
JKQTFastPlotter* p21=new JKQTFastPlotter(w); JKQTFastPlotter* p21=new JKQTFastPlotter(w);
gl->addWidget(p21, 0, 0, 1, 3); gl->addWidget(p21, 0, 0, 1, 3);
for (int x=0; x<IMAGE_N; x++) { for (int x=0; x<IMAGE_N; x++) {
for (int y=0; y<IMAGE_N; y++) { for (int y=0; y<IMAGE_N; y++) {
imageRed[y*IMAGE_N+x]=(fabs(x)+fabs(y))/2.0; imageRed[y*IMAGE_N+x]=(fabs(x)+fabs(y))/2.0;
imageGreen[y*IMAGE_N+x]=(fabs(double(IMAGE_N)-x)+fabs(y))/2.0; imageGreen[y*IMAGE_N+x]=(fabs(double(IMAGE_N)-x)+fabs(y))/2.0;
imageBlue[y*IMAGE_N+x]=sqrt(x*x+y*y); imageBlue[y*IMAGE_N+x]=sqrt(x*x+y*y);
} }
} }
prgb=new JKQTFPRGBImageOverlayPlot(p21); prgb=new JKQTFPRGBImageOverlayPlot(p21);
prgb->set_image(imageRed, JKQTFP_double, imageGreen, JKQTFP_double, imageBlue, JKQTFP_double, IMAGE_N, IMAGE_N,0,10,0,10); prgb->set_image(imageRed, JKQTFP_double, imageGreen, JKQTFP_double, imageBlue, JKQTFP_double, IMAGE_N, IMAGE_N,0,10,0,10);
p21->addPlot(prgb); p21->addPlot(prgb);
QCheckBox* c=new QCheckBox(tr("red channel"), w); QCheckBox* c=new QCheckBox(tr("red channel"), w);
c->setChecked(true); c->setChecked(true);
connect(c, SIGNAL(toggled(bool)), this, SLOT(enableRed(bool))); connect(c, SIGNAL(toggled(bool)), this, SLOT(enableRed(bool)));
gl->addWidget(c, 1,0); gl->addWidget(c, 1,0);
c=new QCheckBox(tr("green channel"), w); c=new QCheckBox(tr("green channel"), w);
c->setChecked(true); c->setChecked(true);
connect(c, SIGNAL(toggled(bool)), this, SLOT(enableGreen(bool))); connect(c, SIGNAL(toggled(bool)), this, SLOT(enableGreen(bool)));
gl->addWidget(c, 1,1); gl->addWidget(c, 1,1);
c=new QCheckBox(tr("blue channel"), w); c=new QCheckBox(tr("blue channel"), w);
c->setChecked(true); c->setChecked(true);
connect(c, SIGNAL(toggled(bool)), this, SLOT(enableBlue(bool))); connect(c, SIGNAL(toggled(bool)), this, SLOT(enableBlue(bool)));
gl->addWidget(c, 1,2); gl->addWidget(c, 1,2);
t->addTab(w, tr("Overlay Test")); t->addTab(w, tr("Overlay Test"));
t->setCurrentIndex(1); t->setCurrentIndex(1);
resize(500,400); resize(500,400);
} }
TestMain::~TestMain() { TestMain::~TestMain() {
free(imageRed); free(imageRed);
free(imageGreen); free(imageGreen);
free(imageBlue); free(imageBlue);
free(image); free(image);
free(ovrl); free(ovrl);
free(x); free(x);
free(y1); free(y1);
free(y2); free(y2);
free(y3); free(y3);
} }
void TestMain::enableRed(bool enabled) { void TestMain::enableRed(bool enabled) {
if (enabled) { if (enabled) {
prgb->set_imageRed(imageRed, JKQTFP_double); prgb->set_imageRed(imageRed, JKQTFP_double);
} else { } else {
prgb->set_imageRed(NULL, JKQTFP_double); prgb->set_imageRed(NULL, JKQTFP_double);
} }
} }
void TestMain::enableGreen(bool enabled) { void TestMain::enableGreen(bool enabled) {
if (enabled) { if (enabled) {
prgb->set_imageGreen(imageGreen, JKQTFP_double); prgb->set_imageGreen(imageGreen, JKQTFP_double);
} else { } else {
prgb->set_imageGreen(NULL, JKQTFP_double); prgb->set_imageGreen(NULL, JKQTFP_double);
} }
} }
void TestMain::enableBlue(bool enabled) { void TestMain::enableBlue(bool enabled) {
if (enabled) { if (enabled) {
prgb->set_imageBlue(imageBlue, JKQTFP_double); prgb->set_imageBlue(imageBlue, JKQTFP_double);
} else { } else {
prgb->set_imageBlue(NULL, JKQTFP_double); prgb->set_imageBlue(NULL, JKQTFP_double);
} }
} }

View File

@ -1,44 +1,44 @@
#ifndef TESTMAIN_H #ifndef TESTMAIN_H
#define TESTMAIN_H #define TESTMAIN_H
#include <QTabWidget> #include <QTabWidget>
#include <QGridLayout> #include <QGridLayout>
#include "jkqtfastplotter/jkqtfastplotter.h" #include "jkqtfastplotter/jkqtfastplotter.h"
#include <QComboBox> #include <QComboBox>
#define N1 20 #define N1 20
#define XMAX 10.0 #define XMAX 10.0
#define IMAGE_N 300 #define IMAGE_N 300
class TestMain : public QWidget { class TestMain : public QWidget {
Q_OBJECT Q_OBJECT
public: public:
explicit TestMain(QWidget *parent = 0); explicit TestMain(QWidget *parent = 0);
virtual ~TestMain(); virtual ~TestMain();
signals: signals:
public slots: public slots:
void enableRed(bool enabled); void enableRed(bool enabled);
void enableGreen(bool enabled); void enableGreen(bool enabled);
void enableBlue(bool enabled); void enableBlue(bool enabled);
protected: protected:
double* x; double* x;
double* y1; double* y1;
double* y2; double* y2;
double* y3; double* y3;
QVector<double> xx; QVector<double> xx;
QVector<double> yy; QVector<double> yy;
QImage img; QImage img;
double* image; double* image;
bool* ovrl; bool* ovrl;
double* imageRed; double* imageRed;
double* imageGreen; double* imageGreen;
double* imageBlue; double* imageBlue;
JKQTFPRGBImageOverlayPlot* prgb; JKQTFPRGBImageOverlayPlot* prgb;
}; };
#endif // TESTMAIN_H #endif // TESTMAIN_H

View File

@ -1,72 +1,72 @@
[Back to JKQTPlotter main page](https://github.com/jkriege2/JKQtPlotter/) [Back to JKQTPlotter main page](https://github.com/jkriege2/JKQtPlotter/)
# JKQtPlotter # JKQtPlotter
## JKQTmathText ## JKQTmathText
JKQTmathText is a hand-written LaTeX-renderer for Qt (implemented in native C++, using Qt). It supports a large set of standard LaTeX markup and can render it to a QPainter. JKQTmathText is a hand-written LaTeX-renderer for Qt (implemented in native C++, using Qt). It supports a large set of standard LaTeX markup and can render it to a QPainter.
## A simple usage example ## A simple usage example
This project (see `./test/jkqtmathtext_simpletest/`) simply creates a QLabel (as a new window) that displays a rendered LaTeX equation (here the time-dependent Schrödinger equation). This project (see `./examples/jkqtmathtext_simpletest/`) simply creates a QLabel (as a new window) that displays a rendered LaTeX equation (here the time-dependent Schrödinger equation).
The QMake project looks like this (see [`jkqtmathtext_simpletest.pro`](https://github.com/jkriege2/JKQtPlotter/blob/master/test/jkqtmathtext_simpletest/jkqtmathtext_simpletest.pro): The QMake project looks like this (see [`jkqtmathtext_simpletest.pro`](https://github.com/jkriege2/JKQtPlotter/blob/master/examples/jkqtmathtext_simpletest/jkqtmathtext_simpletest.pro):
```qmake ```qmake
# include JKQTmathText source-code, including the open-source XITS fonts # include JKQTmathText source-code, including the open-source XITS fonts
include(../../lib/jkqtmathtext_with_xits.pri) include(../../lib/jkqtmathtext_with_xits.pri)
SOURCES += jkqtmathtext_simpletest.cpp SOURCES += jkqtmathtext_simpletest.cpp
# if you don't want to use the XITS fonts, use this line (and uncomment the # if you don't want to use the XITS fonts, use this line (and uncomment the
# last two line!): # last two line!):
#include(../../lib/jkqtmathtext.pri) #include(../../lib/jkqtmathtext.pri)
CONFIG += qt CONFIG += qt
QT += core gui QT += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets printsupport greaterThan(QT_MAJOR_VERSION, 4): QT += widgets printsupport
TARGET = jkqtmathtext_simpletest TARGET = jkqtmathtext_simpletest
``` ```
And the soruce code of the main application is (see [`jkqtmathtext_simpletest.cpp`](https://github.com/jkriege2/JKQtPlotter/blob/master/test/jkqtmathtext_simpletest/jkqtmathtext_simpletest.cpp): And the soruce code of the main application is (see [`jkqtmathtext_simpletest.cpp`](https://github.com/jkriege2/JKQtPlotter/blob/master/examples/jkqtmathtext_simpletest/jkqtmathtext_simpletest.cpp):
```c++ ```c++
#include <QApplication> #include <QApplication>
#include <QLabel> #include <QLabel>
#include <QPixmap> #include <QPixmap>
#include "jkqtmathtext/jkqtmathtext.h" #include "jkqtmathtext/jkqtmathtext.h"
int main(int argc, char* argv[]) int main(int argc, char* argv[])
{ {
QApplication app(argc, argv); QApplication app(argc, argv);
// we use a simple label to display the math text // we use a simple label to display the math text
QLabel lab; QLabel lab;
// 1. we will paint into a QPixmap // 1. we will paint into a QPixmap
QPixmap pix(600,400); QPixmap pix(600,400);
pix.fill(QColor("white")); pix.fill(QColor("white"));
QPainter painter; QPainter painter;
// 2. now we create a JKQTmathText object. // 2. now we create a JKQTmathText object.
// Also we configure the JKQTmathText to use the XITS fonts that // Also we configure the JKQTmathText to use the XITS fonts that
// were included in the *.pro-file // were included in the *.pro-file
JKQTmathText mathText; JKQTmathText mathText;
mathText.useXITS(); mathText.useXITS();
mathText.set_fontSize(20); mathText.set_fontSize(20);
// 3. now we parse some LaTeX code (the Schroedinger's equation), so // 3. now we parse some LaTeX code (the Schroedinger's equation), so
// we can draw it onto the QPixmap in the next step // we can draw it onto the QPixmap in the next step
mathText.parse("$\\left[-\\frac{\\hbar^2}{2m}\\frac{\\partial^2}{\\partial x^2}+V(x)\\right]\\Psi(x)=\\mathrm{i}\\hbar\\frac{\\partial}{\\partial t}\\Psi(x)$"); mathText.parse("$\\left[-\\frac{\\hbar^2}{2m}\\frac{\\partial^2}{\\partial x^2}+V(x)\\right]\\Psi(x)=\\mathrm{i}\\hbar\\frac{\\partial}{\\partial t}\\Psi(x)$");
// 3. here we do the painting // 3. here we do the painting
painter.begin(&pix); painter.begin(&pix);
mathText.draw(painter, Qt::AlignCenter, QRectF(0,0,pix.width(), pix.height()), false); mathText.draw(painter, Qt::AlignCenter, QRectF(0,0,pix.width(), pix.height()), false);
painter.end(); painter.end();
// now we display and resize the label as a window // now we display and resize the label as a window
lab.setPixmap(pix); lab.setPixmap(pix);
lab.show(); lab.show();
lab.resize(600,400); lab.resize(600,400);
return app.exec(); return app.exec();
} }
``` ```
The result looks like this: The result looks like this:
![jkqtmathtext_simpletest](https://raw.githubusercontent.com/jkriege2/JKQtPlotter/master/screenshots/jkqtmathtext_simpletest.png) ![jkqtmathtext_simpletest](https://raw.githubusercontent.com/jkriege2/JKQtPlotter/master/screenshots/jkqtmathtext_simpletest.png)
[Back to JKQTPlotter main page](https://github.com/jkriege2/JKQtPlotter/) [Back to JKQTPlotter main page](https://github.com/jkriege2/JKQtPlotter/)

View File

@ -1,40 +1,40 @@
#include <QApplication> #include <QApplication>
#include <QLabel> #include <QLabel>
#include <QPixmap> #include <QPixmap>
#include "jkqtmathtext/jkqtmathtext.h" #include "jkqtmathtext/jkqtmathtext.h"
int main(int argc, char* argv[]) int main(int argc, char* argv[])
{ {
QApplication app(argc, argv); QApplication app(argc, argv);
// we use a simple label to display the math text // we use a simple label to display the math text
QLabel lab; QLabel lab;
// 1. we will paint into a QPixmap // 1. we will paint into a QPixmap
QPixmap pix(600,400); QPixmap pix(600,400);
pix.fill(QColor("white")); pix.fill(QColor("white"));
QPainter painter; QPainter painter;
// 2. now we create a JKQTmathText object. // 2. now we create a JKQTmathText object.
// Also we configure the JKQTmathText to use the XITS fonts that // Also we configure the JKQTmathText to use the XITS fonts that
// were included in the *.pro-file // were included in the *.pro-file
JKQTmathText mathText; JKQTmathText mathText;
mathText.useXITS(); mathText.useXITS();
mathText.set_fontSize(20); mathText.set_fontSize(20);
// 3. now we parse some LaTeX code (the Schroedinger's equation), so // 3. now we parse some LaTeX code (the Schroedinger's equation), so
// we can draw it onto the QPixmap in the next step // we can draw it onto the QPixmap in the next step
mathText.parse("$\\left[-\\frac{\\hbar^2}{2m}\\frac{\\partial^2}{\\partial x^2}+V(x)\\right]\\Psi(x)=\\mathrm{i}\\hbar\\frac{\\partial}{\\partial t}\\Psi(x)$"); mathText.parse("$\\left[-\\frac{\\hbar^2}{2m}\\frac{\\partial^2}{\\partial x^2}+V(x)\\right]\\Psi(x)=\\mathrm{i}\\hbar\\frac{\\partial}{\\partial t}\\Psi(x)$");
// 3. here we do the painting // 3. here we do the painting
painter.begin(&pix); painter.begin(&pix);
mathText.draw(painter, Qt::AlignCenter, QRectF(0,0,pix.width(), pix.height()), false); mathText.draw(painter, Qt::AlignCenter, QRectF(0,0,pix.width(), pix.height()), false);
painter.end(); painter.end();
// now we display and resize the label as a window // now we display and resize the label as a window
lab.setPixmap(pix); lab.setPixmap(pix);
lab.show(); lab.show();
lab.resize(600,400); lab.resize(600,400);
return app.exec(); return app.exec();
} }

View File

@ -1,14 +1,18 @@
TARGET = jkqtmathtext_simpletest TARGET = jkqtmathtext_simpletest
TEMPLATE = app TEMPLATE = app
SOURCES += jkqtmathtext_simpletest.cpp SOURCES += jkqtmathtext_simpletest.cpp
CONFIG += qt CONFIG += qt
QT += core gui xml svg QT += core gui xml svg
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets printsupport greaterThan(QT_MAJOR_VERSION, 4): QT += widgets printsupport
DEPENDPATH += . ../../lib DEPENDPATH += . ../../lib
INCLUDEPATH += ../../lib INCLUDEPATH += ../../lib
CONFIG (debug, debug|release):LIBS += -L../../lib/debug -ljkqtplotterlib CONFIG (debug, debug|release) {
CONFIG (release):LIBS += -L../../lib/release -ljkqtplotterlib LIBS += -L../../staticlib/debug -ljkqtplotterlib_debug
} else {
LIBS += -L../../staticlib/release -ljkqtplotterlib
}
message("LIBS = $$LIBS")

View File

@ -1,8 +1,8 @@
TEMPLATE = subdirs TEMPLATE = subdirs
SUBDIRS += jkqtplotterlib jkqtmathtext_simpletest SUBDIRS += jkqtplotterlib jkqtmathtext_simpletest
jkqtplotterlib.file = ../../lib/jkqtplotterlib.pro jkqtplotterlib.file = ../../lib/jkqtplotterlib.pro
jkqtmathtext_simpletest.file=$$PWD/jkqtmathtext_simpletest.pro jkqtmathtext_simpletest.file=$$PWD/jkqtmathtext_simpletest.pro
jkqtmathtext_simpletest.depends = jkqtplotterlib jkqtmathtext_simpletest.depends = jkqtplotterlib

View File

@ -1 +1 @@
RESOURCES += asana.qrc RESOURCES += asana.qrc

View File

@ -1,275 +1,275 @@
#include <QApplication> #include <QApplication>
#include <QLabel> #include <QLabel>
#include <QPainter> #include <QPainter>
#include <QPixmap> #include <QPixmap>
#include <QScrollArea> #include <QScrollArea>
#include <QDebug> #include <QDebug>
#include <QHBoxLayout> #include <QHBoxLayout>
#include <QTextBrowser> #include <QTextBrowser>
#include "jkqtmathtext/jkqtmathtext.h" #include "jkqtmathtext/jkqtmathtext.h"
#include "jkqtplottertools/jkqtphighrestimer.h" #include "jkqtplottertools/jkqtphighrestimer.h"
#include "testform.h" #include "testform.h"
#define W 2000 #define W 2000
#define H 3000 #define H 3000
#define X1 15 #define X1 15
#define Y1 50 #define Y1 50
/* /*
HighResTimer ht; HighResTimer ht;
double draw(QPainter& painter, double X, double YY, JKQTmathText& mt, QString name) { double draw(QPainter& painter, double X, double YY, JKQTmathText& mt, QString name) {
double Y=YY; double Y=YY;
painter.save(); painter.save();
ht.start(); ht.start();
QSizeF s=mt.getSize(painter); QSizeF s=mt.getSize(painter);
Y=Y+mt.getAscent(painter); Y=Y+mt.getAscent(painter);
std::cout<<" sizing in "<<ht.get_time()/1000.0<<" ms\n"; std::cout<<" sizing in "<<ht.get_time()/1000.0<<" ms\n";
QPen p=painter.pen(); QPen p=painter.pen();
p.setColor("lightcoral"); p.setColor("lightcoral");
p.setStyle(Qt::DashLine); p.setStyle(Qt::DashLine);
p.setWidth(2); p.setWidth(2);
painter.setPen(p); painter.setPen(p);
QRectF r(X, Y-mt.getAscent(painter),s.width(), s.height()); QRectF r(X, Y-mt.getAscent(painter),s.width(), s.height());
painter.drawRect(r); painter.drawRect(r);
p.setColor("lightblue"); p.setColor("lightblue");
painter.setPen(p); painter.setPen(p);
painter.drawLine(X, Y, X+s.width(), Y); painter.drawLine(X, Y, X+s.width(), Y);
ht.start(); ht.start();
p.setStyle(Qt::SolidLine); p.setStyle(Qt::SolidLine);
p.setWidth(1); p.setWidth(1);
p.setColor("black"); p.setColor("black");
painter.setPen(p); painter.setPen(p);
mt.draw(painter, X, Y); mt.draw(painter, X, Y);
std::cout<<" drawing in "<<ht.get_time()/1000.0<<" ms\n"; std::cout<<" drawing in "<<ht.get_time()/1000.0<<" ms\n";
p.setColor("blue"); p.setColor("blue");
painter.setPen(p); painter.setPen(p);
QFont f; QFont f;
f.setFamily("sans serif"); f.setFamily("sans serif");
f.setUnderline(true); f.setUnderline(true);
f.setPointSize(10); f.setPointSize(10);
painter.setFont(f); painter.setFont(f);
painter.drawText(X, Y-mt.getAscent(painter)-6, name+":"); painter.drawText(X, Y-mt.getAscent(painter)-6, name+":");
painter.restore(); painter.restore();
std::cout<<name.toStdString()<<": width="<<s.width()<<" height="<<s.height()<<" ascent="<<mt.getAscent(painter)<<" descent="<<mt.getDescent(painter)<<std::endl; std::cout<<name.toStdString()<<": width="<<s.width()<<" height="<<s.height()<<" ascent="<<mt.getAscent(painter)<<" descent="<<mt.getDescent(painter)<<std::endl;
return mt.getDescent(painter)+mt.getAscent(painter)+40; return mt.getDescent(painter)+mt.getAscent(painter)+40;
} }
void timingTest(QPainter& painter, QString text, QString name, double fontSize) { void timingTest(QPainter& painter, QString text, QString name, double fontSize) {
double sum_parse=0; double sum_parse=0;
double sum_size=0; double sum_size=0;
double sum_draw=0; double sum_draw=0;
double sqrsum_parse=0, sqrsum_size=0, sqrsum_draw=0; double sqrsum_parse=0, sqrsum_size=0, sqrsum_draw=0;
int N=20; int N=20;
std::cout<<"testing '"<<name.toStdString()<<"':\nparse [ms],\tsize [ms],\tdraw [ms]\n---------------------------------------------\n"; std::cout<<"testing '"<<name.toStdString()<<"':\nparse [ms],\tsize [ms],\tdraw [ms]\n---------------------------------------------\n";
for (int i=0; i<N; i++) { for (int i=0; i<N; i++) {
double t; double t;
JKQTmathText mt; JKQTmathText mt;
mt.set_fontSize(fontSize); mt.set_fontSize(fontSize);
ht.start(); mt.parse(text); t=ht.get_time()/1000.0; ht.start(); mt.parse(text); t=ht.get_time()/1000.0;
sum_parse+=t; sum_parse+=t;
sqrsum_parse+=t*t; sqrsum_parse+=t*t;
//std::cout<<t<<",\t"; //std::cout<<t<<",\t";
ht.start(); mt.getSize(painter); t=ht.get_time()/1000.0; ht.start(); mt.getSize(painter); t=ht.get_time()/1000.0;
sum_size+=t; sum_size+=t;
sqrsum_size+=t*t; sqrsum_size+=t*t;
//std::cout<<t<<",\t"; //std::cout<<t<<",\t";
ht.start(); mt.draw(painter, 0,0); t=ht.get_time()/1000.0; ht.start(); mt.draw(painter, 0,0); t=ht.get_time()/1000.0;
sum_draw+=t; sum_draw+=t;
sqrsum_draw+=t*t; sqrsum_draw+=t*t;
//std::cout<<t<<"\n"; //std::cout<<t<<"\n";
} }
//std::cout<<"---------------------------------------------\n"; //std::cout<<"---------------------------------------------\n";
std::cout<<sum_parse/(double)N<<",\t"<<sum_size/(double)N<<",\t"<<sum_draw/(double)N<<"\t: average\n"; std::cout<<sum_parse/(double)N<<",\t"<<sum_size/(double)N<<",\t"<<sum_draw/(double)N<<"\t: average\n";
std::cout<<sqrt(sqrsum_parse-sum_parse*sum_parse/(double)N)/(double)N<<",\t"<<sqrt(sqrsum_size-sum_size*sum_size/(double)N)/(double)N<<",\t"<<sqrt(sqrsum_draw-sum_draw*sum_draw/(double)N)/(double)N<<"\t: std dev\n"; std::cout<<sqrt(sqrsum_parse-sum_parse*sum_parse/(double)N)/(double)N<<",\t"<<sqrt(sqrsum_size-sum_size*sum_size/(double)N)/(double)N<<",\t"<<sqrt(sqrsum_draw-sum_draw*sum_draw/(double)N)/(double)N<<"\t: std dev\n";
std::cout<<"\n\n"; std::cout<<"\n\n";
} }
int main(int argc, char* argv[]) int main(int argc, char* argv[])
{ {
std::cout<<sizeof(unsigned char)<<" "<<sizeof(unsigned short)<<" "<<sizeof(unsigned int)<<" "<<sizeof(unsigned long)<<" "<<sizeof(unsigned long long)<<"\n\n"; std::cout<<sizeof(unsigned char)<<" "<<sizeof(unsigned short)<<" "<<sizeof(unsigned int)<<" "<<sizeof(unsigned long)<<" "<<sizeof(unsigned long long)<<"\n\n";
QString mathTest="This is normal text: $this is math:\\langle r^2(\\tau)\\rangle=\\left\\langle (\\vec{r}(t)-\\vec{r}(t+\\tau) )^2\\right\\rangle\\ \\ \\ g(\\tau)=\\frac{1}{N}\\cdot\\left(1+\\frac{2}{3}\\frac{\\langle r^2(\\tau)\\rangle}{w_{xy}^2}\\right)^{-1} \\lfloor\\rfloor\\lceil\\rceil\\langle\\rangle\\left\\{\\va\\left|\\|\\va\\|_2\\geq2\\right.\\right\\} \\vr\\vR\\frac{\\sqrt{\\sqrt{\\sqrt{\\sum_{i=0}^\\infty \\hat{i}^2}+y^\\alpha}+1}}{\\dot{v}\\equiv\\ddot{r}}\\argmin_{\\vec{k}}\\sum_{\\sqrt{i}=0}^{N}\\int_{x_0}^{x_1}\\left(\\left(\\left(x\\right)\\right)\\right)\\underbrace{\\left[\\left\\{\\frac{\\partial f}{\\partial x}\\right\\}\\cdot\\frac{1}{2}\\right]}{\\text{underbraced text \\hbar}}\\cdots\\frac{\\sqrt{\\sum_{i=0}^2 \\hat{i}^2}+y^\\alpha}{\\dot{v}\\equiv\\ddot{r}}, \\hat{t}\\hat{T} \\overbrace{\\left|\\sqrt{x\\cdot Y}\\right|}{\\propto\\bbN\\circ\\bbZ} \\left<\\arrow{x(\\tau)}\\cdot\\vec{R}(t+\\bar{\\tau})\\right> \\alpha\\beta\\gamma\\delta\\epsilon\\Gamma\\Delta\\Theta\\Omega \\left\\_\\left~\\cbrt{\\hbar\\omega}\\right~\\right\\_$"; QString mathTest="This is normal text: $this is math:\\langle r^2(\\tau)\\rangle=\\left\\langle (\\vec{r}(t)-\\vec{r}(t+\\tau) )^2\\right\\rangle\\ \\ \\ g(\\tau)=\\frac{1}{N}\\cdot\\left(1+\\frac{2}{3}\\frac{\\langle r^2(\\tau)\\rangle}{w_{xy}^2}\\right)^{-1} \\lfloor\\rfloor\\lceil\\rceil\\langle\\rangle\\left\\{\\va\\left|\\|\\va\\|_2\\geq2\\right.\\right\\} \\vr\\vR\\frac{\\sqrt{\\sqrt{\\sqrt{\\sum_{i=0}^\\infty \\hat{i}^2}+y^\\alpha}+1}}{\\dot{v}\\equiv\\ddot{r}}\\argmin_{\\vec{k}}\\sum_{\\sqrt{i}=0}^{N}\\int_{x_0}^{x_1}\\left(\\left(\\left(x\\right)\\right)\\right)\\underbrace{\\left[\\left\\{\\frac{\\partial f}{\\partial x}\\right\\}\\cdot\\frac{1}{2}\\right]}{\\text{underbraced text \\hbar}}\\cdots\\frac{\\sqrt{\\sum_{i=0}^2 \\hat{i}^2}+y^\\alpha}{\\dot{v}\\equiv\\ddot{r}}, \\hat{t}\\hat{T} \\overbrace{\\left|\\sqrt{x\\cdot Y}\\right|}{\\propto\\bbN\\circ\\bbZ} \\left<\\arrow{x(\\tau)}\\cdot\\vec{R}(t+\\bar{\\tau})\\right> \\alpha\\beta\\gamma\\delta\\epsilon\\Gamma\\Delta\\Theta\\Omega \\left\\_\\left~\\cbrt{\\hbar\\omega}\\right~\\right\\_$";
QString symbolTest="\\lfloor\\rfloor\\lceil\\rceil\\langle\\rangle\\sum\\int \\iint \\oint \\prod \\leftrightarrow \\leftarrow\\Leftarrow\\rightarrow\\Rightarrow\\pm\\mp\\leq\\geq\\ll\\gg\\hbar\\euro\\bbC\\bbH\\bbN\\bbP\\bbQ\\bbZ\\bbR\\Angstrom\\Alef\\Bet\\Gimel\\Dalet\\nexists\\ni\\notni\\circ\\tilde\\oiint\\oiiint\\emptyset\\odot\\ominus\\subsetnot\\DC\\bot\\cdots\\perthousand\\leftharpoonup\\rightharpoonup \\upharpoonleft \\downharpoonleft \\leftrightharpoon \\rightleftharpoon \\coprod \\leftharpoondown \\rightharpoondown \\nwarrow \\nearrow \\mapsto \\cent \\pound \\yen \\div \\multimap \\maporiginal \\mapimage \\bigcap \\bigcup \\benzene \\times \\cdot \\propto \\equiv \\Im \\Re \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ "; QString symbolTest="\\lfloor\\rfloor\\lceil\\rceil\\langle\\rangle\\sum\\int \\iint \\oint \\prod \\leftrightarrow \\leftarrow\\Leftarrow\\rightarrow\\Rightarrow\\pm\\mp\\leq\\geq\\ll\\gg\\hbar\\euro\\bbC\\bbH\\bbN\\bbP\\bbQ\\bbZ\\bbR\\Angstrom\\Alef\\Bet\\Gimel\\Dalet\\nexists\\ni\\notni\\circ\\tilde\\oiint\\oiiint\\emptyset\\odot\\ominus\\subsetnot\\DC\\bot\\cdots\\perthousand\\leftharpoonup\\rightharpoonup \\upharpoonleft \\downharpoonleft \\leftrightharpoon \\rightleftharpoon \\coprod \\leftharpoondown \\rightharpoondown \\nwarrow \\nearrow \\mapsto \\cent \\pound \\yen \\div \\multimap \\maporiginal \\mapimage \\bigcap \\bigcup \\benzene \\times \\cdot \\propto \\equiv \\Im \\Re \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ ";
//QString mathTest="$\\left\\|\\stackrel{1}{2}\\right\\|\\cdot\\left|\\begin{Bmatrix}1123&2^2&\\frac{3}{4}\\\\4&5_5&6\\\\72_8&8_{\\text{längerer Index}}&9&10&11\\end{Bmatrix}\\right|\\cdots f(x)$"; //QString mathTest="$\\left\\|\\stackrel{1}{2}\\right\\|\\cdot\\left|\\begin{Bmatrix}1123&2^2&\\frac{3}{4}\\\\4&5_5&6\\\\72_8&8_{\\text{längerer Index}}&9&10&11\\end{Bmatrix}\\right|\\cdots f(x)$";
//QString mathTest="0"; //QString mathTest="0";
//QString text="x_0 \\sqrt{a^2+b^2}\\underbrace{underbrace}{x_0} (\\bf{Test})\\_\\it{Text} ... ! Äquator\\alpha\\beta $f(x)=\\sin(x{\\cdot}y)$ \\ul{Text\\ol{\\gamma}} \\script{Script}, \\tt{Typewriter}, \\sf{sans serif}"; //QString text="x_0 \\sqrt{a^2+b^2}\\underbrace{underbrace}{x_0} (\\bf{Test})\\_\\it{Text} ... ! Äquator\\alpha\\beta $f(x)=\\sin(x{\\cdot}y)$ \\ul{Text\\ol{\\gamma}} \\script{Script}, \\tt{Typewriter}, \\sf{sans serif}";
//QString text="$\\sum_{i=0_{j=-1_{k=-45}}}^{n^{m^{123456789}}}\\left(\\left(\\left(\\int_0^\\inf\\left[r+i^{\\left\\{2^2\\right\\}}\\right]{\\dd}r\\right)\\right)\\right)$ \\bf{Test}\\_\\it{Text} ... ! \\sc{&Äquator \\&}\\alpha\\beta $f(x)=\\sin(x\\cdot\\cos(a+{\\ii}b))$ \\ul{Text\\gamma} \\script{Script-Text}\\tt{ and Typewriter} \\sf{also sans serif}"; //QString text="$\\sum_{i=0_{j=-1_{k=-45}}}^{n^{m^{123456789}}}\\left(\\left(\\left(\\int_0^\\inf\\left[r+i^{\\left\\{2^2\\right\\}}\\right]{\\dd}r\\right)\\right)\\right)$ \\bf{Test}\\_\\it{Text} ... ! \\sc{&Äquator \\&}\\alpha\\beta $f(x)=\\sin(x\\cdot\\cos(a+{\\ii}b))$ \\ul{Text\\gamma} \\script{Script-Text}\\tt{ and Typewriter} \\sf{also sans serif}";
//QString text="$\\sum_{i=0_{j=-1_{k=-45}}}^2\\left(\\left(\\left(\\int_0^\\inf\\left[r+i^{\\left\\{2^2\\right\\}}\\right]{\\dd}r\\right)\\right)\\right)$ \\bf{Test}\\_\\it{Text} ... ! \\sc{&Äquator \\&}\\alpha\\beta $f(x)=\\sin(x\\cdot\\cos(a+{\\ii}b))$ \\ul{Text\\gamma} \\script{Script-Text}\\tt{ and Typewriter} \\sf{also sans serif}"; //QString text="$\\sum_{i=0_{j=-1_{k=-45}}}^2\\left(\\left(\\left(\\int_0^\\inf\\left[r+i^{\\left\\{2^2\\right\\}}\\right]{\\dd}r\\right)\\right)\\right)$ \\bf{Test}\\_\\it{Text} ... ! \\sc{&Äquator \\&}\\alpha\\beta $f(x)=\\sin(x\\cdot\\cos(a+{\\ii}b))$ \\ul{Text\\gamma} \\script{Script-Text}\\tt{ and Typewriter} \\sf{also sans serif}";
QString text="x_0My Text$\\sqrt{a^2+b^2 } \\underbrace{underbrace}{x_0}$"; QString text="x_0My Text$\\sqrt{a^2+b^2 } \\underbrace{underbrace}{x_0}$";
QApplication app(argc, argv); QApplication app(argc, argv);
QWidget w; QWidget w;
QHBoxLayout lay(&w); QHBoxLayout lay(&w);
w.setLayout(&lay); w.setLayout(&lay);
QScrollArea area; QScrollArea area;
QTextBrowser browser; QTextBrowser browser;
lay.addWidget(&area); lay.addWidget(&area);
lay.addWidget(&browser); lay.addWidget(&browser);
QLabel win; QLabel win;
area.setBackgroundRole(QPalette::Dark); area.setBackgroundRole(QPalette::Dark);
area.setWidget(&win); area.setWidget(&win);
QPixmap pix(W, H), pix2(W,H); QPixmap pix(W, H), pix2(W,H);
pix.fill(); pix.fill();
QPainter painter; QPainter painter;
JKQTmathText mt(&win); JKQTmathText mt(&win);
double Y=Y1; double Y=Y1;
painter.begin(&pix); painter.begin(&pix);
painter.setRenderHint(QPainter::Antialiasing); painter.setRenderHint(QPainter::Antialiasing);
painter.setRenderHint(QPainter::HighQualityAntialiasing); painter.setRenderHint(QPainter::HighQualityAntialiasing);
painter.setRenderHint(QPainter::TextAntialiasing); painter.setRenderHint(QPainter::TextAntialiasing);
ht.start(); ht.start();
mt.set_fontRoman("Times New Roman"); mt.set_fontRoman("Times New Roman");
mt.set_fontMathRoman("Times New Roman"); mt.set_fontMathRoman("Times New Roman");
mt.set_fontSans("Arial"); mt.set_fontSans("Arial");
mt.set_fontMathSans("Arial"); mt.set_fontMathSans("Arial");
mt.set_fontTypewriter("Courier"); mt.set_fontTypewriter("Courier");
mt.parse(mathTest); mt.parse(mathTest);
bool okh=true; bool okh=true;
browser.textCursor().insertHtml("<hr>"+mt.toHtml(&okh)+"<hr><br><br>"); browser.textCursor().insertHtml("<hr>"+mt.toHtml(&okh)+"<hr><br><br>");
qDebug()<<"HTML1: ---------------------------------------------\n"<<mt.toHtml(&okh)<<"\nHTML1: --------------------------------------------- ok="<<okh; qDebug()<<"HTML1: ---------------------------------------------\n"<<mt.toHtml(&okh)<<"\nHTML1: --------------------------------------------- ok="<<okh;
if (mt.get_error_list().size()>0) { if (mt.get_error_list().size()>0) {
std::cout<<mt.get_error_list().join("\n").toStdString()<<std::endl<<std::endl; std::cout<<mt.get_error_list().join("\n").toStdString()<<std::endl<<std::endl;
} }
std::cout<<"parse mathTest in "<<ht.get_time()/1000.0<<" ms\n"; std::cout<<"parse mathTest in "<<ht.get_time()/1000.0<<" ms\n";
mt.set_fontSize(10); mt.set_fontSize(10);
Y+=draw(painter, X1, Y, mt, "math, symbol, 10pt"); Y+=draw(painter, X1, Y, mt, "math, symbol, 10pt");
mt.set_fontSize(20); mt.set_fontSize(20);
Y+=draw(painter, X1, Y, mt, "math, symbol, 20pt"); Y+=draw(painter, X1, Y, mt, "math, symbol, 20pt");
ht.start(); ht.start();
mt.parse(symbolTest); mt.parse(symbolTest);
std::cout<<"parse symbolTest in "<<ht.get_time()/1000.0<<" ms\n"; std::cout<<"parse symbolTest in "<<ht.get_time()/1000.0<<" ms\n";
browser.textCursor().insertHtml("<hr>"+mt.toHtml(&okh)+"<hr><br><br>"); browser.textCursor().insertHtml("<hr>"+mt.toHtml(&okh)+"<hr><br><br>");
qDebug()<<"HTML2: ---------------------------------------------\n"<<mt.toHtml(&okh)<<"\nHTML2: --------------------------------------------- ok="<<okh; qDebug()<<"HTML2: ---------------------------------------------\n"<<mt.toHtml(&okh)<<"\nHTML2: --------------------------------------------- ok="<<okh;
mt.set_fontSize(12); mt.set_fontSize(12);
Y+=draw(painter, X1, Y, mt, "math, XITS, 12pt"); Y+=draw(painter, X1, Y, mt, "math, XITS, 12pt");
ht.start(); ht.start();
mt.parse(text); mt.parse(text);
std::cout<<"parse text in "<<ht.get_time()/1000.0<<" ms\n"; std::cout<<"parse text in "<<ht.get_time()/1000.0<<" ms\n";
browser.textCursor().insertHtml("<hr>"+mt.toHtml(&okh)+"<hr><br><br>"); browser.textCursor().insertHtml("<hr>"+mt.toHtml(&okh)+"<hr><br><br>");
qDebug()<<"HTML2: ---------------------------------------------\n"<<mt.toHtml(&okh)<<"\nHTML2: --------------------------------------------- ok="<<okh; qDebug()<<"HTML2: ---------------------------------------------\n"<<mt.toHtml(&okh)<<"\nHTML2: --------------------------------------------- ok="<<okh;
mt.set_fontSize(10); mt.set_fontSize(10);
Y+=draw(painter, X1, Y, mt, "text, symbol, 10pt"); Y+=draw(painter, X1, Y, mt, "text, symbol, 10pt");
mt.set_fontSize(16); mt.set_fontSize(16);
Y+=draw(painter, X1, Y, mt, "text, symbol, 16pt"); Y+=draw(painter, X1, Y, mt, "text, symbol, 16pt");
Y+=30; Y+=30;
mt.useXITS(); mt.useXITS();
ht.start(); ht.start();
mt.parse(mathTest); mt.parse(mathTest);
std::cout<<"parse mathTest in "<<ht.get_time()/1000.0<<" ms\n"; std::cout<<"parse mathTest in "<<ht.get_time()/1000.0<<" ms\n";
mt.set_fontSize(10); mt.set_fontSize(10);
Y+=draw(painter, X1, Y, mt, "math, XITS, 10pt"); Y+=draw(painter, X1, Y, mt, "math, XITS, 10pt");
mt.set_fontSize(20); mt.set_fontSize(20);
Y+=draw(painter, X1, Y, mt, "math, XITS, 20pt"); Y+=draw(painter, X1, Y, mt, "math, XITS, 20pt");
ht.start(); ht.start();
mt.parse(symbolTest); mt.parse(symbolTest);
std::cout<<"parse symbolTest in "<<ht.get_time()/1000.0<<" ms\n"; std::cout<<"parse symbolTest in "<<ht.get_time()/1000.0<<" ms\n";
mt.set_fontSize(12); mt.set_fontSize(12);
Y+=draw(painter, X1, Y, mt, "math, XITS, 12pt"); Y+=draw(painter, X1, Y, mt, "math, XITS, 12pt");
ht.start(); ht.start();
mt.parse(text); mt.parse(text);
std::cout<<"parse text in "<<ht.get_time()/1000.0<<" ms\n"; std::cout<<"parse text in "<<ht.get_time()/1000.0<<" ms\n";
mt.set_fontSize(10); mt.set_fontSize(10);
Y+=draw(painter, X1, Y, mt, "text, XITS, 10pt"); Y+=draw(painter, X1, Y, mt, "text, XITS, 10pt");
mt.set_fontSize(16); mt.set_fontSize(16);
Y+=draw(painter, X1, Y, mt, "text, XITS, 16pt"); Y+=draw(painter, X1, Y, mt, "text, XITS, 16pt");
Y+=30; Y+=30;
mt.useAnyUnicode("Arial", "Times New Roman"); mt.useAnyUnicode("Arial", "Times New Roman");
ht.start(); ht.start();
mt.parse(mathTest); mt.parse(mathTest);
std::cout<<"parse mathTest in "<<ht.get_time()/1000.0<<" ms\n"; std::cout<<"parse mathTest in "<<ht.get_time()/1000.0<<" ms\n";
mt.set_fontSize(10); mt.set_fontSize(10);
Y+=draw(painter, X1, Y, mt, "math, Arial Unicode, 10pt"); Y+=draw(painter, X1, Y, mt, "math, Arial Unicode, 10pt");
mt.set_fontSize(20); mt.set_fontSize(20);
Y+=draw(painter, X1, Y, mt, "math, Arial Unicode, 20pt"); Y+=draw(painter, X1, Y, mt, "math, Arial Unicode, 20pt");
ht.start(); ht.start();
mt.parse(symbolTest); mt.parse(symbolTest);
std::cout<<"parse symbolTest in "<<ht.get_time()/1000.0<<" ms\n"; std::cout<<"parse symbolTest in "<<ht.get_time()/1000.0<<" ms\n";
mt.set_fontSize(12); mt.set_fontSize(12);
Y+=draw(painter, X1, Y, mt, "math, Arial Unicode, 12pt"); Y+=draw(painter, X1, Y, mt, "math, Arial Unicode, 12pt");
ht.start(); ht.start();
mt.parse(text); mt.parse(text);
std::cout<<"parse text in "<<ht.get_time()/1000.0<<" ms\n"; std::cout<<"parse text in "<<ht.get_time()/1000.0<<" ms\n";
mt.set_fontSize(10); mt.set_fontSize(10);
Y+=draw(painter, X1, Y, mt, "text, Arial Unicode, 10pt"); Y+=draw(painter, X1, Y, mt, "text, Arial Unicode, 10pt");
mt.set_fontSize(16); mt.set_fontSize(16);
Y+=draw(painter, X1, Y, mt, "text, Arial Unicode, 16pt"); Y+=draw(painter, X1, Y, mt, "text, Arial Unicode, 16pt");
Y+=30; Y+=30;
mt.useSTIX(); mt.useSTIX();
ht.start(); ht.start();
mt.parse(mathTest); mt.parse(mathTest);
std::cout<<"parse mathTest in "<<ht.get_time()/1000.0<<" ms\n"; std::cout<<"parse mathTest in "<<ht.get_time()/1000.0<<" ms\n";
mt.set_fontSize(10); mt.set_fontSize(10);
Y+=draw(painter, X1, Y, mt, "math, STIX, 10pt"); Y+=draw(painter, X1, Y, mt, "math, STIX, 10pt");
mt.set_fontSize(20); mt.set_fontSize(20);
Y+=draw(painter, X1, Y, mt, "math, STIX, 20pt"); Y+=draw(painter, X1, Y, mt, "math, STIX, 20pt");
ht.start(); ht.start();
mt.parse(symbolTest); mt.parse(symbolTest);
std::cout<<"parse symbolTest in "<<ht.get_time()/1000.0<<" ms\n"; std::cout<<"parse symbolTest in "<<ht.get_time()/1000.0<<" ms\n";
mt.set_fontSize(12); mt.set_fontSize(12);
Y+=draw(painter, X1, Y, mt, "math, STIX, 12pt"); Y+=draw(painter, X1, Y, mt, "math, STIX, 12pt");
ht.start(); ht.start();
mt.parse(text); mt.parse(text);
std::cout<<"parse text in "<<ht.get_time()/1000.0<<" ms\n"; std::cout<<"parse text in "<<ht.get_time()/1000.0<<" ms\n";
mt.set_fontSize(10); mt.set_fontSize(10);
Y+=draw(painter, X1, Y, mt, "text, STIX, 10pt"); Y+=draw(painter, X1, Y, mt, "text, STIX, 10pt");
mt.set_fontSize(16); mt.set_fontSize(16);
Y+=draw(painter, X1, Y, mt, "text, STIX, 16pt"); Y+=draw(painter, X1, Y, mt, "text, STIX, 16pt");
painter.end(); painter.end();
// timing test // timing test
painter.begin(&pix2); painter.begin(&pix2);
std::cout<<"timing test, font size 10pt:\n"; std::cout<<"timing test, font size 10pt:\n";
timingTest(painter, mathTest, "mathTest", 10); timingTest(painter, mathTest, "mathTest", 10);
timingTest(painter, text, "text", 10); timingTest(painter, text, "text", 10);
std::cout<<"timing test, font size 20pt:\n"; std::cout<<"timing test, font size 20pt:\n";
timingTest(painter, mathTest, "mathTest", 20); timingTest(painter, mathTest, "mathTest", 20);
timingTest(painter, text, "text", 20); timingTest(painter, text, "text", 20);
std::cout<<"timing test, font size 30pt:\n"; std::cout<<"timing test, font size 30pt:\n";
timingTest(painter, mathTest, "mathTest", 30); timingTest(painter, mathTest, "mathTest", 30);
timingTest(painter, text, "text", 30); timingTest(painter, text, "text", 30);
win.setPixmap(pix); win.setPixmap(pix);
win.resize(W, H); win.resize(W, H);
w.show(); w.show();
w.showMaximized(); w.showMaximized();
return app.exec(); return app.exec();
} }
*/ */
int main(int argc, char* argv[]) int main(int argc, char* argv[])
{ {
QApplication app(argc, argv); QApplication app(argc, argv);
TestForm w; TestForm w;
w.show(); w.show();
w.updateMath(); w.updateMath();
w.showMaximized(); w.showMaximized();
return app.exec(); return app.exec();
} }

View File

@ -1,41 +1,45 @@
include($$PWD/asana.pri) include($$PWD/asana.pri)
LIBS += LIBS +=
SOURCES += jkqtmathtext_test.cpp \ SOURCES += jkqtmathtext_test.cpp \
testform.cpp testform.cpp
RCC_DIR = rccs RCC_DIR = rccs
CONFIG += qt windows CONFIG += qt windows
TARGET = jkqtmathtext_test TARGET = jkqtmathtext_test
QT += core gui svg xml QT += core gui svg xml
UI_DIR = .uics UI_DIR = .uics
HEADERS += testform.h HEADERS += testform.h
OBJECTS_DIR = .objs OBJECTS_DIR = .objs
INCLUDEPATH += INCLUDEPATH +=
MOC_DIR = .mocs MOC_DIR = .mocs
FORMS += \ FORMS += \
testform.ui testform.ui
DESTDIR = ./ DESTDIR = ./
DEFINES += AUTOLOAD_XITS_FONTS AUTOLOAD_Asana_FONTS DEFINES += AUTOLOAD_XITS_FONTS AUTOLOAD_Asana_FONTS
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets printsupport greaterThan(QT_MAJOR_VERSION, 4): QT += widgets printsupport
DEPENDPATH += . ../../lib DEPENDPATH += . ../../lib
INCLUDEPATH += ../../lib INCLUDEPATH += ../../lib
CONFIG (debug, debug|release):LIBS += -L../../lib/debug -ljkqtplotterlib CONFIG (debug, debug|release) {
CONFIG (release):LIBS += -L../../lib/release -ljkqtplotterlib LIBS += -L../../staticlib/debug -ljkqtplotterlib_debug
} else {
LIBS += -L../../staticlib/release -ljkqtplotterlib
}
message("LIBS = $$LIBS")

View File

@ -1,8 +1,8 @@
TEMPLATE = subdirs TEMPLATE = subdirs
SUBDIRS += jkqtplotterlib jkqtmathtext_test SUBDIRS += jkqtplotterlib jkqtmathtext_test
jkqtplotterlib.file = ../../lib/jkqtplotterlib.pro jkqtplotterlib.file = ../../lib/jkqtplotterlib.pro
jkqtmathtext_test.file=$$PWD/jkqtmathtext_test.pro jkqtmathtext_test.file=$$PWD/jkqtmathtext_test.pro
jkqtmathtext_test.depends = jkqtplotterlib jkqtmathtext_test.depends = jkqtplotterlib

View File

@ -1,12 +1,12 @@
[FormatInfo] [FormatInfo]
Type=TeXnicCenterProjectInformation Type=TeXnicCenterProjectInformation
Version=4 Version=4
[ProjectInfo] [ProjectInfo]
MainFile=mathtest.tex MainFile=mathtest.tex
UseBibTeX=0 UseBibTeX=0
UseMakeIndex=0 UseMakeIndex=0
ActiveProfile=LaTeX ⇨ PDF ActiveProfile=LaTeX ⇨ PDF
ProjectLanguage=en ProjectLanguage=en
ProjectDialect=US ProjectDialect=US

View File

@ -1,127 +1,127 @@
\documentclass[a4paper]{scrartcl} \documentclass[a4paper]{scrartcl}
%% Deutsche Anpassungen %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Deutsche Anpassungen %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage[ngerman]{babel} \usepackage[ngerman]{babel}
\usepackage[ansinew]{inputenc} \usepackage[ansinew]{inputenc}
\usepackage{ulem} \usepackage{ulem}
\usepackage{mathtools} \usepackage{mathtools}
\usepackage{esint} \usepackage{esint}
%\usepackage{txfonts} %\usepackage{txfonts}
\usepackage[landscape]{geometry} \usepackage[landscape]{geometry}
\usepackage{amsmath} \usepackage{amsmath}
\usepackage{amssymb} \usepackage{amssymb}
\newcommand{\cbrt}[1]{\sqrt[3]{#1}} \newcommand{\cbrt}[1]{\sqrt[3]{#1}}
\newcommand{\bbC}{\mathbb{C}} \newcommand{\bbC}{\mathbb{C}}
\newcommand{\bbH}{\mathbb{H}} \newcommand{\bbH}{\mathbb{H}}
\newcommand{\bbN}{\mathbb{N}} \newcommand{\bbN}{\mathbb{N}}
\newcommand{\bbP}{\mathbb{P}} \newcommand{\bbP}{\mathbb{P}}
\newcommand{\bbQ}{\mathbb{Q}} \newcommand{\bbQ}{\mathbb{Q}}
\newcommand{\bbZ}{\mathbb{Z}} \newcommand{\bbZ}{\mathbb{Z}}
\newcommand{\bbR}{\mathbb{R}} \newcommand{\bbR}{\mathbb{R}}
\newcommand{\Angstrom}{\r{A}} \newcommand{\Angstrom}{\r{A}}
\newcommand{\lefrighttharpoons}{\rightleftharpoons} \newcommand{\lefrighttharpoons}{\rightleftharpoons}
\newcommand{\subsetnot}{\not\subset} \newcommand{\subsetnot}{\not\subset}
\newcommand{\argmax}{\operatorname*{arg\,max}} \newcommand{\argmax}{\operatorname*{arg\,max}}
\newcommand{\va}{\vec{a}} \newcommand{\va}{\vec{a}}
\newcommand{\vr}{\vec{r}} \newcommand{\vr}{\vec{r}}
\newcommand{\vR}{\vec{R}} \newcommand{\vR}{\vec{R}}
\newcommand{\argmin}{\mbox{arg\:min}} \newcommand{\argmin}{\mbox{arg\:min}}
\newcommand{\uul}[1]{\uuline{#1}} \newcommand{\uul}[1]{\uuline{#1}}
\newcommand{\ool}[1]{\overline{\overline{#1}}} \newcommand{\ool}[1]{\overline{\overline{#1}}}
\newcommand{\arrow}[1]{\overrightarrow{#1}} \newcommand{\arrow}[1]{\overrightarrow{#1}}
\begin{document} \begin{document}
\begin{itemize} \begin{itemize}
\item\textbf{std dev:} \[\sigma_x=\sqrt{\langle (x-\langle x\rangle)^2\rangle}=\sqrt{\frac{1}{N-1}\cdot\left( \sum_{i=1}^N{x_i}^2-\frac{1}{N}\cdot\left(\sum_{i=1}^Nx_i\right)^2\right)} \] \item\textbf{std dev:} \[\sigma_x=\sqrt{\langle (x-\langle x\rangle)^2\rangle}=\sqrt{\frac{1}{N-1}\cdot\left( \sum_{i=1}^N{x_i}^2-\frac{1}{N}\cdot\left(\sum_{i=1}^Nx_i\right)^2\right)} \]
\item\textbf{std dev 2:} \[\sigma_x=\sqrt{\langle (x-\langle x\rangle)^2\rangle}=\sqrt{\frac{1}{N-1}\cdot\left( \sum_{i=1}^Nx_i^2-\frac{1}{N}\cdot\left(\sum_{i=1}^Nx_i\right)^2\right)} \] \item\textbf{std dev 2:} \[\sigma_x=\sqrt{\langle (x-\langle x\rangle)^2\rangle}=\sqrt{\frac{1}{N-1}\cdot\left( \sum_{i=1}^Nx_i^2-\frac{1}{N}\cdot\left(\sum_{i=1}^Nx_i\right)^2\right)} \]
\item\textbf{rotation matrix:} \[\mathrm{\mathbf{M}}(\alpha) = \left(\begin{matrix}\cos(\alpha)+n_x^2\cdot (1-\cos(\alpha)) & n_x\cdot n_y\cdot (1-\cos(\alpha))-n_z\cdot \sin(\alpha) & n_x\cdot n_z\cdot (1-\cos(\alpha))+n_y\cdot \sin(\alpha)\\n_x\cdot n_y\cdot (1-\cos(\alpha))+n_z\cdot \sin(\alpha) & \cos(\alpha)+n_y^2\cdot (1-\cos(\alpha)) & n_y\cdot n_z\cdot (1-\cos(\alpha))-n_x\cdot \sin(\alpha)\\n_z\cdot n_x\cdot (1-\cos(\alpha))-n_y\cdot \sin(\alpha) & n_z\cdot n_y\cdot (1-\cos(\alpha))+n_x\cdot \sin(\alpha) & \cos(\alpha)+n_z^2\cdot (1-\cos(\alpha))\end{matrix}\right) \] \item\textbf{rotation matrix:} \[\mathrm{\mathbf{M}}(\alpha) = \left(\begin{matrix}\cos(\alpha)+n_x^2\cdot (1-\cos(\alpha)) & n_x\cdot n_y\cdot (1-\cos(\alpha))-n_z\cdot \sin(\alpha) & n_x\cdot n_z\cdot (1-\cos(\alpha))+n_y\cdot \sin(\alpha)\\n_x\cdot n_y\cdot (1-\cos(\alpha))+n_z\cdot \sin(\alpha) & \cos(\alpha)+n_y^2\cdot (1-\cos(\alpha)) & n_y\cdot n_z\cdot (1-\cos(\alpha))-n_x\cdot \sin(\alpha)\\n_z\cdot n_x\cdot (1-\cos(\alpha))-n_y\cdot \sin(\alpha) & n_z\cdot n_y\cdot (1-\cos(\alpha))+n_x\cdot \sin(\alpha) & \cos(\alpha)+n_z^2\cdot (1-\cos(\alpha))\end{matrix}\right) \]
\item\textbf{like in label at bottom (no MM):} \[\left(\left[\sqrt{2\pi\cdot\int_{-\infty}^\infty f(x)\;\mathrm{d}x}\right]\right) \] \item\textbf{like in label at bottom (no MM):} \[\left(\left[\sqrt{2\pi\cdot\int_{-\infty}^\infty f(x)\;\mathrm{d}x}\right]\right) \]
\item\textbf{like in label at bottom (MM):} \[\left(\left[\sqrt{2\pi\cdot\int_{-\infty}^\infty f(x)\;\mathrm{d}x}\right]\right) \] \item\textbf{like in label at bottom (MM):} \[\left(\left[\sqrt{2\pi\cdot\int_{-\infty}^\infty f(x)\;\mathrm{d}x}\right]\right) \]
\item\textbf{decoration:} \[\vec{x}\vec{X}\vec{\psi} -- \dot{x}\dot{X}\dot{\psi} -- \ddot{x}\ddot{X}\ddot{\psi} -- \overline{x}\overline{X}\overline{\psi} -- \underline{x}\underline{X}\underline{\psi} -- \hat{x}\hat{X}\hat{\psi} -- \tilde{x}\tilde{X}\tilde{\psi} -- \uul{x}\uul{X}\uul{\psi} -- \ool{x}\ool{X}\ool{\psi} -- \bar{x}\bar{X}\bar{\psi} -- \arrow{x}\arrow{X}\arrow{\psi} \] \item\textbf{decoration:} \[\vec{x}\vec{X}\vec{\psi} -- \dot{x}\dot{X}\dot{\psi} -- \ddot{x}\ddot{X}\ddot{\psi} -- \overline{x}\overline{X}\overline{\psi} -- \underline{x}\underline{X}\underline{\psi} -- \hat{x}\hat{X}\hat{\psi} -- \tilde{x}\tilde{X}\tilde{\psi} -- \uul{x}\uul{X}\uul{\psi} -- \ool{x}\ool{X}\ool{\psi} -- \bar{x}\bar{X}\bar{\psi} -- \arrow{x}\arrow{X}\arrow{\psi} \]
\item\textbf{mathtest:}\\ This is normal text: $this is math:\langle r^2(\tau)\rangle=\left\langle (\vec{r}(t)-\vec{r}(t+\tau) )^2\right\rangle\ \ \ g(\tau)=\frac{1}{N}\cdot\left(1+\frac{2}{3}\frac{\langle r^2(\tau)\rangle}{w_{xy}^2}\right)^{-1} \lfloor\rfloor\lceil\rceil\langle\rangle\left\{\va\left|\|\va\|_2\geq2\right.\right\} \vr\vR$\\$\frac{\sqrt{\sqrt{\sqrt{\sum_{i=0}^\infty \hat{i}^2}+y^\alpha}+1}}{\dot{v}\equiv\ddot{r}}\argmin_{\vec{k}}\sum_{\sqrt{i}=0}^{N}\int_{x_0}^{x_1}\left(\left(\left(x\right)\right)\right)\underbrace{\left[\left\{\frac{\partial f}{\partial x}\right\}\cdot\frac{1}{2}\right]}{\text{underbraced text $\hbar$}}\cdots\frac{\sqrt{\sum_{i=0}^2 \hat{i}^2}+y^\alpha}{\dot{v}\equiv\ddot{r}}, \hat{t}\hat{T} \overbrace{\left|\sqrt{x\cdot Y}\right|}{\propto\bbN\circ\bbZ}$\\$\left<\arrow{x(\tau)}\cdot\vec{R}(t+\bar{\tau})\right> \alpha\beta\gamma\delta\epsilon\Gamma\Delta\Theta\Omega \left\lfloor \left\lceil \cbrt{\hbar\omega}\right\rceil\right\rfloor $ \item\textbf{mathtest:}\\ This is normal text: $this is math:\langle r^2(\tau)\rangle=\left\langle (\vec{r}(t)-\vec{r}(t+\tau) )^2\right\rangle\ \ \ g(\tau)=\frac{1}{N}\cdot\left(1+\frac{2}{3}\frac{\langle r^2(\tau)\rangle}{w_{xy}^2}\right)^{-1} \lfloor\rfloor\lceil\rceil\langle\rangle\left\{\va\left|\|\va\|_2\geq2\right.\right\} \vr\vR$\\$\frac{\sqrt{\sqrt{\sqrt{\sum_{i=0}^\infty \hat{i}^2}+y^\alpha}+1}}{\dot{v}\equiv\ddot{r}}\argmin_{\vec{k}}\sum_{\sqrt{i}=0}^{N}\int_{x_0}^{x_1}\left(\left(\left(x\right)\right)\right)\underbrace{\left[\left\{\frac{\partial f}{\partial x}\right\}\cdot\frac{1}{2}\right]}{\text{underbraced text $\hbar$}}\cdots\frac{\sqrt{\sum_{i=0}^2 \hat{i}^2}+y^\alpha}{\dot{v}\equiv\ddot{r}}, \hat{t}\hat{T} \overbrace{\left|\sqrt{x\cdot Y}\right|}{\propto\bbN\circ\bbZ}$\\$\left<\arrow{x(\tau)}\cdot\vec{R}(t+\bar{\tau})\right> \alpha\beta\gamma\delta\epsilon\Gamma\Delta\Theta\Omega \left\lfloor \left\lceil \cbrt{\hbar\omega}\right\rceil\right\rfloor $
\item\textbf{chi2 test:} \[\vec{p}^\ast=\argmax\limits_{\vec{p}}\chi^2=\argmax\limits_{\vec{p}}\sum\limits_{i=1}^N\left|\frac{\hat{f}_i-f(x_i;\vec{p})}{\sigma_i}\right|^2\] \item\textbf{chi2 test:} \[\vec{p}^\ast=\argmax\limits_{\vec{p}}\chi^2=\argmax\limits_{\vec{p}}\sum\limits_{i=1}^N\left|\frac{\hat{f}_i-f(x_i;\vec{p})}{\sigma_i}\right|^2\]
\item\textbf{upper/lower parantheses test:} \[ \text{bblabla} \frac{1}{2}\cdot\left(\frac{1}{\mathrm{e}^x+\mathrm{e}^{-x}}\right)\cdot\left(\frac{1}{\frac{1+2}{5+x}}\right)\cdot\left(\frac{1}{\exp\left[-\frac{y^2}{\sqrt{x}}\right]\cdot\exp\left[-\frac{1}{\frac{1}{2}}\right]}\right) \] \item\textbf{upper/lower parantheses test:} \[ \text{bblabla} \frac{1}{2}\cdot\left(\frac{1}{\mathrm{e}^x+\mathrm{e}^{-x}}\right)\cdot\left(\frac{1}{\frac{1+2}{5+x}}\right)\cdot\left(\frac{1}{\exp\left[-\frac{y^2}{\sqrt{x}}\right]\cdot\exp\left[-\frac{1}{\frac{1}{2}}\right]}\right) \]
\item\textbf{ACF test:} \[g_{rg}^{ab}(\tau)=\frac{1}{N}\cdot\left(1+\frac{2}{3}\frac{\langle r^2(\tau)\rangle}{w_{xy}^2}\right)^{-1}\cdot\left(1+\frac{2}{3}\frac{\langle r^2(\tau)\rangle}{w_{xy}^2}\right)^{-\frac{1}{2}} \] \item\textbf{ACF test:} \[g_{rg}^{ab}(\tau)=\frac{1}{N}\cdot\left(1+\frac{2}{3}\frac{\langle r^2(\tau)\rangle}{w_{xy}^2}\right)^{-1}\cdot\left(1+\frac{2}{3}\frac{\langle r^2(\tau)\rangle}{w_{xy}^2}\right)^{-\frac{1}{2}} \]
\item\textbf{MSD test:} \[\mathrm{MSD}(\tau)\equiv\langle r^2(\tau)\rangle=\left\langle (\vec{r}(t)-\vec{r}(t+\tau) )^2\right\rangle=2n\cdot\frac{K_\alpha}{\Gamma(1+\alpha)}\cdot\tau^\alpha \] \item\textbf{MSD test:} \[\mathrm{MSD}(\tau)\equiv\langle r^2(\tau)\rangle=\left\langle (\vec{r}(t)-\vec{r}(t+\tau) )^2\right\rangle=2n\cdot\frac{K_\alpha}{\Gamma(1+\alpha)}\cdot\tau^\alpha \]
\item\textbf{math: blackboard:} \[\mathbb{ABCDEFGHIJKLMNOPQRSTUVWXYZ120} \] \item\textbf{math: blackboard:} \[\mathbb{ABCDEFGHIJKLMNOPQRSTUVWXYZ120} \]
\item\textbf{math: bf:} \[\mathbf{ABCDEFGHIJKLMNOPQRSTUVWXYZ120} \] \item\textbf{math: bf:} \[\mathbf{ABCDEFGHIJKLMNOPQRSTUVWXYZ120} \]
\item\textbf{math: rm:} \[\mathrm{ABCDEFGHIJKLMNOPQRSTUVWXYZ120} \] \item\textbf{math: rm:} \[\mathrm{ABCDEFGHIJKLMNOPQRSTUVWXYZ120} \]
\item\textbf{math: cal:} \[\mathcal{ABCDEFGHIJKLMNOPQRSTUVWXYZ120} \] \item\textbf{math: cal:} \[\mathcal{ABCDEFGHIJKLMNOPQRSTUVWXYZ120} \]
\item\textbf{subscript test:} \[r_{123}\ \ r_{\frac{1}{2}} \] \item\textbf{subscript test:} \[r_{123}\ \ r_{\frac{1}{2}} \]
\item\textbf{subscript0 test:} \[r_{123} \] \item\textbf{subscript0 test:} \[r_{123} \]
\item\textbf{subscript1 test:} \[r_{123}\ \] \item\textbf{subscript1 test:} \[r_{123}\ \]
\item\textbf{subscript2 test:} \[r_{123}\ \ \] \item\textbf{subscript2 test:} \[r_{123}\ \ \]
\item\textbf{subscript3 test:} \[r_{123}r_{\frac{1}{2}} \] \item\textbf{subscript3 test:} \[r_{123}r_{\frac{1}{2}} \]
\item\textbf{superscript test:} \[r^{123}\ \ r^{\frac{1}{2}} \] \item\textbf{superscript test:} \[r^{123}\ \ r^{\frac{1}{2}} \]
\item\textbf{superscript0 test:} \[r^{123} \] \item\textbf{superscript0 test:} \[r^{123} \]
\item\textbf{superscript1 test:} \[r^{123}\ \] \item\textbf{superscript1 test:} \[r^{123}\ \]
\item\textbf{superscript2 test:} \[r^{123}\ \ \] \item\textbf{superscript2 test:} \[r^{123}\ \ \]
\item\textbf{superscript3 test:} \[r^{123}r^{\frac{1}{2}} \] \item\textbf{superscript3 test:} \[r^{123}r^{\frac{1}{2}} \]
\item\textbf{asuperscript test:} \[a^{123}\ \ a^{\frac{1}{2}} \] \item\textbf{asuperscript test:} \[a^{123}\ \ a^{\frac{1}{2}} \]
\item\textbf{asuperscript0 test:} \[a^{123} \] \item\textbf{asuperscript0 test:} \[a^{123} \]
\item\textbf{gsuperscript1 test:} \[g^{123}\ \] \item\textbf{gsuperscript1 test:} \[g^{123}\ \]
\item\textbf{gsuperscript2 test:} \[g^{123}\ \ \] \item\textbf{gsuperscript2 test:} \[g^{123}\ \ \]
\item\textbf{gsuperscript3 test:} \[g^{123}g^{\frac{1}{2}} \] \item\textbf{gsuperscript3 test:} \[g^{123}g^{\frac{1}{2}} \]
\item\textbf{frac test:} \[\frac{a}{b}+\frac{g}{a}-\frac{a^2}{b^2}\cdot\frac{a^2}{b^{\frac{1}{2}}} \] \item\textbf{frac test:} \[\frac{a}{b}+\frac{g}{a}-\frac{a^2}{b^2}\cdot\frac{a^2}{b^{\frac{1}{2}}} \]
\item\textbf{tfrac test:} \[\tfrac{a}{b}+\tfrac{g}{a}-\tfrac{a^2}{b^2}\cdot\tfrac{a^2}{b^{\tfrac{1}{2}}} \] \item\textbf{tfrac test:} \[\tfrac{a}{b}+\tfrac{g}{a}-\tfrac{a^2}{b^2}\cdot\tfrac{a^2}{b^{\tfrac{1}{2}}} \]
\item\textbf{dfrac test:} \[\dfrac{a}{b}+\dfrac{g}{a}-\dfrac{a^2}{b^2}\cdot\dfrac{a^2}{b^{\dfrac{1}{2}}} \] \item\textbf{dfrac test:} \[\dfrac{a}{b}+\dfrac{g}{a}-\dfrac{a^2}{b^2}\cdot\dfrac{a^2}{b^{\dfrac{1}{2}}} \]
\item\textbf{stackrel test:} \[\stackrel{a}{b}+\stackrel{g}{a}-\stackrel{a^2}{b^2}\cdot\stackrel{a^2}{b^{\stackrel{1}{2}}} \] \item\textbf{stackrel test:} \[\stackrel{a}{b}+\stackrel{g}{a}-\stackrel{a^2}{b^2}\cdot\stackrel{a^2}{b^{\stackrel{1}{2}}} \]
\item\textbf{brace5 test: ( )} \[\left(\left(\left( r^{123}\right)\right)\right) -- \left(\left(\left( r^{123}\right)\right)\right) \] \item\textbf{brace5 test: ( )} \[\left(\left(\left( r^{123}\right)\right)\right) -- \left(\left(\left( r^{123}\right)\right)\right) \]
\item\textbf{brace6 test: [ ]} \[\left[\left[\left[ r^{123}\right]\right]\right] -- \left[\left[\left[ r^{123}\right]\right]\right] \] \item\textbf{brace6 test: [ ]} \[\left[\left[\left[ r^{123}\right]\right]\right] -- \left[\left[\left[ r^{123}\right]\right]\right] \]
\item\textbf{brace7 test: { }} \[\left\{\left\{\left\{ r^{123}\right\}\right\}\right\} -- \left\{\left\{\left\{ r^{123}\right\}\right\}\right\} \] \item\textbf{brace7 test: { }} \[\left\{\left\{\left\{ r^{123}\right\}\right\}\right\} -- \left\{\left\{\left\{ r^{123}\right\}\right\}\right\} \]
\item\textbf{brace8 test: || ||} \[\left\|\left\|\left\| r^{123}\right\|\right\|\right\| -- \left\|\left\|\left\| r^{123}\right\|\right\|\right\| \] \item\textbf{brace8 test: || ||} \[\left\|\left\|\left\| r^{123}\right\|\right\|\right\| -- \left\|\left\|\left\| r^{123}\right\|\right\|\right\| \]
\item\textbf{brace9 test: | |} \[\left|\left|\left| r^{123}\right|\right|\right| -- \left|\left|\left| r^{123}\right|\right|\right| \] \item\textbf{brace9 test: | |} \[\left|\left|\left| r^{123}\right|\right|\right| -- \left|\left|\left| r^{123}\right|\right|\right| \]
\item\textbf{brace10 test} \[\left\{\left[\left( r^{123}\right)\right]\right\} -- \left\{\left[\left( r^{123}\right)\right]\right\} \] \item\textbf{brace10 test} \[\left\{\left[\left( r^{123}\right)\right]\right\} -- \left\{\left[\left( r^{123}\right)\right]\right\} \]
\item\textbf{brace11 test: floor} \[\left\lfloor\left\lfloor\left\lfloor r^{123}\right\rfloor\right\rfloor\right\rfloor -- \left\lfloor\left\lfloor\left\lfloor r^{123}\right\rfloor\right\rfloor\right\rfloor \] \item\textbf{brace11 test: floor} \[\left\lfloor\left\lfloor\left\lfloor r^{123}\right\rfloor\right\rfloor\right\rfloor -- \left\lfloor\left\lfloor\left\lfloor r^{123}\right\rfloor\right\rfloor\right\rfloor \]
\item\textbf{brace12 test: ceil} \[\left\lceil\left\lceil\left\lceil r^{123}\right\rceil\right\rceil\right\rceil -- \left\lceil\left\lceil\left\lceil r^{123}\right\rceil\right\rceil\right\rceil \] \item\textbf{brace12 test: ceil} \[\left\lceil\left\lceil\left\lceil r^{123}\right\rceil\right\rceil\right\rceil -- \left\lceil\left\lceil\left\lceil r^{123}\right\rceil\right\rceil\right\rceil \]
\item\textbf{sub-, superscript test} \[r^{1234}_{321} r_{321}^{1234} -- r^{1234}_{321} r_{321}^{1234} -- \kappa^2 -- \kappa_2 -- \kappa_2^2 \] \item\textbf{sub-, superscript test} \[r^{1234}_{321} r_{321}^{1234} -- r^{1234}_{321} r_{321}^{1234} -- \kappa^2 -- \kappa_2 -- \kappa_2^2 \]
\item\textbf{super-, subscript test} \[r^{123}_{4321} r_{4321}^{123} -- r^{123}_{4321} r_{4321}^{123} -- \kappa^2 -- \kappa_2 -- \kappa_2^2 \] \item\textbf{super-, subscript test} \[r^{123}_{4321} r_{4321}^{123} -- r^{123}_{4321} r_{4321}^{123} -- \kappa^2 -- \kappa_2 -- \kappa_2^2 \]
\item\textbf{math 1:} \[f(x)=\int_{-\infty}^xe^{-t^2}\;\mathrm{d}t \] \item\textbf{math 1:} \[f(x)=\int_{-\infty}^xe^{-t^2}\;\mathrm{d}t \]
\item\textbf{math 2:} \[\sum_{i=1}^\infty\frac{-e^{i\pi}}{2^n} \] \item\textbf{math 2:} \[\sum_{i=1}^\infty\frac{-e^{i\pi}}{2^n} \]
\item\textbf{math 3:} \[\mbox{det} \begin{pmatrix} 1 & x_1 & \ldots & x_1^{n-1} \\ 1 & x_2 & \ldots & x_2^{n-1} \\ \vdots & \vdots & \ddots & \vdots \\ 1 & x_n & \ldots & x_n^{n-1} \end{pmatrix} = \prod_{1 \leq i < j \leq n} (x_j - x_i) \] \item\textbf{math 3:} \[\mbox{det} \begin{pmatrix} 1 & x_1 & \ldots & x_1^{n-1} \\ 1 & x_2 & \ldots & x_2^{n-1} \\ \vdots & \vdots & \ddots & \vdots \\ 1 & x_n & \ldots & x_n^{n-1} \end{pmatrix} = \prod_{1 \leq i < j \leq n} (x_j - x_i) \]
\item\textbf{math 4:} \[\sqrt{1+\sqrt{1+\sqrt{1+\sqrt{1+\sqrt{1+\sqrt{1+x}}}}}} \] \item\textbf{math 4:} \[\sqrt{1+\sqrt{1+\sqrt{1+\sqrt{1+\sqrt{1+\sqrt{1+x}}}}}} \]
\item\textbf{math 5:} \[\left(\stackrel{p}{2}\right)=x^2y^{p-2}-\frac{1}{1-x}\frac{1}{1-x^2} \] \item\textbf{math 5:} \[\left(\stackrel{p}{2}\right)=x^2y^{p-2}-\frac{1}{1-x}\frac{1}{1-x^2} \]
\item\textbf{math 6:} \[a_0+\frac{1}{a_1+\frac{1}{a_2+\frac{1}{a_3+\frac{1}{a_4}}}} \] \item\textbf{math 6:} \[a_0+\frac{1}{a_1+\frac{1}{a_2+\frac{1}{a_3+\frac{1}{a_4}}}} \]
\item\textbf{math 7:} \[\left(\frac{\partial^2}{\partial x^2}+\frac{\partial^2}{\partial y^2}\right)\left|\varphi(x+\mathrm{i}y)\right|^2=0 \] \item\textbf{math 7:} \[\left(\frac{\partial^2}{\partial x^2}+\frac{\partial^2}{\partial y^2}\right)\left|\varphi(x+\mathrm{i}y)\right|^2=0 \]
\item\textbf{math 8:} \[2^{2^{2^{x}}} \] \item\textbf{math 8:} \[2^{2^{2^{x}}} \]
\item\textbf{math 9:} \[\iint_Df(x,y)\;\mathrm{d}x\;\mathrm{d}y \] \item\textbf{math 9:} \[\iint_Df(x,y)\;\mathrm{d}x\;\mathrm{d}y \]
\item\textbf{math 10 (overbrace):} \[\overbrace{x+x+...+x}{k\ \mathrm{times}} \] \item\textbf{math 10 (overbrace):} \[\overbrace{x+x+...+x}{k\ \mathrm{times}} \]
\item\textbf{math 11 (underbrace):} \[\underbrace{x+x+...+x}{k\ \mathrm{times}} \] \item\textbf{math 11 (underbrace):} \[\underbrace{x+x+...+x}{k\ \mathrm{times}} \]
\item\textbf{math 12 (under/overbrace):} \[\underbrace{\overbrace{x+x+...+x}{k\ \mathrm{times}} \overbrace{x+x+...+x}{k\ \mathrm{times}}}{2k\ \mathrm{times}} \] \item\textbf{math 12 (under/overbrace):} \[\underbrace{\overbrace{x+x+...+x}{k\ \mathrm{times}} \overbrace{x+x+...+x}{k\ \mathrm{times}}}{2k\ \mathrm{times}} \]
\item\textbf{math 13:} \[y_1''\ \ \ y_2''' \] \item\textbf{math 13:} \[y_1''\ \ \ y_2''' \]
\item\textbf{math 14:} \[f(x)=\begin{cases} 1/3 & \mathrm{if}\ 0\leq x\leq1 \\ 2/3 & \mathrm{if}\ 3\leq x\leq4 \\0 & \mathrm{elsewhere} \end{cases} \] \item\textbf{math 14:} \[f(x)=\begin{cases} 1/3 & \mathrm{if}\ 0\leq x\leq1 \\ 2/3 & \mathrm{if}\ 3\leq x\leq4 \\0 & \mathrm{elsewhere} \end{cases} \]
\item\textbf{math 15:} \[\Re{z} =\frac{n\pi \dfrac{\theta +\psi}{2}}{\left(\dfrac{\theta +\psi}{2}\right)^2 + \left( \dfrac{1}{2}\log \left\lvert\dfrac{B}{A}\right\rvert\right)^2}. \] \item\textbf{math 15:} \[\Re{z} =\frac{n\pi \dfrac{\theta +\psi}{2}}{\left(\dfrac{\theta +\psi}{2}\right)^2 + \left( \dfrac{1}{2}\log \left\lvert\dfrac{B}{A}\right\rvert\right)^2}. \]
\item\textbf{math 16:} \[\sum_{m=1}^\infty\sum_{n=1}^\infty\frac{m^2\,n}{3^m\left(m\,3^n+n\,3^m\right)} \] \item\textbf{math 16:} \[\sum_{m=1}^\infty\sum_{n=1}^\infty\frac{m^2\,n}{3^m\left(m\,3^n+n\,3^m\right)} \]
\item\textbf{math 17:} \[\phi_n(\kappa) =\frac{1}{4\pi^2\kappa^2} \int_0^\infty\frac{\sin(\kappa R)}{\kappa R}\frac{\partial}{\partial R}\left[R^2\frac{\partial D_n(R)}{\partial R}\right]\,dR \] \item\textbf{math 17:} \[\phi_n(\kappa) =\frac{1}{4\pi^2\kappa^2} \int_0^\infty\frac{\sin(\kappa R)}{\kappa R}\frac{\partial}{\partial R}\left[R^2\frac{\partial D_n(R)}{\partial R}\right]\,dR \]
\item\textbf{math 18:} \[{}_pF_q(a_1,\dots,a_p;c_1,\dots,c_q;z)= \sum_{n=0}^\infty\frac{(a_1)_n\cdots(a_p)_n}{(c_1)_n\cdots(c_q)_n}\frac{z^n}{n!} \] \item\textbf{math 18:} \[{}_pF_q(a_1,\dots,a_p;c_1,\dots,c_q;z)= \sum_{n=0}^\infty\frac{(a_1)_n\cdots(a_p)_n}{(c_1)_n\cdots(c_q)_n}\frac{z^n}{n!} \]
\item\textbf{math 19 (overset):} \[X \overset{=}{def} Y\ \ \ \ \ X \overset{=}{!} Y\ \ \ \ \ X \overset{\rightarrow}{f} Y\ \ \ \ \ \frac{f(x+\Delta x)-f(x)}{\Delta x}\overset{\longrightarrow}{\Delta x\to 0}f'(x) \] \item\textbf{math 19 (overset):} \[X \overset{=}{def} Y\ \ \ \ \ X \overset{=}{!} Y\ \ \ \ \ X \overset{\rightarrow}{f} Y\ \ \ \ \ \frac{f(x+\Delta x)-f(x)}{\Delta x}\overset{\longrightarrow}{\Delta x\to 0}f'(x) \]
\item\textbf{math 20 (underset):} \[X \underset{=}{\text{def (5)}} Y\ \ \ \ \ X \underset{\rightarrow}{f} Y\ \ \ \ \ \frac{f(x+\Delta x)-f(x)}{\Delta x}\underset{\longrightarrow}{\Delta x\to 0}f'(x) \] \item\textbf{math 20 (underset):} \[X \underset{=}{\text{def (5)}} Y\ \ \ \ \ X \underset{\rightarrow}{f} Y\ \ \ \ \ \frac{f(x+\Delta x)-f(x)}{\Delta x}\underset{\longrightarrow}{\Delta x\to 0}f'(x) \]
\item\textbf{axiom of power test:} \[\forall A \, \exists P \, \forall B \, [B \in P \iff \forall C \, (C \in B \Rightarrow C \in A)] \] \item\textbf{axiom of power test:} \[\forall A \, \exists P \, \forall B \, [B \in P \iff \forall C \, (C \in B \Rightarrow C \in A)] \]
\item\textbf{De Morgan's law:} $\neg(P\land Q)\iff(\neg P)\lor(\neg Q)$ or $\overline{\bigcap_{i \in I} A_{i}}\equiv\bigcup_{i \in I} \overline{A_{i}}$ or $\overline{A \cup B}\equiv\overline{A} \cap \overline{B} $ \item\textbf{De Morgan's law:} $\neg(P\land Q)\iff(\neg P)\lor(\neg Q)$ or $\overline{\bigcap_{i \in I} A_{i}}\equiv\bigcup_{i \in I} \overline{A_{i}}$ or $\overline{A \cup B}\equiv\overline{A} \cap \overline{B} $
\item\textbf{quadratic formula:} \[x=\frac{-b \pm \sqrt{b^2-4ac}}{2a} \] \item\textbf{quadratic formula:} \[x=\frac{-b \pm \sqrt{b^2-4ac}}{2a} \]
\item\textbf{combination:} \[\binom{n}{k} = \frac{n(n-1)...(n-k+1)}{k(k-1)\dots1}=\frac{n!}{k!(n-k)!} \] \item\textbf{combination:} \[\binom{n}{k} = \frac{n(n-1)...(n-k+1)}{k(k-1)\dots1}=\frac{n!}{k!(n-k)!} \]
\item\textbf{Sophomore's dream 1:} \[\int_0^1 x^{-x}\,dx = \sum_{n=1}^\infty n^{-n}(\scriptstyle{= 1.29128599706266354040728259059560054149861936827\dots)} \] \item\textbf{Sophomore's dream 1:} \[\int_0^1 x^{-x}\,dx = \sum_{n=1}^\infty n^{-n}(\scriptstyle{= 1.29128599706266354040728259059560054149861936827\dots)} \]
\item\textbf{Sophomore's dream 2:} \[\int_0^1 x^x \,dx = \sum_{n=1}^\infty (-1)^{n+1}n^{-n} = - \sum_{n=1}^\infty (-n)^{-n} (\scriptstyle{= 0.78343051071213440705926438652697546940768199014\dots}) \] \item\textbf{Sophomore's dream 2:} \[\int_0^1 x^x \,dx = \sum_{n=1}^\infty (-1)^{n+1}n^{-n} = - \sum_{n=1}^\infty (-n)^{-n} (\scriptstyle{= 0.78343051071213440705926438652697546940768199014\dots}) \]
\item\textbf{divergence 1:} \[\operatorname{div}\vec{F} = \nabla\cdot\vec{F}=\frac{\partial U}{\partial x}+\frac{\partial V}{\partial y}+\frac{\partial W}{\partial z} \] \item\textbf{divergence 1:} \[\operatorname{div}\vec{F} = \nabla\cdot\vec{F}=\frac{\partial U}{\partial x}+\frac{\partial V}{\partial y}+\frac{\partial W}{\partial z} \]
\item\textbf{divergence 2:} \[\overrightarrow{\operatorname{div}}\,(\mathbf{\underline{\underline{\epsilon}}}) = \item\textbf{divergence 2:} \[\overrightarrow{\operatorname{div}}\,(\mathbf{\underline{\underline{\epsilon}}}) =
\begin{bmatrix} \begin{bmatrix}
\frac{\partial \epsilon_{xx}}{\partial x} +\frac{\partial \epsilon_{yx}}{\partial y} +\frac{\partial \epsilon_{zx}}{\partial z} \\ \frac{\partial \epsilon_{xx}}{\partial x} +\frac{\partial \epsilon_{yx}}{\partial y} +\frac{\partial \epsilon_{zx}}{\partial z} \\
\frac{\partial \epsilon_{xy}}{\partial x} +\frac{\partial \epsilon_{yy}}{\partial y} +\frac{\partial \epsilon_{zy}}{\partial z} \\ \frac{\partial \epsilon_{xy}}{\partial x} +\frac{\partial \epsilon_{yy}}{\partial y} +\frac{\partial \epsilon_{zy}}{\partial z} \\
\frac{\partial \epsilon_{xz}}{\partial x} +\frac{\partial \epsilon_{yz}}{\partial y} +\frac{\partial \epsilon_{zz}}{\partial z} \frac{\partial \epsilon_{xz}}{\partial x} +\frac{\partial \epsilon_{yz}}{\partial y} +\frac{\partial \epsilon_{zz}}{\partial z}
\end{bmatrix} \] \end{bmatrix} \]
\item\textbf{lim, sum ...:} \[\lim_{x\to\infty} f(x) = \binom{k}{r} + \frac{a}{b} \sum_{n=1}^\infty a_n + \displaystyle{ \left\{ \frac{1}{13} \sum_{n=1}^\infty b_n \right\} }. \] \item\textbf{lim, sum ...:} \[\lim_{x\to\infty} f(x) = \binom{k}{r} + \frac{a}{b} \sum_{n=1}^\infty a_n + \displaystyle{ \left\{ \frac{1}{13} \sum_{n=1}^\infty b_n \right\} }. \]
%\item\textbf{array test:} \[ f(x) := \left\{\begin{array}[ll] x^2\sin\frac{1}{x} & \text{if} x \ne 0, \\ 0 & \text{if } x = 0 . \end{array}\right. \] %\item\textbf{array test:} \[ f(x) := \left\{\begin{array}[ll] x^2\sin\frac{1}{x} & \text{if} x \ne 0, \\ 0 & \text{if } x = 0 . \end{array}\right. \]
\item\textbf{Schwinger-Dyson:} \[\left\langle\psi\left|\mathcal{T}\{F \phi^j\}\right|\psi\right\rangle=\left\langle\psi\left|\mathcal{T}\{iF_{,i}D^{ij}-FS_{int,i}D^{ij}\}\right|\psi\right\rangle. \] \item\textbf{Schwinger-Dyson:} \[\left\langle\psi\left|\mathcal{T}\{F \phi^j\}\right|\psi\right\rangle=\left\langle\psi\left|\mathcal{T}\{iF_{,i}D^{ij}-FS_{int,i}D^{ij}\}\right|\psi\right\rangle. \]
\item\textbf{Schrödinger's equation:} \[\left[-\frac{\hbar^2}{-2m}\frac{\partial^2}{\partial x^2}+V\right]\Psi(x)=i\hbar\frac{\partial}{\partial t}\Psi(x) \] \item\textbf{Schrödinger's equation:} \[\left[-\frac{\hbar^2}{-2m}\frac{\partial^2}{\partial x^2}+V\right]\Psi(x)=i\hbar\frac{\partial}{\partial t}\Psi(x) \]
\item\textbf{Cauchy-Schwarz inequality:} \[\left( \sum_{k=1}^n a_k b_k \right)^2 \leq \left( \sum_{k=1}^n a_k^2 \right) \left( \sum_{k=1}^n b_k^2 \right) \] \item\textbf{Cauchy-Schwarz inequality:} \[\left( \sum_{k=1}^n a_k b_k \right)^2 \leq \left( \sum_{k=1}^n a_k^2 \right) \left( \sum_{k=1}^n b_k^2 \right) \]
\item\textbf{Maxwell's equations:} \[\begin{aligned}\nabla \times \vec{\mathbf{B}} -\, \frac{1}{c}\, \frac{\partial\vec{\mathbf{E}}}{\partial t} & = \frac{4\pi}{c}\vec{\mathbf{j}} \\ \nabla \cdot \vec{\mathbf{E}} & = 4 \pi \rho \\\nabla \times \vec{\mathbf{E}}\, +\, \frac{1}{c}\, \frac{\partial\vec{\mathbf{B}}}{\partial t} & = \vec{\mathbf{0}} \\\nabla \cdot \vec{\mathbf{B}} & = 0 \end{aligned} \] \item\textbf{Maxwell's equations:} \[\begin{aligned}\nabla \times \vec{\mathbf{B}} -\, \frac{1}{c}\, \frac{\partial\vec{\mathbf{E}}}{\partial t} & = \frac{4\pi}{c}\vec{\mathbf{j}} \\ \nabla \cdot \vec{\mathbf{E}} & = 4 \pi \rho \\\nabla \times \vec{\mathbf{E}}\, +\, \frac{1}{c}\, \frac{\partial\vec{\mathbf{B}}}{\partial t} & = \vec{\mathbf{0}} \\\nabla \cdot \vec{\mathbf{B}} & = 0 \end{aligned} \]
\end{itemize} \end{itemize}
\end{document} \end{document}

View File

@ -1,387 +1,387 @@
#include "testform.h" #include "testform.h"
#include "ui_testform.h" #include "ui_testform.h"
#include <QDebug> #include <QDebug>
TestForm::TestForm(QWidget *parent) : TestForm::TestForm(QWidget *parent) :
QWidget(parent), QWidget(parent),
ui(new Ui::TestForm) ui(new Ui::TestForm)
{ {
ui->setupUi(this); ui->setupUi(this);
ui->cmbTestset->addItem("simple relations", "$a{\\leq}b$, $a{\\geq}b$, $a{\\equiv}b$, $a=b$, $a{\\neq}b$, $a<b$, $a>b$"); ui->cmbTestset->addItem("simple relations", "$a{\\leq}b$, $a{\\geq}b$, $a{\\equiv}b$, $a=b$, $a{\\neq}b$, $a<b$, $a>b$");
ui->cmbTestset->addItem("simple relations in different modes", "math: $a{\\leq}b$, math/no braces: $a\\leq b$, no math: a{\\leq}b, no math/no braces: a\\leq b"); ui->cmbTestset->addItem("simple relations in different modes", "math: $a{\\leq}b$, math/no braces: $a\\leq b$, no math: a{\\leq}b, no math/no braces: a\\leq b");
ui->cmbTestset->addItem("named symbols 1", "ll: $\\ll$\\ gg: $\\gg$\\ leq: $\\leq$\\ geq: $\\geq$\\ pm: $\\pm$\\ mp: $\\mp$\\ "); ui->cmbTestset->addItem("named symbols 1", "ll: $\\ll$\\ gg: $\\gg$\\ leq: $\\leq$\\ geq: $\\geq$\\ pm: $\\pm$\\ mp: $\\mp$\\ ");
ui->cmbTestset->addItem("named symbols 2", "nexists: $\\nexists$\\ ni: $\\ni$\\ notni: $\\notni$\\ circ: $\\circ$\\ sim: $\\sim$\\ emptyset: $\\emptyset$\\ odot: $\\odot$\\ ominus: $\\ominus$\\ subsetnot: $\\subsetnot$\\ bot: $\\bot$"); ui->cmbTestset->addItem("named symbols 2", "nexists: $\\nexists$\\ ni: $\\ni$\\ notni: $\\notni$\\ circ: $\\circ$\\ sim: $\\sim$\\ emptyset: $\\emptyset$\\ odot: $\\odot$\\ ominus: $\\ominus$\\ subsetnot: $\\subsetnot$\\ bot: $\\bot$");
ui->cmbTestset->addItem("named symbols 3", "leftharpoonup: $\\leftharpoonup$\\ rightharpoonup: $\\rightharpoonup$\\ upharpoonleft: $\\upharpoonleft$\\ downharpoonleft: $\\downharpoonleft$\\ leftrightharpoon: $\\leftrightharpoon$\\ rightleftharpoon: $\\rightleftharpoon$"); ui->cmbTestset->addItem("named symbols 3", "leftharpoonup: $\\leftharpoonup$\\ rightharpoonup: $\\rightharpoonup$\\ upharpoonleft: $\\upharpoonleft$\\ downharpoonleft: $\\downharpoonleft$\\ leftrightharpoon: $\\leftrightharpoon$\\ rightleftharpoon: $\\rightleftharpoon$");
ui->cmbTestset->addItem("named symbols 4", "coprod: $\\coprod$\\ leftharpoondown: $\\leftharpoondown$\\ rightharpoondown: $\\rightharpoondown$\\ upharpoonright: $\\upharpoonright$\\ downharpoonright: $\\downharpoonright$\\ nwarrow: $\\nwarrow$\\ nearrow: $\\nearrow$\\ "); ui->cmbTestset->addItem("named symbols 4", "coprod: $\\coprod$\\ leftharpoondown: $\\leftharpoondown$\\ rightharpoondown: $\\rightharpoondown$\\ upharpoonright: $\\upharpoonright$\\ downharpoonright: $\\downharpoonright$\\ nwarrow: $\\nwarrow$\\ nearrow: $\\nearrow$\\ ");
ui->cmbTestset->addItem("named symbols 5", "searrow: $\\searrow$\\ swarrow: $\\swarrow$\\ mapsto: $\\mapsto$\\ div: $\\div$\\ multimap: $\\multimap$\\ maporiginal: $\\maporiginal$\\ mapimage: $\\mapimage$\\ "); ui->cmbTestset->addItem("named symbols 5", "searrow: $\\searrow$\\ swarrow: $\\swarrow$\\ mapsto: $\\mapsto$\\ div: $\\div$\\ multimap: $\\multimap$\\ maporiginal: $\\maporiginal$\\ mapimage: $\\mapimage$\\ ");
ui->cmbTestset->addItem("named symbols 6", "times: $\\times$\\ propto: $\\propto$\\ bullet: $\\bullet$\\ neq: $\\neq$\\ ne: $\\ne$\\ equiv: $\\equiv$\\ approx: $\\approx$\\ otimes: $\\otimes$\\ oplus: $\\oplus$"); ui->cmbTestset->addItem("named symbols 6", "times: $\\times$\\ propto: $\\propto$\\ bullet: $\\bullet$\\ neq: $\\neq$\\ ne: $\\ne$\\ equiv: $\\equiv$\\ approx: $\\approx$\\ otimes: $\\otimes$\\ oplus: $\\oplus$");
ui->cmbTestset->addItem("named symbols 7", "oslash: $\\oslash$\\ cap: $\\cap$\\ land: $\\land$\\ cup: $\\cup$\\ lor: $\\lor$\\ supset: $\\supset$\\ supseteq: $\\supseteq$\\ supsetnot: $\\supsetnot$\\ subset: $\\subset$"); ui->cmbTestset->addItem("named symbols 7", "oslash: $\\oslash$\\ cap: $\\cap$\\ land: $\\land$\\ cup: $\\cup$\\ lor: $\\lor$\\ supset: $\\supset$\\ supseteq: $\\supseteq$\\ supsetnot: $\\supsetnot$\\ subset: $\\subset$");
ui->cmbTestset->addItem("named symbols 8", "subseteq: $\\subseteq$\\ in: $\\in$\\ notin: $\\notin$\\ cdot: $\\cdot$\\ wedge: $\\wedge$\\ vee: $\\vee$\\ cong: $\\cong$\\ bot: $\\bot$"); ui->cmbTestset->addItem("named symbols 8", "subseteq: $\\subseteq$\\ in: $\\in$\\ notin: $\\notin$\\ cdot: $\\cdot$\\ wedge: $\\wedge$\\ vee: $\\vee$\\ cong: $\\cong$\\ bot: $\\bot$");
ui->cmbTestset->addItem("symbols", "$\\ll\\gg\\leq\\geq\\leftrightarrow\\leftarrow\\rightarrow\\to\\uparrow\\downarrow\\updownarrow\\Leftrightarrow\\iff\\Leftarrow\\Rightarrow\\Uparrow\\Downarrow\\Updownarrow\\pm\\mp\\nexists\\ni\\notni\\circ\\sim\\emptyset\\odot\\ominus\\subsetnot\\bot\\leftharpoonup\\rightharpoonup\\upharpoonleft\\downharpoonleft\\leftrightharpoon\\rightleftharpoon\\coprod\\leftharpoondown\\rightharpoondown\\upharpoonright\\downharpoonright\\nwarrow\\nearrow\\searrow\\swarrow\\mapsto\\div\\multimap\\maporiginal\\mapimage\\times\\propto\\bullet\\neq\\ne\\equiv\\approx\\otimes\\oplus\\oslash\\cap\\land\\cup\\lor\\supset\\supseteq\\supsetnot\\subset\\subseteq\\in\\notin\\cdot\\wedge\\vee\\cong\\bot$"); ui->cmbTestset->addItem("symbols", "$\\ll\\gg\\leq\\geq\\leftrightarrow\\leftarrow\\rightarrow\\to\\uparrow\\downarrow\\updownarrow\\Leftrightarrow\\iff\\Leftarrow\\Rightarrow\\Uparrow\\Downarrow\\Updownarrow\\pm\\mp\\nexists\\ni\\notni\\circ\\sim\\emptyset\\odot\\ominus\\subsetnot\\bot\\leftharpoonup\\rightharpoonup\\upharpoonleft\\downharpoonleft\\leftrightharpoon\\rightleftharpoon\\coprod\\leftharpoondown\\rightharpoondown\\upharpoonright\\downharpoonright\\nwarrow\\nearrow\\searrow\\swarrow\\mapsto\\div\\multimap\\maporiginal\\mapimage\\times\\propto\\bullet\\neq\\ne\\equiv\\approx\\otimes\\oplus\\oslash\\cap\\land\\cup\\lor\\supset\\supseteq\\supsetnot\\subset\\subseteq\\in\\notin\\cdot\\wedge\\vee\\cong\\bot$");
ui->cmbTestset->addItem("std dev", "$\\sigma_x=\\sqrt{\\langle (x-\\langle x\\rangle)^2\\rangle}=\\sqrt{\\frac{1}{N-1}\\cdot\\left( \\sum_{i=1}^N{x_i}^2-\\frac{1}{N}\\cdot\\left(\\sum_{i=1}^Nx_i\\right)^2\\right)}$"); ui->cmbTestset->addItem("std dev", "$\\sigma_x=\\sqrt{\\langle (x-\\langle x\\rangle)^2\\rangle}=\\sqrt{\\frac{1}{N-1}\\cdot\\left( \\sum_{i=1}^N{x_i}^2-\\frac{1}{N}\\cdot\\left(\\sum_{i=1}^Nx_i\\right)^2\\right)}$");
ui->cmbTestset->addItem("std dev 2", "$\\sigma_x=\\sqrt{\\langle (x-\\langle x\\rangle)^2\\rangle}=\\sqrt{\\frac{1}{N-1}\\cdot\\left( \\sum_{i=1}^Nx_i^2-\\frac{1}{N}\\cdot\\left(\\sum_{i=1}^Nx_i\\right)^2\\right)}$"); ui->cmbTestset->addItem("std dev 2", "$\\sigma_x=\\sqrt{\\langle (x-\\langle x\\rangle)^2\\rangle}=\\sqrt{\\frac{1}{N-1}\\cdot\\left( \\sum_{i=1}^Nx_i^2-\\frac{1}{N}\\cdot\\left(\\sum_{i=1}^Nx_i\\right)^2\\right)}$");
ui->cmbTestset->addItem("rotation matrix", "$\\mathrm{\\mathbf{M}}(\\alpha) = \\left(\\begin{matrix}\\cos(\\alpha)+n_x^2\\cdot (1-\\cos(\\alpha)) & n_x\\cdot n_y\\cdot (1-\\cos(\\alpha))-n_z\\cdot \\sin(\\alpha) & n_x\\cdot n_z\\cdot (1-\\cos(\\alpha))+n_y\\cdot \\sin(\\alpha)\\\\n_x\\cdot n_y\\cdot (1-\\cos(\\alpha))+n_z\\cdot \\sin(\\alpha) & \\cos(\\alpha)+n_y^2\\cdot (1-\\cos(\\alpha)) & n_y\\cdot n_z\\cdot (1-\\cos(\\alpha))-n_x\\cdot \\sin(\\alpha)\\\\n_z\\cdot n_x\\cdot (1-\\cos(\\alpha))-n_y\\cdot \\sin(\\alpha) & n_z\\cdot n_y\\cdot (1-\\cos(\\alpha))+n_x\\cdot \\sin(\\alpha) & \\cos(\\alpha)+n_z^2\\cdot (1-\\cos(\\alpha))\\end{matrix}\\right)$"); ui->cmbTestset->addItem("rotation matrix", "$\\mathrm{\\mathbf{M}}(\\alpha) = \\left(\\begin{matrix}\\cos(\\alpha)+n_x^2\\cdot (1-\\cos(\\alpha)) & n_x\\cdot n_y\\cdot (1-\\cos(\\alpha))-n_z\\cdot \\sin(\\alpha) & n_x\\cdot n_z\\cdot (1-\\cos(\\alpha))+n_y\\cdot \\sin(\\alpha)\\\\n_x\\cdot n_y\\cdot (1-\\cos(\\alpha))+n_z\\cdot \\sin(\\alpha) & \\cos(\\alpha)+n_y^2\\cdot (1-\\cos(\\alpha)) & n_y\\cdot n_z\\cdot (1-\\cos(\\alpha))-n_x\\cdot \\sin(\\alpha)\\\\n_z\\cdot n_x\\cdot (1-\\cos(\\alpha))-n_y\\cdot \\sin(\\alpha) & n_z\\cdot n_y\\cdot (1-\\cos(\\alpha))+n_x\\cdot \\sin(\\alpha) & \\cos(\\alpha)+n_z^2\\cdot (1-\\cos(\\alpha))\\end{matrix}\\right)$");
ui->cmbTestset->addItem("like in label at bottom (no MM)", "\\left(\\left[\\sqrt{2\\pi\\cdot\\int_{-\\infty}^\\infty f(x)\\;\\mathrm{d}x}\\right]\\right)"); ui->cmbTestset->addItem("like in label at bottom (no MM)", "\\left(\\left[\\sqrt{2\\pi\\cdot\\int_{-\\infty}^\\infty f(x)\\;\\mathrm{d}x}\\right]\\right)");
ui->cmbTestset->addItem("like in label at bottom (MM)", "$\\left(\\left[\\sqrt{2\\pi\\cdot\\int_{-\\infty}^\\infty f(x)\\;\\mathrm{d}x}\\right]\\right)$"); ui->cmbTestset->addItem("like in label at bottom (MM)", "$\\left(\\left[\\sqrt{2\\pi\\cdot\\int_{-\\infty}^\\infty f(x)\\;\\mathrm{d}x}\\right]\\right)$");
ui->cmbTestset->addItem("text 0", "text"); ui->cmbTestset->addItem("text 0", "text");
ui->cmbTestset->addItem("text 1", "text \\mathbf{bold}"); ui->cmbTestset->addItem("text 1", "text \\mathbf{bold}");
ui->cmbTestset->addItem("text 2", "text \\mathbf{bold}\\textcolor{red}{RED}"); ui->cmbTestset->addItem("text 2", "text \\mathbf{bold}\\textcolor{red}{RED}");
ui->cmbTestset->addItem("decoration", "$\\vec{x}\\vec{X}\\vec{\\psi} -- \\dot{x}\\dot{X}\\dot{\\psi} -- \\ddot{x}\\ddot{X}\\ddot{\\psi} -- \\overline{x}\\overline{X}\\overline{\\psi} -- \\underline{x}\\underline{X}\\underline{\\psi} -- \\hat{x}\\hat{X}\\hat{\\psi} -- \\tilde{x}\\tilde{X}\\tilde{\\psi} -- \\uul{x}\\uul{X}\\uul{\\psi} -- \\ool{x}\\ool{X}\\ool{\\psi} -- \\bar{x}\\bar{X}\\bar{\\psi} -- \\arrow{x}\\arrow{X}\\arrow{\\psi}$"); ui->cmbTestset->addItem("decoration", "$\\vec{x}\\vec{X}\\vec{\\psi} -- \\dot{x}\\dot{X}\\dot{\\psi} -- \\ddot{x}\\ddot{X}\\ddot{\\psi} -- \\overline{x}\\overline{X}\\overline{\\psi} -- \\underline{x}\\underline{X}\\underline{\\psi} -- \\hat{x}\\hat{X}\\hat{\\psi} -- \\tilde{x}\\tilde{X}\\tilde{\\psi} -- \\uul{x}\\uul{X}\\uul{\\psi} -- \\ool{x}\\ool{X}\\ool{\\psi} -- \\bar{x}\\bar{X}\\bar{\\psi} -- \\arrow{x}\\arrow{X}\\arrow{\\psi}$");
ui->cmbTestset->addItem("mathtest", "This is normal text: $this is math:\\langle r^2(\\tau)\\rangle=\\left\\langle (\\vec{r}(t)-\\vec{r}(t+\\tau) )^2\\right\\rangle\\ \\ \\ g(\\tau)=\\frac{1}{N}\\cdot\\left(1+\\frac{2}{3}\\frac{\\langle r^2(\\tau)\\rangle}{w_{xy}^2}\\right)^{-1} \\lfloor\\rfloor\\lceil\\rceil\\langle\\rangle\\left\\{\\va\\left|\\|\\va\\|_2\\geq2\\right.\\right\\} \\vr\\vR\\frac{\\sqrt{\\sqrt{\\sqrt{\\sum_{i=0}^\\infty \\hat{i}^2}+y^\\alpha}+1}}{\\dot{v}\\equiv\\ddot{r}}\\argmin_{\\vec{k}}\\sum_{\\sqrt{i}=0}^{N}\\int_{x_0}^{x_1}\\left(\\left(\\left(x\\right)\\right)\\right)\\underbrace{\\left[\\left\\{\\frac{\\partial f}{\\partial x}\\right\\}\\cdot\\frac{1}{2}\\right]}{\\text{underbraced text \\hbar}}\\cdots\\frac{\\sqrt{\\sum_{i=0}^2 \\hat{i}^2}+y^\\alpha}{\\dot{v}\\equiv\\ddot{r}}, \\hat{t}\\hat{T} \\overbrace{\\left|\\sqrt{x\\cdot Y}\\right|}{\\propto\\bbN\\circ\\bbZ} \\left<\\arrow{x(\\tau)}\\cdot\\vec{R}(t+\\bar{\\tau})\\right> \\alpha\\beta\\gamma\\delta\\epsilon\\Gamma\\Delta\\Theta\\Omega \\left\\_\\left~\\cbrt{\\hbar\\omega}\\right~\\right\\_$"); ui->cmbTestset->addItem("mathtest", "This is normal text: $this is math:\\langle r^2(\\tau)\\rangle=\\left\\langle (\\vec{r}(t)-\\vec{r}(t+\\tau) )^2\\right\\rangle\\ \\ \\ g(\\tau)=\\frac{1}{N}\\cdot\\left(1+\\frac{2}{3}\\frac{\\langle r^2(\\tau)\\rangle}{w_{xy}^2}\\right)^{-1} \\lfloor\\rfloor\\lceil\\rceil\\langle\\rangle\\left\\{\\va\\left|\\|\\va\\|_2\\geq2\\right.\\right\\} \\vr\\vR\\frac{\\sqrt{\\sqrt{\\sqrt{\\sum_{i=0}^\\infty \\hat{i}^2}+y^\\alpha}+1}}{\\dot{v}\\equiv\\ddot{r}}\\argmin_{\\vec{k}}\\sum_{\\sqrt{i}=0}^{N}\\int_{x_0}^{x_1}\\left(\\left(\\left(x\\right)\\right)\\right)\\underbrace{\\left[\\left\\{\\frac{\\partial f}{\\partial x}\\right\\}\\cdot\\frac{1}{2}\\right]}{\\text{underbraced text \\hbar}}\\cdots\\frac{\\sqrt{\\sum_{i=0}^2 \\hat{i}^2}+y^\\alpha}{\\dot{v}\\equiv\\ddot{r}}, \\hat{t}\\hat{T} \\overbrace{\\left|\\sqrt{x\\cdot Y}\\right|}{\\propto\\bbN\\circ\\bbZ} \\left<\\arrow{x(\\tau)}\\cdot\\vec{R}(t+\\bar{\\tau})\\right> \\alpha\\beta\\gamma\\delta\\epsilon\\Gamma\\Delta\\Theta\\Omega \\left\\_\\left~\\cbrt{\\hbar\\omega}\\right~\\right\\_$");
ui->cmbTestset->addItem("upper/lower parantheses test:", "$\\text{bblabla} \\frac{1}{2}\\cdot\\left(\\frac{1}{\\mathrm{e}^x+\\mathrm{e}^{-x}}\\right)\\cdot\\left(\\frac{1}{\\frac{1+2}{5+x}}\\right)\\cdot\\left(\\frac{1}{\\exp\\left[-\\frac{y^2}{\\sqrt{x}}\\right]\\cdot\\exp\\left[-\\frac{1}{\\frac{1}{2}}\\right]}\\right) $"); ui->cmbTestset->addItem("upper/lower parantheses test:", "$\\text{bblabla} \\frac{1}{2}\\cdot\\left(\\frac{1}{\\mathrm{e}^x+\\mathrm{e}^{-x}}\\right)\\cdot\\left(\\frac{1}{\\frac{1+2}{5+x}}\\right)\\cdot\\left(\\frac{1}{\\exp\\left[-\\frac{y^2}{\\sqrt{x}}\\right]\\cdot\\exp\\left[-\\frac{1}{\\frac{1}{2}}\\right]}\\right) $");
ui->cmbTestset->addItem("ACF test", "$g_{rg}^{ab}(\\tau)=\\frac{1}{N}\\cdot\\left(1+\\frac{2}{3}\\frac{\\langle r^2(\\tau)\\rangle}{w_{xy}^2}\\right)^{-1}\\cdot\\left(1+\\frac{2}{3}\\frac{\\langle r^2(\\tau)\\rangle}{w_{xy}^2}\\right)^{-\\frac{1}{2}}$"); ui->cmbTestset->addItem("ACF test", "$g_{rg}^{ab}(\\tau)=\\frac{1}{N}\\cdot\\left(1+\\frac{2}{3}\\frac{\\langle r^2(\\tau)\\rangle}{w_{xy}^2}\\right)^{-1}\\cdot\\left(1+\\frac{2}{3}\\frac{\\langle r^2(\\tau)\\rangle}{w_{xy}^2}\\right)^{-\\frac{1}{2}}$");
ui->cmbTestset->addItem("MSD test", "$\\mathrm{MSD}(\\tau)\\equiv\\langle r^2(\\tau)\\rangle=\\left\\langle (\\vec{r}(t)-\\vec{r}(t+\\tau) )^2\\right\\rangle=2n\\cdot\\frac{K_\\alpha}{\\Gamma(1+\\alpha)}\\cdot\\tau^\\alpha$"); ui->cmbTestset->addItem("MSD test", "$\\mathrm{MSD}(\\tau)\\equiv\\langle r^2(\\tau)\\rangle=\\left\\langle (\\vec{r}(t)-\\vec{r}(t+\\tau) )^2\\right\\rangle=2n\\cdot\\frac{K_\\alpha}{\\Gamma(1+\\alpha)}\\cdot\\tau^\\alpha$");
ui->cmbTestset->addItem("f() test", "$f(\\vec{x})=\\frac{1}{\\sqrt{2\\pi\\cdot\\sigma^2}}\\exp\\left(-\\frac{(\\vec{x}-\\vec{x}_0)^2}{\\sigma^2}\\right)$"); ui->cmbTestset->addItem("f() test", "$f(\\vec{x})=\\frac{1}{\\sqrt{2\\pi\\cdot\\sigma^2}}\\exp\\left(-\\frac{(\\vec{x}-\\vec{x}_0)^2}{\\sigma^2}\\right)$");
ui->cmbTestset->addItem("chi^2 test", "$\\vec{p}^\\ast=\\argmax\\limits_{\\vec{p}}\\chi^2=\\argmax\\limits_{\\vec{p}}\\sum\\limits_{i=1}^N\\left|\\frac{\\hat{f}_i-f(x_i;\\vec{p})}{\\sigma_i}\\right|^2$"); ui->cmbTestset->addItem("chi^2 test", "$\\vec{p}^\\ast=\\argmax\\limits_{\\vec{p}}\\chi^2=\\argmax\\limits_{\\vec{p}}\\sum\\limits_{i=1}^N\\left|\\frac{\\hat{f}_i-f(x_i;\\vec{p})}{\\sigma_i}\\right|^2$");
ui->cmbTestset->addItem("symbol test", "\\vdots\\cdots\\ddots\\iddots\\lfloor\\rfloor\\lceil\\rceil\\langle\\rangle\\sum\\int \\iint \\oint \\prod \\leftrightarrow \\leftarrow\\Leftarrow\\rightarrow\\Rightarrow\\pm\\mp\\leq\\geq\\ll\\gg\\hbar\\euro\\bbC\\bbH\\bbN\\bbP\\bbQ\\bbZ\\bbR\\Angstrom\\Alef\\Bet\\Gimel\\Dalet\\nexists\\ni\\notni\\circ\\tilde\\oiint\\oiiint\\emptyset\\odot\\ominus\\subsetnot\\DC\\bot\\cdots\\perthousand\\leftharpoonup\\rightharpoonup \\upharpoonleft \\downharpoonleft \\leftrightharpoon \\rightleftharpoon \\coprod \\leftharpoondown \\rightharpoondown \\nwarrow \\nearrow \\mapsto \\cent \\pound \\yen \\div \\multimap \\maporiginal \\mapimage \\bigcap \\bigcup \\benzene \\times \\cdot \\propto \\equiv \\Im \\Re \\ "); ui->cmbTestset->addItem("symbol test", "\\vdots\\cdots\\ddots\\iddots\\lfloor\\rfloor\\lceil\\rceil\\langle\\rangle\\sum\\int \\iint \\oint \\prod \\leftrightarrow \\leftarrow\\Leftarrow\\rightarrow\\Rightarrow\\pm\\mp\\leq\\geq\\ll\\gg\\hbar\\euro\\bbC\\bbH\\bbN\\bbP\\bbQ\\bbZ\\bbR\\Angstrom\\Alef\\Bet\\Gimel\\Dalet\\nexists\\ni\\notni\\circ\\tilde\\oiint\\oiiint\\emptyset\\odot\\ominus\\subsetnot\\DC\\bot\\cdots\\perthousand\\leftharpoonup\\rightharpoonup \\upharpoonleft \\downharpoonleft \\leftrightharpoon \\rightleftharpoon \\coprod \\leftharpoondown \\rightharpoondown \\nwarrow \\nearrow \\mapsto \\cent \\pound \\yen \\div \\multimap \\maporiginal \\mapimage \\bigcap \\bigcup \\benzene \\times \\cdot \\propto \\equiv \\Im \\Re \\ ");
ui->cmbTestset->addItem("arrowtest 1", "$\\leftarrow \\longleftarrow \\Leftarrow \\Longleftarrow \\rightarrow \\longrightarrow \\Rightarrow \\Longrightarrow \\uparrow \\Uparrow \\downarrow \\Downarrow \\leftrightarrow \\Leftrightarrow \\longleftrightarrow \\Longleftrightarrow$"); ui->cmbTestset->addItem("arrowtest 1", "$\\leftarrow \\longleftarrow \\Leftarrow \\Longleftarrow \\rightarrow \\longrightarrow \\Rightarrow \\Longrightarrow \\uparrow \\Uparrow \\downarrow \\Downarrow \\leftrightarrow \\Leftrightarrow \\longleftrightarrow \\Longleftrightarrow$");
ui->cmbTestset->addItem("arrowtest 2", "$\\nwarrow \\nearrow \\searrow \\swarrow \\mapsto \\leftharpoonup \\rightharpoonup \\upharpoonleft \\downharpoonleft \\leftrightharpoon \\rightleftharpoon \\leftharpoondown \\rightharpoondown \\upharpoonright \\downharpoonright $"); ui->cmbTestset->addItem("arrowtest 2", "$\\nwarrow \\nearrow \\searrow \\swarrow \\mapsto \\leftharpoonup \\rightharpoonup \\upharpoonleft \\downharpoonleft \\leftrightharpoon \\rightleftharpoon \\leftharpoondown \\rightharpoondown \\upharpoonright \\downharpoonright $");
ui->cmbTestset->addItem("math: blackboard", "$\\mathbb{ABCDEFGHIJKLMNOPQRSTUVWXYZ120}$"); ui->cmbTestset->addItem("math: blackboard", "$\\mathbb{ABCDEFGHIJKLMNOPQRSTUVWXYZ120}$");
ui->cmbTestset->addItem("math: bf", "$\\mathbf{ABCDEFGHIJKLMNOPQRSTUVWXYZ120}$"); ui->cmbTestset->addItem("math: bf", "$\\mathbf{ABCDEFGHIJKLMNOPQRSTUVWXYZ120}$");
ui->cmbTestset->addItem("math: rm", "$\\mathrm{ABCDEFGHIJKLMNOPQRSTUVWXYZ120}$"); ui->cmbTestset->addItem("math: rm", "$\\mathrm{ABCDEFGHIJKLMNOPQRSTUVWXYZ120}$");
ui->cmbTestset->addItem("math: cal", "$\\mathcal{ABCDEFGHIJKLMNOPQRSTUVWXYZ120}$"); ui->cmbTestset->addItem("math: cal", "$\\mathcal{ABCDEFGHIJKLMNOPQRSTUVWXYZ120}$");
ui->cmbTestset->addItem("subscript test", "$r_{123}\\ \\ r_{\\frac{1}{2}}$"); ui->cmbTestset->addItem("subscript test", "$r_{123}\\ \\ r_{\\frac{1}{2}}$");
ui->cmbTestset->addItem("subscript0 test", "$r_{123}$"); ui->cmbTestset->addItem("subscript0 test", "$r_{123}$");
ui->cmbTestset->addItem("subscript1 test", "$r_{123}\\ $"); ui->cmbTestset->addItem("subscript1 test", "$r_{123}\\ $");
ui->cmbTestset->addItem("subscript2 test", "$r_{123}\\ \\ $"); ui->cmbTestset->addItem("subscript2 test", "$r_{123}\\ \\ $");
ui->cmbTestset->addItem("subscript3 test", "$r_{123}r_{\\frac{1}{2}}$"); ui->cmbTestset->addItem("subscript3 test", "$r_{123}r_{\\frac{1}{2}}$");
ui->cmbTestset->addItem("superscript test", "$r^{123}\\ \\ r^{\\frac{1}{2}}$"); ui->cmbTestset->addItem("superscript test", "$r^{123}\\ \\ r^{\\frac{1}{2}}$");
ui->cmbTestset->addItem("superscript0 test", "$r^{123}$"); ui->cmbTestset->addItem("superscript0 test", "$r^{123}$");
ui->cmbTestset->addItem("superscript1 test", "$r^{123}\\ $"); ui->cmbTestset->addItem("superscript1 test", "$r^{123}\\ $");
ui->cmbTestset->addItem("superscript2 test", "$r^{123}\\ \\ $"); ui->cmbTestset->addItem("superscript2 test", "$r^{123}\\ \\ $");
ui->cmbTestset->addItem("superscript3 test", "$r^{123}r^{\\frac{1}{2}}$"); ui->cmbTestset->addItem("superscript3 test", "$r^{123}r^{\\frac{1}{2}}$");
ui->cmbTestset->addItem("asuperscript test", "$a^{123}\\ \\ a^{\\frac{1}{2}}$"); ui->cmbTestset->addItem("asuperscript test", "$a^{123}\\ \\ a^{\\frac{1}{2}}$");
ui->cmbTestset->addItem("asuperscript0 test", "$a^{123}$"); ui->cmbTestset->addItem("asuperscript0 test", "$a^{123}$");
ui->cmbTestset->addItem("gsuperscript1 test", "$g^{123}\\ $"); ui->cmbTestset->addItem("gsuperscript1 test", "$g^{123}\\ $");
ui->cmbTestset->addItem("gsuperscript2 test", "$g^{123}\\ \\ $"); ui->cmbTestset->addItem("gsuperscript2 test", "$g^{123}\\ \\ $");
ui->cmbTestset->addItem("gsuperscript3 test", "$g^{123}g^{\\frac{1}{2}}$"); ui->cmbTestset->addItem("gsuperscript3 test", "$g^{123}g^{\\frac{1}{2}}$");
ui->cmbTestset->addItem("frac test", "$\\frac{a}{b}+\\frac{g}{a}-\\frac{a^2}{b^2}\\cdot\\frac{a^2}{b^{\\frac{1}{2}}}$"); ui->cmbTestset->addItem("frac test", "$\\frac{a}{b}+\\frac{g}{a}-\\frac{a^2}{b^2}\\cdot\\frac{a^2}{b^{\\frac{1}{2}}}$");
ui->cmbTestset->addItem("tfrac test", "$\\tfrac{a}{b}+\\tfrac{g}{a}-\\tfrac{a^2}{b^2}\\cdot\\tfrac{a^2}{b^{\\tfrac{1}{2}}}$"); ui->cmbTestset->addItem("tfrac test", "$\\tfrac{a}{b}+\\tfrac{g}{a}-\\tfrac{a^2}{b^2}\\cdot\\tfrac{a^2}{b^{\\tfrac{1}{2}}}$");
ui->cmbTestset->addItem("dfrac test", "$\\dfrac{a}{b}+\\dfrac{g}{a}-\\dfrac{a^2}{b^2}\\cdot\\dfrac{a^2}{b^{\\dfrac{1}{2}}}$"); ui->cmbTestset->addItem("dfrac test", "$\\dfrac{a}{b}+\\dfrac{g}{a}-\\dfrac{a^2}{b^2}\\cdot\\dfrac{a^2}{b^{\\dfrac{1}{2}}}$");
ui->cmbTestset->addItem("stackrel test", "$\\stackrel{a}{b}+\\stackrel{g}{a}-\\stackrel{a^2}{b^2}\\cdot\\stackrel{a^2}{b^{\\stackrel{1}{2}}}$"); ui->cmbTestset->addItem("stackrel test", "$\\stackrel{a}{b}+\\stackrel{g}{a}-\\stackrel{a^2}{b^2}\\cdot\\stackrel{a^2}{b^{\\stackrel{1}{2}}}$");
ui->cmbTestset->addItem("brace0 test", "\\langle\\langle -- $\\langle\\langle$"); ui->cmbTestset->addItem("brace0 test", "\\langle\\langle -- $\\langle\\langle$");
ui->cmbTestset->addItem("brace1 test", "\\langle\\langle r^{123} -- $\\langle\\langle r^{123}$"); ui->cmbTestset->addItem("brace1 test", "\\langle\\langle r^{123} -- $\\langle\\langle r^{123}$");
ui->cmbTestset->addItem("brace2 test", "\\langle\\langle r^{123}\\rangle\\rangle -- $\\langle\\langle r^{123}\\rangle\\rangle$"); ui->cmbTestset->addItem("brace2 test", "\\langle\\langle r^{123}\\rangle\\rangle -- $\\langle\\langle r^{123}\\rangle\\rangle$");
ui->cmbTestset->addItem("brace3 test", "\\left\\langle r^{123}\\right\\rangle -- $\\left\\langle r^{123}\\right\\rangle$"); ui->cmbTestset->addItem("brace3 test", "\\left\\langle r^{123}\\right\\rangle -- $\\left\\langle r^{123}\\right\\rangle$");
ui->cmbTestset->addItem("brace4 test", "\\left\\langle\\left\\langle\\left\\langle r^{123}\\right\\rangle\\right\\rangle\\right\\rangle -- $\\left\\langle\\left\\langle\\left\\langle r^{123}\\right\\rangle\\right\\rangle\\right\\rangle$"); ui->cmbTestset->addItem("brace4 test", "\\left\\langle\\left\\langle\\left\\langle r^{123}\\right\\rangle\\right\\rangle\\right\\rangle -- $\\left\\langle\\left\\langle\\left\\langle r^{123}\\right\\rangle\\right\\rangle\\right\\rangle$");
ui->cmbTestset->addItem("brace5 test: ( )", "\\left(\\left(\\left( r^{123}\\right)\\right)\\right) -- $\\left(\\left(\\left( r^{123}\\right)\\right)\\right)$"); ui->cmbTestset->addItem("brace5 test: ( )", "\\left(\\left(\\left( r^{123}\\right)\\right)\\right) -- $\\left(\\left(\\left( r^{123}\\right)\\right)\\right)$");
ui->cmbTestset->addItem("brace6 test: [ ]", "\\left[\\left[\\left[ r^{123}\\right]\\right]\\right] -- $\\left[\\left[\\left[ r^{123}\\right]\\right]\\right]$"); ui->cmbTestset->addItem("brace6 test: [ ]", "\\left[\\left[\\left[ r^{123}\\right]\\right]\\right] -- $\\left[\\left[\\left[ r^{123}\\right]\\right]\\right]$");
ui->cmbTestset->addItem("brace7 test: { }", "\\left\\{\\left\\{\\left\\{ r^{123}\\right\\}\\right\\}\\right\\} -- $\\left\\{\\left\\{\\left\\{ r^{123}\\right\\}\\right\\}\\right\\}$"); ui->cmbTestset->addItem("brace7 test: { }", "\\left\\{\\left\\{\\left\\{ r^{123}\\right\\}\\right\\}\\right\\} -- $\\left\\{\\left\\{\\left\\{ r^{123}\\right\\}\\right\\}\\right\\}$");
ui->cmbTestset->addItem("brace8 test: || ||", "\\left\\|\\left\\|\\left\\| r^{123}\\right\\|\\right\\|\\right\\| -- $\\left\\|\\left\\|\\left\\| r^{123}\\right\\|\\right\\|\\right\\|$"); ui->cmbTestset->addItem("brace8 test: || ||", "\\left\\|\\left\\|\\left\\| r^{123}\\right\\|\\right\\|\\right\\| -- $\\left\\|\\left\\|\\left\\| r^{123}\\right\\|\\right\\|\\right\\|$");
ui->cmbTestset->addItem("brace9 test: | |", "\\left|\\left|\\left| r^{123}\\right|\\right|\\right| -- $\\left|\\left|\\left| r^{123}\\right|\\right|\\right|$"); ui->cmbTestset->addItem("brace9 test: | |", "\\left|\\left|\\left| r^{123}\\right|\\right|\\right| -- $\\left|\\left|\\left| r^{123}\\right|\\right|\\right|$");
ui->cmbTestset->addItem("brace10 test", "\\left\\{\\left[\\left( r^{123}\\right)\\right]\\right\\} -- $\\left\\{\\left[\\left( r^{123}\\right)\\right]\\right\\}$"); ui->cmbTestset->addItem("brace10 test", "\\left\\{\\left[\\left( r^{123}\\right)\\right]\\right\\} -- $\\left\\{\\left[\\left( r^{123}\\right)\\right]\\right\\}$");
ui->cmbTestset->addItem("brace11 test: floor", "\\left\\lfloor\\left\\lfloor\\left\\lfloor r^{123}\\right\\rfloor\\right\\rfloor\\right\\rfloor -- $\\left\\lfloor\\left\\lfloor\\left\\lfloor r^{123}\\right\\rfloor\\right\\rfloor\\right\\rfloor$"); ui->cmbTestset->addItem("brace11 test: floor", "\\left\\lfloor\\left\\lfloor\\left\\lfloor r^{123}\\right\\rfloor\\right\\rfloor\\right\\rfloor -- $\\left\\lfloor\\left\\lfloor\\left\\lfloor r^{123}\\right\\rfloor\\right\\rfloor\\right\\rfloor$");
ui->cmbTestset->addItem("brace12 test: ceil", "\\left\\lceil\\left\\lceil\\left\\lceil r^{123}\\right\\rceil\\right\\rceil\\right\\rceil -- $\\left\\lceil\\left\\lceil\\left\\lceil r^{123}\\right\\rceil\\right\\rceil\\right\\rceil$"); ui->cmbTestset->addItem("brace12 test: ceil", "\\left\\lceil\\left\\lceil\\left\\lceil r^{123}\\right\\rceil\\right\\rceil\\right\\rceil -- $\\left\\lceil\\left\\lceil\\left\\lceil r^{123}\\right\\rceil\\right\\rceil\\right\\rceil$");
ui->cmbTestset->addItem("sub-, superscript test", "r^{1234}_{321} r_{321}^{1234} -- $r^{1234}_{321} r_{321}^{1234} -- \\kappa^2 -- \\kappa_2 -- \\kappa_2^2$"); ui->cmbTestset->addItem("sub-, superscript test", "r^{1234}_{321} r_{321}^{1234} -- $r^{1234}_{321} r_{321}^{1234} -- \\kappa^2 -- \\kappa_2 -- \\kappa_2^2$");
ui->cmbTestset->addItem("super-, subscript test", "r^{123}_{4321} r_{4321}^{123} -- $r^{123}_{4321} r_{4321}^{123} -- \\kappa^2 -- \\kappa_2 -- \\kappa_2^2$"); ui->cmbTestset->addItem("super-, subscript test", "r^{123}_{4321} r_{4321}^{123} -- $r^{123}_{4321} r_{4321}^{123} -- \\kappa^2 -- \\kappa_2 -- \\kappa_2^2$");
//ui->cmbTestset->addItem("", ""); //ui->cmbTestset->addItem("", "");
ui->cmbTestset->addItem("math 1", "$f(x)=\\int_{-\\infty}^xe^{-t^2}\\;\\mathrm{d}t$"); ui->cmbTestset->addItem("math 1", "$f(x)=\\int_{-\\infty}^xe^{-t^2}\\;\\mathrm{d}t$");
ui->cmbTestset->addItem("math 2", "$\\sum_{i=1}^\\infty\\frac{-e^{i\\pi}}{2^n}$"); ui->cmbTestset->addItem("math 2", "$\\sum_{i=1}^\\infty\\frac{-e^{i\\pi}}{2^n}$");
ui->cmbTestset->addItem("math 3", "$\\mbox{det} \\begin{pmatrix} 1 & x_1 & \\ldots & x_1^{n-1} \\\\ 1 & x_2 & \\ldots & x_2^{n-1} \\\\ \\vdots & \\vdots & \\ddots & \\vdots \\\\ 1 & x_n & \\ldots & x_n^{n-1} \\end{pmatrix} = \\prod_{1 \\leq i < j \\leq n} (x_j - x_i) $"); ui->cmbTestset->addItem("math 3", "$\\mbox{det} \\begin{pmatrix} 1 & x_1 & \\ldots & x_1^{n-1} \\\\ 1 & x_2 & \\ldots & x_2^{n-1} \\\\ \\vdots & \\vdots & \\ddots & \\vdots \\\\ 1 & x_n & \\ldots & x_n^{n-1} \\end{pmatrix} = \\prod_{1 \\leq i < j \\leq n} (x_j - x_i) $");
ui->cmbTestset->addItem("math 4", "$\\sqrt{1+\\sqrt{1+\\sqrt{1+\\sqrt{1+\\sqrt{1+\\sqrt{1+x}}}}}}$"); ui->cmbTestset->addItem("math 4", "$\\sqrt{1+\\sqrt{1+\\sqrt{1+\\sqrt{1+\\sqrt{1+\\sqrt{1+x}}}}}}$");
ui->cmbTestset->addItem("math 5", "$\\left(\\stackrel{p}{2}\\right)=x^2y^{p-2}-\\frac{1}{1-x}\\frac{1}{1-x^2}$"); ui->cmbTestset->addItem("math 5", "$\\left(\\stackrel{p}{2}\\right)=x^2y^{p-2}-\\frac{1}{1-x}\\frac{1}{1-x^2}$");
ui->cmbTestset->addItem("math 6", "$a_0+\\frac{1}{a_1+\\frac{1}{a_2+\\frac{1}{a_3+\\frac{1}{a_4}}}}$"); ui->cmbTestset->addItem("math 6", "$a_0+\\frac{1}{a_1+\\frac{1}{a_2+\\frac{1}{a_3+\\frac{1}{a_4}}}}$");
ui->cmbTestset->addItem("math 7", "$\\left(\\frac{\\partial^2}{\\partial x^2}+\\frac{\\partial^2}{\\partial y^2}\\right)\\left|\\varphi(x+\\mathrm{i}y)\\right|^2=0$"); ui->cmbTestset->addItem("math 7", "$\\left(\\frac{\\partial^2}{\\partial x^2}+\\frac{\\partial^2}{\\partial y^2}\\right)\\left|\\varphi(x+\\mathrm{i}y)\\right|^2=0$");
ui->cmbTestset->addItem("math 8", "$2^{2^{2^{x}}}$"); ui->cmbTestset->addItem("math 8", "$2^{2^{2^{x}}}$");
ui->cmbTestset->addItem("math 9", "$\\iint_Df(x,y)\\;\\mathrm{d}x\\;\\mathrm{d}y$"); ui->cmbTestset->addItem("math 9", "$\\iint_Df(x,y)\\;\\mathrm{d}x\\;\\mathrm{d}y$");
ui->cmbTestset->addItem("math 10 (overbrace)", "$\\overbrace{x+x+...+x}{k\\ \\mathrm{times}}$"); ui->cmbTestset->addItem("math 10 (overbrace)", "$\\overbrace{x+x+...+x}{k\\ \\mathrm{times}}$");
ui->cmbTestset->addItem("math 11 (underbrace)", "$\\underbrace{x+x+...+x}{k\\ \\mathrm{times}}$"); ui->cmbTestset->addItem("math 11 (underbrace)", "$\\underbrace{x+x+...+x}{k\\ \\mathrm{times}}$");
ui->cmbTestset->addItem("math 12 (under/overbrace)", "$\\underbrace{\\overbrace{x+x+...+x}{k\\ \\mathrm{times}} \\overbrace{x+x+...+x}{k\\ \\mathrm{times}}}{2k\\ \\mathrm{times}}$"); ui->cmbTestset->addItem("math 12 (under/overbrace)", "$\\underbrace{\\overbrace{x+x+...+x}{k\\ \\mathrm{times}} \\overbrace{x+x+...+x}{k\\ \\mathrm{times}}}{2k\\ \\mathrm{times}}$");
ui->cmbTestset->addItem("math 13", "$y_1''\\ \\ \\ y_2'''$"); ui->cmbTestset->addItem("math 13", "$y_1''\\ \\ \\ y_2'''$");
ui->cmbTestset->addItem("math 14", "$f(x)=\\begin{cases} 1/3 & \\mathrm{if}\\ 0\\leq x\\leq1 \\\\ 2/3 & \\mathrm{if}\\ 3\\leq x\\leq4 \\\\0 & \\mathrm{elsewhere} \\end{cases}$"); ui->cmbTestset->addItem("math 14", "$f(x)=\\begin{cases} 1/3 & \\mathrm{if}\\ 0\\leq x\\leq1 \\\\ 2/3 & \\mathrm{if}\\ 3\\leq x\\leq4 \\\\0 & \\mathrm{elsewhere} \\end{cases}$");
ui->cmbTestset->addItem("math 15", "$\\Re{z} =\\frac{n\\pi \\dfrac{\\theta +\\psi}{2}}{\\left(\\dfrac{\\theta +\\psi}{2}\\right)^2 + \\left( \\dfrac{1}{2}\\log \\left\\lvert\\dfrac{B}{A}\\right\\rvert\\right)^2}.$"); ui->cmbTestset->addItem("math 15", "$\\Re{z} =\\frac{n\\pi \\dfrac{\\theta +\\psi}{2}}{\\left(\\dfrac{\\theta +\\psi}{2}\\right)^2 + \\left( \\dfrac{1}{2}\\log \\left\\lvert\\dfrac{B}{A}\\right\\rvert\\right)^2}.$");
ui->cmbTestset->addItem("math 16", "$\\sum_{m=1}^\\infty\\sum_{n=1}^\\infty\\frac{m^2\\,n}{3^m\\left(m\\,3^n+n\\,3^m\\right)}$"); ui->cmbTestset->addItem("math 16", "$\\sum_{m=1}^\\infty\\sum_{n=1}^\\infty\\frac{m^2\\,n}{3^m\\left(m\\,3^n+n\\,3^m\\right)}$");
ui->cmbTestset->addItem("math 17", "$\\phi_n(\\kappa) =\\frac{1}{4\\pi^2\\kappa^2} \\int_0^\\infty\\frac{\\sin(\\kappa R)}{\\kappa R}\\frac{\\partial}{\\partial R}\\left[R^2\\frac{\\partial D_n(R)}{\\partial R}\\right]\\,dR$"); ui->cmbTestset->addItem("math 17", "$\\phi_n(\\kappa) =\\frac{1}{4\\pi^2\\kappa^2} \\int_0^\\infty\\frac{\\sin(\\kappa R)}{\\kappa R}\\frac{\\partial}{\\partial R}\\left[R^2\\frac{\\partial D_n(R)}{\\partial R}\\right]\\,dR$");
ui->cmbTestset->addItem("math 18", "${}_pF_q(a_1,\\dots,a_p;c_1,\\dots,c_q;z)= \\sum_{n=0}^\\infty\\frac{(a_1)_n\\cdots(a_p)_n}{(c_1)_n\\cdots(c_q)_n}\\frac{z^n}{n!}$"); ui->cmbTestset->addItem("math 18", "${}_pF_q(a_1,\\dots,a_p;c_1,\\dots,c_q;z)= \\sum_{n=0}^\\infty\\frac{(a_1)_n\\cdots(a_p)_n}{(c_1)_n\\cdots(c_q)_n}\\frac{z^n}{n!}$");
ui->cmbTestset->addItem("math 19 (overset)", "$X \\overset{=}{def} Y$\\ \\ \\ \\ \\ $X \\overset{=}{!} Y$\\ \\ \\ \\ \\ $X \\overset{\\rightarrow}{f} Y$\\ \\ \\ \\ \\ $\\frac{f(x+\\Delta x)-f(x)}{\\Delta x}\\overset{\\longrightarrow}{\\Delta x\\to 0}f'(x)$"); ui->cmbTestset->addItem("math 19 (overset)", "$X \\overset{=}{def} Y$\\ \\ \\ \\ \\ $X \\overset{=}{!} Y$\\ \\ \\ \\ \\ $X \\overset{\\rightarrow}{f} Y$\\ \\ \\ \\ \\ $\\frac{f(x+\\Delta x)-f(x)}{\\Delta x}\\overset{\\longrightarrow}{\\Delta x\\to 0}f'(x)$");
ui->cmbTestset->addItem("math 20 (underset)", "$X \\underset{=}{\\text{def (5)}} Y$\\ \\ \\ \\ \\ $X \\underset{\\rightarrow}{f} Y$\\ \\ \\ \\ \\ $\\frac{f(x+\\Delta x)-f(x)}{\\Delta x}\\underset{\\longrightarrow}{\\Delta x\\to 0}f'(x)$"); ui->cmbTestset->addItem("math 20 (underset)", "$X \\underset{=}{\\text{def (5)}} Y$\\ \\ \\ \\ \\ $X \\underset{\\rightarrow}{f} Y$\\ \\ \\ \\ \\ $\\frac{f(x+\\Delta x)-f(x)}{\\Delta x}\\underset{\\longrightarrow}{\\Delta x\\to 0}f'(x)$");
ui->cmbTestset->addItem("Jacobi Matrix and VarCov matrix", "$J_{ij}= \\left.\\frac{\\partial f(x,\\vec{p})}{\\partial p_i}\\right|_{\\vec{p},x=x_j}\\ \\ \\ \\ \\ \\mat{C}=\\left(\\mat{J}^\\mathrm{T}\\ J\\right)^{-1}\\ \\ \\ \\ \\ test: \\left|\\frac{\\partial f(x,\\vec{p})}{\\partial p_i}\\right|_{\\vec{p},x=x_j}^2$"); ui->cmbTestset->addItem("Jacobi Matrix and VarCov matrix", "$J_{ij}= \\left.\\frac{\\partial f(x,\\vec{p})}{\\partial p_i}\\right|_{\\vec{p},x=x_j}\\ \\ \\ \\ \\ \\mat{C}=\\left(\\mat{J}^\\mathrm{T}\\ J\\right)^{-1}\\ \\ \\ \\ \\ test: \\left|\\frac{\\partial f(x,\\vec{p})}{\\partial p_i}\\right|_{\\vec{p},x=x_j}^2$");
ui->cmbTestset->addItem("operator test (textmode)", "x=0\\ \\ y>0\\ \\ x+y\\ \\ -1\\ \\ x-2\\ \\ x\\cdot y\\ \\ x\\geq 4\\ \\ x~4"); ui->cmbTestset->addItem("operator test (textmode)", "x=0\\ \\ y>0\\ \\ x+y\\ \\ -1\\ \\ x-2\\ \\ x\\cdot y\\ \\ x\\geq 4\\ \\ x~4");
ui->cmbTestset->addItem("operator test (mathmode)", "$x=0\\ \\ y>0\\ \\ x+y\\ \\ -1\\ \\ x-2\\ \\ x\\cdot y\\ \\ x\\geq 4\\ \\ x~4$"); ui->cmbTestset->addItem("operator test (mathmode)", "$x=0\\ \\ y>0\\ \\ x+y\\ \\ -1\\ \\ x-2\\ \\ x\\cdot y\\ \\ x\\geq 4\\ \\ x~4$");
ui->cmbTestset->addItem("color test", "\\textcolor{red}{RED}\\textcolor{blue}{BLUE}"); ui->cmbTestset->addItem("color test", "\\textcolor{red}{RED}\\textcolor{blue}{BLUE}");
ui->cmbTestset->addItem("boxed test", "test: \\boxed{boxed text} in the middle"); ui->cmbTestset->addItem("boxed test", "test: \\boxed{boxed text} in the middle");
ui->cmbTestset->addItem("mathboxed test", "\\fbox{2^{2^{\\colorbox{red}{2^{x}}}}}"); ui->cmbTestset->addItem("mathboxed test", "\\fbox{2^{2^{\\colorbox{red}{2^{x}}}}}");
ui->cmbTestset->addItem("axiom of power test", "$\\forall A \\, \\exists P \\, \\forall B \\, [B \\in P \\iff \\forall C \\, (C \\in B \\Rightarrow C \\in A)]$"); ui->cmbTestset->addItem("axiom of power test", "$\\forall A \\, \\exists P \\, \\forall B \\, [B \\in P \\iff \\forall C \\, (C \\in B \\Rightarrow C \\in A)]$");
ui->cmbTestset->addItem("De Morgan's law", "$\\neg(P\\land Q)\\iff(\\neg P)\\lor(\\neg Q)$ or $\\overline{\\bigcap_{i \\in I} A_{i}}\\equiv\\bigcup_{i \\in I} \\overline{A_{i}}$ or $\\overline{A \\cup B}\\equiv\\overline{A} \\cap \\overline{B}$"); ui->cmbTestset->addItem("De Morgan's law", "$\\neg(P\\land Q)\\iff(\\neg P)\\lor(\\neg Q)$ or $\\overline{\\bigcap_{i \\in I} A_{i}}\\equiv\\bigcup_{i \\in I} \\overline{A_{i}}$ or $\\overline{A \\cup B}\\equiv\\overline{A} \\cap \\overline{B}$");
ui->cmbTestset->addItem("quadratic formula", "$x=\\frac{-b \\pm \\sqrt{b^2-4ac}}{2a}$"); ui->cmbTestset->addItem("quadratic formula", "$x=\\frac{-b \\pm \\sqrt{b^2-4ac}}{2a}$");
ui->cmbTestset->addItem("combination", "$\\binom{n}{k} = \\frac{n(n-1)...(n-k+1)}{k(k-1)\\dots1}=\\frac{n!}{k!(n-k)!}$"); ui->cmbTestset->addItem("combination", "$\\binom{n}{k} = \\frac{n(n-1)...(n-k+1)}{k(k-1)\\dots1}=\\frac{n!}{k!(n-k)!}$");
ui->cmbTestset->addItem("Sophomore's dream 1", "$\\int_0^1 x^{-x}\\,dx = \\sum_{n=1}^\\infty n^{-n}(\\scriptstyle{= 1.29128599706266354040728259059560054149861936827\\dots)}$"); ui->cmbTestset->addItem("Sophomore's dream 1", "$\\int_0^1 x^{-x}\\,dx = \\sum_{n=1}^\\infty n^{-n}(\\scriptstyle{= 1.29128599706266354040728259059560054149861936827\\dots)}$");
ui->cmbTestset->addItem("Sophomore's dream 2", "$\\int_0^1 x^x \\,dx = \\sum_{n=1}^\\infty (-1)^{n+1}n^{-n} = - \\sum_{n=1}^\\infty (-n)^{-n} (\\scriptstyle{= 0.78343051071213440705926438652697546940768199014\\dots})$"); ui->cmbTestset->addItem("Sophomore's dream 2", "$\\int_0^1 x^x \\,dx = \\sum_{n=1}^\\infty (-1)^{n+1}n^{-n} = - \\sum_{n=1}^\\infty (-n)^{-n} (\\scriptstyle{= 0.78343051071213440705926438652697546940768199014\\dots})$");
ui->cmbTestset->addItem("divergence 1", "$\\operatorname{div}\\vec{F} = \\nabla\\cdot\\vec{F}=\\frac{\\partial U}{\\partial x}+\\frac{\\partial V}{\\partial y}+\\frac{\\partial W}{\\partial z}$"); ui->cmbTestset->addItem("divergence 1", "$\\operatorname{div}\\vec{F} = \\nabla\\cdot\\vec{F}=\\frac{\\partial U}{\\partial x}+\\frac{\\partial V}{\\partial y}+\\frac{\\partial W}{\\partial z}$");
ui->cmbTestset->addItem("divergence 2", "$\\overrightarrow{\\operatorname{div}}\\,(\\mathbf{\\underline{\\underline{\\epsilon}}}) = " ui->cmbTestset->addItem("divergence 2", "$\\overrightarrow{\\operatorname{div}}\\,(\\mathbf{\\underline{\\underline{\\epsilon}}}) = "
"\\begin{bmatrix}" "\\begin{bmatrix}"
"\\frac{\\partial \\epsilon_{xx}}{\\partial x} +\\frac{\\partial \\epsilon_{yx}}{\\partial y} +\\frac{\\partial \\epsilon_{zx}}{\\partial z} \\\\" "\\frac{\\partial \\epsilon_{xx}}{\\partial x} +\\frac{\\partial \\epsilon_{yx}}{\\partial y} +\\frac{\\partial \\epsilon_{zx}}{\\partial z} \\\\"
"\\frac{\\partial \\epsilon_{xy}}{\\partial x} +\\frac{\\partial \\epsilon_{yy}}{\\partial y} +\\frac{\\partial \\epsilon_{zy}}{\\partial z} \\\\" "\\frac{\\partial \\epsilon_{xy}}{\\partial x} +\\frac{\\partial \\epsilon_{yy}}{\\partial y} +\\frac{\\partial \\epsilon_{zy}}{\\partial z} \\\\"
"\\frac{\\partial \\epsilon_{xz}}{\\partial x} +\\frac{\\partial \\epsilon_{yz}}{\\partial y} +\\frac{\\partial \\epsilon_{zz}}{\\partial z}" "\\frac{\\partial \\epsilon_{xz}}{\\partial x} +\\frac{\\partial \\epsilon_{yz}}{\\partial y} +\\frac{\\partial \\epsilon_{zz}}{\\partial z}"
"\\end{bmatrix}$"); "\\end{bmatrix}$");
ui->cmbTestset->addItem("lim, sum ...", "$\\lim_{x\\to\\infty} f(x) = \\binom{k}{r} + \\frac{a}{b} \\sum_{n=1}^\\infty a_n + \\displaystyle{ \\left\\{ \\frac{1}{13} \\sum_{n=1}^\\infty b_n \\right\\} }.$"); ui->cmbTestset->addItem("lim, sum ...", "$\\lim_{x\\to\\infty} f(x) = \\binom{k}{r} + \\frac{a}{b} \\sum_{n=1}^\\infty a_n + \\displaystyle{ \\left\\{ \\frac{1}{13} \\sum_{n=1}^\\infty b_n \\right\\} }.$");
ui->cmbTestset->addItem("array test", "$f(x) := \\left\\{\\begin{array} x^2 \\sin \\frac{1}{x} & \\textrm{if } x \\ne 0, \\\\ 0 & \\textrm{if } x = 0 . \\end{array}\\right.$"); ui->cmbTestset->addItem("array test", "$f(x) := \\left\\{\\begin{array} x^2 \\sin \\frac{1}{x} & \\textrm{if } x \\ne 0, \\\\ 0 & \\textrm{if } x = 0 . \\end{array}\\right.$");
ui->cmbTestset->addItem("Schwinger-Dyson", "$\\left\\langle\\psi\\left|\\mathcal{T}\\{F \\phi^j\\}\\right|\\psi\\right\\rangle=\\left\\langle\\psi\\left|\\mathcal{T}\\{iF_{,i}D^{ij}-FS_{int,i}D^{ij}\\}\\right|\\psi\\right\\rangle.$"); ui->cmbTestset->addItem("Schwinger-Dyson", "$\\left\\langle\\psi\\left|\\mathcal{T}\\{F \\phi^j\\}\\right|\\psi\\right\\rangle=\\left\\langle\\psi\\left|\\mathcal{T}\\{iF_{,i}D^{ij}-FS_{int,i}D^{ij}\\}\\right|\\psi\\right\\rangle.$");
ui->cmbTestset->addItem(QLatin1String("Schrödinger's equation"), "$\\left[-\\frac{\\hbar^2}{2m}\\frac{\\partial^2}{\\partial x^2}+V\\right]\\Psi(x)=\\mathrm{i}\\hbar\\frac{\\partial}{\\partial t}\\Psi(x)$"); ui->cmbTestset->addItem(QLatin1String("Schrödinger's equation"), "$\\left[-\\frac{\\hbar^2}{2m}\\frac{\\partial^2}{\\partial x^2}+V\\right]\\Psi(x)=\\mathrm{i}\\hbar\\frac{\\partial}{\\partial t}\\Psi(x)$");
ui->cmbTestset->addItem("Cauchy-Schwarz inequality", "$\\left( \\sum_{k=1}^n a_k b_k \\right)^2 \\leq \\left( \\sum_{k=1}^n a_k^2 \\right) \\left( \\sum_{k=1}^n b_k^2 \\right)$"); ui->cmbTestset->addItem("Cauchy-Schwarz inequality", "$\\left( \\sum_{k=1}^n a_k b_k \\right)^2 \\leq \\left( \\sum_{k=1}^n a_k^2 \\right) \\left( \\sum_{k=1}^n b_k^2 \\right)$");
ui->cmbTestset->addItem("Maxwell's equations", "$\\begin{aligned}\\nabla \\times \\vec{\\mathbf{B}} -\\, \\frac{1}{c}\\, \\frac{\\partial\\vec{\\mathbf{E}}}{\\partial t} & = \\frac{4\\pi}{c}\\vec{\\mathbf{j}} \\\\ \\nabla \\cdot \\vec{\\mathbf{E}} & = 4 \\pi \\rho \\\\\\nabla \\times \\vec{\\mathbf{E}}\\, +\\, \\frac{1}{c}\\, \\frac{\\partial\\vec{\\mathbf{B}}}{\\partial t} & = \\vec{\\mathbf{0}} \\\\\\nabla \\cdot \\vec{\\mathbf{B}} & = 0 \\end{aligned}$"); ui->cmbTestset->addItem("Maxwell's equations", "$\\begin{aligned}\\nabla \\times \\vec{\\mathbf{B}} -\\, \\frac{1}{c}\\, \\frac{\\partial\\vec{\\mathbf{E}}}{\\partial t} & = \\frac{4\\pi}{c}\\vec{\\mathbf{j}} \\\\ \\nabla \\cdot \\vec{\\mathbf{E}} & = 4 \\pi \\rho \\\\\\nabla \\times \\vec{\\mathbf{E}}\\, +\\, \\frac{1}{c}\\, \\frac{\\partial\\vec{\\mathbf{B}}}{\\partial t} & = \\vec{\\mathbf{0}} \\\\\\nabla \\cdot \\vec{\\mathbf{B}} & = 0 \\end{aligned}$");
ui->cmbTestset->addItem("Langevin Equation", "$m \\dot{v}(t) = -\\gamma v(t) + F(x,t)+ f(t)$"); ui->cmbTestset->addItem("Langevin Equation", "$m \\dot{v}(t) = -\\gamma v(t) + F(x,t)+ f(t)$");
ui->cmbTestset->addItem("Fokker-Planck Equation", "$\\frac{\\partial}{\\partial t}P(y,t)=-\\frac{\\partial}{\\partial y}\\left[ A(y,t)P(y,t)\\right] +\\frac{\\Gamma}{2}\\frac{\\partial^2}{\\partial y^2}\\left[ P(y,t)\\right]$"); ui->cmbTestset->addItem("Fokker-Planck Equation", "$\\frac{\\partial}{\\partial t}P(y,t)=-\\frac{\\partial}{\\partial y}\\left[ A(y,t)P(y,t)\\right] +\\frac{\\Gamma}{2}\\frac{\\partial^2}{\\partial y^2}\\left[ P(y,t)\\right]$");
ui->cmbTestset->addItem("Hamilton Equations of motion", "$\\mathcal{H}(\\mathbf{q},\\mathbf{p})=\\frac{\\mathbf{p}^2}{2\\,m}+V(\\mathbf{q})\\ \\ \\ \\text{and}\\ \\ \\ \\dot{q}_k =\\frac{p_k}{m}\\ ,\\ \\dot{p}_k = - \\frac{\\partial V}{\\partial q_k}$"); ui->cmbTestset->addItem("Hamilton Equations of motion", "$\\mathcal{H}(\\mathbf{q},\\mathbf{p})=\\frac{\\mathbf{p}^2}{2\\,m}+V(\\mathbf{q})\\ \\ \\ \\text{and}\\ \\ \\ \\dot{q}_k =\\frac{p_k}{m}\\ ,\\ \\dot{p}_k = - \\frac{\\partial V}{\\partial q_k}$");
ui->cmbTestset->addItem("Gaussian Distrubution", "$f(x | \\mu,\\sigma^2)=\\frac{1}{\\sqrt{2\\pi\\sigma^2}}\\operatorname{exp}\\left(-\\frac{(x-\\mu)^2}{2\\sigma^2}\\right)=\\frac{1}{\\sqrt{2\\pi\\sigma^2}} e^{-\\frac{(x-\\mu)^2}{2\\sigma^2}}\\quad -\\infty<x<\\infty$"); ui->cmbTestset->addItem("Gaussian Distrubution", "$f(x | \\mu,\\sigma^2)=\\frac{1}{\\sqrt{2\\pi\\sigma^2}}\\operatorname{exp}\\left(-\\frac{(x-\\mu)^2}{2\\sigma^2}\\right)=\\frac{1}{\\sqrt{2\\pi\\sigma^2}} e^{-\\frac{(x-\\mu)^2}{2\\sigma^2}}\\quad -\\infty<x<\\infty$");
ui->cmbTestset->addItem("User-Editable Text"); ui->cmbTestset->addItem("User-Editable Text");
// //
//ui->cmbTestset->addItem("", "$$"); //ui->cmbTestset->addItem("", "$$");
//ui->cmbTestset->addItem("", "$$"); //ui->cmbTestset->addItem("", "$$");
//ui->cmbTestset->addItem("", ""); //ui->cmbTestset->addItem("", "");
ui->cmbTestset->setCurrentIndex(0); ui->cmbTestset->setCurrentIndex(0);
ui->labMath->setMath("\\left(\\left[\\sqrt{2\\pi\\cdot\\int_{-\\infty}^\\infty f(x)\\;\\mathrm{d}x}\\right]\\right)"); ui->labMath->setMath("\\left(\\left[\\sqrt{2\\pi\\cdot\\int_{-\\infty}^\\infty f(x)\\;\\mathrm{d}x}\\right]\\right)");
ui->cmbFont->setCurrentIndex(1); ui->cmbFont->setCurrentIndex(1);
} }
TestForm::~TestForm() TestForm::~TestForm()
{ {
delete ui; delete ui;
} }
#define W 2000 #define W 2000
#define H 2000 #define H 2000
#define X1 15 #define X1 15
#define Y1 50 #define Y1 50
double TestForm::draw(QPainter& painter, double X, double YY, JKQTmathText& mt, QString name, double& durationSizingMS, double&durationTimingMS) { double TestForm::draw(QPainter& painter, double X, double YY, JKQTmathText& mt, QString name, double& durationSizingMS, double&durationTimingMS) {
double Y=YY; double Y=YY;
painter.save(); painter.save();
ht.start(); ht.start();
QSizeF s=mt.getSize(painter); QSizeF s=mt.getSize(painter);
Y=Y+mt.getAscent(painter); Y=Y+mt.getAscent(painter);
durationSizingMS=ht.get_time()/1000.0; durationSizingMS=ht.get_time()/1000.0;
qDebug()<<" sizing in "<<durationSizingMS<<" ms\n"; qDebug()<<" sizing in "<<durationSizingMS<<" ms\n";
QPen p=painter.pen(); QPen p=painter.pen();
p.setColor("lightcoral"); p.setColor("lightcoral");
p.setStyle(Qt::DashLine); p.setStyle(Qt::DashLine);
p.setWidth(2); p.setWidth(2);
painter.setPen(p); painter.setPen(p);
QRectF r(X, Y-mt.getAscent(painter),s.width(), s.height()); QRectF r(X, Y-mt.getAscent(painter),s.width(), s.height());
painter.drawRect(r); painter.drawRect(r);
p.setColor("lightblue"); p.setColor("lightblue");
painter.setPen(p); painter.setPen(p);
painter.drawLine(X, Y, X+s.width(), Y); painter.drawLine(X, Y, X+s.width(), Y);
ht.start(); ht.start();
p.setStyle(Qt::SolidLine); p.setStyle(Qt::SolidLine);
p.setWidth(1); p.setWidth(1);
p.setColor("black"); p.setColor("black");
painter.setPen(p); painter.setPen(p);
mt.draw(painter, X, Y, ui->chkBoxes->isChecked()); mt.draw(painter, X, Y, ui->chkBoxes->isChecked());
durationTimingMS=ht.get_time()/1000.0; durationTimingMS=ht.get_time()/1000.0;
qDebug()<<" drawing in "<<durationTimingMS<<" ms"; qDebug()<<" drawing in "<<durationTimingMS<<" ms";
p.setColor("blue"); p.setColor("blue");
painter.setPen(p); painter.setPen(p);
QFont f; QFont f;
f.setFamily("sans serif"); f.setFamily("sans serif");
f.setUnderline(true); f.setUnderline(true);
f.setPointSize(10); f.setPointSize(10);
painter.setFont(f); painter.setFont(f);
painter.drawText(X, Y-mt.getAscent(painter)-6, name+":"); painter.drawText(X, Y-mt.getAscent(painter)-6, name+":");
painter.restore(); painter.restore();
qDebug()<<name<<": width="<<s.width()<<" height="<<s.height()<<" ascent="<<mt.getAscent(painter)<<" descent="<<mt.getDescent(painter); qDebug()<<name<<": width="<<s.width()<<" height="<<s.height()<<" ascent="<<mt.getAscent(painter)<<" descent="<<mt.getDescent(painter);
return mt.getDescent(painter)+mt.getAscent(painter)+40; return mt.getDescent(painter)+mt.getAscent(painter)+40;
} }
QTreeWidgetItem *TestForm::createTree(JKQTmathText::MTnode *node, QTreeWidgetItem* parent) QTreeWidgetItem *TestForm::createTree(JKQTmathText::MTnode *node, QTreeWidgetItem* parent)
{ {
QString name; QString name;
JKQTmathText::MTtextNode* txtN=dynamic_cast<JKQTmathText::MTtextNode*>(node); JKQTmathText::MTtextNode* txtN=dynamic_cast<JKQTmathText::MTtextNode*>(node);
JKQTmathText::MTwhitespaceNode* spN=dynamic_cast<JKQTmathText::MTwhitespaceNode*>(node); JKQTmathText::MTwhitespaceNode* spN=dynamic_cast<JKQTmathText::MTwhitespaceNode*>(node);
JKQTmathText::MTsymbolNode* symN=dynamic_cast<JKQTmathText::MTsymbolNode*>(node); JKQTmathText::MTsymbolNode* symN=dynamic_cast<JKQTmathText::MTsymbolNode*>(node);
JKQTmathText::MTlistNode* lstN=dynamic_cast<JKQTmathText::MTlistNode*>(node); JKQTmathText::MTlistNode* lstN=dynamic_cast<JKQTmathText::MTlistNode*>(node);
JKQTmathText::MTinstruction1Node* inst1N=dynamic_cast<JKQTmathText::MTinstruction1Node*>(node); JKQTmathText::MTinstruction1Node* inst1N=dynamic_cast<JKQTmathText::MTinstruction1Node*>(node);
JKQTmathText::MTsubscriptNode* subN=dynamic_cast<JKQTmathText::MTsubscriptNode*>(node); JKQTmathText::MTsubscriptNode* subN=dynamic_cast<JKQTmathText::MTsubscriptNode*>(node);
JKQTmathText::MTsuperscriptNode* superN=dynamic_cast<JKQTmathText::MTsuperscriptNode*>(node); JKQTmathText::MTsuperscriptNode* superN=dynamic_cast<JKQTmathText::MTsuperscriptNode*>(node);
JKQTmathText::MTbraceNode* braceN=dynamic_cast<JKQTmathText::MTbraceNode*>(node); JKQTmathText::MTbraceNode* braceN=dynamic_cast<JKQTmathText::MTbraceNode*>(node);
JKQTmathText::MTsqrtNode* sqrtN=dynamic_cast<JKQTmathText::MTsqrtNode*>(node); JKQTmathText::MTsqrtNode* sqrtN=dynamic_cast<JKQTmathText::MTsqrtNode*>(node);
JKQTmathText::MTfracNode* fracN=dynamic_cast<JKQTmathText::MTfracNode*>(node); JKQTmathText::MTfracNode* fracN=dynamic_cast<JKQTmathText::MTfracNode*>(node);
JKQTmathText::MTmatrixNode* matrixN=dynamic_cast<JKQTmathText::MTmatrixNode*>(node); JKQTmathText::MTmatrixNode* matrixN=dynamic_cast<JKQTmathText::MTmatrixNode*>(node);
JKQTmathText::MTdecoratedNode* decoN=dynamic_cast<JKQTmathText::MTdecoratedNode*>(node); JKQTmathText::MTdecoratedNode* decoN=dynamic_cast<JKQTmathText::MTdecoratedNode*>(node);
QTreeWidgetItem* ti=nullptr; QTreeWidgetItem* ti=nullptr;
if (parent) ti=new QTreeWidgetItem(parent); if (parent) ti=new QTreeWidgetItem(parent);
else ti=new QTreeWidgetItem(ui->tree); else ti=new QTreeWidgetItem(ui->tree);
if (decoN) { if (decoN) {
name=QString("MTdecoratedNode: mode='%1'").arg(JKQTmathText::decorationToString(decoN->get_decoration())); name=QString("MTdecoratedNode: mode='%1'").arg(JKQTmathText::decorationToString(decoN->get_decoration()));
if (decoN->get_child()) ti->addChild(createTree(decoN->get_child(), ti)); if (decoN->get_child()) ti->addChild(createTree(decoN->get_child(), ti));
} else if (matrixN) { } else if (matrixN) {
int l=matrixN->get_lines(); int l=matrixN->get_lines();
int c=matrixN->get_columns(); int c=matrixN->get_columns();
name=QString("MTmatrixNode: l*c=%1*%2").arg(l).arg(c); name=QString("MTmatrixNode: l*c=%1*%2").arg(l).arg(c);
QVector<QVector<JKQTmathText::MTnode*> > children=matrixN->get_children(); QVector<QVector<JKQTmathText::MTnode*> > children=matrixN->get_children();
for (int y=0; y<l; y++) { for (int y=0; y<l; y++) {
for (int x=0; x<c; x++) { for (int x=0; x<c; x++) {
if (children[y].at(x)!=nullptr) { if (children[y].at(x)!=nullptr) {
QTreeWidgetItem* it=createTree(children[y].at(x), ti); QTreeWidgetItem* it=createTree(children[y].at(x), ti);
it->setText(0, QString("(%1,%2):").arg(y).arg(x)+it->text(0)); it->setText(0, QString("(%1,%2):").arg(y).arg(x)+it->text(0));
ti->addChild(it); ti->addChild(it);
} }
} }
} }
} else if (fracN) { } else if (fracN) {
name=QString("MTfracNode: mode='%1'").arg(JKQTmathText::fracModeToString(fracN->get_mode())); name=QString("MTfracNode: mode='%1'").arg(JKQTmathText::fracModeToString(fracN->get_mode()));
if (fracN->get_child1()) ti->addChild(createTree(fracN->get_child1(), ti)); if (fracN->get_child1()) ti->addChild(createTree(fracN->get_child1(), ti));
if (fracN->get_child2()) ti->addChild(createTree(fracN->get_child2(), ti)); if (fracN->get_child2()) ti->addChild(createTree(fracN->get_child2(), ti));
} else if (sqrtN) { } else if (sqrtN) {
name=QString("MTsqrtNode: deg=%1").arg(sqrtN->get_degree()); name=QString("MTsqrtNode: deg=%1").arg(sqrtN->get_degree());
if (sqrtN->get_child()) ti->addChild(createTree(sqrtN->get_child(), ti)); if (sqrtN->get_child()) ti->addChild(createTree(sqrtN->get_child(), ti));
} else if (braceN) { } else if (braceN) {
name=QString("MTbraceNode: l='%1', r='%2', showR=%3").arg(braceN->get_openbrace()).arg(braceN->get_closebrace()).arg(braceN->get_showRightBrace()); name=QString("MTbraceNode: l='%1', r='%2', showR=%3").arg(braceN->get_openbrace()).arg(braceN->get_closebrace()).arg(braceN->get_showRightBrace());
if (braceN->get_child()) ti->addChild(createTree(braceN->get_child(), ti)); if (braceN->get_child()) ti->addChild(createTree(braceN->get_child(), ti));
} else if (superN) { } else if (superN) {
name=QString("MTsuperscriptNode"); name=QString("MTsuperscriptNode");
if (superN->get_child()) ti->addChild(createTree(superN->get_child(), ti)); if (superN->get_child()) ti->addChild(createTree(superN->get_child(), ti));
} else if (subN) { } else if (subN) {
name=QString("MTsubscriptNode"); name=QString("MTsubscriptNode");
if (subN->get_child()) ti->addChild(createTree(subN->get_child(), ti)); if (subN->get_child()) ti->addChild(createTree(subN->get_child(), ti));
} else if (inst1N) { } else if (inst1N) {
name=QString("MTinstruction1Node: \'%1\'").arg(inst1N->get_name()); name=QString("MTinstruction1Node: \'%1\'").arg(inst1N->get_name());
if (inst1N->get_child()) ti->addChild(createTree(inst1N->get_child(), ti)); if (inst1N->get_child()) ti->addChild(createTree(inst1N->get_child(), ti));
} else if (lstN) { } else if (lstN) {
name=QString("MTlistNode"); name=QString("MTlistNode");
QList<JKQTmathText::MTnode*> list=lstN->get_nodes(); QList<JKQTmathText::MTnode*> list=lstN->get_nodes();
for (int i=0; i<list.size(); i++) { for (int i=0; i<list.size(); i++) {
ti->addChild(createTree(list[i], ti)); ti->addChild(createTree(list[i], ti));
} }
} else if (symN) { } else if (symN) {
name=QString("MTsymbolNode: \'%1\'").arg(symN->get_symbolName()); name=QString("MTsymbolNode: \'%1\'").arg(symN->get_symbolName());
} else if (spN) { } else if (spN) {
name=QString("MTwhitespaceNode :\'%1\'").arg(txtN->get_text()); name=QString("MTwhitespaceNode :\'%1\'").arg(txtN->get_text());
} else if (txtN) { } else if (txtN) {
name=QString("MTtextNode: \'%1\'").arg(txtN->get_text()); name=QString("MTtextNode: \'%1\'").arg(txtN->get_text());
} else { } else {
name=QString("unknown"); name=QString("unknown");
} }
ti->setText(0,name); ti->setText(0,name);
/* /*
QString space=""; QString space="";
QTreeWidgetItem* p=ti->parent(); QTreeWidgetItem* p=ti->parent();
while (p) { while (p) {
space+=" "; space+=" ";
p=p->parent(); p=p->parent();
} }
qDebug()<<space<<"createTree()"; qDebug()<<space<<"createTree()";
*/ */
return ti; return ti;
} }
void TestForm::updateMath() void TestForm::updateMath()
{ {
QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
QString mathTest=""; QString mathTest="";
//QString symbolTest="\\lfloor\\rfloor\\lceil\\rceil\\langle\\rangle\\sum\\int \\iint \\oint \\prod \\leftrightarrow \\leftarrow\\Leftarrow\\rightarrow\\Rightarrow\\pm\\mp\\leq\\geq\\ll\\gg\\hbar\\euro\\bbC\\bbH\\bbN\\bbP\\bbQ\\bbZ\\bbR\\Angstrom\\Alef\\Bet\\Gimel\\Dalet\\nexists\\ni\\notni\\circ\\tilde\\oiint\\oiiint\\emptyset\\odot\\ominus\\subsetnot\\DC\\bot\\cdots\\perthousand\\leftharpoonup\\rightharpoonup \\upharpoonleft \\downharpoonleft \\leftrightharpoon \\rightleftharpoon \\coprod \\leftharpoondown \\rightharpoondown \\nwarrow \\nearrow \\mapsto \\cent \\pound \\yen \\div \\multimap \\maporiginal \\mapimage \\bigcap \\bigcup \\benzene \\times \\cdot \\propto \\equiv \\Im \\Re \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ "; //QString symbolTest="\\lfloor\\rfloor\\lceil\\rceil\\langle\\rangle\\sum\\int \\iint \\oint \\prod \\leftrightarrow \\leftarrow\\Leftarrow\\rightarrow\\Rightarrow\\pm\\mp\\leq\\geq\\ll\\gg\\hbar\\euro\\bbC\\bbH\\bbN\\bbP\\bbQ\\bbZ\\bbR\\Angstrom\\Alef\\Bet\\Gimel\\Dalet\\nexists\\ni\\notni\\circ\\tilde\\oiint\\oiiint\\emptyset\\odot\\ominus\\subsetnot\\DC\\bot\\cdots\\perthousand\\leftharpoonup\\rightharpoonup \\upharpoonleft \\downharpoonleft \\leftrightharpoon \\rightleftharpoon \\coprod \\leftharpoondown \\rightharpoondown \\nwarrow \\nearrow \\mapsto \\cent \\pound \\yen \\div \\multimap \\maporiginal \\mapimage \\bigcap \\bigcup \\benzene \\times \\cdot \\propto \\equiv \\Im \\Re \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ ";
//QString mathTest="$\\left\\|\\stackrel{1}{2}\\right\\|\\cdot\\left|\\begin{Bmatrix}1123&2^2&\\frac{3}{4}\\\\4&5_5&6\\\\72_8&8_{\\text{längerer Index}}&9&10&11\\end{Bmatrix}\\right|\\cdots f(x)$"; //QString mathTest="$\\left\\|\\stackrel{1}{2}\\right\\|\\cdot\\left|\\begin{Bmatrix}1123&2^2&\\frac{3}{4}\\\\4&5_5&6\\\\72_8&8_{\\text{längerer Index}}&9&10&11\\end{Bmatrix}\\right|\\cdots f(x)$";
//QString mathTest="0"; //QString mathTest="0";
//QString text="x_0 \\sqrt{a^2+b^2}\\underbrace{underbrace}{x_0} (\\bf{Test})\\_\\it{Text} ... ! Äquator\\alpha\\beta $f(x)=\\sin(x{\\cdot}y)$ \\ul{Text\\ol{\\gamma}} \\script{Script}, \\tt{Typewriter}, \\sf{sans serif}"; //QString text="x_0 \\sqrt{a^2+b^2}\\underbrace{underbrace}{x_0} (\\bf{Test})\\_\\it{Text} ... ! Äquator\\alpha\\beta $f(x)=\\sin(x{\\cdot}y)$ \\ul{Text\\ol{\\gamma}} \\script{Script}, \\tt{Typewriter}, \\sf{sans serif}";
//QString text="$\\sum_{i=0_{j=-1_{k=-45}}}^{n^{m^{123456789}}}\\left(\\left(\\left(\\int_0^\\inf\\left[r+i^{\\left\\{2^2\\right\\}}\\right]{\\dd}r\\right)\\right)\\right)$ \\bf{Test}\\_\\it{Text} ... ! \\sc{&Äquator \\&}\\alpha\\beta $f(x)=\\sin(x\\cdot\\cos(a+{\\ii}b))$ \\ul{Text\\gamma} \\script{Script-Text}\\tt{ and Typewriter} \\sf{also sans serif}"; //QString text="$\\sum_{i=0_{j=-1_{k=-45}}}^{n^{m^{123456789}}}\\left(\\left(\\left(\\int_0^\\inf\\left[r+i^{\\left\\{2^2\\right\\}}\\right]{\\dd}r\\right)\\right)\\right)$ \\bf{Test}\\_\\it{Text} ... ! \\sc{&Äquator \\&}\\alpha\\beta $f(x)=\\sin(x\\cdot\\cos(a+{\\ii}b))$ \\ul{Text\\gamma} \\script{Script-Text}\\tt{ and Typewriter} \\sf{also sans serif}";
//QString text="$\\sum_{i=0_{j=-1_{k=-45}}}^2\\left(\\left(\\left(\\int_0^\\inf\\left[r+i^{\\left\\{2^2\\right\\}}\\right]{\\dd}r\\right)\\right)\\right)$ \\bf{Test}\\_\\it{Text} ... ! \\sc{&Äquator \\&}\\alpha\\beta $f(x)=\\sin(x\\cdot\\cos(a+{\\ii}b))$ \\ul{Text\\gamma} \\script{Script-Text}\\tt{ and Typewriter} \\sf{also sans serif}"; //QString text="$\\sum_{i=0_{j=-1_{k=-45}}}^2\\left(\\left(\\left(\\int_0^\\inf\\left[r+i^{\\left\\{2^2\\right\\}}\\right]{\\dd}r\\right)\\right)\\right)$ \\bf{Test}\\_\\it{Text} ... ! \\sc{&Äquator \\&}\\alpha\\beta $f(x)=\\sin(x\\cdot\\cos(a+{\\ii}b))$ \\ul{Text\\gamma} \\script{Script-Text}\\tt{ and Typewriter} \\sf{also sans serif}";
//QString text="x_0My Text$\\sqrt{a^2+b^2 } \\underbrace{underbrace}{x_0}$"; //QString text="x_0My Text$\\sqrt{a^2+b^2 } \\underbrace{underbrace}{x_0}$";
if (ui->cmbTestset->currentIndex()==ui->cmbTestset->count()-1) { if (ui->cmbTestset->currentIndex()==ui->cmbTestset->count()-1) {
mathTest=ui->textBrowserSource->toPlainText(); mathTest=ui->textBrowserSource->toPlainText();
ui->textBrowserSource->setReadOnly(false); ui->textBrowserSource->setReadOnly(false);
ui->btnRender->setEnabled(true); ui->btnRender->setEnabled(true);
} else { } else {
mathTest=ui->cmbTestset->itemData(ui->cmbTestset->currentIndex()).toString(); mathTest=ui->cmbTestset->itemData(ui->cmbTestset->currentIndex()).toString();
ui->textBrowserSource->setPlainText(mathTest); ui->textBrowserSource->setPlainText(mathTest);
ui->textBrowserSource->setReadOnly(true); ui->textBrowserSource->setReadOnly(true);
ui->btnRender->setEnabled(false); ui->btnRender->setEnabled(false);
} }
ui->scrollArea->setBackgroundRole(QPalette::Dark); ui->scrollArea->setBackgroundRole(QPalette::Dark);
QPixmap pix(W, H); QPixmap pix(W, H);
pix.fill(); pix.fill();
QPainter painter; QPainter painter;
JKQTmathText mt(this); JKQTmathText mt(this);
double Y=Y1; double Y=Y1;
painter.begin(&pix); painter.begin(&pix);
if (ui->chkAntiAlias->isChecked()) painter.setRenderHint(QPainter::Antialiasing); if (ui->chkAntiAlias->isChecked()) painter.setRenderHint(QPainter::Antialiasing);
if (ui->chkAntiAliasHQ->isChecked()) painter.setRenderHint(QPainter::HighQualityAntialiasing); if (ui->chkAntiAliasHQ->isChecked()) painter.setRenderHint(QPainter::HighQualityAntialiasing);
if (ui->chkAntiAliasText->isChecked()) painter.setRenderHint(QPainter::TextAntialiasing); if (ui->chkAntiAliasText->isChecked()) painter.setRenderHint(QPainter::TextAntialiasing);
if (ui->chkSmoothTransform->isChecked()) painter.setRenderHint(QPainter::QPainter::SmoothPixmapTransform); if (ui->chkSmoothTransform->isChecked()) painter.setRenderHint(QPainter::QPainter::SmoothPixmapTransform);
ht.start(); ht.start();
mt.set_fontRoman(ui->cmbUnicodeSerif->currentFont().family()); mt.set_fontRoman(ui->cmbUnicodeSerif->currentFont().family());
mt.set_fontMathRoman(ui->cmbUnicodeSerif->currentFont().family()); mt.set_fontMathRoman(ui->cmbUnicodeSerif->currentFont().family());
mt.set_fontSans(ui->cmbUnicodeSans->currentFont().family()); mt.set_fontSans(ui->cmbUnicodeSans->currentFont().family());
mt.set_fontMathSans(ui->cmbUnicodeSans->currentFont().family()); mt.set_fontMathSans(ui->cmbUnicodeSans->currentFont().family());
mt.set_fontTypewriter(ui->cmbUnicodeFixed->currentFont().family()); mt.set_fontTypewriter(ui->cmbUnicodeFixed->currentFont().family());
mt.set_fontSymbol(ui->cmbUnicodeSymbol->currentFont().family()); mt.set_fontSymbol(ui->cmbUnicodeSymbol->currentFont().family());
switch (ui->cmbFont->currentIndex()) { switch (ui->cmbFont->currentIndex()) {
case 1: mt.useXITS(); break; case 1: mt.useXITS(); break;
case 2: mt.useSTIX(); break; case 2: mt.useSTIX(); break;
case 3: mt.useAnyUnicode(ui->cmbUnicodeSans->currentFont().family(),ui->cmbUnicodeSerif->currentFont().family()); break; case 3: mt.useAnyUnicode(ui->cmbUnicodeSans->currentFont().family(),ui->cmbUnicodeSerif->currentFont().family()); break;
case 4: mt.useLatexFonts(ui->edtLatexPrefix->text(), ui->edtLatexPostfix->text()); break; case 4: mt.useLatexFonts(ui->edtLatexPrefix->text(), ui->edtLatexPostfix->text()); break;
case 5: mt.useASANA(); break; case 5: mt.useASANA(); break;
} }
ui->tree->clear(); ui->tree->clear();
ht.start(); ht.start();
double durationParse=0; double durationParse=0;
if (mt.parse(mathTest)) { if (mt.parse(mathTest)) {
durationParse=ht.get_time()/1000.0; durationParse=ht.get_time()/1000.0;
ui->tree->addTopLevelItem(createTree(mt.get_parsedNode())); ui->tree->addTopLevelItem(createTree(mt.get_parsedNode()));
} else { } else {
durationParse=ht.get_time()/1000.0; durationParse=ht.get_time()/1000.0;
} }
ui->labParsingTimes->setText(QString(" %1ms").arg(durationParse, 0, 'f', 3)); ui->labParsingTimes->setText(QString(" %1ms").arg(durationParse, 0, 'f', 3));
ui->tree->expandAll(); ui->tree->expandAll();
bool okh=true; bool okh=true;
ui->textBrowser->clear(); ui->textBrowser->clear();
qDebug()<<"parse mathTest in "<<ht.get_time()/1000.0<<" ms\n"; qDebug()<<"parse mathTest in "<<ht.get_time()/1000.0<<" ms\n";
QStringList sl=ui->edtSizes->text().split(","); QStringList sl=ui->edtSizes->text().split(",");
ui->labRenderTimes->setText(""); ui->labRenderTimes->setText("");
for (int i=0; i<sl.size(); i++) { for (int i=0; i<sl.size(); i++) {
bool ok=true; bool ok=true;
int size=sl[i].trimmed().toUInt(&ok); int size=sl[i].trimmed().toUInt(&ok);
if (!ok) size=10+i*5; if (!ok) size=10+i*5;
mt.set_fontSize(size); mt.set_fontSize(size);
double durationSizingMS=0, durationTimingMS=0; double durationSizingMS=0, durationTimingMS=0;
Y+=draw(painter, X1, Y, mt, QString("%1, %2, %3pt").arg(ui->cmbTestset->currentText()).arg(ui->cmbFont->currentText()).arg(size), durationSizingMS, durationTimingMS); Y+=draw(painter, X1, Y, mt, QString("%1, %2, %3pt").arg(ui->cmbTestset->currentText()).arg(ui->cmbFont->currentText()).arg(size), durationSizingMS, durationTimingMS);
if (i==0) { if (i==0) {
if (mt.get_error_list().size()>0) { if (mt.get_error_list().size()>0) {
ui->labError->setText("<span color=\"red\">"+mt.get_error_list().join("<br>")+"</span>"); ui->labError->setText("<span color=\"red\">"+mt.get_error_list().join("<br>")+"</span>");
} else { } else {
ui->labError->setText("<span color=\"green\">OK</span>"); ui->labError->setText("<span color=\"green\">OK</span>");
} }
} }
ui->labRenderTimes->setText(ui->labRenderTimes->text()+QString(" %1pt: %2ms/%3ms").arg(size).arg(durationSizingMS, 0, 'F', 1).arg(durationTimingMS, 0, 'F', 1)); ui->labRenderTimes->setText(ui->labRenderTimes->text()+QString(" %1pt: %2ms/%3ms").arg(size).arg(durationSizingMS, 0, 'F', 1).arg(durationTimingMS, 0, 'F', 1));
ui->textBrowser->textCursor().insertHtml("<hr>"+mt.toHtml(&okh)+"<hr><br><br>"); ui->textBrowser->textCursor().insertHtml("<hr>"+mt.toHtml(&okh)+"<hr><br><br>");
qDebug()<<"HTML: ---------------------------------------------\n"<<mt.toHtml(&okh)<<"\nHTML: --------------------------------------------- ok="<<okh; qDebug()<<"HTML: ---------------------------------------------\n"<<mt.toHtml(&okh)<<"\nHTML: --------------------------------------------- ok="<<okh;
if (mt.get_error_list().size()>0) { if (mt.get_error_list().size()>0) {
qDebug()<<mt.get_error_list().join("\n")<<"\n"; qDebug()<<mt.get_error_list().join("\n")<<"\n";
} }
} }
painter.end(); painter.end();
ui->label->setPixmap(pix); ui->label->setPixmap(pix);
QApplication::restoreOverrideCursor(); QApplication::restoreOverrideCursor();
} }

View File

@ -1,34 +1,34 @@
#ifndef TESTFORM_H #ifndef TESTFORM_H
#define TESTFORM_H #define TESTFORM_H
#include <QWidget> #include <QWidget>
#include <QStringList> #include <QStringList>
#include "jkqtmathtext/jkqtmathtext.h" #include "jkqtmathtext/jkqtmathtext.h"
#include "jkqtplottertools/jkqtphighrestimer.h" #include "jkqtplottertools/jkqtphighrestimer.h"
#include <QPainter> #include <QPainter>
#include <QTreeWidget> #include <QTreeWidget>
namespace Ui { namespace Ui {
class TestForm; class TestForm;
} }
class TestForm : public QWidget class TestForm : public QWidget
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit TestForm(QWidget *parent = 0); explicit TestForm(QWidget *parent = 0);
~TestForm(); ~TestForm();
public slots: public slots:
void updateMath(); void updateMath();
private: private:
Ui::TestForm *ui; Ui::TestForm *ui;
JKQTPHighResTimer ht; JKQTPHighResTimer ht;
double draw(QPainter& painter, double X, double YY, JKQTmathText& mt, QString name, double &durationSizingMS, double &durationTimingMS); double draw(QPainter& painter, double X, double YY, JKQTmathText& mt, QString name, double &durationSizingMS, double &durationTimingMS);
QTreeWidgetItem* createTree(JKQTmathText::MTnode* node, QTreeWidgetItem *parent=NULL); QTreeWidgetItem* createTree(JKQTmathText::MTnode* node, QTreeWidgetItem *parent=NULL);
}; };
#endif // TESTFORM_H #endif // TESTFORM_H

View File

@ -1,66 +1,66 @@
EmfEngine GNU GPL v. 3.0 EmfEngine GNU GPL v. 3.0
------------------------ ------------------------
26/07/2010 - Release 0.8 26/07/2010 - Release 0.8
This release improves the support for Unix-like systems, using the GDI API provided by libEMF: This release improves the support for Unix-like systems, using the GDI API provided by libEMF:
- Fixes compilation issues. - Fixes compilation issues.
- Fixed crash when exporting rotated text strings. - Fixed crash when exporting rotated text strings.
- Fixed drawing of paths. - Fixed drawing of paths.
- Added support for drawing images and tiled pixmaps. - Added support for drawing images and tiled pixmaps.
------------------------ ------------------------
30/08/2009 - Release 0.7: 30/08/2009 - Release 0.7:
- Fixed crash when exporting text strings having a non available font family using the GDI+ backend. - Fixed crash when exporting text strings having a non available font family using the GDI+ backend.
- Improved exporting of texts containing superscripts/subscripts. - Improved exporting of texts containing superscripts/subscripts.
------------------------ ------------------------
16/07/2009 - Release 0.6. Improvements for the GDI+ backend: 16/07/2009 - Release 0.6. Improvements for the GDI+ backend:
- Implemented support for pens with custom dash patterns. - Implemented support for pens with custom dash patterns.
- Fixed drawing of polygons. - Fixed drawing of polygons.
- Fixed drawing of pixmaps/images. - Fixed drawing of pixmaps/images.
------------------------ ------------------------
25/05/2009 - Release 0.5: 25/05/2009 - Release 0.5:
- Implemented drawPoints(). - Implemented drawPoints().
- Improved GDI+ backend: - Improved GDI+ backend:
- Fixed clipping. - Fixed clipping.
- Improved drawRects(). - Improved drawRects().
------------------------ ------------------------
07/05/2009 - Release 0.4: 07/05/2009 - Release 0.4:
- Fixed compile errors with Visual Studio 2008. - Fixed compile errors with Visual Studio 2008.
- Removed clipping in drawTextItem(). - Removed clipping in drawTextItem().
- Improved the build system. - Improved the build system.
- Added the "EMFENGINE_DLL" and "EMFENGINE_DLL_BUILD" preprocessor flags in order to be able to build using Visual Studio (thanks to David Stranz). - Added the "EMFENGINE_DLL" and "EMFENGINE_DLL_BUILD" preprocessor flags in order to be able to build using Visual Studio (thanks to David Stranz).
------------------------ ------------------------
22/04/2009 - Release 0.3: 22/04/2009 - Release 0.3:
EmfEngine was completely rewritten using the Windows GDI+ API. The old implementation using Windows GDI (also provided by libEMF on Unix-like systems) is still available if you disable the HAVE_GDI_PLUS option in EmfEngine.pro. EmfEngine was completely rewritten using the Windows GDI+ API. The old implementation using Windows GDI (also provided by libEMF on Unix-like systems) is still available if you disable the HAVE_GDI_PLUS option in EmfEngine.pro.
This new implementation adds the following features: This new implementation adds the following features:
- Antialiasing - Antialiasing
- Antialiased texts (if the option HAVE_ANTIALIASED_TEXT is enabled in EmfEngine.pro) - Antialiased texts (if the option HAVE_ANTIALIASED_TEXT is enabled in EmfEngine.pro)
- Transparent brushes - Transparent brushes
- Support for Qt::LinearGradientPattern and Qt::RadialGradientPattern - Support for Qt::LinearGradientPattern and Qt::RadialGradientPattern
------------------------ ------------------------
13/04/2009 - Release 0.2: 13/04/2009 - Release 0.2:
- Implemented drawImage(). - Implemented drawImage().
- Implemented drawTiledPixmap(). - Implemented drawTiledPixmap().
- Improved drawPixmap(). - Improved drawPixmap().
- Implemented rendering of QBrush with style set to Qt::TexturePattern. - Implemented rendering of QBrush with style set to Qt::TexturePattern.
- Improved paths handling in drawPath(). - Improved paths handling in drawPath().
- Fixed polyline drawing in drawPolygon(). - Fixed polyline drawing in drawPolygon().
- Modified the example to make use of the new features. - Modified the example to make use of the new features.
------------------------ ------------------------
10/04/2009 - Release 0.1: Initial release. 10/04/2009 - Release 0.1: Initial release.

View File

@ -1,7 +1,7 @@
include( config.pri ) include( config.pri )
TEMPLATE = subdirs TEMPLATE = subdirs
SUBDIRS = \ SUBDIRS = \
src \ src \
example example

View File

@ -1,28 +1,28 @@
EmfEngine GNU GPL v. 3.0 EmfEngine GNU GPL v. 3.0
------------------------ ------------------------
AUTHOR: Ion Vasilief AUTHOR: Ion Vasilief
------------------------ ------------------------
FEATURES: EmfEngine enables Qt based applications to easily export graphics created using the FEATURES: EmfEngine enables Qt based applications to easily export graphics created using the
QPainter class to the Enhanced MetaFile format (EMF). QPainter class to the Enhanced MetaFile format (EMF).
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
DEPENDENCIES: You need Qt (http://www.qtsoftware.com) installed on your system in order to build EmfEngine. DEPENDENCIES: You need Qt (http://www.qtsoftware.com) installed on your system in order to build EmfEngine.
On Unix-like systems you also need libEMF (http://libemf.sourceforge.net/). On Unix-like systems you also need libEMF (http://libemf.sourceforge.net/).
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
COMPILING: EmfEngine uses qmake for the building process. COMPILING: EmfEngine uses qmake for the building process.
qmake is part of a Qt distribution: qmake is part of a Qt distribution:
qmake reads project files, that contain the options and rules how to build a certain project. qmake reads project files, that contain the options and rules how to build a certain project.
A project file ends with the suffix "*.pro". Please read the qmake documentation for more details. A project file ends with the suffix "*.pro". Please read the qmake documentation for more details.
After installing Qt on your system, type the following command lines: After installing Qt on your system, type the following command lines:
$ qmake $ qmake
$ make $ make
if you use MinGW, or: if you use MinGW, or:
$ qmake -tp vc -r $ qmake -tp vc -r
if you use Microsoft Visual Studio (this will generate Visual Studio .vcproj project files in the "src" and "example" folders). if you use Microsoft Visual Studio (this will generate Visual Studio .vcproj project files in the "src" and "example" folders).
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
USE: a short demo application is provided in the "example" folder of the source archive. USE: a short demo application is provided in the "example" folder of the source archive.
--------------------------------------------------------------------------- ---------------------------------------------------------------------------

View File

@ -1,15 +1,15 @@
CONFIG += qt warn_on thread CONFIG += qt warn_on thread
CONFIG += release CONFIG += release
# Comment the following line if you want to build using the GDI backend # Comment the following line if you want to build using the GDI backend
win32:CONFIG += HAVE_GDI_PLUS win32:CONFIG += HAVE_GDI_PLUS
# Uncomment the following line if you want to enable text antialiasing (works only with the GDI+ backend enabled) # Uncomment the following line if you want to enable text antialiasing (works only with the GDI+ backend enabled)
#DEFINES += HAVE_ANTIALIASED_TEXT #DEFINES += HAVE_ANTIALIASED_TEXT
# Comment the following line if you want to build EmfEngine statically # Comment the following line if you want to build EmfEngine statically
#CONFIG += EmfEngineDll #CONFIG += EmfEngineDll

View File

@ -1,23 +1,23 @@
include( ../config.pri ) include( ../config.pri )
TARGET = example TARGET = example
TEMPLATE = app TEMPLATE = app
CONFIG += warn_on release thread CONFIG += warn_on release thread
win32: CONFIG += console win32: CONFIG += console
MOC_DIR = ../tmp MOC_DIR = ../tmp
OBJECTS_DIR = ../tmp OBJECTS_DIR = ../tmp
DESTDIR = ./ DESTDIR = ./
INCLUDEPATH += ../src INCLUDEPATH += ../src
unix: INCLUDEPATH += /usr/local/include/libEMF unix: INCLUDEPATH += /usr/local/include/libEMF
LIBS += ../libEmfEngine.a LIBS += ../libEmfEngine.a
win32: LIBS += -lgdi32 win32: LIBS += -lgdi32
unix: LIBS += /usr/local/lib/libEMF.a unix: LIBS += /usr/local/lib/libEMF.a
HEADERS = renderarea.h \ HEADERS = renderarea.h \
pixmaps.h pixmaps.h
SOURCES = main.cpp \ SOURCES = main.cpp \
renderarea.cpp renderarea.cpp

View File

@ -1,20 +1,20 @@
#include <QApplication> #include <QApplication>
#include "renderarea.h" #include "renderarea.h"
#include <EmfEngine.h> #include <EmfEngine.h>
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
QApplication app(argc, argv); QApplication app(argc, argv);
RenderArea area; RenderArea area;
area.setGeometry(100, 100, 600, 500); area.setGeometry(100, 100, 600, 500);
area.show(); area.show();
EmfPaintDevice emf(QSize(600, 500), QString("example.emf")); EmfPaintDevice emf(QSize(600, 500), QString("example.emf"));
QPainter paint; QPainter paint;
paint.begin(&emf); paint.begin(&emf);
area.draw(&paint); area.draw(&paint);
paint.end(); paint.end();
return app.exec(); return app.exec();
} }

View File

@ -1,135 +1,135 @@
#include <QtGui> #include <QtGui>
#include "renderarea.h" #include "renderarea.h"
#include "pixmaps.h" #include "pixmaps.h"
RenderArea::RenderArea(QWidget *parent) RenderArea::RenderArea(QWidget *parent)
: QWidget(parent) : QWidget(parent)
{ {
setBackgroundRole(QPalette::Base); setBackgroundRole(QPalette::Base);
setAutoFillBackground(true); setAutoFillBackground(true);
setFixedWidth(600); setFixedWidth(600);
setFixedHeight(500); setFixedHeight(500);
} }
void RenderArea::draw(QPainter *painter) void RenderArea::draw(QPainter *painter)
{ {
static const QPoint points[4] = { static const QPoint points[4] = {
QPoint(10, 80), QPoint(10, 80),
QPoint(20, 10), QPoint(20, 10),
QPoint(80, 30), QPoint(80, 30),
QPoint(90, 70) QPoint(90, 70)
}; };
QRect rect(10, 20, 80, 60); QRect rect(10, 20, 80, 60);
QPainterPath path; QPainterPath path;
path.moveTo(20, 80); path.moveTo(20, 80);
path.lineTo(20, 30); path.lineTo(20, 30);
path.cubicTo(80, 0, 50, 50, 80, 80); path.cubicTo(80, 0, 50, 50, 80, 80);
int startAngle = 20 * 16; int startAngle = 20 * 16;
int arcLength = 120 * 16; int arcLength = 120 * 16;
QLinearGradient linearGrad(QPointF(0, 0), QPointF(100, 100)); QLinearGradient linearGrad(QPointF(0, 0), QPointF(100, 100));
linearGrad.setColorAt(0, Qt::black); linearGrad.setColorAt(0, Qt::black);
linearGrad.setColorAt(1, Qt::red); linearGrad.setColorAt(1, Qt::red);
QRadialGradient radialGrad(QPointF(50, 50), 40, QPointF(75, 50)); QRadialGradient radialGrad(QPointF(50, 50), 40, QPointF(75, 50));
radialGrad.setColorAt(0, Qt::white); radialGrad.setColorAt(0, Qt::white);
radialGrad.setColorAt(0.5, Qt::black); radialGrad.setColorAt(0.5, Qt::black);
radialGrad.setColorAt(1, Qt::red); radialGrad.setColorAt(1, Qt::red);
/*QConicalGradient conGrad(QPointF(50, 50), 90); /*QConicalGradient conGrad(QPointF(50, 50), 90);
conGrad.setColorAt(0, Qt::blue); conGrad.setColorAt(0, Qt::blue);
conGrad.setColorAt(0.5, Qt::red); conGrad.setColorAt(0.5, Qt::red);
conGrad.setColorAt(1, Qt::green); conGrad.setColorAt(1, Qt::green);
QBrush brush = QBrush(conGrad);*/ QBrush brush = QBrush(conGrad);*/
QBrush brush = QBrush(Qt::gray); QBrush brush = QBrush(Qt::gray);
int brushStyle = Qt::NoBrush; int brushStyle = Qt::NoBrush;
int penStyle = Qt::NoPen; int penStyle = Qt::NoPen;
int shape = Rect; int shape = Rect;
int drawnRects = 0; int drawnRects = 0;
for (int x = 0; x < width(); x += 100){ for (int x = 0; x < width(); x += 100){
for (int y = 0; y < height(); y += 100){ for (int y = 0; y < height(); y += 100){
painter->save(); painter->save();
painter->setRenderHint(QPainter::Antialiasing); painter->setRenderHint(QPainter::Antialiasing);
shape = (shape + 1)%14; shape = (shape + 1)%14;
penStyle = (penStyle + 1)%4; penStyle = (penStyle + 1)%4;
if(!penStyle) if(!penStyle)
penStyle = 1; penStyle = 1;
if (shape == RoundedRect && drawnRects < 2){ if (shape == RoundedRect && drawnRects < 2){
if (drawnRects == 0) if (drawnRects == 0)
painter->setBrush(QBrush(linearGrad)); painter->setBrush(QBrush(linearGrad));
else if (drawnRects == 1) else if (drawnRects == 1)
painter->setBrush(QBrush(radialGrad)); painter->setBrush(QBrush(radialGrad));
drawnRects++; drawnRects++;
} else { } else {
brushStyle = (brushStyle + 1)%14; brushStyle = (brushStyle + 1)%14;
if(!brushStyle) if(!brushStyle)
brushStyle = 1; brushStyle = 1;
brush.setStyle((Qt::BrushStyle)brushStyle); brush.setStyle((Qt::BrushStyle)brushStyle);
painter->setBrush(brush); painter->setBrush(brush);
} }
painter->setPen(QPen(Qt::black, 2, (Qt::PenStyle)penStyle, Qt::FlatCap, Qt::MiterJoin)); painter->setPen(QPen(Qt::black, 2, (Qt::PenStyle)penStyle, Qt::FlatCap, Qt::MiterJoin));
painter->translate(x, y); painter->translate(x, y);
switch (shape) { switch (shape) {
case Line: case Line:
painter->drawLine(rect.bottomLeft(), rect.topRight()); painter->drawLine(rect.bottomLeft(), rect.topRight());
break; break;
case Polyline: case Polyline:
painter->drawPolyline(points, 4); painter->drawPolyline(points, 4);
break; break;
case Polygon: case Polygon:
painter->drawPolygon(points, 4); painter->drawPolygon(points, 4);
break; break;
case Rect: case Rect:
painter->drawRect(rect); painter->drawRect(rect);
break; break;
case RoundedRect: case RoundedRect:
painter->drawRoundedRect(rect, 25, 25, Qt::RelativeSize); painter->drawRoundedRect(rect, 25, 25, Qt::RelativeSize);
break; break;
case Ellipse: case Ellipse:
painter->drawEllipse(rect); painter->drawEllipse(rect);
break; break;
case Arc: case Arc:
painter->drawArc(rect, startAngle, arcLength); painter->drawArc(rect, startAngle, arcLength);
break; break;
case Chord: case Chord:
painter->drawChord(rect, startAngle, arcLength); painter->drawChord(rect, startAngle, arcLength);
break; break;
case Pie: case Pie:
painter->drawPie(rect, startAngle, arcLength); painter->drawPie(rect, startAngle, arcLength);
break; break;
case Path: case Path:
painter->drawPath(path); painter->drawPath(path);
break; break;
case Text: case Text:
painter->drawText(rect, Qt::AlignCenter, "EmfEngine demo"); painter->drawText(rect, Qt::AlignCenter, "EmfEngine demo");
break; break;
case Pixmap: case Pixmap:
painter->drawPixmap(10, 10, QPixmap(qt_logo_xpm)); painter->drawPixmap(10, 10, QPixmap(qt_logo_xpm));
break; break;
case TiledPixmap: case TiledPixmap:
painter->drawTiledPixmap (QRect(10, 10, 64, 64), QPixmap(brick_xpm)); painter->drawTiledPixmap (QRect(10, 10, 64, 64), QPixmap(brick_xpm));
break; break;
} }
painter->restore(); painter->restore();
} }
} }
painter->setPen(Qt::darkGray); painter->setPen(Qt::darkGray);
painter->setBrush(Qt::NoBrush); painter->setBrush(Qt::NoBrush);
painter->drawRect(QRect(9, 9, width() - 18, height() - 18)); painter->drawRect(QRect(9, 9, width() - 18, height() - 18));
} }
void RenderArea::paintEvent(QPaintEvent * /* event */) void RenderArea::paintEvent(QPaintEvent * /* event */)
{ {
QPainter painter(this); QPainter painter(this);
draw(&painter); draw(&painter);
} }

View File

@ -1,19 +1,19 @@
#ifndef RENDERAREA_H #ifndef RENDERAREA_H
#define RENDERAREA_H #define RENDERAREA_H
#include <QWidget> #include <QWidget>
class RenderArea : public QWidget class RenderArea : public QWidget
{ {
public: public:
enum Shape { Line, Polyline, Polygon, Rect, RoundedRect, Ellipse, Arc, enum Shape { Line, Polyline, Polygon, Rect, RoundedRect, Ellipse, Arc,
Chord, Pie, Path, Text, Pixmap, TiledPixmap }; Chord, Pie, Path, Text, Pixmap, TiledPixmap };
RenderArea(QWidget *parent = 0); RenderArea(QWidget *parent = 0);
void draw(QPainter *painter); void draw(QPainter *painter);
protected: protected:
void paintEvent(QPaintEvent *event); void paintEvent(QPaintEvent *event);
}; };
#endif #endif

View File

@ -1,138 +1,138 @@
/*************************************************************************** /***************************************************************************
File : EmfEngine.h File : EmfEngine.h
Project : EmfEngine Project : EmfEngine
-------------------------------------------------------------------- --------------------------------------------------------------------
Copyright : (C) 2009 - 2010 by Ion Vasilief Copyright : (C) 2009 - 2010 by Ion Vasilief
Email (use @ for *) : ion_vasilief*yahoo.fr Email (use @ for *) : ion_vasilief*yahoo.fr
Description : Enables the export of QPainter grafics to Description : Enables the export of QPainter grafics to
Windows Enhanced Metafiles (.emf) Windows Enhanced Metafiles (.emf)
***************************************************************************/ ***************************************************************************/
/*************************************************************************** /***************************************************************************
* * * *
* This program is free software; you can redistribute it and/or modify * * This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by * * it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 3 of the License, or * * the Free Software Foundation; either version 3 of the License, or *
* (at your option) any later version. * * (at your option) any later version. *
* * * *
* This program is distributed in the hope that it will be useful, * * This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of * * but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. * * GNU General Public License for more details. *
* * * *
* You should have received a copy of the GNU General Public License * * You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the Free Software * * along with this program; if not, write to the Free Software *
* Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Foundation, Inc., 51 Franklin Street, Fifth Floor, *
* Boston, MA 02110-1301 USA * * Boston, MA 02110-1301 USA *
* * * *
***************************************************************************/ ***************************************************************************/
#ifndef EMFENGINE_H #ifndef EMFENGINE_H
#define EMFENGINE_H #define EMFENGINE_H
#include <QPaintDevice> #include <QPaintDevice>
#include <QPaintEngine> #include <QPaintEngine>
#ifdef Q_WS_WIN #ifdef Q_WS_WIN
#include <windows.h> #include <windows.h>
#endif #endif
#ifdef EMFENGINE_DLL #ifdef EMFENGINE_DLL
# ifdef EMFENGINE_DLL_BUILD # ifdef EMFENGINE_DLL_BUILD
# define EMFENGINELIB_EXPORT Q_DECL_EXPORT # define EMFENGINELIB_EXPORT Q_DECL_EXPORT
# else # else
# define EMFENGINELIB_EXPORT Q_DECL_IMPORT # define EMFENGINELIB_EXPORT Q_DECL_IMPORT
# endif # endif
#else #else
# define EMFENGINELIB_EXPORT # define EMFENGINELIB_EXPORT
#endif #endif
#ifdef HAVE_GDIPLUS #ifdef HAVE_GDIPLUS
#include <gdiplus.h> #include <gdiplus.h>
using namespace Gdiplus; using namespace Gdiplus;
#else #else
#ifdef Q_WS_X11 #ifdef Q_WS_X11
#include <emf.h> #include <emf.h>
#endif #endif
#ifdef Q_WS_MAC #ifdef Q_WS_MAC
#include <emf.h> #include <emf.h>
#endif #endif
#undef min #undef min
#undef max #undef max
#endif #endif
class EmfPaintEngine : public QPaintEngine class EmfPaintEngine : public QPaintEngine
{ {
public: public:
EmfPaintEngine(const QString&); EmfPaintEngine(const QString&);
~EmfPaintEngine(){}; ~EmfPaintEngine(){};
virtual bool begin(QPaintDevice*); virtual bool begin(QPaintDevice*);
virtual bool end(); virtual bool end();
virtual void updateState( const QPaintEngineState & ) {}; virtual void updateState( const QPaintEngineState & ) {};
virtual void drawEllipse(const QRectF &); virtual void drawEllipse(const QRectF &);
virtual void drawImage(const QRectF& r, const QImage& im, const QRectF& sr) {drawPixmap(r,QPixmap::fromImage(im),sr);}; virtual void drawImage(const QRectF& r, const QImage& im, const QRectF& sr) {drawPixmap(r,QPixmap::fromImage(im),sr);};
virtual QPaintEngine::Type type() const {return QPaintEngine::User;}; virtual QPaintEngine::Type type() const {return QPaintEngine::User;};
virtual void drawPoints ( const QPointF * points, int pointCount ); virtual void drawPoints ( const QPointF * points, int pointCount );
virtual void drawLines ( const QLineF * , int ); virtual void drawLines ( const QLineF * , int );
virtual void drawPath ( const QPainterPath & path ); virtual void drawPath ( const QPainterPath & path );
virtual void drawPolygon ( const QPointF * , int , PolygonDrawMode ); virtual void drawPolygon ( const QPointF * , int , PolygonDrawMode );
virtual void drawTextItem ( const QPointF & , const QTextItem & ); virtual void drawTextItem ( const QPointF & , const QTextItem & );
virtual void drawRects ( const QRectF * , int ); virtual void drawRects ( const QRectF * , int );
virtual void drawPixmap ( const QRectF &, const QPixmap &, const QRectF &); virtual void drawPixmap ( const QRectF &, const QPixmap &, const QRectF &);
virtual void drawTiledPixmap(const QRectF &, const QPixmap &, const QPointF &); virtual void drawTiledPixmap(const QRectF &, const QPixmap &, const QPointF &);
virtual void drawImage(const QRectF &, const QImage &, const QRectF &, Qt::ImageConversionFlags); virtual void drawImage(const QRectF &, const QImage &, const QRectF &, Qt::ImageConversionFlags);
#ifdef HAVE_GDIPLUS #ifdef HAVE_GDIPLUS
Graphics *graphicsObject(){return d_grx;}; Graphics *graphicsObject(){return d_grx;};
GraphicsPath *convertPath (const QPainterPath & path); GraphicsPath *convertPath (const QPainterPath & path);
#endif #endif
private: private:
#ifdef HAVE_GDIPLUS #ifdef HAVE_GDIPLUS
Metafile *metafile; Metafile *metafile;
Graphics *d_grx; Graphics *d_grx;
GdiplusStartupInput gdiplusStartupInput; GdiplusStartupInput gdiplusStartupInput;
ULONG_PTR gdiplusToken; ULONG_PTR gdiplusToken;
//! Converts a QPen to a GDI+ Pen structure //! Converts a QPen to a GDI+ Pen structure
Pen *convertPen(const QPen& pen); Pen *convertPen(const QPen& pen);
//! Converts a QBrush to a GDI+ Brush structure //! Converts a QBrush to a GDI+ Brush structure
Brush *convertBrush(const QBrush& brush, GraphicsPath *origPath = nullptr); Brush *convertBrush(const QBrush& brush, GraphicsPath *origPath = nullptr);
//! Draws pixmap pix in a given rectangle //! Draws pixmap pix in a given rectangle
void drawPixmap(const QPixmap &pix, const RectF &p); void drawPixmap(const QPixmap &pix, const RectF &p);
//! Constructs a texture brush based on pixmap pix //! Constructs a texture brush based on pixmap pix
TextureBrush *textureBrush(const QPixmap & pix); TextureBrush *textureBrush(const QPixmap & pix);
#else #else
//! Converts a QPen to a HPEN structure //! Converts a QPen to a HPEN structure
HPEN convertPen(const QPen&); HPEN convertPen(const QPen&);
//! Converts a QBrush to a HBRUSH structure //! Converts a QBrush to a HBRUSH structure
HBRUSH convertBrush(const QBrush&); HBRUSH convertBrush(const QBrush&);
//! Pointer to the metafile device context //! Pointer to the metafile device context
HDC metaDC; HDC metaDC;
RECT d_rect; RECT d_rect;
#endif #endif
//! Name of the output metafile //! Name of the output metafile
QString fname; QString fname;
void setClipping(); void setClipping();
void resetClipping(); void resetClipping();
}; };
class EMFENGINELIB_EXPORT EmfPaintDevice : public QPaintDevice class EMFENGINELIB_EXPORT EmfPaintDevice : public QPaintDevice
{ {
public: public:
EmfPaintDevice(const QSize& s, const QString& fileName); EmfPaintDevice(const QSize& s, const QString& fileName);
~EmfPaintDevice(); ~EmfPaintDevice();
virtual QPaintEngine * paintEngine () const; virtual QPaintEngine * paintEngine () const;
protected: protected:
virtual int metric ( PaintDeviceMetric ) const; virtual int metric ( PaintDeviceMetric ) const;
private: private:
//! Size in pixels //! Size in pixels
QSize d_size; QSize d_size;
EmfPaintEngine* engine; EmfPaintEngine* engine;
}; };
#endif #endif

View File

@ -1,78 +1,78 @@
/*************************************************************************** /***************************************************************************
File : EmfPaintDevice.cpp File : EmfPaintDevice.cpp
Project : EmfEngine Project : EmfEngine
-------------------------------------------------------------------- --------------------------------------------------------------------
Copyright : (C) 2009 -2010 by Ion Vasilief Copyright : (C) 2009 -2010 by Ion Vasilief
Email (use @ for *) : ion_vasilief*yahoo.fr Email (use @ for *) : ion_vasilief*yahoo.fr
Description : Enables the export of QPainter grafics to Description : Enables the export of QPainter grafics to
Windows Enhanced Metafiles (.emf) by using GDI calls Windows Enhanced Metafiles (.emf) by using GDI calls
***************************************************************************/ ***************************************************************************/
/*************************************************************************** /***************************************************************************
* * * *
* This program is free software; you can redistribute it and/or modify * * This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by * * it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 3 of the License, or * * the Free Software Foundation; either version 3 of the License, or *
* (at your option) any later version. * * (at your option) any later version. *
* * * *
* This program is distributed in the hope that it will be useful, * * This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of * * but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. * * GNU General Public License for more details. *
* * * *
* You should have received a copy of the GNU General Public License * * You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the Free Software * * along with this program; if not, write to the Free Software *
* Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Foundation, Inc., 51 Franklin Street, Fifth Floor, *
* Boston, MA 02110-1301 USA * * Boston, MA 02110-1301 USA *
* * * *
***************************************************************************/ ***************************************************************************/
#include "EmfEngine.h" #include "EmfEngine.h"
#include <QApplication> #include <QApplication>
#include <QDesktopWidget> #include <QDesktopWidget>
EmfPaintDevice::EmfPaintDevice(const QSize& s, const QString& fileName) : QPaintDevice(), EmfPaintDevice::EmfPaintDevice(const QSize& s, const QString& fileName) : QPaintDevice(),
d_size(s) d_size(s)
{ {
engine = new EmfPaintEngine(fileName); engine = new EmfPaintEngine(fileName);
} }
EmfPaintDevice::~EmfPaintDevice() EmfPaintDevice::~EmfPaintDevice()
{ {
delete engine; delete engine;
} }
QPaintEngine * EmfPaintDevice::paintEngine () const QPaintEngine * EmfPaintDevice::paintEngine () const
{ {
return engine; return engine;
} }
int EmfPaintDevice::metric ( PaintDeviceMetric metric ) const int EmfPaintDevice::metric ( PaintDeviceMetric metric ) const
{ {
int xdpi = QApplication::desktop()->logicalDpiX(); int xdpi = QApplication::desktop()->logicalDpiX();
int ydpi = QApplication::desktop()->logicalDpiY(); int ydpi = QApplication::desktop()->logicalDpiY();
switch (metric){ switch (metric){
case QPaintDevice::PdmWidth: case QPaintDevice::PdmWidth:
return d_size.width(); return d_size.width();
case QPaintDevice::PdmHeight: case QPaintDevice::PdmHeight:
return d_size.height(); return d_size.height();
case QPaintDevice::PdmWidthMM: case QPaintDevice::PdmWidthMM:
return int(25.4*d_size.width()/(double)xdpi); return int(25.4*d_size.width()/(double)xdpi);
case QPaintDevice::PdmHeightMM: case QPaintDevice::PdmHeightMM:
return int(25.4*d_size.height()/(double)ydpi); return int(25.4*d_size.height()/(double)ydpi);
case QPaintDevice::PdmNumColors: case QPaintDevice::PdmNumColors:
return 65536;//should it be millions? return 65536;//should it be millions?
case QPaintDevice::PdmDepth: case QPaintDevice::PdmDepth:
return 32; return 32;
case QPaintDevice::PdmDpiX: case QPaintDevice::PdmDpiX:
case QPaintDevice::PdmPhysicalDpiX: case QPaintDevice::PdmPhysicalDpiX:
return xdpi; return xdpi;
case QPaintDevice::PdmDpiY: case QPaintDevice::PdmDpiY:
case QPaintDevice::PdmPhysicalDpiY: case QPaintDevice::PdmPhysicalDpiY:
return ydpi; return ydpi;
default: default:
qWarning ("EmfPaintDevice::Strange metric asked"); qWarning ("EmfPaintDevice::Strange metric asked");
return 0; return 0;
} }
} }

View File

@ -1,26 +1,26 @@
# qmake project file for building the EmfEngine libraries # qmake project file for building the EmfEngine libraries
include( ../config.pri ) include( ../config.pri )
TARGET = EmfEngine TARGET = EmfEngine
TEMPLATE = lib TEMPLATE = lib
MOC_DIR = ../tmp MOC_DIR = ../tmp
OBJECTS_DIR = ../tmp OBJECTS_DIR = ../tmp
DESTDIR = ../ DESTDIR = ../
contains(CONFIG, EmfEngineDll) { contains(CONFIG, EmfEngineDll) {
CONFIG += dll CONFIG += dll
DEFINES += EMFENGINE_DLL EMFENGINE_DLL_BUILD DEFINES += EMFENGINE_DLL EMFENGINE_DLL_BUILD
} else { } else {
CONFIG += staticlib CONFIG += staticlib
} }
HEADERS = EmfEngine.h HEADERS = EmfEngine.h
SOURCES += EmfEngine.cpp SOURCES += EmfEngine.cpp
SOURCES += EmfPaintDevice.cpp SOURCES += EmfPaintDevice.cpp
win32: LIBS += -lgdi32 win32: LIBS += -lgdi32
unix: LIBS += /usr/local/lib/libEMF.a unix: LIBS += /usr/local/lib/libEMF.a
unix: INCLUDEPATH += /usr/local/include/libEMF unix: INCLUDEPATH += /usr/local/include/libEMF

View File

@ -1,16 +1,16 @@
QTeXEngine GNU GPL v. 3.0 QTeXEngine GNU GPL v. 3.0
------------------------ ------------------------
09/11/2010 - Release 0.3: 09/11/2010 - Release 0.3:
Fixed a bug leading to the creation of empty drawing paths. Fixed a bug leading to the creation of empty drawing paths.
------------------------ ------------------------
17/08/2009 - Release 0.2: 17/08/2009 - Release 0.2:
- Improved handling of text strings. - Improved handling of text strings.
- Added several useful output options. - Added several useful output options.
- Added Doxygen configuration files. - Added Doxygen configuration files.
------------------------ ------------------------
05/08/2009 - Release 0.1: Initial release. 05/08/2009 - Release 0.1: Initial release.

View File

@ -1,8 +1,8 @@
include( config.pri ) include( config.pri )
TEMPLATE = subdirs TEMPLATE = subdirs
SUBDIRS = \ SUBDIRS = \
src \ src \
example \ example \
test test

View File

@ -1,28 +1,28 @@
QTeXEngine GNU GPL v. 3.0 QTeXEngine GNU GPL v. 3.0
------------------------ ------------------------
AUTHOR: Ion Vasilief AUTHOR: Ion Vasilief
------------------------ ------------------------
FEATURES: QTeXEngine enables Qt based applications to easily export graphics created using the FEATURES: QTeXEngine enables Qt based applications to easily export graphics created using the
QPainter class to the .tex format using Pgf/TikZ packages (http://sourceforge.net/projects/pgf/). QPainter class to the .tex format using Pgf/TikZ packages (http://sourceforge.net/projects/pgf/).
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
DEPENDENCIES: You need Qt (http://www.qtsoftware.com) installed on your system in order to build QTeXEngine. DEPENDENCIES: You need Qt (http://www.qtsoftware.com) installed on your system in order to build QTeXEngine.
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
COMPILING: QTeXEngine uses qmake for the building process. COMPILING: QTeXEngine uses qmake for the building process.
qmake is part of a Qt distribution: qmake is part of a Qt distribution:
qmake reads project files, that contain the options and rules how to build a certain project. qmake reads project files, that contain the options and rules how to build a certain project.
A project file ends with the suffix "*.pro". Please read the qmake documentation for more details. A project file ends with the suffix "*.pro". Please read the qmake documentation for more details.
After installing Qt on your system, type the following command lines: After installing Qt on your system, type the following command lines:
$ qmake $ qmake
$ make $ make
if you use MinGW, or: if you use MinGW, or:
$ qmake -tp vc -r $ qmake -tp vc -r
if you use Microsoft Visual Studio (this will generate Visual Studio .vcproj project files in the "src" and "example" folders). if you use Microsoft Visual Studio (this will generate Visual Studio .vcproj project files in the "src" and "example" folders).
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
USE: a short demo application is provided in the "example" folder of the source archive. USE: a short demo application is provided in the "example" folder of the source archive.
--------------------------------------------------------------------------- ---------------------------------------------------------------------------

View File

@ -1,9 +1,9 @@
CONFIG += qt warn_on thread CONFIG += qt warn_on thread
CONFIG += release CONFIG += release
# Comment the lines bellow if you want to build QTeXEngine statically # Comment the lines bellow if you want to build QTeXEngine statically
#CONFIG += QTeXEngineDll #CONFIG += QTeXEngineDll

View File

@ -1,222 +1,222 @@
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
# Project related configuration options # Project related configuration options
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
PROJECT_NAME = QTeXEngine PROJECT_NAME = QTeXEngine
PROJECT_NUMBER = 0.2 PROJECT_NUMBER = 0.2
OUTPUT_DIRECTORY = . OUTPUT_DIRECTORY = .
CREATE_SUBDIRS = NO CREATE_SUBDIRS = NO
OUTPUT_LANGUAGE = English OUTPUT_LANGUAGE = English
USE_WINDOWS_ENCODING = NO USE_WINDOWS_ENCODING = NO
BRIEF_MEMBER_DESC = YES BRIEF_MEMBER_DESC = YES
REPEAT_BRIEF = YES REPEAT_BRIEF = YES
ABBREVIATE_BRIEF = ABBREVIATE_BRIEF =
ALWAYS_DETAILED_SEC = NO ALWAYS_DETAILED_SEC = NO
INLINE_INHERITED_MEMB = NO INLINE_INHERITED_MEMB = NO
FULL_PATH_NAMES = YES FULL_PATH_NAMES = YES
STRIP_FROM_PATH = STRIP_FROM_PATH =
STRIP_FROM_INC_PATH = STRIP_FROM_INC_PATH =
SHORT_NAMES = NO SHORT_NAMES = NO
JAVADOC_AUTOBRIEF = NO JAVADOC_AUTOBRIEF = NO
MULTILINE_CPP_IS_BRIEF = NO MULTILINE_CPP_IS_BRIEF = NO
DETAILS_AT_TOP = YES DETAILS_AT_TOP = YES
INHERIT_DOCS = YES INHERIT_DOCS = YES
DISTRIBUTE_GROUP_DOC = NO DISTRIBUTE_GROUP_DOC = NO
TAB_SIZE = 4 TAB_SIZE = 4
ALIASES = ALIASES =
OPTIMIZE_OUTPUT_FOR_C = NO OPTIMIZE_OUTPUT_FOR_C = NO
OPTIMIZE_OUTPUT_JAVA = NO OPTIMIZE_OUTPUT_JAVA = NO
SUBGROUPING = YES SUBGROUPING = YES
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
# Build related configuration options # Build related configuration options
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
EXTRACT_ALL = YES EXTRACT_ALL = YES
EXTRACT_PRIVATE = YES EXTRACT_PRIVATE = YES
EXTRACT_STATIC = YES EXTRACT_STATIC = YES
EXTRACT_LOCAL_CLASSES = YES EXTRACT_LOCAL_CLASSES = YES
EXTRACT_LOCAL_METHODS = NO EXTRACT_LOCAL_METHODS = NO
HIDE_UNDOC_MEMBERS = NO HIDE_UNDOC_MEMBERS = NO
HIDE_UNDOC_CLASSES = NO HIDE_UNDOC_CLASSES = NO
HIDE_FRIEND_COMPOUNDS = NO HIDE_FRIEND_COMPOUNDS = NO
HIDE_IN_BODY_DOCS = NO HIDE_IN_BODY_DOCS = NO
INTERNAL_DOCS = NO INTERNAL_DOCS = NO
CASE_SENSE_NAMES = YES CASE_SENSE_NAMES = YES
HIDE_SCOPE_NAMES = NO HIDE_SCOPE_NAMES = NO
SHOW_INCLUDE_FILES = YES SHOW_INCLUDE_FILES = YES
INLINE_INFO = YES INLINE_INFO = YES
SORT_MEMBER_DOCS = YES SORT_MEMBER_DOCS = YES
SORT_BRIEF_DOCS = YES SORT_BRIEF_DOCS = YES
SORT_BY_SCOPE_NAME = NO SORT_BY_SCOPE_NAME = NO
GENERATE_TODOLIST = YES GENERATE_TODOLIST = YES
GENERATE_TESTLIST = YES GENERATE_TESTLIST = YES
GENERATE_BUGLIST = YES GENERATE_BUGLIST = YES
GENERATE_DEPRECATEDLIST= YES GENERATE_DEPRECATEDLIST= YES
ENABLED_SECTIONS = ENABLED_SECTIONS =
MAX_INITIALIZER_LINES = 30 MAX_INITIALIZER_LINES = 30
SHOW_USED_FILES = YES SHOW_USED_FILES = YES
SHOW_DIRECTORIES = YES SHOW_DIRECTORIES = YES
FILE_VERSION_FILTER = FILE_VERSION_FILTER =
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
# configuration options related to warning and progress messages # configuration options related to warning and progress messages
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
QUIET = NO QUIET = NO
WARNINGS = YES WARNINGS = YES
WARN_IF_UNDOCUMENTED = YES WARN_IF_UNDOCUMENTED = YES
WARN_IF_DOC_ERROR = YES WARN_IF_DOC_ERROR = YES
WARN_NO_PARAMDOC = NO WARN_NO_PARAMDOC = NO
WARN_FORMAT = "$file:$line: $text" WARN_FORMAT = "$file:$line: $text"
WARN_LOGFILE = WARN_LOGFILE =
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
# configuration options related to the input files # configuration options related to the input files
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
INPUT = ../src . INPUT = ../src .
FILE_PATTERNS = *.cpp \ FILE_PATTERNS = *.cpp \
*.h \ *.h \
*.txt \ *.txt \
*.dox *.dox
RECURSIVE = yes RECURSIVE = yes
EXCLUDE = EXCLUDE =
EXCLUDE_SYMLINKS = NO EXCLUDE_SYMLINKS = NO
EXCLUDE_PATTERNS = *moc_* EXCLUDE_PATTERNS = *moc_*
EXAMPLE_PATH = ../README.txt ../COPYING.txt EXAMPLE_PATH = ../README.txt ../COPYING.txt
EXAMPLE_PATTERNS = EXAMPLE_PATTERNS =
EXAMPLE_RECURSIVE = NO EXAMPLE_RECURSIVE = NO
IMAGE_PATH = IMAGE_PATH =
INPUT_FILTER = INPUT_FILTER =
FILTER_PATTERNS = FILTER_PATTERNS =
FILTER_SOURCE_FILES = NO FILTER_SOURCE_FILES = NO
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
# configuration options related to source browsing # configuration options related to source browsing
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
SOURCE_BROWSER = NO SOURCE_BROWSER = NO
INLINE_SOURCES = NO INLINE_SOURCES = NO
STRIP_CODE_COMMENTS = YES STRIP_CODE_COMMENTS = YES
REFERENCED_BY_RELATION = YES REFERENCED_BY_RELATION = YES
REFERENCES_RELATION = YES REFERENCES_RELATION = YES
VERBATIM_HEADERS = YES VERBATIM_HEADERS = YES
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
# configuration options related to the alphabetical class index # configuration options related to the alphabetical class index
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
ALPHABETICAL_INDEX = YES ALPHABETICAL_INDEX = YES
COLS_IN_ALPHA_INDEX = 5 COLS_IN_ALPHA_INDEX = 5
IGNORE_PREFIX = IGNORE_PREFIX =
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
# configuration options related to the HTML output # configuration options related to the HTML output
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
GENERATE_HTML = YES GENERATE_HTML = YES
HTML_OUTPUT = html HTML_OUTPUT = html
HTML_FILE_EXTENSION = .html HTML_FILE_EXTENSION = .html
HTML_HEADER = HTML_HEADER =
HTML_FOOTER = HTML_FOOTER =
HTML_STYLESHEET = HTML_STYLESHEET =
HTML_ALIGN_MEMBERS = YES HTML_ALIGN_MEMBERS = YES
GENERATE_HTMLHELP = NO GENERATE_HTMLHELP = NO
CHM_FILE = CHM_FILE =
HHC_LOCATION = HHC_LOCATION =
GENERATE_CHI = NO GENERATE_CHI = NO
BINARY_TOC = NO BINARY_TOC = NO
TOC_EXPAND = NO TOC_EXPAND = NO
DISABLE_INDEX = NO DISABLE_INDEX = NO
ENUM_VALUES_PER_LINE = 4 ENUM_VALUES_PER_LINE = 4
GENERATE_TREEVIEW = NO GENERATE_TREEVIEW = NO
TREEVIEW_WIDTH = 250 TREEVIEW_WIDTH = 250
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
# configuration options related to the LaTeX output # configuration options related to the LaTeX output
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
GENERATE_LATEX = NO GENERATE_LATEX = NO
LATEX_OUTPUT = latex LATEX_OUTPUT = latex
LATEX_CMD_NAME = latex LATEX_CMD_NAME = latex
MAKEINDEX_CMD_NAME = makeindex MAKEINDEX_CMD_NAME = makeindex
COMPACT_LATEX = NO COMPACT_LATEX = NO
PAPER_TYPE = a4wide PAPER_TYPE = a4wide
EXTRA_PACKAGES = EXTRA_PACKAGES =
LATEX_HEADER = LATEX_HEADER =
PDF_HYPERLINKS = NO PDF_HYPERLINKS = NO
USE_PDFLATEX = NO USE_PDFLATEX = NO
LATEX_BATCHMODE = NO LATEX_BATCHMODE = NO
LATEX_HIDE_INDICES = NO LATEX_HIDE_INDICES = NO
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
# configuration options related to the RTF output # configuration options related to the RTF output
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
GENERATE_RTF = NO GENERATE_RTF = NO
RTF_OUTPUT = rtf RTF_OUTPUT = rtf
COMPACT_RTF = NO COMPACT_RTF = NO
RTF_HYPERLINKS = NO RTF_HYPERLINKS = NO
RTF_STYLESHEET_FILE = RTF_STYLESHEET_FILE =
RTF_EXTENSIONS_FILE = RTF_EXTENSIONS_FILE =
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
# configuration options related to the man page output # configuration options related to the man page output
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
GENERATE_MAN = NO GENERATE_MAN = NO
MAN_OUTPUT = man MAN_OUTPUT = man
MAN_EXTENSION = .3 MAN_EXTENSION = .3
MAN_LINKS = NO MAN_LINKS = NO
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
# configuration options related to the XML output # configuration options related to the XML output
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
GENERATE_XML = NO GENERATE_XML = NO
XML_OUTPUT = xml XML_OUTPUT = xml
XML_SCHEMA = XML_SCHEMA =
XML_DTD = XML_DTD =
XML_PROGRAMLISTING = YES XML_PROGRAMLISTING = YES
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
# configuration options for the AutoGen Definitions output # configuration options for the AutoGen Definitions output
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
GENERATE_AUTOGEN_DEF = NO GENERATE_AUTOGEN_DEF = NO
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
# configuration options related to the Perl module output # configuration options related to the Perl module output
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
GENERATE_PERLMOD = NO GENERATE_PERLMOD = NO
PERLMOD_LATEX = NO PERLMOD_LATEX = NO
PERLMOD_PRETTY = YES PERLMOD_PRETTY = YES
PERLMOD_MAKEVAR_PREFIX = PERLMOD_MAKEVAR_PREFIX =
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
# Configuration options related to the preprocessor # Configuration options related to the preprocessor
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
ENABLE_PREPROCESSING = YES ENABLE_PREPROCESSING = YES
MACRO_EXPANSION = NO MACRO_EXPANSION = NO
EXPAND_ONLY_PREDEF = NO EXPAND_ONLY_PREDEF = NO
SEARCH_INCLUDES = YES SEARCH_INCLUDES = YES
INCLUDE_PATH = INCLUDE_PATH =
INCLUDE_FILE_PATTERNS = INCLUDE_FILE_PATTERNS =
PREDEFINED = PREDEFINED =
EXPAND_AS_DEFINED = EXPAND_AS_DEFINED =
SKIP_FUNCTION_MACROS = YES SKIP_FUNCTION_MACROS = YES
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
# Configuration::additions related to external references # Configuration::additions related to external references
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
TAGFILES = TAGFILES =
GENERATE_TAGFILE = GENERATE_TAGFILE =
ALLEXTERNALS = NO ALLEXTERNALS = NO
EXTERNAL_GROUPS = YES EXTERNAL_GROUPS = YES
PERL_PATH = /usr/bin/perl PERL_PATH = /usr/bin/perl
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
# Configuration options related to the dot tool # Configuration options related to the dot tool
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
CLASS_DIAGRAMS = YES CLASS_DIAGRAMS = YES
HIDE_UNDOC_RELATIONS = YES HIDE_UNDOC_RELATIONS = YES
# recommendation: install graphviz and use HAVE_DOT = YES # recommendation: install graphviz and use HAVE_DOT = YES
HAVE_DOT = NO HAVE_DOT = NO
CLASS_GRAPH = YES CLASS_GRAPH = YES
COLLABORATION_GRAPH = YES COLLABORATION_GRAPH = YES
GROUP_GRAPHS = YES GROUP_GRAPHS = YES
UML_LOOK = NO UML_LOOK = NO
TEMPLATE_RELATIONS = NO TEMPLATE_RELATIONS = NO
INCLUDE_GRAPH = YES INCLUDE_GRAPH = YES
INCLUDED_BY_GRAPH = YES INCLUDED_BY_GRAPH = YES
CALL_GRAPH = NO CALL_GRAPH = NO
GRAPHICAL_HIERARCHY = YES GRAPHICAL_HIERARCHY = YES
DIRECTORY_GRAPH = YES DIRECTORY_GRAPH = YES
DOT_IMAGE_FORMAT = png DOT_IMAGE_FORMAT = png
DOT_PATH = DOT_PATH =
DOTFILE_DIRS = DOTFILE_DIRS =
MAX_DOT_GRAPH_WIDTH = 1024 MAX_DOT_GRAPH_WIDTH = 1024
MAX_DOT_GRAPH_HEIGHT = 1024 MAX_DOT_GRAPH_HEIGHT = 1024
MAX_DOT_GRAPH_DEPTH = 1000 MAX_DOT_GRAPH_DEPTH = 1000
DOT_TRANSPARENT = NO DOT_TRANSPARENT = NO
DOT_MULTI_TARGETS = NO DOT_MULTI_TARGETS = NO
GENERATE_LEGEND = YES GENERATE_LEGEND = YES
DOT_CLEANUP = YES DOT_CLEANUP = YES
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
# Configuration::additions related to the search engine # Configuration::additions related to the search engine
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
SEARCHENGINE = NO SEARCHENGINE = NO

View File

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

Before

Width:  |  Height:  |  Size: 35 B

After

Width:  |  Height:  |  Size: 35 B

View File

Before

Width:  |  Height:  |  Size: 706 B

After

Width:  |  Height:  |  Size: 706 B

View File

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

View File

@ -1,15 +1,15 @@
TARGET = example TARGET = example
TEMPLATE = app TEMPLATE = app
CONFIG += warn_on release thread CONFIG += warn_on release thread
MOC_DIR = ../tmp MOC_DIR = ../tmp
OBJECTS_DIR = ../tmp OBJECTS_DIR = ../tmp
DESTDIR = ./ DESTDIR = ./
INCLUDEPATH += ../src INCLUDEPATH += ../src
LIBS += ../libQTeXEngine.a LIBS += ../libQTeXEngine.a
HEADERS = renderarea.h \ HEADERS = renderarea.h \
pixmaps.h pixmaps.h
SOURCES = main.cpp \ SOURCES = main.cpp \
renderarea.cpp renderarea.cpp

View File

@ -1,21 +1,21 @@
#include <QApplication> #include <QApplication>
#include "renderarea.h" #include "renderarea.h"
#include <QTeXEngine.h> #include <QTeXEngine.h>
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
QApplication app(argc, argv); QApplication app(argc, argv);
RenderArea area; RenderArea area;
area.setGeometry(100, 100, 600, 500); area.setGeometry(100, 100, 600, 500);
area.show(); area.show();
QTeXPaintDevice tex(QString("example.tex"), QSize(600, 500)); QTeXPaintDevice tex(QString("example.tex"), QSize(600, 500));
tex.setDocumentMode(); tex.setDocumentMode();
QPainter paint; QPainter paint;
paint.begin(&tex); paint.begin(&tex);
area.draw(&paint); area.draw(&paint);
paint.end(); paint.end();
return app.exec(); return app.exec();
} }

View File

@ -1,134 +1,134 @@
#include <QtGui> #include <QtGui>
#include "renderarea.h" #include "renderarea.h"
#include "pixmaps.h" #include "pixmaps.h"
RenderArea::RenderArea(QWidget *parent) RenderArea::RenderArea(QWidget *parent)
: QWidget(parent) : QWidget(parent)
{ {
setBackgroundRole(QPalette::Base); setBackgroundRole(QPalette::Base);
setAutoFillBackground(true); setAutoFillBackground(true);
setFixedWidth(600); setFixedWidth(600);
setFixedHeight(500); setFixedHeight(500);
} }
void RenderArea::draw(QPainter *painter) void RenderArea::draw(QPainter *painter)
{ {
static const QPoint points[4] = { static const QPoint points[4] = {
QPoint(10, 80), QPoint(10, 80),
QPoint(20, 10), QPoint(20, 10),
QPoint(80, 30), QPoint(80, 30),
QPoint(90, 70) QPoint(90, 70)
}; };
QRect rect(10, 20, 80, 60); QRect rect(10, 20, 80, 60);
QPainterPath path; QPainterPath path;
path.moveTo(20, 80); path.moveTo(20, 80);
path.lineTo(20, 30); path.lineTo(20, 30);
path.cubicTo(80, 0, 50, 50, 80, 80); path.cubicTo(80, 0, 50, 50, 80, 80);
int startAngle = 20 * 16; int startAngle = 20 * 16;
int arcLength = 120 * 16; int arcLength = 120 * 16;
QLinearGradient linearGrad(QPointF(0, 0), QPointF(100, 100)); QLinearGradient linearGrad(QPointF(0, 0), QPointF(100, 100));
linearGrad.setColorAt(0, Qt::black); linearGrad.setColorAt(0, Qt::black);
linearGrad.setColorAt(1, Qt::red); linearGrad.setColorAt(1, Qt::red);
QRadialGradient radialGrad(QPointF(50, 50), 50, QPointF(50, 50)); QRadialGradient radialGrad(QPointF(50, 50), 50, QPointF(50, 50));
radialGrad.setColorAt(0, Qt::red); radialGrad.setColorAt(0, Qt::red);
radialGrad.setColorAt(1, Qt::green); radialGrad.setColorAt(1, Qt::green);
/*QConicalGradient conGrad(QPointF(50, 50), 90); /*QConicalGradient conGrad(QPointF(50, 50), 90);
conGrad.setColorAt(0, Qt::blue); conGrad.setColorAt(0, Qt::blue);
conGrad.setColorAt(0.5, Qt::red); conGrad.setColorAt(0.5, Qt::red);
conGrad.setColorAt(1, Qt::green); conGrad.setColorAt(1, Qt::green);
QBrush brush = QBrush(conGrad);*/ QBrush brush = QBrush(conGrad);*/
QBrush brush = QBrush(Qt::gray); QBrush brush = QBrush(Qt::gray);
int brushStyle = Qt::NoBrush; int brushStyle = Qt::NoBrush;
int penStyle = Qt::NoPen; int penStyle = Qt::NoPen;
int shape = Rect; int shape = Rect;
int drawnRects = 0; int drawnRects = 0;
for (int x = 0; x < width(); x += 100){ for (int x = 0; x < width(); x += 100){
for (int y = 0; y < height(); y += 100){ for (int y = 0; y < height(); y += 100){
painter->save(); painter->save();
painter->setRenderHint(QPainter::Antialiasing); painter->setRenderHint(QPainter::Antialiasing);
shape = (shape + 1)%14; shape = (shape + 1)%14;
penStyle = (penStyle + 1)%4; penStyle = (penStyle + 1)%4;
if(!penStyle) if(!penStyle)
penStyle = 1; penStyle = 1;
if (shape == RoundedRect && drawnRects < 2){ if (shape == RoundedRect && drawnRects < 2){
if (drawnRects == 0) if (drawnRects == 0)
painter->setBrush(QBrush(linearGrad)); painter->setBrush(QBrush(linearGrad));
else if (drawnRects == 1) else if (drawnRects == 1)
painter->setBrush(QBrush(radialGrad)); painter->setBrush(QBrush(radialGrad));
drawnRects++; drawnRects++;
} else { } else {
brushStyle = (brushStyle + 1)%14; brushStyle = (brushStyle + 1)%14;
if(!brushStyle) if(!brushStyle)
brushStyle = 1; brushStyle = 1;
brush.setStyle((Qt::BrushStyle)brushStyle); brush.setStyle((Qt::BrushStyle)brushStyle);
painter->setBrush(brush); painter->setBrush(brush);
} }
painter->setPen(QPen(Qt::black, 2, (Qt::PenStyle)penStyle, Qt::FlatCap, Qt::MiterJoin)); painter->setPen(QPen(Qt::black, 2, (Qt::PenStyle)penStyle, Qt::FlatCap, Qt::MiterJoin));
painter->translate(x, y); painter->translate(x, y);
switch (shape) { switch (shape) {
case Line: case Line:
painter->drawLine(rect.bottomLeft(), rect.topRight()); painter->drawLine(rect.bottomLeft(), rect.topRight());
break; break;
case Polyline: case Polyline:
painter->drawPolyline(points, 4); painter->drawPolyline(points, 4);
break; break;
case Polygon: case Polygon:
painter->drawPolygon(points, 4); painter->drawPolygon(points, 4);
break; break;
case Rect: case Rect:
painter->drawRect(rect); painter->drawRect(rect);
break; break;
case RoundedRect: case RoundedRect:
painter->drawRoundedRect(rect, 25, 25, Qt::RelativeSize); painter->drawRoundedRect(rect, 25, 25, Qt::RelativeSize);
break; break;
case Ellipse: case Ellipse:
painter->drawEllipse(rect); painter->drawEllipse(rect);
break; break;
case Arc: case Arc:
painter->drawArc(rect, startAngle, arcLength); painter->drawArc(rect, startAngle, arcLength);
break; break;
case Chord: case Chord:
painter->drawChord(rect, startAngle, arcLength); painter->drawChord(rect, startAngle, arcLength);
break; break;
case Pie: case Pie:
painter->drawPie(rect, startAngle, arcLength); painter->drawPie(rect, startAngle, arcLength);
break; break;
case Path: case Path:
painter->drawPath(path); painter->drawPath(path);
break; break;
case Text: case Text:
painter->drawText(rect, Qt::AlignCenter, "QTeXEngine"); painter->drawText(rect, Qt::AlignCenter, "QTeXEngine");
break; break;
case Pixmap: case Pixmap:
painter->drawPixmap(10, 10, QPixmap(qt_logo_xpm)); painter->drawPixmap(10, 10, QPixmap(qt_logo_xpm));
break; break;
case TiledPixmap: case TiledPixmap:
painter->drawTiledPixmap (QRect(10, 10, 64, 64), QPixmap(brick_xpm)); painter->drawTiledPixmap (QRect(10, 10, 64, 64), QPixmap(brick_xpm));
break; break;
} }
painter->restore(); painter->restore();
} }
} }
painter->setPen(Qt::darkGray); painter->setPen(Qt::darkGray);
painter->setBrush(Qt::NoBrush); painter->setBrush(Qt::NoBrush);
painter->drawRect(QRect(9, 9, width() - 18, height() - 18)); painter->drawRect(QRect(9, 9, width() - 18, height() - 18));
} }
void RenderArea::paintEvent(QPaintEvent * /* event */) void RenderArea::paintEvent(QPaintEvent * /* event */)
{ {
QPainter painter(this); QPainter painter(this);
draw(&painter); draw(&painter);
} }

View File

@ -1,19 +1,19 @@
#ifndef RENDERAREA_H #ifndef RENDERAREA_H
#define RENDERAREA_H #define RENDERAREA_H
#include <QWidget> #include <QWidget>
class RenderArea : public QWidget class RenderArea : public QWidget
{ {
public: public:
enum Shape { Line, Polyline, Polygon, Rect, RoundedRect, Ellipse, Arc, enum Shape { Line, Polyline, Polygon, Rect, RoundedRect, Ellipse, Arc,
Chord, Pie, Path, Text, Pixmap, TiledPixmap }; Chord, Pie, Path, Text, Pixmap, TiledPixmap };
RenderArea(QWidget *parent = 0); RenderArea(QWidget *parent = 0);
void draw(QPainter *painter); void draw(QPainter *painter);
protected: protected:
void paintEvent(QPaintEvent *event); void paintEvent(QPaintEvent *event);
}; };
#endif #endif

View File

@ -1,166 +1,166 @@
/*************************************************************************** /***************************************************************************
File : QTeXEngine.h File : QTeXEngine.h
Project : QTeXEngine GNU GPL v. 3.0 Project : QTeXEngine GNU GPL v. 3.0
-------------------------------------------------------------------- --------------------------------------------------------------------
Copyright : (C) 2009 by Ion Vasilief Copyright : (C) 2009 by Ion Vasilief
Email (use @ for *) : ion_vasilief*yahoo.fr Email (use @ for *) : ion_vasilief*yahoo.fr
Description : Enables the export of QPainter grafics to .tex files Description : Enables the export of QPainter grafics to .tex files
***************************************************************************/ ***************************************************************************/
/*************************************************************************** /***************************************************************************
* * * *
* This program is free software; you can redistribute it and/or modify * * This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by * * it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 3 of the License, or * * the Free Software Foundation; either version 3 of the License, or *
* (at your option) any later version. * * (at your option) any later version. *
* * * *
* This program is distributed in the hope that it will be useful, * * This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of * * but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. * * GNU General Public License for more details. *
* * * *
* You should have received a copy of the GNU General Public License * * You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the Free Software * * along with this program; if not, write to the Free Software *
* Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Foundation, Inc., 51 Franklin Street, Fifth Floor, *
* Boston, MA 02110-1301 USA * * Boston, MA 02110-1301 USA *
* * * *
***************************************************************************/ ***************************************************************************/
#ifndef Q_TEX_ENGINE_H #ifndef Q_TEX_ENGINE_H
#define Q_TEX_ENGINE_H #define Q_TEX_ENGINE_H
#include <QPaintDevice> #include <QPaintDevice>
#include <QPaintEngine> #include <QPaintEngine>
#include <QPrinter> #include <QPrinter>
class QFile; class QFile;
class QTeXPaintEngine; class QTeXPaintEngine;
class QTeXPaintDevice : public QPaintDevice class QTeXPaintDevice : public QPaintDevice
{ {
public: public:
enum Unit{pt, bp, mm, cm, in, ex, em}; enum Unit{pt, bp, mm, cm, in, ex, em};
enum OutputMode{Tikz, Pgf}; enum OutputMode{Tikz, Pgf};
QTeXPaintDevice(const QString& fileName, const QSize& s = QSize(), Unit u = pt); QTeXPaintDevice(const QString& fileName, const QSize& s = QSize(), Unit u = pt);
~QTeXPaintDevice(); ~QTeXPaintDevice();
virtual QPaintEngine * paintEngine () const; virtual QPaintEngine * paintEngine () const;
//! Set color mode (Color or GrayScale) //! Set color mode (Color or GrayScale)
void setColorMode(QPrinter::ColorMode mode); void setColorMode(QPrinter::ColorMode mode);
//! Set output mode (Tikz or Pgf) //! Set output mode (Tikz or Pgf)
void setOutputMode(OutputMode mode); void setOutputMode(OutputMode mode);
//! Set length unit //! Set length unit
void setUnit(Unit u); void setUnit(Unit u);
//! Set size //! Set size
void setSize(const QSize& s){d_size = s;}; void setSize(const QSize& s){d_size = s;};
//! Enables/Disables document tags //! Enables/Disables document tags
void setDocumentMode(bool on = true); void setDocumentMode(bool on = true);
//! Enables/Disables escaping of special characters in texts //! Enables/Disables escaping of special characters in texts
void setEscapeTextMode(bool on = true); void setEscapeTextMode(bool on = true);
//! Enables/Disables exporting of font sizes //! Enables/Disables exporting of font sizes
void exportFontSizes(bool on = true); void exportFontSizes(bool on = true);
//! Set horizontal alignment //! Set horizontal alignment
void setTextHorizontalAlignment(Qt::Alignment alignment); void setTextHorizontalAlignment(Qt::Alignment alignment);
protected: protected:
virtual int metric ( PaintDeviceMetric ) const; virtual int metric ( PaintDeviceMetric ) const;
private: private:
//! Size in pixels //! Size in pixels
QSize d_size; QSize d_size;
QTeXPaintEngine* engine; QTeXPaintEngine* engine;
}; };
class QTeXPaintEngine : public QPaintEngine class QTeXPaintEngine : public QPaintEngine
{ {
public: public:
QTeXPaintEngine(const QString&, QTeXPaintDevice::Unit u = QTeXPaintDevice::pt); QTeXPaintEngine(const QString&, QTeXPaintDevice::Unit u = QTeXPaintDevice::pt);
~QTeXPaintEngine(){}; ~QTeXPaintEngine(){};
virtual bool begin(QPaintDevice*); virtual bool begin(QPaintDevice*);
virtual bool end(); virtual bool end();
virtual void updateState( const QPaintEngineState & ) {}; virtual void updateState( const QPaintEngineState & ) {};
virtual void drawEllipse(const QRectF &); virtual void drawEllipse(const QRectF &);
virtual QPaintEngine::Type type() const {return QPaintEngine::User;}; virtual QPaintEngine::Type type() const {return QPaintEngine::User;};
virtual void drawPoints ( const QPointF * points, int pointCount ); virtual void drawPoints ( const QPointF * points, int pointCount );
virtual void drawLines ( const QLineF * , int ); virtual void drawLines ( const QLineF * , int );
virtual void drawPath ( const QPainterPath & path ); virtual void drawPath ( const QPainterPath & path );
virtual void drawPolygon ( const QPointF * , int , PolygonDrawMode ); virtual void drawPolygon ( const QPointF * , int , PolygonDrawMode );
virtual void drawTextItem ( const QPointF & , const QTextItem & ); virtual void drawTextItem ( const QPointF & , const QTextItem & );
virtual void drawRects ( const QRectF * , int ); virtual void drawRects ( const QRectF * , int );
virtual void drawPixmap ( const QRectF &, const QPixmap &, const QRectF &); virtual void drawPixmap ( const QRectF &, const QPixmap &, const QRectF &);
virtual void drawImage(const QRectF &, const QImage &, const QRectF &, Qt::ImageConversionFlags); virtual void drawImage(const QRectF &, const QImage &, const QRectF &, Qt::ImageConversionFlags);
//! Set length unit //! Set length unit
void setUnit(QTeXPaintDevice::Unit u){d_unit = u;}; void setUnit(QTeXPaintDevice::Unit u){d_unit = u;};
//! Enables/Disables gray scale output //! Enables/Disables gray scale output
void setGrayScale(bool on = true){d_gray_scale = on;}; void setGrayScale(bool on = true){d_gray_scale = on;};
//! Set output syntax //! Set output syntax
void setOutputMode(QTeXPaintDevice::OutputMode mode){d_pgf_mode = (mode == QTeXPaintDevice::Pgf) ? true : false;}; void setOutputMode(QTeXPaintDevice::OutputMode mode){d_pgf_mode = (mode == QTeXPaintDevice::Pgf) ? true : false;};
void setDocumentMode(bool on = true){d_document_mode = on;}; void setDocumentMode(bool on = true){d_document_mode = on;};
//! Enables/Disables escaping of special characters in texts //! Enables/Disables escaping of special characters in texts
void setEscapeTextMode(bool on = true){d_escape_text = on;}; void setEscapeTextMode(bool on = true){d_escape_text = on;};
void exportFontSizes(bool on = true){d_font_size = on;}; void exportFontSizes(bool on = true){d_font_size = on;};
void setTextHorizontalAlignment(Qt::Alignment alignment){d_horizontal_alignment = alignment;}; void setTextHorizontalAlignment(Qt::Alignment alignment){d_horizontal_alignment = alignment;};
private: private:
enum Shape{Line, Polygon, Polyline, Rect, Ellipse, Path, Points}; enum Shape{Line, Polygon, Polyline, Rect, Ellipse, Path, Points};
//! Returns true if draw operation has NoBrush and NoPen //! Returns true if draw operation has NoBrush and NoPen
bool emptyStringOperation(); bool emptyStringOperation();
QString unit(); QString unit();
double unitFactor(); double unitFactor();
double resFactorX(); double resFactorX();
double resFactorY(); double resFactorY();
QString pgfPoint(const QPointF& p); QString pgfPoint(const QPointF& p);
QString tikzPoint(const QPointF& p); QString tikzPoint(const QPointF& p);
QPointF convertPoint(const QPointF& p); QPointF convertPoint(const QPointF& p);
QString color(const QColor& col); QString color(const QColor& col);
QString defineColor(const QColor& c, const QString& name); QString defineColor(const QColor& c, const QString& name);
QString pgfPen(const QPen& pen); QString pgfPen(const QPen& pen);
QString tikzPen(const QPen& pen); QString tikzPen(const QPen& pen);
QString pgfBrush(const QBrush& brush); QString pgfBrush(const QBrush& brush);
QString tikzBrush(const QBrush& brush); QString tikzBrush(const QBrush& brush);
QString beginScope(); QString beginScope();
QString endScope(); QString endScope();
QString clipPath(); QString clipPath();
bool changedClipping(); bool changedClipping();
QString path(const QPainterPath & path); QString path(const QPainterPath & path);
QString pgfPath(const QPainterPath & path); QString pgfPath(const QPainterPath & path);
QString tikzPath(const QPainterPath & path); QString tikzPath(const QPainterPath & path);
QString drawShape(Shape shape, const QString & path); QString drawShape(Shape shape, const QString & path);
QString drawPgfShape(Shape shape, const QString & path); QString drawPgfShape(Shape shape, const QString & path);
QString drawTikzShape(Shape shape, const QString & path); QString drawTikzShape(Shape shape, const QString & path);
//! Draws pixmap pix in a given rectangle //! Draws pixmap pix in a given rectangle
void drawPixmap(const QPixmap &pix, const QRectF &p); void drawPixmap(const QPixmap &pix, const QRectF &p);
void writeToFile(const QString& s); void writeToFile(const QString& s);
QString indentString(const QString& s); QString indentString(const QString& s);
//! Returns true if a new color command should be added //! Returns true if a new color command should be added
bool addNewBrushColor(); bool addNewBrushColor();
bool addNewPatternColor(); bool addNewPatternColor();
bool addNewPenColor(); bool addNewPenColor();
QFile *file; QFile *file;
//! Name of the output file //! Name of the output file
QString fname; QString fname;
int d_pixmap_index; int d_pixmap_index;
bool d_pgf_mode; bool d_pgf_mode;
bool d_open_scope; bool d_open_scope;
bool d_gray_scale; bool d_gray_scale;
bool d_document_mode; bool d_document_mode;
bool d_escape_text; bool d_escape_text;
bool d_font_size; bool d_font_size;
QPainterPath d_clip_path; QPainterPath d_clip_path;
QColor d_current_color, d_pattern_color; QColor d_current_color, d_pattern_color;
QTeXPaintDevice::Unit d_unit; QTeXPaintDevice::Unit d_unit;
Qt::Alignment d_horizontal_alignment; Qt::Alignment d_horizontal_alignment;
}; };
#endif #endif

View File

@ -1,118 +1,118 @@
/*************************************************************************** /***************************************************************************
File : QTeXPaintDevice.cpp File : QTeXPaintDevice.cpp
Project : QTeXEngine GNU GPL v. 3.0 Project : QTeXEngine GNU GPL v. 3.0
-------------------------------------------------------------------- --------------------------------------------------------------------
Copyright : (C) 2009 by Ion Vasilief Copyright : (C) 2009 by Ion Vasilief
Email (use @ for *) : ion_vasilief*yahoo.fr Email (use @ for *) : ion_vasilief*yahoo.fr
Description : Enables the export of QPainter grafics to .tex files Description : Enables the export of QPainter grafics to .tex files
***************************************************************************/ ***************************************************************************/
/*************************************************************************** /***************************************************************************
* * * *
* This program is free software; you can redistribute it and/or modify * * This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by * * it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 3 of the License, or * * the Free Software Foundation; either version 3 of the License, or *
* (at your option) any later version. * * (at your option) any later version. *
* * * *
* This program is distributed in the hope that it will be useful, * * This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of * * but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. * * GNU General Public License for more details. *
* * * *
* You should have received a copy of the GNU General Public License * * You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the Free Software * * along with this program; if not, write to the Free Software *
* Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Foundation, Inc., 51 Franklin Street, Fifth Floor, *
* Boston, MA 02110-1301 USA * * Boston, MA 02110-1301 USA *
* * * *
***************************************************************************/ ***************************************************************************/
#include "QTeXEngine.h" #include "QTeXEngine.h"
#include <QApplication> #include <QApplication>
#include <QDesktopWidget> #include <QDesktopWidget>
QTeXPaintDevice::QTeXPaintDevice(const QString& fileName, const QSize& s, Unit u) QTeXPaintDevice::QTeXPaintDevice(const QString& fileName, const QSize& s, Unit u)
: QPaintDevice() : QPaintDevice()
{ {
d_size = s; d_size = s;
if (!d_size.isValid()) if (!d_size.isValid())
d_size = QSize(500, 400); d_size = QSize(500, 400);
engine = new QTeXPaintEngine(fileName, u); engine = new QTeXPaintEngine(fileName, u);
} }
QTeXPaintDevice::~QTeXPaintDevice() QTeXPaintDevice::~QTeXPaintDevice()
{ {
delete engine; delete engine;
} }
QPaintEngine * QTeXPaintDevice::paintEngine () const QPaintEngine * QTeXPaintDevice::paintEngine () const
{ {
return engine; return engine;
} }
void QTeXPaintDevice::setColorMode(QPrinter::ColorMode mode) void QTeXPaintDevice::setColorMode(QPrinter::ColorMode mode)
{ {
engine->setGrayScale(mode == QPrinter::GrayScale); engine->setGrayScale(mode == QPrinter::GrayScale);
} }
void QTeXPaintDevice::setOutputMode(OutputMode mode) void QTeXPaintDevice::setOutputMode(OutputMode mode)
{ {
engine->setOutputMode(mode); engine->setOutputMode(mode);
} }
void QTeXPaintDevice::setUnit(Unit u) void QTeXPaintDevice::setUnit(Unit u)
{ {
engine->setUnit(u); engine->setUnit(u);
} }
void QTeXPaintDevice::setDocumentMode(bool on) void QTeXPaintDevice::setDocumentMode(bool on)
{ {
engine->setDocumentMode(on); engine->setDocumentMode(on);
} }
void QTeXPaintDevice::setEscapeTextMode(bool on) void QTeXPaintDevice::setEscapeTextMode(bool on)
{ {
engine->setEscapeTextMode(on); engine->setEscapeTextMode(on);
} }
void QTeXPaintDevice::exportFontSizes(bool on) void QTeXPaintDevice::exportFontSizes(bool on)
{ {
engine->exportFontSizes(on); engine->exportFontSizes(on);
} }
void QTeXPaintDevice::setTextHorizontalAlignment(Qt::Alignment alignment) void QTeXPaintDevice::setTextHorizontalAlignment(Qt::Alignment alignment)
{ {
engine->setTextHorizontalAlignment(alignment); engine->setTextHorizontalAlignment(alignment);
} }
int QTeXPaintDevice::metric ( PaintDeviceMetric metric ) const int QTeXPaintDevice::metric ( PaintDeviceMetric metric ) const
{ {
QDesktopWidget *desktop = QApplication::desktop(); QDesktopWidget *desktop = QApplication::desktop();
int dpi_x = desktop->logicalDpiX(); int dpi_x = desktop->logicalDpiX();
int dpi_y = desktop->logicalDpiY(); int dpi_y = desktop->logicalDpiY();
switch (metric){ switch (metric){
case QPaintDevice::PdmWidth: case QPaintDevice::PdmWidth:
return d_size.width(); return d_size.width();
case QPaintDevice::PdmHeight: case QPaintDevice::PdmHeight:
return d_size.height(); return d_size.height();
case QPaintDevice::PdmWidthMM: case QPaintDevice::PdmWidthMM:
return int(25.4*d_size.width()/(double)dpi_x); return int(25.4*d_size.width()/(double)dpi_x);
case QPaintDevice::PdmHeightMM: case QPaintDevice::PdmHeightMM:
return int(25.4*d_size.height()/(double)dpi_y); return int(25.4*d_size.height()/(double)dpi_y);
case QPaintDevice::PdmNumColors: case QPaintDevice::PdmNumColors:
return 65536;//should it be millions? return 65536;//should it be millions?
case QPaintDevice::PdmDepth: case QPaintDevice::PdmDepth:
return 32; return 32;
case QPaintDevice::PdmDpiX: case QPaintDevice::PdmDpiX:
case QPaintDevice::PdmPhysicalDpiX: case QPaintDevice::PdmPhysicalDpiX:
return dpi_x; return dpi_x;
case QPaintDevice::PdmDpiY: case QPaintDevice::PdmDpiY:
case QPaintDevice::PdmPhysicalDpiY: case QPaintDevice::PdmPhysicalDpiY:
return dpi_y; return dpi_y;
default: default:
qWarning ("QTeXPaintDevice::Unknown metric asked"); qWarning ("QTeXPaintDevice::Unknown metric asked");
return 0; return 0;
} }
} }

View File

@ -1,21 +1,21 @@
# qmake project file for building the QTeXEngine libraries # qmake project file for building the QTeXEngine libraries
include( ../config.pri ) include( ../config.pri )
TARGET = QTeXEngine TARGET = QTeXEngine
TEMPLATE = lib TEMPLATE = lib
MOC_DIR = ../tmp MOC_DIR = ../tmp
OBJECTS_DIR = ../tmp OBJECTS_DIR = ../tmp
DESTDIR = ../ DESTDIR = ../
contains(CONFIG, QTeXEngineDll) { contains(CONFIG, QTeXEngineDll) {
CONFIG += dll CONFIG += dll
DEFINES += QTEXENGINE_DLL QTEXENGINE_DLL_BUILD DEFINES += QTEXENGINE_DLL QTEXENGINE_DLL_BUILD
} else { } else {
CONFIG += staticlib CONFIG += staticlib
} }
HEADERS = QTeXEngine.h HEADERS = QTeXEngine.h
SOURCES += QTeXPaintEngine.cpp SOURCES += QTeXPaintEngine.cpp
SOURCES += QTeXPaintDevice.cpp SOURCES += QTeXPaintDevice.cpp

View File

@ -46,14 +46,14 @@ public:
int main(int argc, char **argv) { int main(int argc, char **argv) {
QApplication app(argc, argv); QApplication app(argc, argv);
GraphicsView view; GraphicsView view;
view.show(); view.show();
QTeXPaintDevice tex("test.tex", view.scene()->sceneRect().size().toSize()); QTeXPaintDevice tex("test.tex", view.scene()->sceneRect().size().toSize());
tex.setOutputMode(QTeXPaintDevice::Pgf); tex.setOutputMode(QTeXPaintDevice::Pgf);
tex.setDocumentMode(); tex.setDocumentMode();
QPainter painter(&tex); QPainter painter(&tex);
view.scene()->render(&painter); view.scene()->render(&painter);
painter.end(); painter.end();
return app.exec(); return app.exec();
} }

View File

@ -1,12 +1,12 @@
TARGET = test TARGET = test
TEMPLATE = app TEMPLATE = app
CONFIG += warn_on release thread CONFIG += warn_on release thread
MOC_DIR = ../tmp MOC_DIR = ../tmp
OBJECTS_DIR = ../tmp OBJECTS_DIR = ../tmp
DESTDIR = ./ DESTDIR = ./
INCLUDEPATH += ../src INCLUDEPATH += ../src
LIBS += ../libQTeXEngine.a LIBS += ../libQTeXEngine.a
SOURCES += test.cpp SOURCES += test.cpp

View File

@ -1,155 +1,155 @@
#include "TestWidgetBarcharts.h" #include "TestWidgetBarcharts.h"
#include <QDebug> #include <QDebug>
#include <QDate> #include <QDate>
#include <QDateTime> #include <QDateTime>
#include <QApplication> #include <QApplication>
#include "jkqtplotter/jkqtpgraphsbarchart.h" #include "jkqtplotter/jkqtpgraphsbarchart.h"
TestWidgetBarcharts::TestWidgetBarcharts(QWidget *parent) : TestWidgetBarcharts::TestWidgetBarcharts(QWidget *parent) :
QWidget(parent) QWidget(parent)
{ {
QVBoxLayout* barchartLayout=new QVBoxLayout(this); QVBoxLayout* barchartLayout=new QVBoxLayout(this);
setLayout(barchartLayout); setLayout(barchartLayout);
resize(1000, 800); resize(1000, 800);
plotBarchart=new JKQtPlotter(true, this); plotBarchart=new JKQtPlotter(true, this);
plotBarchart->set_doDrawing(false); plotBarchart->set_doDrawing(false);
plotBarchart->get_plotter()->set_plotLabel(tr("\\textbf{bar charts}")); plotBarchart->get_plotter()->set_plotLabel(tr("\\textbf{bar charts}"));
plotBarchart->setObjectName("plotBarchart"); plotBarchart->setObjectName("plotBarchart");
plotBarchart->get_plotter()->set_userSettigsFilename(QApplication::applicationDirPath()+"/usersettings.ini", "plot_peaks/"); plotBarchart->get_plotter()->set_userSettigsFilename(QApplication::applicationDirPath()+"/usersettings.ini", "plot_peaks/");
plotBarchart->get_plotter()->get_xAxis()->set_labelType(JKQTPCALTdate); plotBarchart->get_plotter()->get_xAxis()->set_labelType(JKQTPCALTdate);
plotBarchart->get_plotter()->get_xAxis()->set_tickDateFormat("dd. MMM yyyy"); plotBarchart->get_plotter()->get_xAxis()->set_tickDateFormat("dd. MMM yyyy");
barchartLayout->addWidget(plotBarchart); barchartLayout->addWidget(plotBarchart);
QVector<double> dataBCX, dataBCXD, dataBCY1, dataBCY2, dataBCYE1, dataBCYE2; QVector<double> dataBCX, dataBCXD, dataBCY1, dataBCY2, dataBCYE1, dataBCYE2;
for (int i=0; i<8; i++) { for (int i=0; i<8; i++) {
double x=double(i); double x=double(i);
dataBCX<<x; dataBCX<<x;
QDateTime dt; QDateTime dt;
dt.setDate(QDate(2012,1+i,1)); dt.setDate(QDate(2012,1+i,1));
//qDebug()<<dt<<dt.toMSecsSinceEpoch(); //qDebug()<<dt<<dt.toMSecsSinceEpoch();
dataBCXD<<double(dt.toMSecsSinceEpoch()); dataBCXD<<double(dt.toMSecsSinceEpoch());
dataBCY1<<1.0+sin(x*M_PI/6.0); dataBCY1<<1.0+sin(x*M_PI/6.0);
dataBCY2<<2.0+cos(x*M_PI/3.0); dataBCY2<<2.0+cos(x*M_PI/3.0);
dataBCYE1<<dataBCY1.last()*0.1; dataBCYE1<<dataBCY1.last()*0.1;
dataBCYE2<<dataBCY2.last()*0.05; dataBCYE2<<dataBCY2.last()*0.05;
} }
size_t bcpx=plotBarchart->getDatastore()->addCopiedColumn(dataBCX, "x"); size_t bcpx=plotBarchart->getDatastore()->addCopiedColumn(dataBCX, "x");
size_t bcpxd=plotBarchart->getDatastore()->addCopiedColumn(dataBCXD, "x_date"); size_t bcpxd=plotBarchart->getDatastore()->addCopiedColumn(dataBCXD, "x_date");
size_t bcpy1=plotBarchart->getDatastore()->addCopiedColumn(dataBCY1, "y1"); size_t bcpy1=plotBarchart->getDatastore()->addCopiedColumn(dataBCY1, "y1");
size_t bcpye1=plotBarchart->getDatastore()->addCopiedColumn(dataBCYE1, "ye1"); size_t bcpye1=plotBarchart->getDatastore()->addCopiedColumn(dataBCYE1, "ye1");
size_t bcpy2=plotBarchart->getDatastore()->addCopiedColumn(dataBCY2, "y2"); size_t bcpy2=plotBarchart->getDatastore()->addCopiedColumn(dataBCY2, "y2");
size_t bcpye2=plotBarchart->getDatastore()->addCopiedColumn(dataBCYE2, "ye2"); size_t bcpye2=plotBarchart->getDatastore()->addCopiedColumn(dataBCYE2, "ye2");
JKQTPbarVerticalErrorGraph* plteBar1=new JKQTPbarVerticalErrorGraph(plotBarchart->get_plotter()); JKQTPbarVerticalErrorGraph* plteBar1=new JKQTPbarVerticalErrorGraph(plotBarchart->get_plotter());
plteBar1->set_title(tr("bars 1")); plteBar1->set_title(tr("bars 1"));
plteBar1->set_xColumn(bcpxd); plteBar1->set_xColumn(bcpxd);
plteBar1->set_yColumn(bcpy1); plteBar1->set_yColumn(bcpy1);
plteBar1->set_yErrorColumn(bcpye1); plteBar1->set_yErrorColumn(bcpye1);
plteBar1->set_width(0.45); plteBar1->set_width(0.45);
plteBar1->set_shift(-0.25); plteBar1->set_shift(-0.25);
plotBarchart->get_plotter()->addGraph(plteBar1); plotBarchart->get_plotter()->addGraph(plteBar1);
JKQTPbarVerticalErrorGraph* plteBar2=new JKQTPbarVerticalErrorGraph(plotBarchart->get_plotter()); JKQTPbarVerticalErrorGraph* plteBar2=new JKQTPbarVerticalErrorGraph(plotBarchart->get_plotter());
plteBar2->set_xColumn(bcpxd); plteBar2->set_xColumn(bcpxd);
plteBar2->set_yColumn(bcpy2); plteBar2->set_yColumn(bcpy2);
plteBar2->set_yErrorColumn(bcpye2); plteBar2->set_yErrorColumn(bcpye2);
plteBar2->set_title(tr("bars 2")); plteBar2->set_title(tr("bars 2"));
plteBar2->set_width(0.45); plteBar2->set_width(0.45);
plteBar2->set_shift(0.25); plteBar2->set_shift(0.25);
plteBar2->set_baseline(0.5); plteBar2->set_baseline(0.5);
plteBar2->set_yErrorSymmetric(false); plteBar2->set_yErrorSymmetric(false);
plotBarchart->get_plotter()->addGraph(plteBar2); plotBarchart->get_plotter()->addGraph(plteBar2);
plteBar2->autoscaleBarWidthAndShift(); plteBar2->autoscaleBarWidthAndShift();
plotBarchart->set_doDrawing(true); plotBarchart->set_doDrawing(true);
plotBarchart->zoomToFit(); plotBarchart->zoomToFit();
plotBarchart2=new JKQtPlotter(false, this, plotBarchart->getDatastore()); plotBarchart2=new JKQtPlotter(false, this, plotBarchart->getDatastore());
plotBarchart2->set_doDrawing(false); plotBarchart2->set_doDrawing(false);
plotBarchart2->get_plotter()->set_plotLabel(tr("\\textbf{bar charts}")); plotBarchart2->get_plotter()->set_plotLabel(tr("\\textbf{bar charts}"));
plotBarchart2->setObjectName("plotBarchart2"); plotBarchart2->setObjectName("plotBarchart2");
plotBarchart2->get_plotter()->set_userSettigsFilename(QApplication::applicationDirPath()+"/usersettings.ini", "plot_peaks/"); plotBarchart2->get_plotter()->set_userSettigsFilename(QApplication::applicationDirPath()+"/usersettings.ini", "plot_peaks/");
barchartLayout->addWidget(plotBarchart2); barchartLayout->addWidget(plotBarchart2);
JKQTPbarHorizontalErrorGraph* plteBar3=new JKQTPbarHorizontalErrorGraph(plotBarchart2->get_plotter()); JKQTPbarHorizontalErrorGraph* plteBar3=new JKQTPbarHorizontalErrorGraph(plotBarchart2->get_plotter());
plteBar3->set_title(tr("bars 1")); plteBar3->set_title(tr("bars 1"));
plteBar3->set_yColumn(bcpx); plteBar3->set_yColumn(bcpx);
plteBar3->set_xColumn(bcpy1); plteBar3->set_xColumn(bcpy1);
plteBar3->set_xErrorColumn(bcpye1); plteBar3->set_xErrorColumn(bcpye1);
plteBar3->set_width(0.45); plteBar3->set_width(0.45);
plteBar3->set_shift(-0.25); plteBar3->set_shift(-0.25);
plotBarchart2->get_plotter()->addGraph(plteBar3); plotBarchart2->get_plotter()->addGraph(plteBar3);
JKQTPbarHorizontalErrorGraph* plteBar4=new JKQTPbarHorizontalErrorGraph(plotBarchart2->get_plotter()); JKQTPbarHorizontalErrorGraph* plteBar4=new JKQTPbarHorizontalErrorGraph(plotBarchart2->get_plotter());
plteBar4->set_yColumn(bcpx); plteBar4->set_yColumn(bcpx);
plteBar4->set_xColumn(bcpy2); plteBar4->set_xColumn(bcpy2);
plteBar4->set_xErrorColumn(bcpye2); plteBar4->set_xErrorColumn(bcpye2);
plteBar4->set_title(tr("bars 2")); plteBar4->set_title(tr("bars 2"));
plteBar4->set_width(0.45); plteBar4->set_width(0.45);
plteBar4->set_shift(0.25); plteBar4->set_shift(0.25);
plteBar4->set_xErrorSymmetric(false); plteBar4->set_xErrorSymmetric(false);
plotBarchart2->get_plotter()->addGraph(plteBar4); plotBarchart2->get_plotter()->addGraph(plteBar4);
plteBar4->autoscaleBarWidthAndShift(0.9, 1); plteBar4->autoscaleBarWidthAndShift(0.9, 1);
plotBarchart2->set_doDrawing(true); plotBarchart2->set_doDrawing(true);
plotBarchart2->zoomToFit(); plotBarchart2->zoomToFit();
chkBarLog=new QCheckBox(tr("log-log plots"), this); chkBarLog=new QCheckBox(tr("log-log plots"), this);
chkBarLog->setChecked(false); chkBarLog->setChecked(false);
barchartLayout->addWidget(chkBarLog); barchartLayout->addWidget(chkBarLog);
connect(chkBarLog, SIGNAL(toggled(bool)), this, SLOT(setBarchartLogLog(bool))); connect(chkBarLog, SIGNAL(toggled(bool)), this, SLOT(setBarchartLogLog(bool)));
spinBarLabelAngel=new QSpinBox(this); spinBarLabelAngel=new QSpinBox(this);
spinBarLabelAngel->setPrefix(tr("rotation angel: ")); spinBarLabelAngel->setPrefix(tr("rotation angel: "));
spinBarLabelAngel->setSuffix(QLatin1String("°")); spinBarLabelAngel->setSuffix(QLatin1String("°"));
spinBarLabelAngel->setRange(-180,180); spinBarLabelAngel->setRange(-180,180);
spinBarLabelAngel->setValue(0); spinBarLabelAngel->setValue(0);
spinBarLabelAngel->setSingleStep(15); spinBarLabelAngel->setSingleStep(15);
barchartLayout->addWidget(spinBarLabelAngel); barchartLayout->addWidget(spinBarLabelAngel);
connect(spinBarLabelAngel, SIGNAL(valueChanged(int)), this, SLOT(setBarchartAngele(int))); connect(spinBarLabelAngel, SIGNAL(valueChanged(int)), this, SLOT(setBarchartAngele(int)));
spinBarLabelAngel2=new QSpinBox(this); spinBarLabelAngel2=new QSpinBox(this);
spinBarLabelAngel2->setPrefix(tr("rotation angel: ")); spinBarLabelAngel2->setPrefix(tr("rotation angel: "));
spinBarLabelAngel2->setSuffix(QLatin1String("°")); spinBarLabelAngel2->setSuffix(QLatin1String("°"));
spinBarLabelAngel2->setRange(-180,180); spinBarLabelAngel2->setRange(-180,180);
spinBarLabelAngel2->setValue(0); spinBarLabelAngel2->setValue(0);
spinBarLabelAngel2->setSingleStep(15); spinBarLabelAngel2->setSingleStep(15);
barchartLayout->addWidget(spinBarLabelAngel2); barchartLayout->addWidget(spinBarLabelAngel2);
connect(spinBarLabelAngel2, SIGNAL(valueChanged(int)), this, SLOT(setBarchartAngele2(int))); connect(spinBarLabelAngel2, SIGNAL(valueChanged(int)), this, SLOT(setBarchartAngele2(int)));
} }
void TestWidgetBarcharts::setBarchartLogLog(bool checked) void TestWidgetBarcharts::setBarchartLogLog(bool checked)
{ {
plotBarchart->get_xAxis()->set_logAxis(checked); plotBarchart->get_xAxis()->set_logAxis(checked);
plotBarchart->get_yAxis()->set_logAxis(checked); plotBarchart->get_yAxis()->set_logAxis(checked);
plotBarchart->zoomToFit(); plotBarchart->zoomToFit();
plotBarchart2->get_xAxis()->set_logAxis(checked); plotBarchart2->get_xAxis()->set_logAxis(checked);
plotBarchart2->get_yAxis()->set_logAxis(checked); plotBarchart2->get_yAxis()->set_logAxis(checked);
plotBarchart2->zoomToFit(); plotBarchart2->zoomToFit();
} }
void TestWidgetBarcharts::setBarchartAngele(int angle) void TestWidgetBarcharts::setBarchartAngele(int angle)
{ {
plotBarchart->get_xAxis()->set_tickLabelAngle(angle); plotBarchart->get_xAxis()->set_tickLabelAngle(angle);
plotBarchart->get_xAxis()->set_drawMode2(JKQTPCADMcomplete); plotBarchart->get_xAxis()->set_drawMode2(JKQTPCADMcomplete);
} }
void TestWidgetBarcharts::setBarchartAngele2(int angle) void TestWidgetBarcharts::setBarchartAngele2(int angle)
{ {
plotBarchart->get_yAxis()->set_tickLabelAngle(angle); plotBarchart->get_yAxis()->set_tickLabelAngle(angle);
plotBarchart->get_yAxis()->set_drawMode2(JKQTPCADMcomplete); plotBarchart->get_yAxis()->set_drawMode2(JKQTPCADMcomplete);
} }

View File

@ -1,59 +1,59 @@
#ifndef TestWidgetBarcharts_H #ifndef TestWidgetBarcharts_H
#define TestWidgetBarcharts_H #define TestWidgetBarcharts_H
#include <QElapsedTimer> #include <QElapsedTimer>
#include <QCheckBox> #include <QCheckBox>
#include <QLineEdit> #include <QLineEdit>
#include <QTimer> #include <QTimer>
#include <QImage> #include <QImage>
#include <QVBoxLayout> #include <QVBoxLayout>
#include <QWidget> #include <QWidget>
#include <QTabWidget> #include <QTabWidget>
#include <QFormLayout> #include <QFormLayout>
#include <QCheckBox> #include <QCheckBox>
#include "jkqtplotter/jkqtplotter.h" #include "jkqtplotter/jkqtplotter.h"
#include "jkqtplotter/jkqtpgraphsgeometric.h" #include "jkqtplotter/jkqtpgraphsgeometric.h"
#include "jkqtplotter/jkqtpgraphsimage.h" #include "jkqtplotter/jkqtpgraphsimage.h"
#include "jkqtplotter/jkqtpelementsoverlay.h" #include "jkqtplotter/jkqtpelementsoverlay.h"
#include "jkqtplotter/jkqtpgraphsparsedfunction.h" #include "jkqtplotter/jkqtpgraphsparsedfunction.h"
#include "jkqtplotter/jkqtpbaseelements.h" #include "jkqtplotter/jkqtpbaseelements.h"
#include "jkqtplottergui/jkqtpgraphsmodel.h" #include "jkqtplottergui/jkqtpgraphsmodel.h"
#include "jkqtplottertools/jkqtptools.h" #include "jkqtplottertools/jkqtptools.h"
#define N1 200 #define N1 200
#define N2 50 #define N2 50
#define N3 8 #define N3 8
class TestWidgetBarcharts : public QWidget class TestWidgetBarcharts : public QWidget
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit TestWidgetBarcharts(QWidget *parent = 0); explicit TestWidgetBarcharts(QWidget *parent = 0);
signals: signals:
public slots: public slots:
void setBarchartLogLog(bool checked); void setBarchartLogLog(bool checked);
void setBarchartAngele(int angel); void setBarchartAngele(int angel);
void setBarchartAngele2(int angel); void setBarchartAngele2(int angel);
protected: protected:
JKQtPlotter* plotBarchart; JKQtPlotter* plotBarchart;
JKQtPlotter* plotBarchart2; JKQtPlotter* plotBarchart2;
QCheckBox* chkBarLog; QCheckBox* chkBarLog;
QSpinBox* spinBarLabelAngel; QSpinBox* spinBarLabelAngel;
QSpinBox* spinBarLabelAngel2; QSpinBox* spinBarLabelAngel2;
}; };
#endif // TestWidgetBarcharts_H #endif // TestWidgetBarcharts_H

View File

@ -1,120 +1,120 @@
#include "TestWidgetContourPlots.h" #include "TestWidgetContourPlots.h"
#include <QDebug> #include <QDebug>
#include <QDate> #include <QDate>
#include <QDateTime> #include <QDateTime>
#include <QApplication> #include <QApplication>
TestWidgetContourPlots::TestWidgetContourPlots(QWidget *parent) : TestWidgetContourPlots::TestWidgetContourPlots(QWidget *parent) :
QWidget(parent) QWidget(parent)
{ {
// contour plot // contour plot
QHBoxLayout* layoutContour=new QHBoxLayout(this); QHBoxLayout* layoutContour=new QHBoxLayout(this);
setLayout(layoutContour); setLayout(layoutContour);
JKQtPlotter* plotContour=new JKQtPlotter(true, this); JKQtPlotter* plotContour=new JKQtPlotter(true, this);
plotContour->set_doDrawing(false); plotContour->set_doDrawing(false);
plotContour->get_plotter()->set_plotLabel(tr("\\textbf{hist contour plot}")); plotContour->get_plotter()->set_plotLabel(tr("\\textbf{hist contour plot}"));
plotContour->setObjectName("contour"); plotContour->setObjectName("contour");
plotContour->get_plotter()->set_userSettigsFilename(QApplication::applicationDirPath()+"/usersettings.ini", "contour/"); plotContour->get_plotter()->set_userSettigsFilename(QApplication::applicationDirPath()+"/usersettings.ini", "contour/");
layoutContour->addWidget(plotContour); layoutContour->addWidget(plotContour);
JKQtPlotter* plotDensity=new JKQtPlotter(true, this); JKQtPlotter* plotDensity=new JKQtPlotter(true, this);
plotContour->set_doDrawing(false); plotContour->set_doDrawing(false);
plotContour->get_plotter()->set_plotLabel(tr("\\textbf{2D histogram plot with contours}")); plotContour->get_plotter()->set_plotLabel(tr("\\textbf{2D histogram plot with contours}"));
plotDensity->get_plotter()->set_plotLabel(tr("\\textbf{2D histogram}")); plotDensity->get_plotter()->set_plotLabel(tr("\\textbf{2D histogram}"));
plotContour->setObjectName("density"); plotContour->setObjectName("density");
plotContour->get_plotter()->set_userSettigsFilename(QApplication::applicationDirPath()+"/usersettings.ini", "density/"); plotContour->get_plotter()->set_userSettigsFilename(QApplication::applicationDirPath()+"/usersettings.ini", "density/");
layoutContour->addWidget(plotDensity); layoutContour->addWidget(plotDensity);
QVector<double> histAlex; QVector<double> histAlex;
uint histAlexNx,histAlexNy; uint histAlexNx,histAlexNy;
// choose the test data // choose the test data
histAlex.clear(); histAlex.clear();
histAlex.resize(5); histAlex.resize(5);
histAlex.append(15.0); histAlex.append(15.0);
histAlex.append(5); histAlex.append(5);
histAlex.append(0); histAlex.append(0);
histAlex.append(0); histAlex.append(0);
histAlex.append(5); histAlex.append(5);
histAlex.append(15); histAlex.append(15);
histAlex.append(6); histAlex.append(6);
histAlex.append(6); histAlex.append(6);
histAlex.resize(16); histAlex.resize(16);
histAlexNx=(uint)sqrt(histAlex.size()); histAlexNx=(uint)sqrt(histAlex.size());
histAlexNy=histAlexNx; histAlexNy=histAlexNx;
auto ds=plotDensity->get_plotter()->getDatastore(); auto ds=plotDensity->get_plotter()->getDatastore();
plotContour->get_plotter()->useExternalDatastore(ds); plotContour->get_plotter()->useExternalDatastore(ds);
// empty datastore and grid // empty datastore and grid
plotDensity->get_plotter()->clearGraphs(true); plotDensity->get_plotter()->clearGraphs(true);
ds->clear(); ds->clear();
plotDensity->setGrid(false); plotDensity->setGrid(false);
plotDensity->get_plotter()->get_xAxis()->set_axisLabel("X"); plotDensity->get_plotter()->get_xAxis()->set_axisLabel("X");
plotDensity->get_plotter()->get_yAxis()->set_axisLabel("Y"); plotDensity->get_plotter()->get_yAxis()->set_axisLabel("Y");
size_t colHist2D=ds->addCopiedImageAsColumn(histAlex.data(), histAlexNx, histAlexNy, tr("2Dhist")); size_t colHist2D=ds->addCopiedImageAsColumn(histAlex.data(), histAlexNx, histAlexNy, tr("2Dhist"));
// size_t colContour=plotContour->getDatastore()->addCopiedImageAsColumnTranspose(histAlex.data(), histAlexNx, histAlexNy, tr("2Dhist")); // size_t colContour=plotContour->getDatastore()->addCopiedImageAsColumnTranspose(histAlex.data(), histAlexNx, histAlexNy, tr("2Dhist"));
JKQTPColumnMathImage* densityplot=new JKQTPColumnMathImage(plotDensity->get_plotter()); JKQTPColumnMathImage* densityplot=new JKQTPColumnMathImage(plotDensity->get_plotter());
densityplot->set_x(-0.1); densityplot->set_x(-0.1);
densityplot->set_y(-0.1); densityplot->set_y(-0.1);
densityplot->set_width(1.1); densityplot->set_width(1.1);
densityplot->set_height(1.1); densityplot->set_height(1.1);
densityplot->set_Nx(histAlexNx); densityplot->set_Nx(histAlexNx);
densityplot->set_Ny(histAlexNy); densityplot->set_Ny(histAlexNy);
densityplot->set_palette(JKQTPMathImageINVERTED_OCEAN); densityplot->set_palette(JKQTPMathImageINVERTED_OCEAN);
densityplot->set_imageColumn(colHist2D); densityplot->set_imageColumn(colHist2D);
densityplot->set_infColor(Qt::transparent); densityplot->set_infColor(Qt::transparent);
densityplot->set_nanColor(Qt::transparent); densityplot->set_nanColor(Qt::transparent);
densityplot->set_title("density plot"); densityplot->set_title("density plot");
plotDensity->addGraph(densityplot); plotDensity->addGraph(densityplot);
densityplot=new JKQTPColumnMathImage(plotContour->get_plotter()); densityplot=new JKQTPColumnMathImage(plotContour->get_plotter());
densityplot->set_x(-0.1); densityplot->set_x(-0.1);
densityplot->set_y(-0.1); densityplot->set_y(-0.1);
densityplot->set_width(1.1); densityplot->set_width(1.1);
densityplot->set_height(1.1); densityplot->set_height(1.1);
densityplot->set_Nx(histAlexNx); densityplot->set_Nx(histAlexNx);
densityplot->set_Ny(histAlexNy); densityplot->set_Ny(histAlexNy);
densityplot->set_palette(JKQTPMathImageINVERTED_OCEAN); densityplot->set_palette(JKQTPMathImageINVERTED_OCEAN);
densityplot->set_imageColumn(colHist2D); densityplot->set_imageColumn(colHist2D);
densityplot->set_title("density plot"); densityplot->set_title("density plot");
plotContour->addGraph(densityplot); plotContour->addGraph(densityplot);
plotContour->setGrid(false); plotContour->setGrid(false);
plotDensity->zoom(-0.1,1.1,-0.1,1.1); plotDensity->zoom(-0.1,1.1,-0.1,1.1);
QList<double> levels; QList<double> levels;
// levels<<5<<10<<25; // levels<<5.1<<10.1; // levels<<5<<10<<25; // levels<<5.1<<10.1;
levels<<4<<5<<9<<14; levels<<4<<5<<9<<14;
JKQTPContour* cp=new JKQTPContour(plotContour->get_plotter()); JKQTPContour* cp=new JKQTPContour(plotContour->get_plotter());
cp->set_x(-0.1); cp->set_x(-0.1);
cp->set_y(-0.1); cp->set_y(-0.1);
cp->set_width(1.1); cp->set_width(1.1);
cp->set_height(1.1); cp->set_height(1.1);
cp->set_Nx(histAlexNx); cp->set_Nx(histAlexNx);
cp->set_Ny(histAlexNy); cp->set_Ny(histAlexNy);
cp->set_imageColumn(colHist2D); cp->set_imageColumn(colHist2D);
// cp->set_palette(JKQTPMathImageINVERTED_OCEAN); // cp->set_palette(JKQTPMathImageINVERTED_OCEAN);
cp->set_contourLevels(levels); cp->set_contourLevels(levels);
cp->set_title("contour plot"); cp->set_title("contour plot");
plotContour->addGraph(cp); plotContour->addGraph(cp);
plotContour->zoom(-0.1,1.1,-0.1,1.1); plotContour->zoom(-0.1,1.1,-0.1,1.1);
plotContour->set_doDrawing(true); plotContour->set_doDrawing(true);
plotContour->update_plot(); plotContour->update_plot();
} }

View File

@ -1,47 +1,47 @@
#ifndef TestWidgetContourPlots_H #ifndef TestWidgetContourPlots_H
#define TestWidgetContourPlots_H #define TestWidgetContourPlots_H
#include <QElapsedTimer> #include <QElapsedTimer>
#include <QCheckBox> #include <QCheckBox>
#include <QLineEdit> #include <QLineEdit>
#include <QTimer> #include <QTimer>
#include <QImage> #include <QImage>
#include <QVBoxLayout> #include <QVBoxLayout>
#include <QWidget> #include <QWidget>
#include <QTabWidget> #include <QTabWidget>
#include <QFormLayout> #include <QFormLayout>
#include <QCheckBox> #include <QCheckBox>
#include "jkqtplotter/jkqtplotter.h" #include "jkqtplotter/jkqtplotter.h"
#include "jkqtplotter/jkqtpgraphsgeometric.h" #include "jkqtplotter/jkqtpgraphsgeometric.h"
#include "jkqtplotter/jkqtpgraphsimage.h" #include "jkqtplotter/jkqtpgraphsimage.h"
#include "jkqtplotter/jkqtpelementsoverlay.h" #include "jkqtplotter/jkqtpelementsoverlay.h"
#include "jkqtplotter/jkqtpgraphsparsedfunction.h" #include "jkqtplotter/jkqtpgraphsparsedfunction.h"
#include "jkqtplotter/jkqtpbaseelements.h" #include "jkqtplotter/jkqtpbaseelements.h"
#include "jkqtplottergui/jkqtpgraphsmodel.h" #include "jkqtplottergui/jkqtpgraphsmodel.h"
#include "jkqtplottertools/jkqtptools.h" #include "jkqtplottertools/jkqtptools.h"
#define N1 200 #define N1 200
#define N2 50 #define N2 50
#define N3 8 #define N3 8
class TestWidgetContourPlots : public QWidget class TestWidgetContourPlots : public QWidget
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit TestWidgetContourPlots(QWidget *parent = 0); explicit TestWidgetContourPlots(QWidget *parent = 0);
signals: signals:
public slots: public slots:
protected: protected:
}; };
#endif // TestWidgetContourPlots_H #endif // TestWidgetContourPlots_H

View File

@ -1,33 +1,33 @@
#include "TestWidgetEmptyPlot.h" #include "TestWidgetEmptyPlot.h"
#include <QDebug> #include <QDebug>
#include <QDate> #include <QDate>
#include <QDateTime> #include <QDateTime>
#include <QApplication> #include <QApplication>
TestWidgetEmptyPlot::TestWidgetEmptyPlot(QWidget *parent) : TestWidgetEmptyPlot::TestWidgetEmptyPlot(QWidget *parent) :
QWidget(parent) QWidget(parent)
{ {
#define NEMPTY 500 #define NEMPTY 500
JKQtPlotter* plotEmpty=new JKQtPlotter(true, this); JKQtPlotter* plotEmpty=new JKQtPlotter(true, this);
JKQTPxyLineGraph* efunc=new JKQTPxyLineGraph(plotEmpty->get_plotter()); JKQTPxyLineGraph* efunc=new JKQTPxyLineGraph(plotEmpty->get_plotter());
double xef[NEMPTY], efy[NEMPTY]; double xef[NEMPTY], efy[NEMPTY];
for (int i=0; i<NEMPTY; i++) { for (int i=0; i<NEMPTY; i++) {
xef[i]=i; xef[i]=i;
efy[i]=double(i%5)*1e-308; efy[i]=double(i%5)*1e-308;
} }
efunc->set_xColumn(plotEmpty->getDatastore()->addCopiedColumn(xef, NEMPTY, "x")); efunc->set_xColumn(plotEmpty->getDatastore()->addCopiedColumn(xef, NEMPTY, "x"));
efunc->set_yColumn(plotEmpty->getDatastore()->addCopiedColumn(efy, NEMPTY, "y")); efunc->set_yColumn(plotEmpty->getDatastore()->addCopiedColumn(efy, NEMPTY, "y"));
plotEmpty->addGraph(efunc); plotEmpty->addGraph(efunc);
plotEmpty->get_yAxis()->set_logAxis(true); plotEmpty->get_yAxis()->set_logAxis(true);
plotEmpty->zoomToFit(); plotEmpty->zoomToFit();
plotEmpty->setY(0,0); plotEmpty->setY(0,0);
} }

View File

@ -1,46 +1,46 @@
#ifndef TestWidgetEmptyPlot_H #ifndef TestWidgetEmptyPlot_H
#define TestWidgetEmptyPlot_H #define TestWidgetEmptyPlot_H
#include <QElapsedTimer> #include <QElapsedTimer>
#include <QCheckBox> #include <QCheckBox>
#include <QLineEdit> #include <QLineEdit>
#include <QTimer> #include <QTimer>
#include <QImage> #include <QImage>
#include <QVBoxLayout> #include <QVBoxLayout>
#include <QWidget> #include <QWidget>
#include <QTabWidget> #include <QTabWidget>
#include <QFormLayout> #include <QFormLayout>
#include <QCheckBox> #include <QCheckBox>
#include "jkqtplotter/jkqtplotter.h" #include "jkqtplotter/jkqtplotter.h"
#include "jkqtplotter/jkqtpgraphsgeometric.h" #include "jkqtplotter/jkqtpgraphsgeometric.h"
#include "jkqtplotter/jkqtpgraphsimage.h" #include "jkqtplotter/jkqtpgraphsimage.h"
#include "jkqtplotter/jkqtpelementsoverlay.h" #include "jkqtplotter/jkqtpelementsoverlay.h"
#include "jkqtplotter/jkqtpgraphsparsedfunction.h" #include "jkqtplotter/jkqtpgraphsparsedfunction.h"
#include "jkqtplotter/jkqtpbaseelements.h" #include "jkqtplotter/jkqtpbaseelements.h"
#include "jkqtplottergui/jkqtpgraphsmodel.h" #include "jkqtplottergui/jkqtpgraphsmodel.h"
#include "jkqtplottertools/jkqtptools.h" #include "jkqtplottertools/jkqtptools.h"
#define N1 200 #define N1 200
#define N2 50 #define N2 50
#define N3 8 #define N3 8
class TestWidgetEmptyPlot : public QWidget class TestWidgetEmptyPlot : public QWidget
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit TestWidgetEmptyPlot(QWidget *parent = 0); explicit TestWidgetEmptyPlot(QWidget *parent = 0);
signals: signals:
public slots: public slots:
protected: protected:
}; };
#endif // TestWidgetEmptyPlot_H #endif // TestWidgetEmptyPlot_H

View File

@ -1,116 +1,116 @@
#include "TestWidgetFunctionPlots.h" #include "TestWidgetFunctionPlots.h"
#include <QDebug> #include <QDebug>
#include <QDate> #include <QDate>
#include <QDateTime> #include <QDateTime>
#include <QApplication> #include <QApplication>
TestWidgetFunctionPlots::TestWidgetFunctionPlots(QWidget *parent) : TestWidgetFunctionPlots::TestWidgetFunctionPlots(QWidget *parent) :
QWidget(parent) QWidget(parent)
{ {
QVBoxLayout* plotFuncLayout=new QVBoxLayout(this); QVBoxLayout* plotFuncLayout=new QVBoxLayout(this);
setLayout(plotFuncLayout); setLayout(plotFuncLayout);
plotFuncPlt=new JKQtPlotter(true, this); plotFuncPlt=new JKQtPlotter(true, this);
plotFuncLayout->addWidget(plotFuncPlt); plotFuncLayout->addWidget(plotFuncPlt);
pfunc=new JKQTPxParsedFunctionLineGraph(plotFuncPlt->get_plotter()); pfunc=new JKQTPxParsedFunctionLineGraph(plotFuncPlt->get_plotter());
pfunc->set_function("x^2/10+sin(x*pi*10)"); pfunc->set_function("x^2/10+sin(x*pi*10)");
pfunc->set_errorFunction("x^2/20"); pfunc->set_errorFunction("x^2/20");
pfunc->set_drawErrorPolygons(true); pfunc->set_drawErrorPolygons(true);
pfunc->set_style(Qt::DashLine); pfunc->set_style(Qt::DashLine);
plotFuncPlt->addGraph(pfunc); plotFuncPlt->addGraph(pfunc);
plotFuncPlt->update_plot(); plotFuncPlt->update_plot();
pfuncErrorStyle=new JKQTPerrorPlotstyleComboBox(this); pfuncErrorStyle=new JKQTPerrorPlotstyleComboBox(this);
pfuncErrorStyle->setCurrentIndex(3); pfuncErrorStyle->setCurrentIndex(3);
plotFuncLayout->addWidget(pfuncErrorStyle); plotFuncLayout->addWidget(pfuncErrorStyle);
connect(pfuncErrorStyle, SIGNAL(currentIndexChanged(int)), this, SLOT(setPFuncStyle())); connect(pfuncErrorStyle, SIGNAL(currentIndexChanged(int)), this, SLOT(setPFuncStyle()));
chkPFuncDrawSamples=new QCheckBox(tr("display samples"), this); chkPFuncDrawSamples=new QCheckBox(tr("display samples"), this);
plotFuncLayout->addWidget(chkPFuncDrawSamples); plotFuncLayout->addWidget(chkPFuncDrawSamples);
connect(chkPFuncDrawSamples, SIGNAL(toggled(bool)), this, SLOT(setPFuncStyle())); connect(chkPFuncDrawSamples, SIGNAL(toggled(bool)), this, SLOT(setPFuncStyle()));
chkPFuncDrawLine=new QCheckBox(tr("draw line"), this); chkPFuncDrawLine=new QCheckBox(tr("draw line"), this);
chkPFuncDrawLine->setChecked(true); chkPFuncDrawLine->setChecked(true);
plotFuncLayout->addWidget(chkPFuncDrawLine); plotFuncLayout->addWidget(chkPFuncDrawLine);
connect(chkPFuncDrawLine, SIGNAL(toggled(bool)), this, SLOT(setPFuncStyle())); connect(chkPFuncDrawLine, SIGNAL(toggled(bool)), this, SLOT(setPFuncStyle()));
QSpinBox* spinPFunc=new QSpinBox(this); QSpinBox* spinPFunc=new QSpinBox(this);
spinPFunc->setValue(pfunc->get_minSamples()); spinPFunc->setValue(pfunc->get_minSamples());
plotFuncLayout->addWidget(new QLabel(tr("min samples:"), this)); plotFuncLayout->addWidget(new QLabel(tr("min samples:"), this));
plotFuncLayout->addWidget(spinPFunc); plotFuncLayout->addWidget(spinPFunc);
connect(spinPFunc, SIGNAL(valueChanged(int)), this, SLOT(setPFuncMinPoint(int))); connect(spinPFunc, SIGNAL(valueChanged(int)), this, SLOT(setPFuncMinPoint(int)));
spinPFunc=new QSpinBox(this); spinPFunc=new QSpinBox(this);
spinPFunc->setValue(pfunc->get_maxRefinementDegree()); spinPFunc->setValue(pfunc->get_maxRefinementDegree());
plotFuncLayout->addWidget(new QLabel(tr("max refinement degree:"), this)); plotFuncLayout->addWidget(new QLabel(tr("max refinement degree:"), this));
plotFuncLayout->addWidget(spinPFunc); plotFuncLayout->addWidget(spinPFunc);
connect(spinPFunc, SIGNAL(valueChanged(int)), this, SLOT(setPFuncMaxRefine(int))); connect(spinPFunc, SIGNAL(valueChanged(int)), this, SLOT(setPFuncMaxRefine(int)));
QComboBox* edtPFunc=new QComboBox(this); QComboBox* edtPFunc=new QComboBox(this);
edtPFunc->addItem(pfunc->get_function()); edtPFunc->addItem(pfunc->get_function());
edtPFunc->addItem("x"); edtPFunc->addItem("x");
edtPFunc->addItem("x^2"); edtPFunc->addItem("x^2");
edtPFunc->addItem("x^2-x^3"); edtPFunc->addItem("x^2-x^3");
edtPFunc->addItem("sin(x)"); edtPFunc->addItem("sin(x)");
edtPFunc->setCurrentIndex(0); edtPFunc->setCurrentIndex(0);
plotFuncLayout->addWidget(new QLabel(tr("function:"), this)); plotFuncLayout->addWidget(new QLabel(tr("function:"), this));
plotFuncLayout->addWidget(edtPFunc); plotFuncLayout->addWidget(edtPFunc);
connect(edtPFunc, SIGNAL(currentIndexChanged(QString)), this, SLOT(setPFunc(QString))); connect(edtPFunc, SIGNAL(currentIndexChanged(QString)), this, SLOT(setPFunc(QString)));
edtPFunc=new QComboBox(this); edtPFunc=new QComboBox(this);
edtPFunc->addItem(pfunc->get_errorFunction()); edtPFunc->addItem(pfunc->get_errorFunction());
edtPFunc->addItem(""); edtPFunc->addItem("");
edtPFunc->addItem("x"); edtPFunc->addItem("x");
edtPFunc->addItem("cos(x)"); edtPFunc->addItem("cos(x)");
edtPFunc->addItem("1"); edtPFunc->addItem("1");
edtPFunc->setCurrentIndex(0); edtPFunc->setCurrentIndex(0);
plotFuncLayout->addWidget(new QLabel(tr("error function:"), this)); plotFuncLayout->addWidget(new QLabel(tr("error function:"), this));
plotFuncLayout->addWidget(edtPFunc); plotFuncLayout->addWidget(edtPFunc);
connect(edtPFunc, SIGNAL(currentIndexChanged(QString)), this, SLOT(setPFuncE(QString))); connect(edtPFunc, SIGNAL(currentIndexChanged(QString)), this, SLOT(setPFuncE(QString)));
QCheckBox* chkFLogX=new QCheckBox(tr("x-axis: log-scale")); QCheckBox* chkFLogX=new QCheckBox(tr("x-axis: log-scale"));
chkFLogX->setChecked(false); chkFLogX->setChecked(false);
connect(chkFLogX, SIGNAL(toggled(bool)), plotFuncPlt->get_xAxis(), SLOT(set_logAxis(bool))); connect(chkFLogX, SIGNAL(toggled(bool)), plotFuncPlt->get_xAxis(), SLOT(set_logAxis(bool)));
plotFuncLayout->addWidget(chkFLogX); plotFuncLayout->addWidget(chkFLogX);
QCheckBox* chkFLogY=new QCheckBox(tr("y-axis: log-scale")); QCheckBox* chkFLogY=new QCheckBox(tr("y-axis: log-scale"));
chkFLogY->setChecked(false); chkFLogY->setChecked(false);
connect(chkFLogY, SIGNAL(toggled(bool)), plotFuncPlt->get_yAxis(), SLOT(set_logAxis(bool))); connect(chkFLogY, SIGNAL(toggled(bool)), plotFuncPlt->get_yAxis(), SLOT(set_logAxis(bool)));
plotFuncLayout->addWidget(chkFLogY); plotFuncLayout->addWidget(chkFLogY);
} }
void TestWidgetFunctionPlots::setPFuncStyle() void TestWidgetFunctionPlots::setPFuncStyle()
{ {
pfunc->set_drawErrorLines(false); pfunc->set_drawErrorLines(false);
pfunc->set_drawErrorPolygons(false); pfunc->set_drawErrorPolygons(false);
if (pfuncErrorStyle->getErrorStyle()==JKQTPerrorLines) pfunc->set_drawErrorLines(true); if (pfuncErrorStyle->getErrorStyle()==JKQTPerrorLines) pfunc->set_drawErrorLines(true);
if (pfuncErrorStyle->getErrorStyle()==JKQTPerrorPolygons) pfunc->set_drawErrorPolygons(true); if (pfuncErrorStyle->getErrorStyle()==JKQTPerrorPolygons) pfunc->set_drawErrorPolygons(true);
pfunc->set_drawLine(chkPFuncDrawLine->isChecked()); pfunc->set_drawLine(chkPFuncDrawLine->isChecked());
pfunc->set_displaySamplePoints(chkPFuncDrawSamples->isChecked()); pfunc->set_displaySamplePoints(chkPFuncDrawSamples->isChecked());
plotFuncPlt->update_plot(); plotFuncPlt->update_plot();
} }
void TestWidgetFunctionPlots::setPFuncMinPoint(int value) void TestWidgetFunctionPlots::setPFuncMinPoint(int value)
{ {
pfunc->set_minSamples(value); pfunc->set_minSamples(value);
plotFuncPlt->update_plot(); plotFuncPlt->update_plot();
} }
void TestWidgetFunctionPlots::setPFuncMaxRefine(int value) void TestWidgetFunctionPlots::setPFuncMaxRefine(int value)
{ {
pfunc->set_maxRefinementDegree(value); pfunc->set_maxRefinementDegree(value);
plotFuncPlt->update_plot(); plotFuncPlt->update_plot();
} }
void TestWidgetFunctionPlots::setPFunc(const QString &expression) void TestWidgetFunctionPlots::setPFunc(const QString &expression)
{ {
pfunc->set_function(expression); pfunc->set_function(expression);
plotFuncPlt->update_plot(); plotFuncPlt->update_plot();
} }
void TestWidgetFunctionPlots::setPFuncE(const QString &expression) void TestWidgetFunctionPlots::setPFuncE(const QString &expression)
{ {
pfunc->set_errorFunction(expression); pfunc->set_errorFunction(expression);
plotFuncPlt->update_plot(); plotFuncPlt->update_plot();
} }

View File

@ -1,59 +1,59 @@
#ifndef TestWidgetFunctionPlots_H #ifndef TestWidgetFunctionPlots_H
#define TestWidgetFunctionPlots_H #define TestWidgetFunctionPlots_H
#include <QElapsedTimer> #include <QElapsedTimer>
#include <QCheckBox> #include <QCheckBox>
#include <QLineEdit> #include <QLineEdit>
#include <QTimer> #include <QTimer>
#include <QImage> #include <QImage>
#include <QVBoxLayout> #include <QVBoxLayout>
#include <QWidget> #include <QWidget>
#include <QTabWidget> #include <QTabWidget>
#include <QFormLayout> #include <QFormLayout>
#include <QCheckBox> #include <QCheckBox>
#include "jkqtplotter/jkqtplotter.h" #include "jkqtplotter/jkqtplotter.h"
#include "jkqtplotter/jkqtpgraphsgeometric.h" #include "jkqtplotter/jkqtpgraphsgeometric.h"
#include "jkqtplotter/jkqtpgraphsimage.h" #include "jkqtplotter/jkqtpgraphsimage.h"
#include "jkqtplotter/jkqtpelementsoverlay.h" #include "jkqtplotter/jkqtpelementsoverlay.h"
#include "jkqtplotter/jkqtpgraphsparsedfunction.h" #include "jkqtplotter/jkqtpgraphsparsedfunction.h"
#include "jkqtplotter/jkqtpbaseelements.h" #include "jkqtplotter/jkqtpbaseelements.h"
#include "jkqtplottergui/jkqtpgraphsmodel.h" #include "jkqtplottergui/jkqtpgraphsmodel.h"
#include "jkqtplottergui/jkqtpcomboboxes.h" #include "jkqtplottergui/jkqtpcomboboxes.h"
#include "jkqtplottertools/jkqtptools.h" #include "jkqtplottertools/jkqtptools.h"
#define N1 200 #define N1 200
#define N2 50 #define N2 50
#define N3 8 #define N3 8
class TestWidgetFunctionPlots : public QWidget class TestWidgetFunctionPlots : public QWidget
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit TestWidgetFunctionPlots(QWidget *parent = 0); explicit TestWidgetFunctionPlots(QWidget *parent = 0);
signals: signals:
public slots: public slots:
void setPFuncStyle(); void setPFuncStyle();
void setPFuncMinPoint(int value); void setPFuncMinPoint(int value);
void setPFuncMaxRefine(int value); void setPFuncMaxRefine(int value);
void setPFunc(const QString& expression); void setPFunc(const QString& expression);
void setPFuncE(const QString& expression); void setPFuncE(const QString& expression);
protected: protected:
JKQTPxParsedFunctionLineGraph* pfunc; JKQTPxParsedFunctionLineGraph* pfunc;
JKQtPlotter* plotFuncPlt; JKQtPlotter* plotFuncPlt;
JKQTPerrorPlotstyleComboBox* pfuncErrorStyle; JKQTPerrorPlotstyleComboBox* pfuncErrorStyle;
QCheckBox* chkPFuncDrawSamples; QCheckBox* chkPFuncDrawSamples;
QCheckBox* chkPFuncDrawLine; QCheckBox* chkPFuncDrawLine;
}; };
#endif // TestWidgetFunctionPlots_H #endif // TestWidgetFunctionPlots_H

Some files were not shown because too many files have changed in this diff Show More