JKQTPlotter trunk/v5.0.0
an extensive Qt5+Qt6 Plotter framework (including a feature-richt plotter widget, a speed-optimized, but limited variant and a LaTeX equation renderer!), written fully in C/C++ and without external dependencies
Loading...
Searching...
No Matches
jkqttools.h
1/*
2 Copyright (c) 2008-2024 Jan W. Krieger (<jan@jkrieger.de>)
3
4 last modification: $LastChangedDate$ (revision $Rev$)
5
6 This software is free software: you can redistribute it and/or modify
7 it under the terms of the GNU Lesser General Public License (LGPL) as published by
8 the Free Software Foundation, either version 2.1 of the License, or
9 (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU Lesser General Public License (LGPL) for more details.
15
16 You should have received a copy of the GNU Lesser General Public License (LGPL)
17 along with this program. If not, see <http://www.gnu.org/licenses/>.
18*/
19
20
21
22
23
24#ifndef JKQTTOOLS_H
25#define JKQTTOOLS_H
26
27#include "jkqtcommon/jkqtcommon_imexport.h"
28#include <QSettings>
29#include <QWidget>
30#include <QSplitter>
31
32/*! \brief store the geometry of a given widget to a QSettings
33 \ingroup jkqtpjkqtptools_qt
34
35 This method stores the widget size and position.
36
37 \param settings the QSettings object to write to
38 \param widget the widget to store
39 \param prefix this prefix is prepended to the QSettings keys
40*/
41JKQTCOMMON_LIB_EXPORT void jksaveWidgetGeometry(QSettings& settings, QWidget* widget, const QString& prefix=QString(""));
42
43/*! \brief load the geometry of a given widget to a QSettings
44 \ingroup jkqtpjkqtptools_qt
45
46 This method loads the widget size and position.
47
48 \param settings the QSettings object to write to
49 \param[out] widget the widget to change
50 \param prefix this prefix is prepended to the QSettings keys
51*/
52JKQTCOMMON_LIB_EXPORT void jkloadWidgetGeometry(QSettings& settings, QWidget* widget, const QString& prefix=QString(""));
53
54
55/*! \brief load the geometry of a given widget to a QSettings
56 \ingroup jkqtpjkqtptools_qt
57
58 This method loads the widget size and position.
59
60 \param settings the QSettings object to write to
61 \param[out] widget the widget to change
62 \param defaultPosition default position of the widget
63 \param defaultSize default size of the widget
64 \param prefix this prefix is prepended to the QSettings keys
65*/
66JKQTCOMMON_LIB_EXPORT void jkloadWidgetGeometry(QSettings& settings, QWidget* widget, QPoint defaultPosition, QSize defaultSize, const QString& prefix=QString(""));
67
68/*! \brief store the geometry of a given widget to a QSettings
69 \ingroup jkqtpjkqtptools_qt
70
71 This method stores the widget size and position.
72
73 \param settings the QSettings object to write to
74 \param widget the widget to store
75 \param prefix this prefix is prepended to the QSettings keys
76*/
77JKQTCOMMON_LIB_EXPORT void jksaveSplitter(QSettings& settings, QSplitter* splitter, const QString& prefix=QString(""));
78
79/*! \brief load the geometry of a given widget to a QSettings
80 \ingroup jkqtpjkqtptools_qt
81
82 This method loads the widget size and position.
83
84 \param settings the QSettings object to write to
85 \param[out] plitter the plitter to change
86 \param prefix this prefix is prepended to the QSettings keys
87*/
88JKQTCOMMON_LIB_EXPORT void jkloadSplitter(QSettings& settings, QSplitter* splitter, const QString& prefix=QString(""));
89
90
91/** \brief convert a <a href="http://doc.qt.io/qt-5/qstring.html">QString</a> (created by jkqtp_MouseButton2String() ) to <a href="http://doc.qt.io/qt-5/qt.html#MouseButton-enum">Qt::MouseButton</a>
92 * \ingroup jkqtptools_general
93 *
94 * \see jkqtp_MouseButton2String()
95 */
96JKQTCOMMON_LIB_EXPORT quint16 jkqtp_checksum(const void* data, size_t len);
97
98/** \brief Checks whether a given iterator is an input iterator (std::input_iterator_tag)
99 * \ingroup jkqtptools_general
100 *
101 **/
102template <typename Iterator>
103using JKQTPIsInputIteratorTrait = typename std::enable_if<std::is_convertible<typename std::iterator_traits<Iterator>::iterator_category, std::input_iterator_tag>::value, bool>::type;
104
105
106#endif // JKQTTOOLS_H
typename std::enable_if< std::is_convertible< typename std::iterator_traits< Iterator >::iterator_category, std::input_iterator_tag >::value, bool >::type JKQTPIsInputIteratorTrait
Checks whether a given iterator is an input iterator (std::input_iterator_tag)
Definition jkqttools.h:103
JKQTCOMMON_LIB_EXPORT quint16 jkqtp_checksum(const void *data, size_t len)
convert a QString (created by jkqtp_MouseButton2String() ) to Qt::MouseButton
#define JKQTCOMMON_LIB_EXPORT
Definition jkqtcommon_imexport.h:87