Compare commits

...

7 Commits
0.6 ... 0.61

Author SHA1 Message Date
scorpio810
d509cd468c Tag version 0.61
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/tags/0.61@5491 bfdf4180-ca20-0410-9c96-a3a8aa849046
2018-08-23 00:22:24 +00:00
scorpio810
81c06ddadc Update displayed version
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/branches/0.60@5490 bfdf4180-ca20-0410-9c96-a3a8aa849046
2018-08-23 00:19:45 +00:00
scorpio810
d121c50f5a Update changelog
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/branches/0.60@5451 bfdf4180-ca20-0410-9c96-a3a8aa849046
2018-07-24 14:10:08 +00:00
scorpio810
57dc12c148 Fix FTBFS on Qt 5.11/GCC 8.x
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/branches/0.60@5450 bfdf4180-ca20-0410-9c96-a3a8aa849046
2018-07-20 02:33:48 +00:00
scorpio810
11cc09a637 Backport commit 5307, 5311, 5312
Update changelog 


git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/branches/0.60@5314 bfdf4180-ca20-0410-9c96-a3a8aa849046
2018-04-08 04:05:18 +00:00
scorpio810
5178de2c15 Backport commit 5284 : Fix bug N° 157
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/branches/0.60@5292 bfdf4180-ca20-0410-9c96-a3a8aa849046
2018-04-02 16:19:30 +00:00
scorpio810
bcab13fdde Backport HiDPI fix
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/branches/0.60@5282 bfdf4180-ca20-0410-9c96-a3a8aa849046
2018-03-29 14:32:17 +00:00
18 changed files with 222 additions and 154 deletions

View File

@@ -1,3 +1,20 @@
====== ChangeLog from 0.6 to 0.61 ======
* Backport HiDPI fix.
* Backport commit 5284 : Fix bug N° 157.
* Backport commit 5307 : Function for search conductor at the same potential.
When the search function is searching in a terminal element, they search only for the first terminal found, no matter if the terminal element have more than two terminals.
So the list of conductors at the same potential is missing some conductors.
This commit fix it, now the search function search for every terminals of a terminal element
* Backport commit 5311, 5312 : elements connections change propertie to terminal, fixed by commit svn 5307
* GCC 8.1 fix
====== ChangeLog from 0.5 to 0.6 ======
In the official collection, there are now 4106 elements, and 539 categoris for a total of 4645 files

View File

@@ -1,21 +1,25 @@
<definition type="element" height="20" orientation="dyyy" version="0.5" link_type="simple" hotspot_y="4" width="30" hotspot_x="11">
<uuid uuid="{8ef9d490-8db2-450a-ab89-22d2b35c01ed}"/>
<definition hotspot_x="11" hotspot_y="4" version="0.70" type="element" height="20" orientation="dyyy" link_type="terminal" width="30">
<uuid uuid="{141e7e1e-4f7f-456d-9f04-52c32109b969}"/>
<names>
<name lang="it">Collegamento</name>
<name lang="en">Combine</name>
<name lang="ru">Соединение</name>
<name lang="pl">Połączenie 1</name>
<name lang="fr">Jonction</name>
<name lang="es">Unión</name>
<name lang="it">Collegamento</name>
<name lang="pl">Połączenie 1</name>
<name lang="ar">وصلة</name>
<name lang="ru">Соединение</name>
<name lang="cs">Spoj</name>
<name lang="es">Unión</name>
</names>
<elementInformations/>
<informations></informations>
<description>
<line y2="0" style="line-style:normal;line-weight:normal;filling:none;color:black" length1="1.5" x1="7" y1="0" end2="none" x2="1" antialias="false" end1="none" length2="1.5"/>
<input x="2" y="13.5" size="1" tagg="label" rotate="true" text="_"/>
<line y2="0" style="line-style:normal;line-weight:normal;filling:none;color:black" length1="1.5" x1="0" y1="6" end2="none" x2="6" antialias="false" end1="none" length2="1.5"/>
<terminal orientation="w" x="-4" y="0"/>
<terminal orientation="s" x="0" y="10"/>
<terminal orientation="e" x="10" y="0"/>
<line end2="none" style="line-style:normal;line-weight:normal;filling:none;color:black" y1="0" antialias="false" x1="7" length1="1.5" x2="1" y2="0" length2="1.5" end1="none"/>
<dynamic_text text_from="UserText" y="8.5" uuid="{43af2b14-2822-4ba2-988b-bda2005f69fd}" x="2" frame="false" z="2" rotation="0" text_width="-1" font_size="1">
<text>_</text>
</dynamic_text>
<line end2="none" style="line-style:normal;line-weight:normal;filling:none;color:black" y1="6" antialias="false" x1="0" length1="1.5" x2="6" y2="0" length2="1.5" end1="none"/>
<terminal y="0" x="-4" orientation="w"/>
<terminal y="10" x="0" orientation="s"/>
<terminal y="0" x="10" orientation="e"/>
</description>
</definition>

