#include "ui_exportgraphtoimagedialog.h"
#include <QtCore/QLocale>
#include <QtWidgets/QFileDialog>
+#include <QDoubleValidator>
+#include <QIntValidator>
#include <tuple>
/* Public functions */
ui->qle_dpi->setText(m_locale.toString(params.dpi));
ui->qcbox_outputFormat->setCurrentIndex(params.formatIdx);
ui->qck_includeInteg->setChecked(params.includePeaks);
+
+ ui->qle_width->setLocale(m_locale);
+ ui->qle_height->setLocale(m_locale);
+ ui->qle_dpi->setLocale(m_locale);
+ ui->qle_fromX->setLocale(m_locale);
+ ui->qle_fromY->setLocale(m_locale);
+ ui->qle_toX->setLocale(m_locale);
+ ui->qle_toY->setLocale(m_locale);
+
+ m_intValidator = new QIntValidator(this);
+ if (m_intValidator != nullptr) {
+ m_intValidator->setLocale(m_locale);
+ m_intValidator->setRange(0, INT_MAX);
+
+ ui->qle_width->setValidator(m_intValidator);
+ ui->qle_height->setValidator(m_intValidator);
+ ui->qle_dpi->setValidator(m_intValidator);
+ } else
+ Logger::log(Logger::Level::WARNING, ME_SENDER_STR, __QFUNC__ + " unable to create IntValidator. Input fields will not be restricted.");
+
+ m_dblValidator = new QDoubleValidator(this);
+ if (m_dblValidator != nullptr) {
+ m_dblValidator->setLocale(m_locale);
+ m_dblValidator->setRange(-__DBL_MAX__, __DBL_MAX__);
+ m_dblValidator->setDecimals(1000);
+
+ ui->qle_fromX->setValidator(m_dblValidator);
+ ui->qle_fromY->setValidator(m_dblValidator);
+ ui->qle_toX->setValidator(m_dblValidator);
+ ui->qle_toY->setValidator(m_dblValidator);
+ } else
+ Logger::log(Logger::Level::WARNING, ME_SENDER_STR, __QFUNC__ + " unable to create DoubleValidator. Chart range fields will not be restricted.");
}
void ExportGraphToImageDialog::addSignal(const double fromX, const double fromY, const double toX, const double toY, const std::string& key)
#include <QtWidgets/QDialog>
#include <QLocale>
+class QDoubleValidator;
+class QIntValidator;
+
namespace Ui {
class ExportGraphToImageDialog;
}
std::vector<std::string> m_signalKeys;
QString m_lastUsedPath;
Parameters m_lastUsedParameters;
+ QDoubleValidator* m_dblValidator;
+ QIntValidator* m_intValidator;
Ui::ExportGraphToImageDialog *ui;
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="qle_width">
+ <property name="inputMethodHints">
+ <set>Qt::ImhDigitsOnly</set>
+ </property>
<property name="text">
<string>1000</string>
</property>
</item>
<item row="0" column="3">
<widget class="QLineEdit" name="qle_height">
+ <property name="inputMethodHints">
+ <set>Qt::ImhDigitsOnly</set>
+ </property>
<property name="text">
<string>1000</string>
</property>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="qle_dpi">
+ <property name="inputMethodHints">
+ <set>Qt::ImhDigitsOnly</set>
+ </property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="3">
<widget class="QLineEdit" name="qle_toX">
+ <property name="inputMethodHints">
+ <set>Qt::ImhFormattedNumbersOnly</set>
+ </property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="qle_fromX">
+ <property name="inputMethodHints">
+ <set>Qt::ImhFormattedNumbersOnly</set>
+ </property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="qle_fromY">
+ <property name="inputMethodHints">
+ <set>Qt::ImhFormattedNumbersOnly</set>
+ </property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</item>
<item row="1" column="3">
<widget class="QLineEdit" name="qle_toY">
+ <property name="inputMethodHints">
+ <set>Qt::ImhFormattedNumbersOnly</set>
+ </property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>