chore : Add message box for advise use hpdi round factor is unsafe

Add a message box to advise user that use a hdpi round factor can cause
strange render according to :
1 - the selected value
2 - the dpi of the screen
3 - Edit the project on another computer and/or screen who don't have
the same parameters as point 1 and 2.
This commit is contained in:
joshua
2025-11-14 21:23:29 +01:00
parent 3803834d6d
commit 4e695de914
3 changed files with 48 additions and 5 deletions

View File

@@ -21,6 +21,7 @@
#include "../../qeticons.h"
#include "ui_generalconfigurationpage.h"
#include "../../utils/qetsettings.h"
#include "../../qetmessagebox.h"
#include <QFileDialog>
#include <QFontDialog>
@@ -560,3 +561,29 @@ void GeneralConfigurationPage::on_ElementEditor_Grid_PointSize_min_sb_valueChang
{
ui->ElementEditor_Grid_PointSize_max_sb->setMinimum(std::max(1, value));
}
void GeneralConfigurationPage::on_m_hdpi_round_cb_clicked(bool checked)
{
if (checked) {
if (QMessageBox::Cancel == QET::QetMessageBox::warning(
this,
tr("Fonctionnalité expérimental"),
tr("AVERTISSEMENT :\n"
"Toutes valeurs autre que Pas darrondi peut causer des erreurs de rendu "
"du projet en fonction de :\n\n"
"1 - la valeur sélectionnée \n"
"2 - du dpi de l'écran \n"
"3 - Modifier le projet sur un autre ordinateur et/ou écran n'ayant pas les mêmes paramètres des points 1 et 2."),
QMessageBox::StandardButton::Cancel|QMessageBox::StandardButton::Ok,
QMessageBox::StandardButton::Cancel
)) {
ui->m_hdpi_round_cb->blockSignals(true);
ui->m_hdpi_round_cb->setChecked(false);
ui->m_hdpi_round_cb->blockSignals(false);
return;
}
}
ui->m_hdpi_round_label->setEnabled(checked);
ui->m_hdpi_round_policy_cb->setEnabled(checked);
}

View File

@@ -51,6 +51,8 @@ class GeneralConfigurationPage : public ConfigPage
void on_DiagramEditor_Grid_PointSize_min_sb_valueChanged(int value);
void on_ElementEditor_Grid_PointSize_min_sb_valueChanged(int value);
void on_m_hdpi_round_cb_clicked(bool checked);
private:
void fillLang();

View File

@@ -6,7 +6,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>935</width>
<width>955</width>
<height>556</height>
</rect>
</property>
@@ -17,7 +17,7 @@
<item>
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
<number>1</number>
<number>0</number>
</property>
<widget class="QWidget" name="tab_3">
<attribute name="title">
@@ -82,7 +82,7 @@
</item>
<item>
<widget class="QWidget" name="m_hdpi_round_policy_widget" native="true">
<layout class="QHBoxLayout" name="horizontalLayout">
<layout class="QHBoxLayout" name="horizontalLayout" stretch="0,0,1">
<property name="leftMargin">
<number>0</number>
</property>
@@ -96,14 +96,28 @@
<number>0</number>
</property>
<item>
<widget class="QLabel" name="label_2">
<widget class="QCheckBox" name="m_hdpi_round_cb">
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="m_hdpi_round_label">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Méthode de mise à l'echelle des écrans à haute densité de pixels (hdpi) (appliqué au prochain lancement de QElectroTech) :</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="m_hdpi_round_policy_cb"/>
<widget class="QComboBox" name="m_hdpi_round_policy_cb">
<property name="enabled">
<bool>false</bool>
</property>
</widget>
</item>
</layout>
</widget>