View File

@@ -1,18 +1,22 @@
<definition type="element" height="20" orientation="dyyy" version="0.5" link_type="simple" hotspot_y="7" width="20" hotspot_x="11">
<uuid uuid="{2c6c492e-8d8e-402e-a449-0cf5a7462ced}"/>
<definition hotspot_y="7" width="20" orientation="dyyy" type="element" height="20" version="0.70" hotspot_x="11" link_type="terminal">
<uuid uuid="{2d505b61-db0f-4784-9b9c-189366058272}"/>
<names>
<name lang="es">Esquina</name>
<name lang="en">Corner</name>
<name lang="it">Angolo</name>
<name lang="ru">Угол</name>
<name lang="fr">Coin</name>
<name lang="pl">Narożnik</name>
<name lang="cs">Roh</name>
<name lang="es">Esquina</name>
<name lang="fr">Coin</name>
<name lang="ru">Угол</name>
<name lang="pl">Narożnik</name>
<name lang="ar">ركن</name>
<name lang="it">Angolo</name>
</names>
<elementInformations/>
<informations></informations>
<description>
<input x="-0.5" y="-0.45" size="1" tagg="label" rotate="true" text="_"/>
<terminal orientation="s" x="0" y="4"/>
<terminal orientation="w" x="-4" y="0"/>
<dynamic_text rotation="0" x="-0.5" y="-5.45" uuid="{9b8dd22d-096a-4989-b6f7-1de9e0339f53}" font_size="1" z="1" frame="false" text_from="UserText" text_width="-1">
<text>_</text>
</dynamic_text>
<terminal x="0" y="4" orientation="s"/>
<terminal x="-4" y="0" orientation="w"/>
</description>
</definition>

View File

@@ -1,21 +1,25 @@
<definition type="element" height="20" orientation="dyyy" version="0.5" link_type="simple" hotspot_y="9" width="20" hotspot_x="9">
<uuid uuid="{eb8040c8-6998-4f43-818b-1d368825ffac}"/>
<definition height="20" link_type="terminal" hotspot_x="9" width="20" orientation="dyyy" hotspot_y="9" version="0.70" type="element">
<uuid uuid="{8c0d3e9c-dc37-41d7-bfd5-fe4dbf8dc4fb}"/>
<names>
<name lang="en">Cross</name>
<name lang="it">Croce</name>
<name lang="ru">Пересечение</name>
<name lang="fr">Croix</name>
<name lang="pl">Połączenie 2</name>
<name lang="cs">Kříž</name>
<name lang="es">Cruzar</name>
<name lang="pl">Połączenie 2</name>
<name lang="it">Croce</name>
<name lang="es">Cruzar</name>
<name lang="en">Cross</name>
<name lang="ar">صليب</name>
<name lang="fr">Croix</name>
</names>
<elementInformations/>
<informations></informations>
<description>
<circle x="-1" y="-1" style="line-style:normal;line-weight:normal;filling:black;color:black" antialias="true" diameter="2"/>
<input x="-0.5" y="-4.45" size="1" tagg="label" rotate="true" text="_"/>
<terminal orientation="e" x="4" y="0"/>
<terminal orientation="s" x="0" y="4"/>
<terminal orientation="n" x="0" y="-4"/>
<terminal orientation="w" x="-4" y="0"/>
<circle y="-1" style="line-style:normal;line-weight:normal;filling:black;color:black" x="-1" antialias="true" diameter="2"/>
<dynamic_text uuid="{fc5c039b-1fca-40d9-a6ff-a9e1775de38b}" text_width="-1" frame="false" y="-9.45" font_size="1" x="-0.5" z="2" rotation="0" text_from="UserText">
<text>_</text>
</dynamic_text>
<terminal y="0" orientation="e" x="4"/>
<terminal y="4" orientation="s" x="0"/>
<terminal y="-4" orientation="n" x="0"/>
<terminal y="0" orientation="w" x="-4"/>
</description>
</definition>

