Topic: DiagramEditor Grid(grille) 1-10
Bonjour,
La distance de grille entre deux points est maintenant de 10
J'ai réussi à ajuster la grille.
Vous pouvez maintenant choisir de 1 à 10
Ce qui suit doit arriver dans les fichiers suivants.
Now the grid distance between two points is 10
I managed to adjust the Grid.
You can now choose from 1 to 10
The following must happen in the following files.
sources/diagram.h
supprimer Const dans les lignes 76 et 78
Delete Const in lines 76 and 78
76 - static int xGrid; //static const int xGrid;
78 - static int yGrid; //static const int yGrid;
sources/diagram.cpp
supprimer Const dans les lignes 41 et 42
Delete Const in lines 41 and 42 41 - int Diagram::xGrid = 10; //const int Diagram::xGrid = 10;
42 - int Diagram::yGrid = 10; //const int Diagram::yGrid = 10;
Ajouter les lignes suivantes
Après les paramètres QSettings;
Add the following lines
After QSettings settings;
153 - int xGrid = settings.value("DiagramEditor_xGrid_sb", Diagram::xGrid).toInt();
154 - int yGrid = settings.value("DiagramEditor_yGrid_sb", Diagram::yGrid).toInt();
sources/ui/configpage/generalconfigurationpage.cpp
Ajouter les lignes suivantes
Après les paramètres QSettings;
Add the following lines
After QSettings settings;
38 - ui->DiagramEditor_xGrid_sb->setValue(settings.value("DiagramEditor_xGrid_sb", 10).toInt());
39 - ui->DiagramEditor_yGrid_sb->setValue(settings.value("DiagramEditor_yGrid_sb", 10).toInt());
Ajouter les lignes suivantes
Add the following lines
142 - settings.setValue("DiagramEditor_xGrid_sb", ui->DiagramEditor_xGrid_sb->value());
143 - settings.setValue("DiagramEditor_yGrid_sb", ui->DiagramEditor_yGrid_sb->value());
Forms/sources/ui/configpage/generalconfigurationpage.ui
Maintenant, utilisez un éditeur de texte et non Qtcreator.
J'utilise Mousepad.
Ajouter les lignes suivantes de la ligne 467
C'est entre <widget> et <widget>
Now use a text editor and not Qtcreator.
I use Mousepad.
Add the following lines from line 467
It's between <widget> and <widget>
<widget class="QWidget" name="Grid">
<attribute name="title">
<string>Grid</string>
</attribute>
<widget class="QLabel" name="Label_Diagram_xGrid">
<property name="geometry">
<rect>
<x>20</x>
<y>10</y>
<width>191</width>
<height>30</height>
</rect>
</property>
<property name="text">
<string>DiagramEditor xGrid</string>
</property>
</widget>
<widget class="QLabel" name="Label_Diagram_yGrid">
<property name="geometry">
<rect>
<x>20</x>
<y>50</y>
<width>191</width>
<height>30</height>
</rect>
</property>
<property name="text">
<string>DiagramEditor yGrid</string>
</property>
</widget>
<widget class="QSpinBox" name="DiagramEditor_xGrid_sb">
<property name="geometry">
<rect>
<x>220</x>
<y>10</y>
<width>55</width>
<height>30</height>
</rect>
</property>
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>10</number>
</property>
<property name="singleStep">
<number>1</number>
</property>
<property name="value">
<number>10</number>
</property>
</widget>
<widget class="QSpinBox" name="DiagramEditor_yGrid_sb">
<property name="geometry">
<rect>
<x>220</x>
<y>50</y>
<width>55</width>
<height>30</height>
</rect>
</property>
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>10</number>
</property>
<property name="value">
<number>10</number>
</property>
</widget>
<widget class="QLabel" name="Label_DiagramGrid">
<property name="geometry">
<rect>
<x>20</x>
<y>100</y>
<width>251</width>
<height>30</height>
</rect>
</property>
<property name="text">
<string>Grid on/off = See the change</string>
</property>
</widget>
</widget>