1

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 nomicons/smile

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  nomicons/smile

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>

I am an pre-retired industrial developer technician and born in 1960

2

Re: DiagramEditor Grid(grille) 1-10

Bonjour,

thanks, please use qtcreator to make a clean diff file.
Go to Tools -> Subversion -> Diff project "qelectrotech" 
Now save patch and send me here.

Or you could use also in your local directory Subversion to create a diff :
svn diff > my_changes.diff

"Le jour où tu découvres le Libre, tu sais que tu ne pourras jamais plus revenir en arrière..."Questions regarding QET belong in this forum and will NOT be answered via PM! – Les questions concernant QET doivent être posées sur ce forum et ne seront pas traitées par MP !

3

Re: DiagramEditor Grid(grille) 1-10

New files QET 5734

Post's attachments

Attachment icon diagram.h 11.34 kb, 499 downloads since 2019-02-09 

I am an pre-retired industrial developer technician and born in 1960

4

Re: DiagramEditor Grid(grille) 1-10

New File QET 5734

Post's attachments

Attachment icon diagram.cpp 55.58 kb, 603 downloads since 2019-02-09 

I am an pre-retired industrial developer technician and born in 1960

5 (edited by Re-searcher 2019-02-09 21:02:19)

Re: DiagramEditor Grid(grille) 1-10

New file QET-5734

Post's attachments

Attachment icon generalconfigurationpage.cpp 13.85 kb, 445 downloads since 2019-02-09 

I am an pre-retired industrial developer technician and born in 1960

6 (edited by Re-searcher 2019-02-09 21:01:55)

Re: DiagramEditor Grid(grille) 1-10

New file QET-5734

Post's attachments

Attachment icon generalconfigurationpage.ui 17.33 kb, 458 downloads since 2019-02-09 

I am an pre-retired industrial developer technician and born in 1960

7

Re: DiagramEditor Grid(grille) 1-10

Patch

Post's attachments

Attachment icon grid.diff 5.55 kb, 476 downloads since 2019-02-10 

"Le jour où tu découvres le Libre, tu sais que tu ne pourras jamais plus revenir en arrière..."Questions regarding QET belong in this forum and will NOT be answered via PM! – Les questions concernant QET doivent être posées sur ce forum et ne seront pas traitées par MP !

8

Re: DiagramEditor Grid(grille) 1-10

https://download.qelectrotech.org/qet/forum_img/grid-2.png
https://download.qelectrotech.org/qet/forum_img/grid.png

"Le jour où tu découvres le Libre, tu sais que tu ne pourras jamais plus revenir en arrière..."Questions regarding QET belong in this forum and will NOT be answered via PM! – Les questions concernant QET doivent être posées sur ce forum et ne seront pas traitées par MP !

9

Re: DiagramEditor Grid(grille) 1-10

Very interesting, thanks Erik nomicons/smile

It could be very useful to place and align elements, conductors, etc,  a workaround is to use xgrid = 1, ygrid = 25 or more. nomicons/smile

https://download.qelectrotech.org/qet/forum_img/grid-3.png
xgrid = 25, ygrid = 1
https://download.qelectrotech.org/qet/forum_img/grid-4.png

"Le jour où tu découvres le Libre, tu sais que tu ne pourras jamais plus revenir en arrière..."Questions regarding QET belong in this forum and will NOT be answered via PM! – Les questions concernant QET doivent être posées sur ce forum et ne seront pas traitées par MP !