View File

@@ -1,19 +1,23 @@
<definition type="element" height="30" orientation="dyyy" version="0.5" link_type="simple" hotspot_y="14" width="10" hotspot_x="5">
<uuid uuid="{cd8b3f5f-5eae-416c-9966-c7b5529b6e63}"/>
<definition width="10" hotspot_y="14" hotspot_x="5" height="30" link_type="terminal" orientation="dyyy" version="0.70" type="element">
<uuid uuid="{b5abb4c2-455d-45ff-95f2-328521f4e2e1}"/>
<names>
<name lang="en">Jump</name>
<name lang="it">Salto</name>
<name lang="ru">Перемычка</name>
<name lang="fr">Saut</name>
<name lang="pl">Brak połączenia</name>
<name lang="ar">قفز</name>
<name lang="cs">Skok</name>
<name lang="es">Puente</name>
<name lang="it">Salto</name>
<name lang="pl">Brak połączenia</name>
<name lang="ru">Перемычка</name>
<name lang="es">Puente</name>
</names>
<elementInformations/>
<informations></informations>
<description>
<arc height="6" start="90" angle="-180" x="-3" y="-3" style="line-style:normal;line-weight:normal;filling:none;color:black" antialias="true" width="6"/>
<input x="1.5" y="-6.45" size="1" tagg="label" rotate="true" text="_"/>
<terminal orientation="n" x="0" y="-7"/>
<terminal orientation="s" x="0" y="7"/>
<arc x="-3" antialias="true" style="line-style:normal;line-weight:normal;filling:none;color:black" width="6" start="90" y="-3" height="6" angle="-180"/>
<dynamic_text font_size="1" x="1.5" text_from="UserText" z="2" y="-11.45" rotation="0" uuid="{1a3e4d91-15cc-424b-99d0-25930d779fb6}" frame="false" text_width="-1">
<text>_</text>
</dynamic_text>
<terminal x="0" y="-7" orientation="n"/>
<terminal x="0" y="7" orientation="s"/>
</description>
</definition>

View File

@@ -3,7 +3,6 @@
<name lang="ru">Соединения</name>
<name lang="de">Verbindungen</name>
<name lang="en">Connections</name>
<name lang="es">Conexiones</name>
<name lang="fr">Connections</name>
<name lang="it">Collegamenti</name>
<name lang="pl">Połączenia</name>

View File

@@ -1,21 +1,25 @@
<definition type="element" height="20" orientation="dyyy" version="0.5" link_type="simple" hotspot_y="4" width="30" hotspot_x="17">
<uuid uuid="{0f807068-d5a4-4628-85f4-0644e6d3129f}"/>
<definition type="element" height="20" width="30" orientation="dyyy" version="0.70" hotspot_y="4" link_type="terminal" hotspot_x="17">
<uuid uuid="{709e6400-adc2-4faf-ba46-aa513d1dcaf1}"/>
<names>
<name lang="en">Splice</name>
<name lang="it">Spaziatura</name>
<name lang="ru">Сращивание</name>
<name lang="fr">Epissure</name>
<name lang="pl">Połączenie 3</name>
<name lang="cs">Spojka</name>
<name lang="es">Empalme</name>
<name lang="en">Splice</name>
<name lang="it">Spaziatura</name>
<name lang="ru">Сращивание</name>
<name lang="es">Empalme</name>
</names>
<elementInformations/>
<informations></informations>
<description>
<input x="1.5" y="3.55" size="1" tagg="label" rotate="true" text="_"/>
<line y2="0" style="line-style:normal;line-weight:normal;filling:none;color:black" length1="1.5" x1="0" y1="6" end2="none" x2="-6" antialias="false" end1="none" length2="1.5"/>
<line y2="0" style="line-style:normal;line-weight:normal;filling:none;color:black" length1="1.5" x1="1" y1="0" end2="none" x2="-5" antialias="false" end1="none" length2="1.5"/>
<terminal orientation="s" x="0" y="10"/>
<terminal orientation="w" x="-10" y="0"/>
<terminal orientation="e" x="4" y="0"/>
<dynamic_text text_width="-1" x="1.5" rotation="0" frame="false" uuid="{b653b162-d4c8-4660-a5ca-e6ca05a56de9}" font_size="1" z="1" text_from="ElementInfo" y="-1.45">
<text></text>
<info_name>label</info_name>
</dynamic_text>
<line x2="-6" antialias="false" x1="0" end2="none" y2="0" end1="none" length2="1.5" length1="1.5" y1="6" style="line-style:normal;line-weight:normal;filling:none;color:black"/>
<line x2="-5" antialias="false" x1="1" end2="none" y2="0" end1="none" length2="1.5" length1="1.5" y1="0" style="line-style:normal;line-weight:normal;filling:none;color:black"/>
<terminal x="0" orientation="s" y="10"/>
<terminal x="-10" orientation="w" y="0"/>
<terminal x="4" orientation="e" y="0"/>
</description>
</definition>

View File

@@ -1,21 +1,25 @@
<definition type="element" height="20" orientation="dyyy" version="0.5" link_type="simple" hotspot_y="4" width="30" hotspot_x="17">
<uuid uuid="{a1ced185-e98f-4cf1-8a62-3f8ea691bcb6}"/>
<definition hotspot_y="4" height="20" hotspot_x="17" type="element" width="30" link_type="terminal" orientation="dyyy" version="0.70">
<uuid uuid="{9e88368e-1b20-4a56-8941-5d17a4cce2d4}"/>
<names>
<name lang="en">Thru left</name>
<name lang="it">Collegamento sinistro</name>
<name lang="cs">Levé spojení</name>
<name lang="ru">Справа налево</name>
<name lang="fr">Liaison gauche</name>
<name lang="en">Thru left</name>
<name lang="ar">ربط يسار</name>
<name lang="it">Collegamento sinistro</name>
<name lang="pl">Połączenie 4</name>
<name lang="cs">Levé spojení</name>
<name lang="es">A la izquierda</name>
<name lang="es">A la izquierda</name>
</names>
<elementInformations/>
<informations></informations>
<description>
<input x="1.5" y="3.55" size="1" tagg="label" rotate="true" text="_"/>
<line y2="0" style="line-style:normal;line-weight:normal;filling:none;color:black" length1="1.5" x1="0" y1="6" end2="none" x2="-6" antialias="false" end1="none" length2="1.5"/>
<line y2="5" style="line-style:normal;line-weight:normal;filling:none;color:black" length1="1.5" x1="0" y1="0" end2="none" x2="0" antialias="false" end1="none" length2="1.5"/>
<terminal orientation="e" x="4" y="0"/>
<terminal orientation="w" x="-10" y="0"/>
<terminal orientation="s" x="0" y="10"/>
<dynamic_text font_size="1" rotation="0" uuid="{5ff9bef8-b6a8-4cf8-ba82-4dabe7b1820f}" text_width="-1" frame="false" text_from="UserText" z="1" x="1.5" y="-1.45">
<text>_</text>
</dynamic_text>
<line x1="0" length1="1.5" end2="none" length2="1.5" style="line-style:normal;line-weight:normal;filling:none;color:black" y1="6" y2="0" end1="none" antialias="false" x2="-6"/>
<line x1="0" length1="1.5" end2="none" length2="1.5" style="line-style:normal;line-weight:normal;filling:none;color:black" y1="0" y2="5" end1="none" antialias="false" x2="0"/>
<terminal x="4" orientation="e" y="0"/>
<terminal x="-10" orientation="w" y="0"/>
<terminal x="0" orientation="s" y="10"/>
</description>
</definition>

View File

@@ -1,22 +1,26 @@
<definition type="element" height="20" orientation="dyyy" version="0.5" link_type="simple" hotspot_y="4" width="30" hotspot_x="14">
<uuid uuid="{5d72394b-8aa0-4368-bc88-0f738478ca45}"/>
<definition link_type="terminal" width="30" hotspot_x="14" orientation="dyyy" height="20" version="0.70" hotspot_y="4" type="element">
<uuid uuid="{6e40fff3-691c-4622-b9aa-4ff930a5b981}"/>
<names>
<name lang="en">Thru right</name>
<name lang="it">Collegamento destro</name>
<name lang="ru">Слева направо</name>
<name lang="fr">Liaison droite</name>
<name lang="pl">Połączenie 5</name>
<name lang="cs">Pravé spojení</name>
<name lang="es">A la derecha</name>
<name lang="fr">Liaison droite</name>
<name lang="it">Collegamento destro</name>
<name lang="es">A la derecha</name>
<name lang="ar">ربط يمين</name>
<name lang="pl">Połączenie 5</name>
</names>
<elementInformations/>
<informations></informations>
<description>
<input x="5.5" y="4.55" size="1" tagg="label" rotate="true" text="_"/>
<line y2="0" style="line-style:normal;line-weight:normal;filling:none;color:black" length1="1.5" x1="0" y1="0" end2="none" x2="-6" antialias="false" end1="none" length2="1.5"/>
<line y2="5" style="line-style:normal;line-weight:normal;filling:none;color:black" length1="1.5" x1="0" y1="0" end2="none" x2="0" antialias="false" end1="none" length2="1.5"/>
<line y2="6" style="line-style:normal;line-weight:normal;filling:none;color:black" length1="1.5" x1="6" y1="0" end2="none" x2="0" antialias="false" end1="none" length2="1.5"/>
<terminal orientation="s" x="0" y="10"/>
<terminal orientation="w" x="-10" y="0"/>
<terminal orientation="e" x="10" y="0"/>
<dynamic_text text_width="-1" y="-0.45" rotation="0" uuid="{ab829572-e7d6-4e5c-9c6e-a0852fea788e}" x="5.5" frame="false" text_from="UserText" font_size="1" z="1">
<text>_</text>
</dynamic_text>
<line antialias="false" x1="0" y1="0" style="line-style:normal;line-weight:normal;filling:none;color:black" length1="1.5" end2="none" end1="none" y2="0" length2="1.5" x2="-6"/>
<line antialias="false" x1="0" y1="0" style="line-style:normal;line-weight:normal;filling:none;color:black" length1="1.5" end2="none" end1="none" y2="5" length2="1.5" x2="0"/>
<line antialias="false" x1="6" y1="0" style="line-style:normal;line-weight:normal;filling:none;color:black" length1="1.5" end2="none" end1="none" y2="6" length2="1.5" x2="0"/>
<terminal orientation="s" y="10" x="0"/>
<terminal orientation="w" y="0" x="-10"/>
<terminal orientation="e" y="0" x="10"/>
</description>
</definition>

View File

@@ -351,13 +351,31 @@ void DiagramPrintDialog::browseFilePrintTypeDialog() {
@param fit_page Booleen indiquant s'il faut adapter les schemas aux pages
ou non
@param options Options de rendu
*/
void DiagramPrintDialog::print(const QList<Diagram *> &diagrams, bool fit_page, const ExportProperties options) {
//qDebug() << "Demande d'impression de " << diagrams.count() << "schemas.";
// QPainter utiliser pour effectuer le rendu
QPainter qp(printer_);
*/
void DiagramPrintDialog::print(const QList<Diagram *> &diagrams, bool fit_page, const ExportProperties options) {
//qDebug() << "Demande d'impression de " << diagrams.count() << "schemas.";
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
#ifdef Q_OS_WIN
#ifdef QT_DEBUG
qDebug() << "--";
qDebug() << "DiagramPrintDialog::print printer_->resolution() before " << printer_->resolution();
qDebug() << "DiagramPrintDialog::print screennumber " << QApplication::desktop()->screenNumber();
#endif
QScreen *srn = QApplication::screens().at(QApplication::desktop()->screenNumber());
qreal dotsPerInch = (qreal)srn->logicalDotsPerInch();
printer_->setResolution(dotsPerInch);
#ifdef QT_DEBUG
qDebug() << "DiagramPrintDialog::print dotsPerInch " << dotsPerInch;
qDebug() << "DiagramPrintDialog::print printer_->resolution() after" << printer_->resolution();
qDebug() << "--";
#endif
#endif
#endif
// QPainter utiliser pour effectuer le rendu
QPainter qp(printer_);
// cas special : il n'y a aucun schema a imprimer
if (!diagrams.count()) {
qp.end();

View File

@@ -29,17 +29,13 @@ int main(int argc, char **argv)
//Some setup, notably to use with QSetting.
QCoreApplication::setOrganizationName("QElectroTech");
QCoreApplication::setOrganizationDomain("qelectrotech.org");
QCoreApplication::setApplicationName("QElectroTech");
//Creation and execution of the application
//HighDPI
#if QT_VERSION >= QT_VERSION_CHECK (5, 6, 0)
#if defined Q_OS_MAC
QApplication::setAttribute (Qt::AA_EnableHighDpiScaling);
#elif !defined(Q_OS_MAC)
QApplication::setAttribute (Qt::AA_DisableHighDpiScaling);
#else
qputenv("QT_DEVICE_PIXEL_RATIO", QByteArray("1"));
#endif
#endif
return(QETApp(argc, argv).exec());
}
QCoreApplication::setApplicationName("QElectroTech");
//Creation and execution of the application
//HighDPI
#if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0)
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
#else
qputenv("QT_DEVICE_PIXEL_RATIO", QByteArray("auto"));
#endif
return(QETApp(argc, argv).exec());
}

View File

@@ -25,9 +25,9 @@
*/
namespace QET {
/// QElectroTech version (as string, used to mark projects and elements XML documents)
const QString version = "0.60";
const QString version = "0.61";
/// QElectroTech displayed version
const QString displayedVersion = "0.60";
const QString displayedVersion = "0.61";
QString license();
/// Oriented movements

View File

@@ -310,16 +310,16 @@ void QETDiagramEditor::setUpActions()
QAction *open_file = m_file_actions_group.addAction( QET::Icons::DocumentOpen, tr("&Ouvrir") );
save_file = m_file_actions_group.addAction( QET::Icons::DocumentSave, tr("&Enregistrer") );
save_file_as = m_file_actions_group.addAction( QET::Icons::DocumentSaveAs, tr("Enregistrer sous") );
close_file = m_file_actions_group.addAction( QET::Icons::ProjectClose, tr("&Fermer") );
m_close_file = m_file_actions_group.addAction( QET::Icons::ProjectClose, tr("&Fermer") );
new_file -> setShortcut( QKeySequence::New );
open_file -> setShortcut( QKeySequence::Open );
close_file -> setShortcut( QKeySequence::Close );
m_close_file -> setShortcut( QKeySequence::Close );
save_file -> setShortcut( QKeySequence::Save );
new_file -> setStatusTip( tr("Crée un nouveau projet", "status bar tip") );
open_file -> setStatusTip( tr("Ouvre un projet existant", "status bar tip") );
close_file -> setStatusTip( tr("Ferme le projet courant", "status bar tip") );
m_close_file -> setStatusTip( tr("Ferme le projet courant", "status bar tip") );
save_file -> setStatusTip( tr("Enregistre le projet courant et tous ses folios", "status bar tip") );
save_file_as -> setStatusTip( tr("Enregistre le projet courant avec un autre nom de fichier", "status bar tip") );
@@ -327,7 +327,7 @@ void QETDiagramEditor::setUpActions()
connect(save_file, SIGNAL( triggered() ), this, SLOT( save() ) );
connect(new_file, SIGNAL( triggered() ), this, SLOT( newProject() ) );
connect(open_file, SIGNAL( triggered() ), this, SLOT( openProject() ) );
connect(close_file, SIGNAL( triggered() ), this, SLOT( closeCurrentProject() ) );
connect(m_close_file, SIGNAL( triggered() ), this, SLOT( closeCurrentProject() ) );
//Row and Column actions
QAction *add_column = m_row_column_actions_group.addAction( QET::Icons::EditTableInsertColumnRight, tr("Ajouter une colonne") );
@@ -673,23 +673,12 @@ void QETDiagramEditor::closeEvent(QCloseEvent *qce) {
/**
* @brief QETDiagramEditor::event
* Reimplemented to :
* -avoid conflic with shortcut "Ctrl+W" (QKeySequence::Close)
* -Load elements collection when WindowActivate.
* @param e
* @return
*/
bool QETDiagramEditor::event(QEvent *e)
{
if (e -> type() == QEvent::ShortcutOverride)
{
QKeyEvent *shortcut_event = static_cast<QKeyEvent *>(e);
if (shortcut_event && shortcut_event -> matches(QKeySequence::Close))
{
close_file -> trigger();
e -> accept();
return(true);
}
}
if (m_first_show && e->type() == QEvent::WindowActivate)
{
m_first_show = false;
@@ -1320,7 +1309,7 @@ void QETDiagramEditor::slot_updateActions()
bool opened_diagram = dv;
bool editable_project = (pv && !pv -> project() -> isReadOnly());
close_file -> setEnabled(opened_project);
m_close_file -> setEnabled(opened_project);
save_file -> setEnabled(opened_project);
save_file_as -> setEnabled(opened_project);
prj_edit_prop -> setEnabled(opened_project);
@@ -1540,6 +1529,15 @@ void QETDiagramEditor::addProjectView(ProjectView *project_view)
QMdiSubWindow *sub_window = workspace.addSubWindow(project_view);
sub_window -> setWindowIcon(project_view -> windowIcon());
sub_window -> systemMenu() -> clear();
//By defaut QMdiSubWindow have a QAction "close" with shortcut QKeySequence::Close
//But the QAction m_close_file of this class have the same shortcut too.
//We remove the shortcut of the QAction of QMdiSubWindow for avoid conflic
for(QAction *act : sub_window->actions())
{
if(act->shortcut() == QKeySequence::Close)
act->setShortcut(QKeySequence());
}
//Display the new window
if (maximise) project_view -> showMaximized();
@@ -1627,7 +1625,7 @@ void QETDiagramEditor::slot_updateWindowsMenu() {
foreach(QAction *a, windows_menu -> actions()) windows_menu -> removeAction(a);
// actions de fermeture
windows_menu -> addAction(close_file);
windows_menu -> addAction(m_close_file);
//windows_menu -> addAction(closeAllAct);
// actions de reorganisation des fenetres

View File

@@ -213,7 +213,7 @@ class QETDiagramEditor : public QETMainWindow {
QAction *find_element; ///< Find the selected element in the panel
QActionGroup m_file_actions_group; ///Actions related to file (open, close, save...)
QAction *close_file; ///< Close current project file
QAction *m_close_file; ///< Close current project file
QAction *save_file; ///< Save current project
QAction *save_file_as; ///< Save current project as a specific file

View File

@@ -1517,12 +1517,14 @@ void Conductor::displayedTextChanged()
* part of the returned QSet.
* @param all_diagram : if true search in all diagram of the project,
* false search only in the parent diagram of this conductor
* @param t_list, a list of terminal already cheched for the serach of potential.
* @param t_list, a list of terminal already found for this potential.
* @return a QSet of conductor at the same potential.
*/
QSet<Conductor *> Conductor::relatedPotentialConductors(const bool all_diagram, QList <Terminal *> *t_list) {
QSet<Conductor *> Conductor::relatedPotentialConductors(const bool all_diagram, QList <Terminal *> *t_list)
{
bool declar_t_list = false;
if (t_list == 0) {
if (t_list == nullptr)
{
declar_t_list = true;
t_list = new QList <Terminal *>;
}
@@ -1531,23 +1533,29 @@ QSet<Conductor *> Conductor::relatedPotentialConductors(const bool all_diagram,
QList <Terminal *> this_terminal;
this_terminal << terminal1 << terminal2;
// Return all conductor of terminal 1 and 2
foreach (Terminal *terminal, this_terminal) {
if (!t_list -> contains(terminal)) {
t_list -> append(terminal);
QList <Conductor *> other_conductors_list_t = terminal -> conductors();
// Return all conductors of terminal 1 and 2
for (Terminal *terminal : this_terminal)
{
if (!t_list->contains(terminal))
{
t_list->append(terminal);
QList <Conductor *> other_conductors_list_t = terminal->conductors();
//get terminal share the same potential of @terminal, of parent element
Terminal *t1_bis = relatedPotentialTerminal(terminal, all_diagram);
if (t1_bis && !t_list->contains(t1_bis)) {
t_list -> append(t1_bis);
other_conductors_list_t += t1_bis->conductors();
//Get the other terminals of the parent element of @terminal, who share the same potential
//This is use for element type "folio report" and "terminal element"
for (Terminal *t : relatedPotentialTerminal(terminal, all_diagram))
{
if (!t_list->contains(t))
{
t_list -> append(t);
other_conductors_list_t += t->conductors();
}
}
other_conductors_list_t.removeAll(this);
// Research the conductors connected to conductors already found
foreach (Conductor *c, other_conductors_list_t) {
other_conductors += c -> relatedPotentialConductors(all_diagram, t_list);
//Get the conductors at the same potential for each conductors of other_conductors_list_t
for (Conductor *c : other_conductors_list_t) {
other_conductors += c->relatedPotentialConductors(all_diagram, t_list);
}
other_conductors += other_conductors_list_t.toSet();
}

View File

@@ -765,24 +765,27 @@ Element *Terminal::parentElement() const {
* @param t terminal to start search
* @param all_diagram :if true return all related terminal,
* false return only terminal in the same diagram of @t
* @return
* @return the list of terminal at the same potential
*/
Terminal * relatedPotentialTerminal (const Terminal *terminal, const bool all_diagram) {
// If terminal parent element is a folio report.
if (all_diagram && terminal -> parentElement() -> linkType() & Element::AllReport) {
QList<Terminal *> relatedPotentialTerminal (const Terminal *terminal, const bool all_diagram)
{
// If terminal parent element is a folio report.
if (all_diagram && terminal -> parentElement() -> linkType() & Element::AllReport)
{
QList <Element *> elmt_list = terminal -> parentElement() -> linkedElements();
if (!elmt_list.isEmpty()) {
return (elmt_list.first() -> terminals().first());
if (!elmt_list.isEmpty())
{
return (elmt_list.first()->terminals());
}
}
// If terminal parent element is a Terminal element.
else if (terminal -> parentElement() -> linkType() & Element::Terminale) {
QList <Terminal *> terminals = terminal -> parentElement() -> terminals();
terminals.removeAll(const_cast<Terminal *> (terminal));
if (!terminals.isEmpty())
return terminals.first();
// If terminal parent element is a Terminal element.
else if (terminal -> parentElement() -> linkType() & Element::Terminale)
{
QList <Terminal *> terminals = terminal->parentElement()->terminals();
terminals.removeAll(const_cast<Terminal *>(terminal));
return terminals;
}
return nullptr;
return QList<Terminal *>();
}

View File

@@ -169,6 +169,6 @@ inline QString Terminal::name() const {
return(name_terminal_);
}
Terminal * relatedPotentialTerminal (const Terminal *terminal, const bool all_diagram = true);
QList<Terminal *> relatedPotentialTerminal (const Terminal *terminal, const bool all_diagram = true);
#endif

View File

@@ -17,6 +17,7 @@
*/
#include "importelementdialog.h"
#include "ui_importelementdialog.h"
#include <QButtonGroup>
ImportElementDialog::ImportElementDialog(QWidget *parent) :
QDialog(parent),