Compare commits

..

54 Commits
0.1 ... 0.11

Author SHA1 Message Date
scorpio810
f3649a5d95 Reverting deletion of branch 0.2, 0.3
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/tags/0.11@5946 bfdf4180-ca20-0410-9c96-a3a8aa849046
2019-06-26 08:02:48 +00:00
xavierqet
cb2c816ea2 Tag de la version 0.11
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/tags/0.11@394 bfdf4180-ca20-0410-9c96-a3a8aa849046
2008-08-30 12:02:21 +00:00
xavierqet
03c161f257 Passage de la 0.1 a la 0.11
Modification du Splash Screen en consequence
Mise a jour des credits et instructions d'installation
Les pages de manuel sont desormais compresses au maximum


git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@393 bfdf4180-ca20-0410-9c96-a3a8aa849046
2008-08-30 11:41:46 +00:00
xavierqet
120c541ed3 Ajout de schemas exemples.
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@392 bfdf4180-ca20-0410-9c96-a3a8aa849046
2008-08-24 13:42:06 +00:00
xavierqet
a4acad7317 Resolution d'un probleme avec l'export XML de coordonnees decimales : le separateur decimal utilise variait selon la locale utilisee.
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@391 bfdf4180-ca20-0410-9c96-a3a8aa849046
2008-08-23 19:27:14 +00:00
xavierqet
3e31df6820 Les fichiers recents affichent desormais les fichiers dont le nom vient d'etre defini via Fichier > enregistrer sous
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@390 bfdf4180-ca20-0410-9c96-a3a8aa849046
2008-08-23 18:17:00 +00:00
xavierqet
ce4596124c Les connexions internes sont desormais autorisees pour les contacts de puissance.
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@389 bfdf4180-ca20-0410-9c96-a3a8aa849046
2008-08-23 16:03:07 +00:00
xavierqet
1ca68fcddc Modification des dimensions par defaut des schemas.
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@388 bfdf4180-ca20-0410-9c96-a3a8aa849046
2008-08-23 15:44:25 +00:00
xavierqet
ae71d0a12d Les ouvertures de fichiers impliquant la creation d'un nouvel editeur de schema sont desormais prises en compte dans la liste des fichiers recents
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@387 bfdf4180-ca20-0410-9c96-a3a8aa849046
2008-08-23 12:54:16 +00:00
xavierqet
30175f43c5 La correction du rendu (pour le bug de decalage au zoom par defaut) est desormais desactivee par defaut.
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@386 bfdf4180-ca20-0410-9c96-a3a8aa849046
2008-08-23 10:55:37 +00:00
xavierqet
716ca01824 Typos dans les mans
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@385 bfdf4180-ca20-0410-9c96-a3a8aa849046
2008-08-21 18:15:03 +00:00
xavierqet
1cd7590651 Ajout d'une page de manuel UNIX (en anglais et en francais)
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@384 bfdf4180-ca20-0410-9c96-a3a8aa849046
2008-08-20 21:25:53 +00:00
xavierqet
9f8c1b03e8 Petites corrections sur le dialogue d'impression (titre et chemin PDF propose)
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@383 bfdf4180-ca20-0410-9c96-a3a8aa849046
2008-08-19 21:25:31 +00:00
xavierqet
eb14050796 Correction d'un bug : apres fermeture d'un schema, le menu Fenetres n'etait pas correctement mis a jour.
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@382 bfdf4180-ca20-0410-9c96-a3a8aa849046
2008-08-19 20:35:42 +00:00
xavierqet
3c7c538d7c Ajout d'une description dans le dialogue des options d'impression
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@381 bfdf4180-ca20-0410-9c96-a3a8aa849046
2008-08-18 20:18:18 +00:00
xavierqet
1f712ba103 Ajout d'un script bash facilitant le lancement de QET en utilisant la collection et les fichiers de langue du repertoire de travail
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@380 bfdf4180-ca20-0410-9c96-a3a8aa849046
2008-08-17 21:47:07 +00:00
xavierqet
dde819c278 Lors de l'impression, l'option "Adapter le schema a la page" est desormais cochee par defaut.
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@379 bfdf4180-ca20-0410-9c96-a3a8aa849046
2008-08-17 21:21:29 +00:00
xavierqet
147deca55d Ajout de l'option --lang-dir pour redefinir le dossier contenant les fichiers de langue
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@378 bfdf4180-ca20-0410-9c96-a3a8aa849046
2008-08-17 21:08:31 +00:00
xavierqet
bee622e7cc Peaufinage de la plupart des dialogues pour qu'ils n'apparaissent pas dans la barre des taches
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@377 bfdf4180-ca20-0410-9c96-a3a8aa849046
2008-08-17 20:41:37 +00:00
xavierqet
3957baaa6f Adaptation de l'impression pour Qt >= 4.4
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@376 bfdf4180-ca20-0410-9c96-a3a8aa849046
2008-08-17 16:16:44 +00:00
xavierqet
75f689ffa9 Correction des chemins d'installation des .desktop et .xml pour les associations de fichiers sous X11
Mise a jour du fichier de traduction pour la langue anglaise


git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@375 bfdf4180-ca20-0410-9c96-a3a8aa849046
2008-08-15 18:00:55 +00:00
xavierqet
601b90ffd4 Mise a jour des traductions
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@374 bfdf4180-ca20-0410-9c96-a3a8aa849046
2008-08-15 14:31:25 +00:00
xavierqet
fc1f573719 Correction d'un bug avec l'option --config-dir=
Correction dans le script d'enregistrement des associations de fichier sous Windows


git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@373 bfdf4180-ca20-0410-9c96-a3a8aa849046
2008-08-15 13:50:43 +00:00
xavierqet
5e952533d6 Il est desormais possible d'afficher ou non les entetes des lignes et colonnes
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@372 bfdf4180-ca20-0410-9c96-a3a8aa849046
2008-08-15 12:46:22 +00:00
xavierqet
faf504f2d0 Ajout des classes BorderProperties et BorderPropertiesWidget
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@371 bfdf4180-ca20-0410-9c96-a3a8aa849046
2008-08-14 22:51:08 +00:00
xavierqet
7ac471c6f2 Mise a jour des traductions
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@370 bfdf4180-ca20-0410-9c96-a3a8aa849046
2008-08-11 19:24:12 +00:00
xavierqet
15020669d9 Suppression d'avertissements a la compilation
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@369 bfdf4180-ca20-0410-9c96-a3a8aa849046
2008-08-10 18:53:31 +00:00
xavierqet
5c9a6edff5 Correction d'un bug lors de l'interpretation de l'attribut height d'un schema
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@368 bfdf4180-ca20-0410-9c96-a3a8aa849046
2008-08-10 16:52:37 +00:00
xavierqet
8d7572090a Mise a jour des fichiers de configuration exemple
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@367 bfdf4180-ca20-0410-9c96-a3a8aa849046
2008-08-10 15:48:42 +00:00
xavierqet
8b3e64a724 Amelioration du comportement du HotspotEditor lorsqu'on le redimensionne
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@366 bfdf4180-ca20-0410-9c96-a3a8aa849046
2008-08-10 15:43:54 +00:00
xavierqet
e0cf69d6bf La hauteur du schema est desormais geree via un systeme de lignes, dont le nombre et la hauteur sont ajustables.
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@365 bfdf4180-ca20-0410-9c96-a3a8aa849046
2008-08-10 15:07:59 +00:00
xavierqet
818982272f Nettoyage du trunk : deplacement des sources dans un sous-repertoire
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@364 bfdf4180-ca20-0410-9c96-a3a8aa849046
2008-08-07 19:50:56 +00:00
xavierqet
1a11287dfc Changement du numero de version affiche par le splash screen.
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@363 bfdf4180-ca20-0410-9c96-a3a8aa849046
2008-08-03 18:23:26 +00:00
xavierqet
b3a3c87eba Ajout d'un splash screen
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@362 bfdf4180-ca20-0410-9c96-a3a8aa849046
2008-08-02 16:53:42 +00:00
xavierqet
cd57178b11 Correction d'un bug dans l'operator= et le constructeur de copie de la classe QETArguments
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@361 bfdf4180-ca20-0410-9c96-a3a8aa849046
2008-08-02 16:24:10 +00:00
xavierqet
7a48bcc228 Corrections de code :
* avertissements a la compilation (teste avec gcc 4.3)
  * inclusions non pertinentes


git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@360 bfdf4180-ca20-0410-9c96-a3a8aa849046
2008-07-30 12:44:57 +00:00
xavierqet
e8e881ff51 Ajout des "fichiers recents"
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@359 bfdf4180-ca20-0410-9c96-a3a8aa849046
2008-07-30 11:51:27 +00:00
xavierqet
0272d5ed66 Mise a jour des associations de fichiers sous Windows
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@358 bfdf4180-ca20-0410-9c96-a3a8aa849046
2008-07-27 15:48:06 +00:00
xavierqet
da1e965c83 L'application est desormais capable d'ouvrir un fichier element passe en parametre
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@357 bfdf4180-ca20-0410-9c96-a3a8aa849046
2008-07-26 15:26:19 +00:00
xavierqet
e26560188f Ajout des associations de fichiers pour X11 (shared-mime-info)
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@356 bfdf4180-ca20-0410-9c96-a3a8aa849046
2008-07-24 21:18:09 +00:00
xavierqet
c6140bce49 Ajout de fichiers permettant d'automatiser les associations de fichiers sous Windows
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@355 bfdf4180-ca20-0410-9c96-a3a8aa849046
2008-07-20 18:03:56 +00:00
xavierqet
7f520f0b8d Modification pour Windows : evite d'initialiser le systray lorsqu'une nouvelle instance est lancee.
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@354 bfdf4180-ca20-0410-9c96-a3a8aa849046
2008-07-20 12:50:12 +00:00
xavierqet
4364410029 L'application verifie desormais que le fichier n'est pas deja ouvert dans tous les editeurs de schemas.
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@353 bfdf4180-ca20-0410-9c96-a3a8aa849046
2008-07-20 11:37:31 +00:00
xavierqet
fe4c3f6f7d Import dans le trunk des modifications apportees lors de la revision 335 :
* Affinage du constructeur de la classe QETApp


git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@351 bfdf4180-ca20-0410-9c96-a3a8aa849046
2008-07-19 17:34:13 +00:00
xavierqet
eae7513eef Lors de l'ouverture d'un fichier en dehors de l'application alors que QET est deja demarre, celui-ci essaye de s'afficher ou d'attirer l'attention de l'utilisateur.
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@350 bfdf4180-ca20-0410-9c96-a3a8aa849046
2008-07-18 21:05:51 +00:00
xavierqet
158cf97bb3 Correction d'une segfault survenant avec Qt 4.4
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@349 bfdf4180-ca20-0410-9c96-a3a8aa849046
2008-07-17 22:57:50 +00:00
xavierqet
429d7e55a2 L'application se lance desormais une seule fois par utilisateur
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@348 bfdf4180-ca20-0410-9c96-a3a8aa849046
2008-07-17 19:25:57 +00:00
xavierqet
f4b828a3cd Les classes Conductor et Element heritent desormais de QObject.
Correction du bug #16 : Mauvaise gestion des modifications du texte d'un conducteur



git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@346 bfdf4180-ca20-0410-9c96-a3a8aa849046
2008-07-09 21:14:30 +00:00
xavierqet
9c6f602439 Les textes des elements, des conducteurs, du cartouche ainsi que les textes independants utilisent desormais tous la meme police.
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@345 bfdf4180-ca20-0410-9c96-a3a8aa849046
2008-07-09 17:30:52 +00:00
xavierqet
b030058966 Rapatriement dans le trunk d'une correction apportee dans la branche 0.2 :
* [r343] Le cartouche utilise desormais la meme police que les textes des elements


git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@344 bfdf4180-ca20-0410-9c96-a3a8aa849046
2008-07-08 18:27:07 +00:00
xavierqet
c6fc0ad51b Correction du bug #15 : Mauvais positionnement des champs de texte sur le schema.
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@341 bfdf4180-ca20-0410-9c96-a3a8aa849046
2008-06-25 11:15:43 +00:00
xavierqet
f9813f1f84 Bugfixes :
* Bug #13 : il manquait un / dans le chemin propose lors de l'impression vers un PDF
  * La classe DiagramView ecrivait sur la sortie d'erreur sans fin de ligne


git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@332 bfdf4180-ca20-0410-9c96-a3a8aa849046
2008-05-26 17:37:39 +00:00
xavierqet
d7444ae90c Correction pour que QET compile avec gcc-4.3
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@327 bfdf4180-ca20-0410-9c96-a3a8aa849046
2008-05-20 20:37:17 +00:00
xavierqet
8c59b8183a Correction du bug #12 : QET provoquait une erreur de segmentation des son demarrage dans un environnement sans systray
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@322 bfdf4180-ca20-0410-9c96-a3a8aa849046
2008-05-11 20:05:18 +00:00
180 changed files with 8257 additions and 2600 deletions

6
CREDIT
View File

@@ -7,8 +7,11 @@ project ( http://www.kde.org/ ).
Thanks to Loic for his mathematics-related explanations. Thanks to Loic for his mathematics-related explanations.
Thanks to Nicolas for the Mac OS X experimentations. Thanks to Nicolas for the Mac OS X experimentations.
Thanks to Remi Collet for the Fedora packaging. Thanks to Remi Collet for the Fedora packaging.
Thanks to Piotr SQLek Skólski for the Debian packaging.
Thanks to `trem' for the Mandriva packaging.
Thanks to TuxFamily ( http://tuxfamily.org ) for hosting the project. Thanks to TuxFamily ( http://tuxfamily.org ) for hosting the project.
Thanks to `Nishiki' for his elements and his support. Thanks to `Nishiki' for his elements and his support.
Thanks to qtcentre.org for their SingleApplication class.
[fr] [fr]
Merci à Trolltech pour la bibliothèque Qt ( http://trolltech.com/ ), sous Merci à Trolltech pour la bibliothèque Qt ( http://trolltech.com/ ), sous
@@ -19,5 +22,8 @@ http://www.kde.org/ ).
Merci à Loic pour ses explications d'ordre mathématique. Merci à Loic pour ses explications d'ordre mathématique.
Merci à Nicolas pour les expérimentations Mac OS X. Merci à Nicolas pour les expérimentations Mac OS X.
Merci à Remi Collet pour les paquets Fedora. Merci à Remi Collet pour les paquets Fedora.
Merci à Piotr SQLek Skólski pour les paquets Debian.
Merci à `trem' pour les paquets Mandriva.
Merci à TuxFamily ( http://tuxfamily.org ) pour l'hébergement du projet. Merci à TuxFamily ( http://tuxfamily.org ) pour l'hébergement du projet.
Merci à `Nishiki' pour ses éléments et son soutien. Merci à `Nishiki' pour ses éléments et son soutien.
Merci à qtcentre.org pour leur classe SingleApplication.

View File

@@ -1,14 +1,14 @@
# Doxyfile 1.5.1-KDevelop # Doxyfile 1.5.5
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
# Project related configuration options # Project related configuration options
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
DOXYFILE_ENCODING = UTF-8
PROJECT_NAME = QElectroTech PROJECT_NAME = QElectroTech
PROJECT_NUMBER = 0.1 PROJECT_NUMBER = 0.1
OUTPUT_DIRECTORY = OUTPUT_DIRECTORY =
CREATE_SUBDIRS = NO CREATE_SUBDIRS = NO
OUTPUT_LANGUAGE = French OUTPUT_LANGUAGE = French
USE_WINDOWS_ENCODING = NO
BRIEF_MEMBER_DESC = YES BRIEF_MEMBER_DESC = YES
REPEAT_BRIEF = YES REPEAT_BRIEF = YES
ABBREVIATE_BRIEF = "The $name class" \ ABBREVIATE_BRIEF = "The $name class" \
@@ -29,6 +29,7 @@ STRIP_FROM_PATH = /home/data/chaos/projets/qet/qelectrotech/
STRIP_FROM_INC_PATH = STRIP_FROM_INC_PATH =
SHORT_NAMES = NO SHORT_NAMES = NO
JAVADOC_AUTOBRIEF = NO JAVADOC_AUTOBRIEF = NO
QT_AUTOBRIEF = NO
MULTILINE_CPP_IS_BRIEF = NO MULTILINE_CPP_IS_BRIEF = NO
DETAILS_AT_TOP = NO DETAILS_AT_TOP = NO
INHERIT_DOCS = YES INHERIT_DOCS = YES
@@ -37,9 +38,14 @@ TAB_SIZE = 4
ALIASES = ALIASES =
OPTIMIZE_OUTPUT_FOR_C = NO OPTIMIZE_OUTPUT_FOR_C = NO
OPTIMIZE_OUTPUT_JAVA = NO OPTIMIZE_OUTPUT_JAVA = NO
OPTIMIZE_FOR_FORTRAN = NO
OPTIMIZE_OUTPUT_VHDL = NO
BUILTIN_STL_SUPPORT = NO BUILTIN_STL_SUPPORT = NO
CPP_CLI_SUPPORT = NO
SIP_SUPPORT = NO
DISTRIBUTE_GROUP_DOC = NO DISTRIBUTE_GROUP_DOC = NO
SUBGROUPING = YES SUBGROUPING = YES
TYPEDEF_HIDES_STRUCT = NO
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
# Build related configuration options # Build related configuration options
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
@@ -48,6 +54,7 @@ EXTRACT_PRIVATE = NO
EXTRACT_STATIC = YES EXTRACT_STATIC = YES
EXTRACT_LOCAL_CLASSES = YES EXTRACT_LOCAL_CLASSES = YES
EXTRACT_LOCAL_METHODS = NO EXTRACT_LOCAL_METHODS = NO
EXTRACT_ANON_NSPACES = NO
HIDE_UNDOC_MEMBERS = NO HIDE_UNDOC_MEMBERS = NO
HIDE_UNDOC_CLASSES = NO HIDE_UNDOC_CLASSES = NO
HIDE_FRIEND_COMPOUNDS = NO HIDE_FRIEND_COMPOUNDS = NO
@@ -59,6 +66,7 @@ SHOW_INCLUDE_FILES = YES
INLINE_INFO = YES INLINE_INFO = YES
SORT_MEMBER_DOCS = YES SORT_MEMBER_DOCS = YES
SORT_BRIEF_DOCS = NO SORT_BRIEF_DOCS = NO
SORT_GROUP_NAMES = NO
SORT_BY_SCOPE_NAME = NO SORT_BY_SCOPE_NAME = NO
GENERATE_TODOLIST = NO GENERATE_TODOLIST = NO
GENERATE_TESTLIST = NO GENERATE_TESTLIST = NO
@@ -82,7 +90,8 @@ WARN_LOGFILE =
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
# configuration options related to the input files # configuration options related to the input files
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
INPUT = /home/data/chaos/projets/qet/qelectrotech INPUT =
INPUT_ENCODING = UTF-8
FILE_PATTERNS = *.h \ FILE_PATTERNS = *.h \
*.cpp *.cpp
RECURSIVE = YES RECURSIVE = YES
@@ -92,6 +101,7 @@ EXCLUDE = moc_* \
debug debug
EXCLUDE_SYMLINKS = NO EXCLUDE_SYMLINKS = NO
EXCLUDE_PATTERNS = EXCLUDE_PATTERNS =
EXCLUDE_SYMBOLS =
EXAMPLE_PATH = EXAMPLE_PATH =
EXAMPLE_PATTERNS = * EXAMPLE_PATTERNS = *
EXAMPLE_RECURSIVE = NO EXAMPLE_RECURSIVE = NO
@@ -127,6 +137,10 @@ HTML_FOOTER =
HTML_STYLESHEET = HTML_STYLESHEET =
HTML_ALIGN_MEMBERS = YES HTML_ALIGN_MEMBERS = YES
GENERATE_HTMLHELP = NO GENERATE_HTMLHELP = NO
GENERATE_DOCSET = NO
DOCSET_FEEDNAME = "Doxygen generated docs"
DOCSET_BUNDLE_ID = org.doxygen.Project
HTML_DYNAMIC_SECTIONS = NO
CHM_FILE = CHM_FILE =
HHC_LOCATION = HHC_LOCATION =
GENERATE_CHI = NO GENERATE_CHI = NO
@@ -210,6 +224,7 @@ PERL_PATH = /usr/bin/perl
# Configuration options related to the dot tool # Configuration options related to the dot tool
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
CLASS_DIAGRAMS = YES CLASS_DIAGRAMS = YES
MSCGEN_PATH =
HIDE_UNDOC_RELATIONS = YES HIDE_UNDOC_RELATIONS = YES
HAVE_DOT = YES HAVE_DOT = YES
CLASS_GRAPH = YES CLASS_GRAPH = YES
@@ -226,8 +241,7 @@ DIRECTORY_GRAPH = YES
DOT_IMAGE_FORMAT = png DOT_IMAGE_FORMAT = png
DOT_PATH = DOT_PATH =
DOTFILE_DIRS = DOTFILE_DIRS =
MAX_DOT_GRAPH_WIDTH = 1024 DOT_GRAPH_MAX_NODES = 50
MAX_DOT_GRAPH_HEIGHT = 1024
MAX_DOT_GRAPH_DEPTH = 1000 MAX_DOT_GRAPH_DEPTH = 1000
DOT_TRANSPARENT = NO DOT_TRANSPARENT = NO
DOT_MULTI_TARGETS = NO DOT_MULTI_TARGETS = NO

View File

@@ -6,6 +6,7 @@ cupsys-bsd for printing
Howto compile : Howto compile :
$ qmake (qmake-qt4 for Debian-based systems) $ qmake (qmake-qt4 for Debian-based systems)
$ make $ make
# umask 0022
# make install # make install
[fr] [fr]
@@ -16,4 +17,5 @@ cupsys-bsd pour l'impression
Comment compiler : Comment compiler :
$ qmake (qmake-qt4 pour les systèmes basés sur Debian) $ qmake (qmake-qt4 pour les systèmes basés sur Debian)
$ make $ make
# umask 0022
# make install # make install

View File

@@ -1,231 +0,0 @@
/*
Copyright 2006-2008 Xavier Guerrin
This file is part of QElectroTech.
QElectroTech is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
QElectroTech is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
*/
#include "borderinset.h"
#include "qetapp.h"
/**
Constructeur simple : construit une bordure de 15 colonnes de 50x500 avec
un cartouche de 400x50.
@param parent QObject parent de ce BorderInset
*/
BorderInset::BorderInset(QObject *parent) : QObject(parent) {
nb_columns = qMax(3, QETApp::settings().value("diagrameditor/defaultcols", 15).toInt());
min_nb_columns = 3;
columns_width = QETApp::settings().value("diagrameditor/defaultcolsize", 50.0).toDouble();
columns_height = QETApp::settings().value("diagrameditor/defaultheight", 500.0).toDouble();
min_columns_height = 80.0;
inset_width = nb_columns * columns_width;
inset_height = 50.0;
columns_header_height = 20.0;
display_inset = true;
display_columns = true;
display_border = true;
updateRectangles();
bi_author = QETApp::settings().value("diagrameditor/defaultauthor").toString();
bi_title = QETApp::settings().value("diagrameditor/defaulttitle").toString();
bi_folio = QETApp::settings().value("diagrameditor/defaultfolio").toString();
bi_filename = QETApp::settings().value("diagrameditor/defaultfilename").toString();
QString settings_date = QETApp::settings().value("diagrameditor/defaultdate").toString();
if (settings_date == "now") bi_date = QDate::currentDate();
else if (settings_date.isEmpty() || settings_date == "null") bi_date = QDate();
else bi_date = QDate::fromString(settings_date, "yyyyMMdd");
}
/**
Destructeur - ne fait rien
*/
BorderInset::~BorderInset() {
}
/**
Methode recalculant les rectangles composant le cadre et le cartouche en
fonction des attributs de taille
*/
void BorderInset::updateRectangles() {
// rectangle delimitant le schema
QRectF previous_border = border;
border = QRectF(0, 0, nb_columns * columns_width, columns_height);
if (border != previous_border) emit(borderChanged(previous_border, border));
// rectangles relatifs au cartouche
inset = QRectF(border.bottomLeft().x(), border.bottomLeft().y(), inset_width, inset_height);
inset_author = QRectF(inset.topLeft(), QSizeF(2.0 * inset_width / 9.0, 0.5 * inset_height));
inset_date = QRectF(inset_author.bottomLeft(), inset_author.size());
inset_title = QRectF(inset_author.topRight(), QSizeF(5.0 * inset_width / 9.0, inset_height));
inset_file = QRectF(inset_title.topRight(), inset_author.size());
inset_folio = QRectF(inset_file.bottomLeft(), inset_author.size());
}
/**
Dessine le cadre et le cartouche
@param qp QPainter a utiliser pour dessiner le cadre et le cartouche
@param x Abscisse du cadre
@param y Ordonnee du cadre
*/
void BorderInset::draw(QPainter *qp, qreal x, qreal y) {
// translate tous les rectangles
border .translate(x, y);
inset .translate(x, y);
inset_author.translate(x, y);
inset_date .translate(x, y);
inset_title .translate(x, y);
inset_file .translate(x, y);
inset_folio .translate(x, y);
// prepare le QPainter
qp -> save();
qp -> setPen(Qt::black);
qp -> setBrush(Qt::NoBrush);
// dessine le cadre
if (display_border) qp -> drawRect(border);
// dessine la numerotation des colonnes
if (display_columns) {
qp -> setBrush(Qt::white);
for (int i = 1 ; i <= nb_columns ; ++ i) {
QRectF numbered_rectangle = QRectF(
border.topLeft().x() + ((i - 1) * columns_width),
border.topLeft().y(),
columns_width,
columns_header_height
);
qp -> drawRect(numbered_rectangle);
qp -> drawText(numbered_rectangle, Qt::AlignVCenter | Qt::AlignCenter, QString("%1").arg(i));
}
}
// dessine le cartouche
if (display_inset) {
qp -> setBrush(Qt::white);
qp -> drawRect(inset);
qp -> drawRect(inset_author);
qp -> drawText(inset_author, Qt::AlignVCenter | Qt::AlignLeft, tr(" Auteur : ") + bi_author);
qp -> drawRect(inset_date);
qp -> drawText(inset_date, Qt::AlignVCenter | Qt::AlignLeft, tr(" Date : ") + bi_date.toString("dd/MM/yyyy"));
qp -> drawRect(inset_title);
qp -> drawText(inset_title, Qt::AlignVCenter | Qt::AlignCenter, tr("Titre du document : ") + bi_title);
qp -> drawRect(inset_file);
qp -> drawText(inset_file, Qt::AlignVCenter | Qt::AlignLeft, tr(" Fichier : ") + bi_filename);
qp -> drawRect(inset_folio);
qp -> drawText(inset_folio, Qt::AlignVCenter | Qt::AlignLeft, tr(" Folio : ") + bi_folio);
}
qp -> restore();
// annule la translation des rectangles
border .translate(-x, -y);
inset .translate(-x, -y);
inset_author.translate(-x, -y);
inset_date .translate(-x, -y);
inset_title .translate(-x, -y);
inset_file .translate(-x, -y);
inset_folio .translate(-x, -y);
}
/**
Ajoute une colonne.
*/
void BorderInset::addColumn() {
++ nb_columns;
setInsetWidth(nb_columns * columns_width);
updateRectangles();
}
/**
Enleve une colonne. Il doit rester au moins 3 colonnes.
*/
void BorderInset::removeColumn() {
if (nb_columns == min_nb_columns) return;
-- nb_columns;
setInsetWidth(nb_columns * columns_width);
updateRectangles();
}
/**
Permet de changer le nombre de colonnes.
Si ce nombre de colonnes est inferieur au minimum requis, cette fonction ne
fait rien
@param nb_c nouveau nombre de colonnes
@see minNbColumns()
*/
void BorderInset::setNbColumns(int nb_c) {
if (nb_c < min_nb_columns) return;
nb_columns = nb_c;
setInsetWidth(nb_columns * columns_width);
updateRectangles();
}
/**
Change la largeur des colonnes ; celle-ci doit rester comprise entre 10 et
200px.
*/
void BorderInset::setColumnsWidth(const qreal &new_cw) {
columns_width = qBound(10.0, new_cw, 200.0);
updateRectangles();
}
/**
Change la hauteur des en-tetes contenant les numeros de colonnes. Celle-ci
doit rester comprise entre 5 et 50 px.
*/
void BorderInset::setColumnsHeaderHeight(const qreal &new_chh) {
columns_header_height = qBound(5.0, new_chh, 50.0);
updateRectangles();
}
/**
Change la hauteur des colonnes (et donc du cadre). Cette hauteur doit
rester superieure a la hauteur des en-tetes de colonnes + 20px.
*/
void BorderInset::setColumnsHeight(const qreal &new_ch) {
columns_height = qMax(columns_header_height + min_columns_height, new_ch);
updateRectangles();
}
/**
Change la largeur du cartouche. Cette largeur doit rester comprise entre
100px et la largeur du cartouche
*/
void BorderInset::setInsetWidth(const qreal &new_iw) {
inset_width = qMax(100.0, qMin(nb_columns * columns_width, new_iw));
updateRectangles();
}
/**
Change la hauteur du cartouche. Cette largeur doit rester comprise entre
20px et la hauteur du cartouche.
*/
void BorderInset::setInsetHeight(const qreal &new_ih) {
inset_height = qMax(20.0, qMin(columns_height, new_ih));
updateRectangles();
}
/**
Ajuste la largeur du cartouche de facon a ce que celui-ci soit aussi large
que le schema
*/
void BorderInset::adjustInsetToColumns() {
setInsetWidth(nbColumn() * columnsWidth());
}

View File

@@ -1,4 +1,4 @@
<definition width="50" version="0.1" hotspot_x="10" hotspot_y="25" height="50" type="element" orientation="dnny" > <definition width="50" version="0.1" hotspot_x="10" hotspot_y="25" height="50" type="element" ic="true" orientation="dnny" >
<names> <names>
<name lang="en" >Contact power contactor (NC)</name> <name lang="en" >Contact power contactor (NC)</name>
<name lang="fr" >Contact puissance contacteur (NF)</name> <name lang="fr" >Contact puissance contacteur (NF)</name>

View File

@@ -1,4 +1,4 @@
<definition width="60" version="0.1" hotspot_x="10" hotspot_y="25" height="50" type="element" orientation="dnny" > <definition width="60" version="0.1" hotspot_x="10" hotspot_y="25" height="50" type="element" ic="true" orientation="dnny" >
<names> <names>
<name lang="en" >Contact power contactor (NC)</name> <name lang="en" >Contact power contactor (NC)</name>
<name lang="fr" >Contact puissance contacteur (NF)</name> <name lang="fr" >Contact puissance contacteur (NF)</name>

View File

@@ -1,4 +1,4 @@
<definition width="70" version="0.1" hotspot_x="10" hotspot_y="25" height="50" type="element" orientation="dnny" > <definition width="70" version="0.1" hotspot_x="10" hotspot_y="25" height="50" type="element" ic="true" orientation="dnny" >
<names> <names>
<name lang="en" >Contact power contactor (NC)</name> <name lang="en" >Contact power contactor (NC)</name>
<name lang="fr" >Contact puissance contacteur (NF)</name> <name lang="fr" >Contact puissance contacteur (NF)</name>

View File

@@ -1,4 +1,4 @@
<definition width="70" version="0.1" hotspot_x="10" hotspot_y="25" height="50" type="element" orientation="dnny" > <definition width="70" version="0.1" hotspot_x="10" hotspot_y="25" height="50" type="element" ic="true" orientation="dnny" >
<names> <names>
<name lang="en" >Contact power contactor (NC)</name> <name lang="en" >Contact power contactor (NC)</name>
<name lang="fr" >Contact puissance contacteur (NF)</name> <name lang="fr" >Contact puissance contacteur (NF)</name>

View File

@@ -1,4 +1,4 @@
<definition width="40" version="0.1" hotspot_x="10" hotspot_y="25" height="50" type="element" orientation="dnny" > <definition width="40" version="0.1" hotspot_x="10" hotspot_y="25" height="50" type="element" ic="true" orientation="dnny" >
<names> <names>
<name lang="en" >Contact power contactor</name> <name lang="en" >Contact power contactor</name>
<name lang="fr" >Contact puissance contacteur</name> <name lang="fr" >Contact puissance contacteur</name>

View File

@@ -1,4 +1,4 @@
<definition width="60" version="0.1" hotspot_x="10" hotspot_y="25" height="50" type="element" orientation="dnny" > <definition width="60" version="0.1" hotspot_x="10" hotspot_y="25" height="50" type="element" ic="true" orientation="dnny" >
<names> <names>
<name lang="en" >Contact power contactor</name> <name lang="en" >Contact power contactor</name>
<name lang="fr" >Contact puissance contacteur</name> <name lang="fr" >Contact puissance contacteur</name>

View File

@@ -1,4 +1,4 @@
<definition width="70" version="0.1" hotspot_x="10" hotspot_y="25" height="50" type="element" orientation="dnny" > <definition width="70" version="0.1" hotspot_x="10" hotspot_y="25" height="50" type="element" ic="true" orientation="dnny" >
<names> <names>
<name lang="en" >Contact power contactor</name> <name lang="en" >Contact power contactor</name>
<name lang="fr" >Contact puissance contacteur</name> <name lang="fr" >Contact puissance contacteur</name>

View File

@@ -1,4 +1,4 @@
<definition width="70" version="0.1" hotspot_x="10" hotspot_y="25" height="50" type="element" orientation="dnny" > <definition width="70" version="0.1" hotspot_x="10" hotspot_y="25" height="50" type="element" ic="true" orientation="dnny" >
<names> <names>
<name lang="en" >Contact power contactor</name> <name lang="en" >Contact power contactor</name>
<name lang="fr" >Contact puissance contacteur</name> <name lang="fr" >Contact puissance contacteur</name>

340
examples/domestique.qet Normal file
View File

@@ -0,0 +1,340 @@
<project version="0.1" >
<diagram title="Exemple d'instalation domestique" displayrows="true" cols="15" folio="" displaycols="true" height="340" colsize="50" rows="4" author="Benoît A" filename="Exemples QET" rowsize="80" >
<defaultconductor neutral="true" phase="1" ground="true" type="single" />
<elements>
<element x="150" y="220" type="common://protections/disjoncteurs/disjoncteur1.elmt" orientation="0" >
<terminals>
<terminal x="0" y="-17" id="0" orientation="0" />
<terminal x="0" y="17" id="1" orientation="2" />
</terminals>
<inputs>
<input x="2.75" y="3" text="PC" />
</inputs>
</element>
<element x="650" y="310" type="common://recepteurs/misc/pc.elmt" orientation="0" >
<terminals>
<terminal x="0" y="-17" id="2" orientation="0" />
</terminals>
<inputs/>
</element>
<element x="350" y="300" type="common://recepteurs/domestiques/convecteur.elmt" orientation="0" >
<terminals>
<terminal x="0" y="-8" id="3" orientation="0" />
</terminals>
<inputs/>
</element>
<element x="250" y="300" type="common://recepteurs/domestiques/convecteur.elmt" orientation="0" >
<terminals>
<terminal x="0" y="-8" id="4" orientation="0" />
</terminals>
<inputs/>
</element>
<element x="200" y="310" type="common://recepteurs/lampes/lampe1.elmt" orientation="0" >
<terminals>
<terminal x="0" y="-17" id="5" orientation="0" />
</terminals>
<inputs>
<input x="15" y="3" text="" />
</inputs>
</element>
<element x="50" y="220" type="common://protections/disjoncteurs/disjoncteur1.elmt" orientation="0" >
<terminals>
<terminal x="0" y="-17" id="6" orientation="0" />
<terminal x="0" y="17" id="7" orientation="2" />
</terminals>
<inputs>
<input x="2.75" y="3" text="PC" />
</inputs>
</element>
<element x="450" y="300" type="common://recepteurs/domestiques/lave_vaiselle.elmt" orientation="0" >
<terminals>
<terminal x="0" y="-8" id="8" orientation="0" />
</terminals>
<inputs/>
</element>
<element x="150" y="310" type="common://recepteurs/misc/pc.elmt" orientation="0" >
<terminals>
<terminal x="0" y="-17" id="9" orientation="0" />
</terminals>
<inputs/>
</element>
<element x="100" y="220" type="common://protections/disjoncteurs/disjoncteur1.elmt" orientation="0" >
<terminals>
<terminal x="0" y="-17" id="10" orientation="0" />
<terminal x="0" y="17" id="11" orientation="2" />
</terminals>
<inputs>
<input x="2.75" y="3" text="Lum" />
</inputs>
</element>
<element x="50" y="60" type="common://protections/disjoncteurs_differentiels/ddr1.elmt" orientation="0" >
<terminals>
<terminal x="0" y="-17" id="12" orientation="0" />
<terminal x="0" y="17" id="13" orientation="2" />
</terminals>
<inputs>
<input x="5" y="-3" text="Distributeur" />
<input x="9" y="14" text="500mA" />
</inputs>
</element>
<element x="50" y="140" type="common://protections/disjoncteurs_differentiels/ddr1.elmt" orientation="0" >
<terminals>
<terminal x="0" y="-17" id="14" orientation="0" />
<terminal x="0" y="17" id="15" orientation="2" />
</terminals>
<inputs>
<input x="5" y="-3" text="Salon" />
<input x="9" y="14" text="30mA" />
</inputs>
</element>
<element x="150" y="140" type="common://protections/disjoncteurs_differentiels/ddr1.elmt" orientation="0" >
<terminals>
<terminal x="0" y="-17" id="16" orientation="0" />
<terminal x="0" y="17" id="17" orientation="2" />
</terminals>
<inputs>
<input x="5" y="-3" text="SDB" />
<input x="9" y="14" text="30mA" />
</inputs>
</element>
<element x="650" y="140" type="common://protections/disjoncteurs_differentiels/ddr1.elmt" orientation="0" >
<terminals>
<terminal x="0" y="-17" id="18" orientation="0" />
<terminal x="0" y="17" id="19" orientation="2" />
</terminals>
<inputs>
<input x="5" y="-3" text="Chambre" />
<input x="9" y="14" text="30mA" />
</inputs>
</element>
<element x="300" y="140" type="common://protections/disjoncteurs_differentiels/ddr1.elmt" orientation="0" >
<terminals>
<terminal x="0" y="-17" id="20" orientation="0" />
<terminal x="0" y="17" id="21" orientation="2" />
</terminals>
<inputs>
<input x="5" y="-3" text="Cuisine" />
<input x="9" y="14" text="30mA" />
</inputs>
</element>
<element x="750" y="150" type="common://protections/disjoncteurs/disjoncteur1.elmt" orientation="0" >
<terminals>
<terminal x="0" y="-17" id="22" orientation="0" />
<terminal x="0" y="17" id="23" orientation="2" />
</terminals>
<inputs>
<input x="2.75" y="3" text="Ent" />
</inputs>
</element>
<element x="400" y="300" type="common://recepteurs/domestiques/lave_linge.elmt" orientation="0" >
<terminals>
<terminal x="0" y="-8" id="24" orientation="0" />
</terminals>
<inputs/>
</element>
<element x="600" y="310" type="common://recepteurs/lampes/lampe1.elmt" orientation="0" >
<terminals>
<terminal x="0" y="-17" id="25" orientation="0" />
</terminals>
<inputs>
<input x="15" y="3" text="" />
</inputs>
</element>
<element x="750" y="310" type="common://recepteurs/lampes/lampe1.elmt" orientation="0" >
<terminals>
<terminal x="0" y="-17" id="26" orientation="0" />
</terminals>
<inputs>
<input x="15" y="3" text="" />
</inputs>
</element>
<element x="100" y="310" type="common://recepteurs/lampes/lampe1.elmt" orientation="0" >
<terminals>
<terminal x="0" y="-17" id="27" orientation="0" />
</terminals>
<inputs>
<input x="15" y="3" text="" />
</inputs>
</element>
<element x="500" y="300" type="common://recepteurs/domestiques/four.elmt" orientation="0" >
<terminals>
<terminal x="0" y="-8" id="28" orientation="0" />
</terminals>
<inputs/>
</element>
<element x="550" y="300" type="common://recepteurs/domestiques/plaque_cuisson.elmt" orientation="0" >
<terminals>
<terminal x="0" y="-8" id="29" orientation="0" />
</terminals>
<inputs/>
</element>
<element x="700" y="310" type="common://recepteurs/lampes/lampe1.elmt" orientation="0" >
<terminals>
<terminal x="0" y="-17" id="30" orientation="0" />
</terminals>
<inputs>
<input x="15" y="3" text="" />
</inputs>
</element>
<element x="300" y="310" type="common://recepteurs/misc/pc.elmt" orientation="0" >
<terminals>
<terminal x="0" y="-17" id="31" orientation="0" />
</terminals>
<inputs/>
</element>
<element x="50" y="310" type="common://recepteurs/misc/pc.elmt" orientation="0" >
<terminals>
<terminal x="0" y="-17" id="32" orientation="0" />
</terminals>
<inputs/>
</element>
<element x="200" y="220" type="common://protections/disjoncteurs/disjoncteur1.elmt" orientation="0" >
<terminals>
<terminal x="0" y="-17" id="33" orientation="0" />
<terminal x="0" y="17" id="34" orientation="2" />
</terminals>
<inputs>
<input x="2.75" y="3" text="Lum" />
</inputs>
</element>
<element x="250" y="220" type="common://protections/disjoncteurs/disjoncteur1.elmt" orientation="0" >
<terminals>
<terminal x="0" y="-17" id="35" orientation="0" />
<terminal x="0" y="17" id="36" orientation="2" />
</terminals>
<inputs>
<input x="2.75" y="3" text="Rad" />
</inputs>
</element>
<element x="300" y="220" type="common://protections/disjoncteurs/disjoncteur1.elmt" orientation="0" >
<terminals>
<terminal x="0" y="-17" id="37" orientation="0" />
<terminal x="0" y="17" id="38" orientation="2" />
</terminals>
<inputs>
<input x="2.75" y="3" text="PC" />
</inputs>
</element>
<element x="350" y="220" type="common://protections/disjoncteurs/disjoncteur1.elmt" orientation="0" >
<terminals>
<terminal x="0" y="-17" id="39" orientation="0" />
<terminal x="0" y="17" id="40" orientation="2" />
</terminals>
<inputs>
<input x="2.75" y="3" text="Rad" />
</inputs>
</element>
<element x="400" y="220" type="common://protections/disjoncteurs/disjoncteur1.elmt" orientation="0" >
<terminals>
<terminal x="0" y="-17" id="41" orientation="0" />
<terminal x="0" y="17" id="42" orientation="2" />
</terminals>
<inputs>
<input x="2.75" y="3" text="Linge" />
</inputs>
</element>
<element x="450" y="220" type="common://protections/disjoncteurs/disjoncteur1.elmt" orientation="0" >
<terminals>
<terminal x="0" y="-17" id="43" orientation="0" />
<terminal x="0" y="17" id="44" orientation="2" />
</terminals>
<inputs>
<input x="2.75" y="3" text="Ves." />
</inputs>
</element>
<element x="500" y="220" type="common://protections/disjoncteurs/disjoncteur1.elmt" orientation="0" >
<terminals>
<terminal x="0" y="-17" id="45" orientation="0" />
<terminal x="0" y="17" id="46" orientation="2" />
</terminals>
<inputs>
<input x="2.75" y="3" text="Four" />
</inputs>
</element>
<element x="550" y="220" type="common://protections/disjoncteurs/disjoncteur1.elmt" orientation="0" >
<terminals>
<terminal x="0" y="-17" id="47" orientation="0" />
<terminal x="0" y="17" id="48" orientation="2" />
</terminals>
<inputs>
<input x="2.75" y="3" text="Cuis." />
</inputs>
</element>
<element x="600" y="220" type="common://protections/disjoncteurs/disjoncteur1.elmt" orientation="0" >
<terminals>
<terminal x="0" y="-17" id="49" orientation="0" />
<terminal x="0" y="17" id="50" orientation="2" />
</terminals>
<inputs>
<input x="2.75" y="3" text="Lum" />
</inputs>
</element>
<element x="650" y="220" type="common://protections/disjoncteurs/disjoncteur1.elmt" orientation="0" >
<terminals>
<terminal x="0" y="-17" id="51" orientation="0" />
<terminal x="0" y="17" id="52" orientation="2" />
</terminals>
<inputs>
<input x="2.75" y="3" text="PC" />
</inputs>
</element>
<element x="700" y="220" type="common://protections/disjoncteurs/disjoncteur1.elmt" orientation="0" >
<terminals>
<terminal x="0" y="-17" id="53" orientation="0" />
<terminal x="0" y="17" id="54" orientation="2" />
</terminals>
<inputs>
<input x="2.75" y="3" text="Lum" />
</inputs>
</element>
</elements>
<conductors>
<conductor neutral="true" phase="1" terminal1="11" ground="true" terminal2="27" type="single" />
<conductor neutral="true" phase="1" terminal1="7" ground="true" terminal2="32" type="single" />
<conductor neutral="true" phase="1" terminal1="6" ground="true" terminal2="10" type="single" />
<conductor neutral="true" phase="1" terminal1="23" ground="true" terminal2="26" type="single" />
<conductor neutral="true" phase="1" terminal1="15" ground="true" terminal2="6" type="single" />
<conductor neutral="true" phase="1" terminal1="13" ground="true" terminal2="14" type="single" />
<conductor neutral="true" phase="1" terminal1="16" ground="true" terminal2="20" type="single" />
<conductor neutral="true" phase="1" terminal1="13" ground="true" terminal2="16" type="single" >
<segment length="6.5" orientation="vertical" />
<segment length="22.5" orientation="vertical" />
<segment length="100" orientation="horizontal" />
<segment length="2.5" orientation="vertical" />
<segment length="6.5" orientation="vertical" />
</conductor>
<conductor neutral="true" phase="1" terminal1="20" ground="true" terminal2="18" type="single" />
<conductor neutral="true" phase="1" terminal1="18" ground="true" terminal2="22" type="single" >
<segment length="-6.5" orientation="vertical" />
<segment length="-2.5" orientation="vertical" />
<segment length="100" orientation="horizontal" />
<segment length="7.5" orientation="vertical" />
<segment length="11.5" orientation="vertical" />
</conductor>
<conductor neutral="true" phase="1" terminal1="17" ground="true" terminal2="0" type="single" />
<conductor neutral="true" phase="1" terminal1="1" ground="true" terminal2="9" type="single" />
<conductor neutral="true" phase="1" terminal1="0" ground="true" terminal2="33" type="single" />
<conductor neutral="true" phase="1" terminal1="34" ground="true" terminal2="5" type="single" />
<conductor neutral="true" phase="1" terminal1="33" ground="true" terminal2="35" type="single" />
<conductor neutral="true" phase="1" terminal1="4" ground="true" terminal2="36" type="single" />
<conductor neutral="true" phase="1" terminal1="21" ground="true" terminal2="37" type="single" />
<conductor neutral="true" phase="1" terminal1="37" ground="true" terminal2="39" type="single" />
<conductor neutral="true" phase="1" terminal1="39" ground="true" terminal2="41" type="single" />
<conductor neutral="true" phase="1" terminal1="41" ground="true" terminal2="43" type="single" />
<conductor neutral="true" phase="1" terminal1="43" ground="true" terminal2="45" type="single" />
<conductor neutral="true" phase="1" terminal1="45" ground="true" terminal2="47" type="single" />
<conductor neutral="true" phase="1" terminal1="47" ground="true" terminal2="49" type="single" />
<conductor neutral="true" phase="1" terminal1="19" ground="true" terminal2="51" type="single" />
<conductor neutral="true" phase="1" terminal1="51" ground="true" terminal2="53" type="single" />
<conductor neutral="true" phase="1" terminal1="38" ground="true" terminal2="31" type="single" />
<conductor neutral="true" phase="1" terminal1="3" ground="true" terminal2="40" type="single" />
<conductor neutral="true" phase="1" terminal1="24" ground="true" terminal2="42" type="single" />
<conductor neutral="true" phase="1" terminal1="8" ground="true" terminal2="44" type="single" />
<conductor neutral="true" phase="1" terminal1="28" ground="true" terminal2="46" type="single" />
<conductor neutral="true" phase="1" terminal1="29" ground="true" terminal2="48" type="single" />
<conductor neutral="true" phase="1" terminal1="50" ground="true" terminal2="25" type="single" />
<conductor neutral="true" phase="1" terminal1="52" ground="true" terminal2="2" type="single" />
<conductor neutral="true" phase="1" terminal1="54" ground="true" terminal2="30" type="single" />
</conductors>
</diagram>
</project>

383
examples/double_sens.qet Normal file
View File

@@ -0,0 +1,383 @@
<project version="0.1" >
<diagram title="Exemple Moteur double sens" displayrows="true" cols="15" folio="" displaycols="true" height="500" colsize="50" rows="6" author="Benoît A" filename="Exemples QET" rowsize="80" >
<defaultconductor type="simple" />
<elements>
<element x="50" y="70" type="common://sources/multifilaire/src_3pn.elmt" orientation="0" >
<terminals>
<terminal x="6" y="-20" id="0" orientation="1" />
<terminal x="6" y="-10" id="1" orientation="1" />
<terminal x="6" y="0" id="2" orientation="1" />
<terminal x="6" y="10" id="3" orientation="1" />
</terminals>
<inputs/>
</element>
<element x="80" y="140" type="common://protections/disjoncteurs/disjoncteur5.elmt" orientation="0" >
<terminals>
<terminal x="0" y="-17" id="4" orientation="0" />
<terminal x="0" y="17" id="5" orientation="2" />
<terminal x="10" y="-17" id="6" orientation="0" />
<terminal x="10" y="17" id="7" orientation="2" />
<terminal x="20" y="-17" id="8" orientation="0" />
<terminal x="20" y="17" id="9" orientation="2" />
<terminal x="30" y="-17" id="10" orientation="0" />
<terminal x="30" y="17" id="11" orientation="2" />
</terminals>
<inputs>
<input x="32.75" y="3" text="Q1" />
</inputs>
</element>
<element x="90" y="230" type="common://contacts/puissance/normalement_ouverts/com_puiss4.elmt" orientation="0" >
<terminals>
<terminal x="0" y="-17" id="12" orientation="0" />
<terminal x="0" y="17" id="13" orientation="2" />
<terminal x="10" y="-17" id="14" orientation="0" />
<terminal x="10" y="17" id="15" orientation="2" />
<terminal x="20" y="-17" id="16" orientation="0" />
<terminal x="20" y="17" id="17" orientation="2" />
</terminals>
<inputs>
<input x="25" y="3" text="KM1" />
</inputs>
</element>
<element x="190" y="230" type="common://contacts/puissance/normalement_ouverts/com_puiss4.elmt" orientation="0" >
<terminals>
<terminal x="0" y="-17" id="18" orientation="0" />
<terminal x="0" y="17" id="19" orientation="2" />
<terminal x="10" y="-17" id="20" orientation="0" />
<terminal x="10" y="17" id="21" orientation="2" />
<terminal x="20" y="-17" id="22" orientation="0" />
<terminal x="20" y="17" id="23" orientation="2" />
</terminals>
<inputs>
<input x="25" y="3" text="KM2" />
</inputs>
</element>
<element x="350" y="380" type="common://contacts/simples/con_simple_nf.elmt" orientation="0" >
<terminals>
<terminal x="0" y="-17" id="24" orientation="0" />
<terminal x="0" y="17" id="25" orientation="2" />
</terminals>
<inputs>
<input x="5.75" y="3" text="KM2" />
</inputs>
</element>
<element x="100" y="380" type="common://recepteurs/machines/moteur_tri.elmt" orientation="0" >
<terminals>
<terminal x="-10" y="-17" id="26" orientation="0" />
<terminal x="10" y="-17" id="27" orientation="0" />
<terminal x="0" y="-17" id="28" orientation="0" />
</terminals>
<inputs>
<input x="18" y="15" text="M1" />
</inputs>
</element>
<element x="260" y="220" type="common://recepteurs/transformateurs/transfo_mono.elmt" orientation="0" >
<terminals>
<terminal x="0" y="-22" id="29" orientation="0" />
<terminal x="10" y="22" id="30" orientation="2" />
<terminal x="0" y="22" id="31" orientation="2" />
<terminal x="10" y="-22" id="32" orientation="0" />
</terminals>
<inputs>
<input x="20" y="17" text="12V" />
<input x="20" y="-10" text="230V" />
<input x="18" y="3" text="T1" />
</inputs>
</element>
<element x="90" y="320" type="common://protections/relais_thermiques/relais_therm4.elmt" orientation="0" >
<terminals>
<terminal x="0" y="-17" id="33" orientation="0" />
<terminal x="0" y="17" id="34" orientation="2" />
<terminal x="10" y="-17" id="35" orientation="0" />
<terminal x="10" y="17" id="36" orientation="2" />
<terminal x="20" y="-17" id="37" orientation="0" />
<terminal x="20" y="17" id="38" orientation="2" />
</terminals>
<inputs>
<input x="30" y="3" text="F1" />
</inputs>
</element>
<element x="270" y="300" type="common://recepteurs/securite/fusible.elmt" orientation="0" >
<terminals>
<terminal x="0" y="-17" id="39" orientation="0" />
<terminal x="0" y="17" id="40" orientation="2" />
</terminals>
<inputs>
<input x="5" y="3" text="Q2" />
</inputs>
</element>
<element x="350" y="70" type="common://protections/au.elmt" orientation="0" >
<terminals>
<terminal x="0" y="-17" id="41" orientation="0" />
<terminal x="0" y="17" id="42" orientation="2" />
</terminals>
<inputs>
<input x="5.75" y="3" text="AU1" />
</inputs>
</element>
<element x="350" y="140" type="common://contacts/poussoirs/poussoir_nf.elmt" orientation="0" >
<terminals>
<terminal x="0" y="-17" id="43" orientation="0" />
<terminal x="0" y="17" id="44" orientation="2" />
</terminals>
<inputs>
<input x="5.75" y="3" text="S1" />
</inputs>
</element>
<element x="350" y="300" type="common://contacts/poussoirs/poussoir.elmt" orientation="0" >
<terminals>
<terminal x="0" y="-17" id="45" orientation="0" />
<terminal x="0" y="17" id="46" orientation="2" />
</terminals>
<inputs>
<input x="2.75" y="3" text="S2" />
</inputs>
</element>
<element x="400" y="300" type="common://contacts/simples/con_simple.elmt" orientation="0" >
<terminals>
<terminal x="0" y="-17" id="47" orientation="0" />
<terminal x="0" y="17" id="48" orientation="2" />
</terminals>
<inputs>
<input x="2.75" y="3" text="KM1" />
</inputs>
</element>
<element x="450" y="300" type="common://contacts/poussoirs/poussoir.elmt" orientation="0" >
<terminals>
<terminal x="0" y="-17" id="49" orientation="0" />
<terminal x="0" y="17" id="50" orientation="2" />
</terminals>
<inputs>
<input x="2.75" y="3" text="S3" />
</inputs>
</element>
<element x="500" y="300" type="common://contacts/simples/con_simple.elmt" orientation="0" >
<terminals>
<terminal x="0" y="-17" id="51" orientation="0" />
<terminal x="0" y="17" id="52" orientation="2" />
</terminals>
<inputs>
<input x="2.75" y="3" text="KM2" />
</inputs>
</element>
<element x="350" y="220" type="common://contacts/relais_thermique/contact_relais_nf.elmt" orientation="0" >
<terminals>
<terminal x="0" y="-17" id="53" orientation="0" />
<terminal x="0" y="17" id="54" orientation="2" />
</terminals>
<inputs>
<input x="5.75" y="3" text="F1" />
</inputs>
</element>
<element x="450" y="380" type="common://contacts/simples/con_simple_nf.elmt" orientation="0" >
<terminals>
<terminal x="0" y="-17" id="55" orientation="0" />
<terminal x="0" y="17" id="56" orientation="2" />
</terminals>
<inputs>
<input x="5.75" y="3" text="KM1" />
</inputs>
</element>
<element x="350" y="460" type="common://recepteurs/bobines/bobine2.elmt" orientation="0" >
<terminals>
<terminal x="0" y="-17" id="57" orientation="0" />
<terminal x="0" y="17" id="58" orientation="2" />
</terminals>
<inputs>
<input x="30" y="3" text="KM1" />
</inputs>
</element>
<element x="450" y="460" type="common://recepteurs/bobines/bobine2.elmt" orientation="0" >
<terminals>
<terminal x="0" y="-17" id="59" orientation="0" />
<terminal x="0" y="17" id="60" orientation="2" />
</terminals>
<inputs>
<input x="30" y="3" text="KM2" />
</inputs>
</element>
<element x="230" y="310" type="common://recepteurs/securite/terre.elmt" orientation="0" >
<terminals>
<terminal x="0" y="-7" id="61" orientation="0" />
</terminals>
<inputs/>
</element>
<element x="660" y="230" type="common://contacts/simples/con_simple.elmt" orientation="0" >
<terminals>
<terminal x="0" y="-17" id="62" orientation="0" />
<terminal x="0" y="17" id="63" orientation="2" />
</terminals>
<inputs>
<input x="2.75" y="3" text="KM2" />
</inputs>
</element>
<element x="660" y="460" type="common://recepteurs/lampes/lampe2.elmt" orientation="0" >
<terminals>
<terminal x="0" y="-17" id="64" orientation="0" />
<terminal x="0" y="17" id="65" orientation="2" />
</terminals>
<inputs>
<input x="15" y="3" text="H3" />
</inputs>
</element>
<element x="560" y="460" type="common://recepteurs/lampes/lampe2.elmt" orientation="0" >
<terminals>
<terminal x="0" y="-17" id="66" orientation="0" />
<terminal x="0" y="17" id="67" orientation="2" />
</terminals>
<inputs>
<input x="15" y="3" text="H1" />
</inputs>
</element>
<element x="610" y="460" type="common://recepteurs/lampes/lampe2.elmt" orientation="0" >
<terminals>
<terminal x="0" y="-17" id="68" orientation="0" />
<terminal x="0" y="17" id="69" orientation="2" />
</terminals>
<inputs>
<input x="15" y="3" text="H2" />
</inputs>
</element>
<element x="610" y="230" type="common://contacts/simples/con_simple.elmt" orientation="0" >
<terminals>
<terminal x="0" y="-17" id="70" orientation="0" />
<terminal x="0" y="17" id="71" orientation="2" />
</terminals>
<inputs>
<input x="2.75" y="3" text="KM1" />
</inputs>
</element>
<element x="560" y="230" type="common://contacts/relais_thermique/contact_relais.elmt" orientation="0" >
<terminals>
<terminal x="0" y="-17" id="72" orientation="0" />
<terminal x="0" y="17" id="73" orientation="2" />
</terminals>
<inputs>
<input x="2.75" y="3" text="F1" />
</inputs>
</element>
<element x="710" y="460" type="common://recepteurs/lampes/lampe2.elmt" orientation="0" >
<terminals>
<terminal x="0" y="-17" id="74" orientation="0" />
<terminal x="0" y="17" id="75" orientation="2" />
</terminals>
<inputs>
<input x="15" y="3" text="H4" />
</inputs>
</element>
</elements>
<conductors>
<conductor terminal1="3" terminal2="4" type="simple" />
<conductor terminal1="2" terminal2="6" type="simple" />
<conductor terminal1="8" terminal2="1" type="simple" />
<conductor terminal1="0" terminal2="10" type="simple" />
<conductor terminal1="7" terminal2="12" type="simple" />
<conductor terminal1="9" terminal2="14" type="simple" />
<conductor terminal1="11" terminal2="16" type="simple" />
<conductor terminal1="14" terminal2="20" type="simple" >
<segment length="-9" orientation="vertical" />
<segment length="-10" orientation="vertical" />
<segment length="100" orientation="horizontal" />
<segment length="10" orientation="vertical" />
<segment length="9" orientation="vertical" />
</conductor>
<conductor terminal1="16" terminal2="18" type="simple" />
<conductor terminal1="12" terminal2="22" type="simple" >
<segment length="-9" orientation="vertical" />
<segment length="-20" orientation="vertical" />
<segment length="120" orientation="horizontal" />
<segment length="20" orientation="vertical" />
<segment length="9" orientation="vertical" />
</conductor>
<conductor terminal1="5" terminal2="32" type="simple" />
<conductor terminal1="22" terminal2="29" type="simple" >
<segment length="-9" orientation="vertical" />
<segment length="-20" orientation="vertical" />
<segment length="50" orientation="horizontal" />
<segment length="5" orientation="vertical" />
<segment length="9" orientation="vertical" />
</conductor>
<conductor terminal1="33" terminal2="13" type="simple" />
<conductor terminal1="35" terminal2="15" type="simple" />
<conductor terminal1="37" terminal2="17" type="simple" />
<conductor terminal1="37" terminal2="23" type="simple" >
<segment length="-14" orientation="vertical" />
<segment length="5" orientation="vertical" />
<segment length="100" orientation="horizontal" />
<segment length="-25" orientation="vertical" />
<segment length="-14" orientation="vertical" />
</conductor>
<conductor terminal1="35" terminal2="21" type="simple" >
<segment length="-9" orientation="vertical" />
<segment length="-10" orientation="vertical" />
<segment length="100" orientation="horizontal" />
<segment length="-20" orientation="vertical" />
<segment length="-9" orientation="vertical" />
</conductor>
<conductor terminal1="33" terminal2="19" type="simple" />
<conductor terminal1="34" terminal2="26" type="simple" />
<conductor terminal1="36" terminal2="28" type="simple" />
<conductor terminal1="38" terminal2="27" type="simple" />
<conductor terminal1="45" terminal2="47" type="simple" />
<conductor terminal1="47" terminal2="49" type="simple" />
<conductor terminal1="49" terminal2="51" type="simple" />
<conductor terminal1="43" terminal2="42" type="simple" />
<conductor terminal1="30" terminal2="39" type="simple" />
<conductor terminal1="41" terminal2="40" type="simple" >
<segment length="-2.33333" orientation="vertical" />
<segment length="-6.66667" orientation="vertical" />
<segment length="-30" orientation="horizontal" />
<segment length="290" orientation="vertical" />
<segment length="-50" orientation="horizontal" />
<segment length="-6.66667" orientation="vertical" />
<segment length="-2.33333" orientation="vertical" />
</conductor>
<conductor terminal1="24" terminal2="46" type="simple" />
<conductor terminal1="46" terminal2="48" type="simple" />
<conductor terminal1="50" terminal2="52" type="simple" />
<conductor terminal1="50" terminal2="55" type="simple" />
<conductor terminal1="25" terminal2="57" type="simple" />
<conductor terminal1="56" terminal2="59" type="simple" />
<conductor terminal1="60" terminal2="58" type="simple" />
<conductor terminal1="58" terminal2="31" type="simple" />
<conductor terminal1="61" terminal2="31" type="simple" />
<conductor terminal1="44" terminal2="53" type="simple" />
<conductor terminal1="54" terminal2="45" type="simple" />
<conductor terminal1="63" terminal2="64" type="simple" />
<conductor terminal1="71" terminal2="68" type="simple" />
<conductor terminal1="60" terminal2="67" type="simple" />
<conductor terminal1="73" terminal2="66" type="simple" />
<conductor terminal1="75" terminal2="65" type="simple" />
<conductor terminal1="65" terminal2="69" type="simple" />
<conductor terminal1="69" terminal2="67" type="simple" />
<conductor terminal1="42" terminal2="72" type="simple" >
<segment length="9" orientation="vertical" />
<segment length="10" orientation="vertical" />
<segment length="210" orientation="horizontal" />
<segment length="90" orientation="vertical" />
<segment length="9" orientation="vertical" />
</conductor>
<conductor terminal1="70" terminal2="72" type="simple" >
<segment length="-9" orientation="vertical" />
<segment length="-90" orientation="vertical" />
<segment length="-50" orientation="horizontal" />
<segment length="90" orientation="vertical" />
<segment length="9" orientation="vertical" />
</conductor>
<conductor terminal1="62" terminal2="70" type="simple" >
<segment length="-9" orientation="vertical" />
<segment length="-90" orientation="vertical" />
<segment length="-50" orientation="horizontal" />
<segment length="90" orientation="vertical" />
<segment length="9" orientation="vertical" />
</conductor>
<conductor terminal1="74" terminal2="62" type="simple" >
<segment length="-9" orientation="vertical" />
<segment length="-320" orientation="vertical" />
<segment length="-50" orientation="horizontal" />
<segment length="90" orientation="vertical" />
<segment length="9" orientation="vertical" />
</conductor>
</conductors>
</diagram>
</project>

BIN
ico/add_row.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 523 B

BIN
ico/remove_row.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 363 B

BIN
ico/splash.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

10
man/compress_man_pages.sh Executable file
View File

@@ -0,0 +1,10 @@
#!/bin/bash
# Compresses every man page
APP=qelectrotech.1
MAN_DIR=$(dirname $0)/files
find ${MAN_DIR} -type f -name "${APP}" -exec gzip --best {} \;
# correct files permissions
find ${MAN_DIR} -type d -exec chmod a+rx {} \;
find ${MAN_DIR} -type f -name "${APP}.gz" -exec chmod a+r {} \;

View File

@@ -0,0 +1,59 @@
.TH QELECTROTECH 1 "AOÛT 2008" QElectroTech "Manuel utilisateur"
.SH NOM
qelectrotech \- Éditeur de schémas électriques
.SH SYNOPSIS
.B qelectrotech
.B [\-\-common\-elements\-dir\fR=\fIREP\fB]
.B [\-\-config\-dir\-elements\-dir\fR=\fIREP\fB]
.B [\-\-lang\-dir\fR=\fIREP\fB]
.B [\-\-help]
.B [\-v\fR|\fB\-\-version]
.B [\-\-license]
.B [\fIFICHIER\fB]...
.SH DESCRIPTION
QElectroTech est un éditeur de schémas électriques. Les schémas (*.qet) et les éléments électriques (*.elmt) sont enregistrés au format XML.
Les éléments disposables sur le schéma peuvent provenir de la collection commune ou de la collection utilisateur.
Typiquement, la collection commune est accessible à tous les utilisateurs mais elle n'est pas éditable par eux.
La collection utilisateur est propre à chaque utilisateur et peut être modifiée comme bon lui semble.
.SH OPTIONS
.TP
\fB\-\-common\-elements\-dir\fR=\fIREP\fR
Utilise le dossier REP comme racine de la collection d'éléments commune. Note : cette option n'est activée que si la directive QET_ALLOW_OVERRIDE_CED_OPTION a été spécifiée durant la compilation.
.TP
\fB\-\-config\-dir\-elements\fR=\fIREP\fR
Utilise le dossier REP comme dossier de configuration de l'utilisateur courant. Ce dossier accueille un fichier qelectrotech.conf contenant la configuration de l'application et un sous\-dossier elements contenant la collection d'éléments de l'utilisateur. Note : cette option n'est activée que si la directive QET_ALLOW_OVERRIDE_CD_OPTION a été spécifiée durant la compilation.
.TP
\fB\-\-lang\-dir\fR=\fIREP\fR
Recherche les fichiers de traduction de l'application dans le dossier REP.
.TP
\fB\-\-help\fR
Affiche une courte description des options disponibles
.TP
\fB\-v\fR, \fB\-\-version\fR
Affiche la version de l'application (exemple : 0.1).
.TP
\fB\-\-license\fR
Affiche la licence de l'application (GNU/GPL).
À noter que si l'une des trois dernières options est specifiée dans la ligne de commande, le programme s'arrête après affichage de l'information correspondante.
Si une instance de l'application a déjà été lancée par l'utilisateur, c'est celle\-ci qui prendra en compte la ligne de commande, et notamment les fichiers à ouvrir.
Les options redéfinissant les dossiers (collection commune, répertoire de configuration et fichiers de langue) ne seront toutefois pas pris en compte.
Si le nom d'un fichier à ouvrir se termine par .elmt, QElectroTech essaiera de l'ouvrir dans un éditeur d'élément.
Autrement, il les considérera comme des schémas.
.SH AUTEURS
Benoît Ansieau <benoit.ansieau@gmail.com>
.br
Xavier Guerrin <xavier.guerrin@gmail.com>
.SH SIGNALER DES BUGS
Si vous rencontrez un comportement qui vous paraît anormal dans l'application, consultez notre FAQ <http://qelectrotech.tuxfamily.org/wiki/doku.php?id=doc:faq> et notre BugTracker <http://qelectrotech.tuxfamily.org/bugtracker/> pour voir si le problème n'est pas déjà connu. Dans la négative, soumettez un rapport de bug via le BugTracker.
.SH COPYRIGHT
Copyright © Les développeurs de QElectroTech
.br
Licence : GNU/GPL v2+ : <http://www.gnu.org/licenses/old\-licenses/gpl\-2.0.html>
.br
Ce programme est un logiciel libre. Vous pouvez le modifier et le redistribuer. Il est fourni tel quel et sans AUCUNE GARANTIE.
.SH VOIR AUSSI
Site officiel : <http://qelectrotech.tuxfamily.org/>

View File

@@ -0,0 +1,59 @@
.TH QELECTROTECH 1 "AUGUST 2008" QElectroTech "User Manual"
.SH NAME
qelectrotech \- Electric diagrams editor
.SH SYNOPSIS
.B qelectrotech
.B [\-\-common\-elements\-dir\fR=\fIDIR\fB]
.B [\-\-config\-dir\-elements\-dir\fR=\fIDIR\fB]
.B [\-\-lang\-dir\fR=\fIDIR\fB]
.B [\-\-help]
.B [\-v\fR|\fB\-\-version]
.B [\-\-license]
.B [\fIFILE\fB]...
.SH DESCRIPTION
QElectroTech is an electric diagrams editor. Diagrams (*.qet) and electric elements (*.elmt) are stored using the XML format.
The elements that can be used in diagrams may come from the common collection or from the user's custom collection.
Typically, the common collection is readable by all users but it can't be edited by them.
Each user owns its custom collection he can modify as he wants.
.SH OPTIONS
.TP
\fB\-\-common\-elements\-dir\fR=\fIDIR\fR
Uses DIR as the common collection root directory. Note : this option is enabled only if the QET_ALLOW_OVERRIDE_CED_OPTION directive has been specified at compilation time.
.TP
\fB\-\-config\-dir\-elements\fR=\fIDIR\fR
Uses DIR as the current user's configuration directory. This directory hosts a file named qelectrotech.conf, which contains the application configuration, and a subdirectory named elements, which contains the user's elements collection. Note : this option is enabled only if the QET_ALLOW_OVERRIDE_CD_OPTION directive has been specified at compilation time.
.TP
\fB\-\-lang\-dir\fR=\fIDIR\fR
Looks for the application translation files in the directory DIR.
.TP
\fB\-\-help\fR
Displays a short description of the available options.
.TP
\fB\-v\fR, \fB\-\-version\fR
Displays the application version (e.g.: 0.1).
.TP
\fB\-\-license\fR
Displays the application license (GNU/GPL).
Note that if one of the three last options is specified in the command line, the programs stops after having displayed the adequate information.
If an instance of the application launched by the user is still running, this instance will consider the command line, and notably the files to open.
However, options that redefine directories (common collection, configuration and translation files) will not be considered.
If a filename ends with .elmt, QElectroTech will try to open it into an element editor.
Otherwise, it will consider it as diagrams.
.SH AUTHORS
Benoît Ansieau <benoit.ansieau@gmail.com>
.br
Xavier Guerrin <xavier.guerrin@gmail.com>
.SH REPORTING BUGS
If you encounter a behavior in the application that looks unusual to you, browse our FAQ <http://qelectrotech.tuxfamily.org/wiki/doku.php?id=doc:faq> and our BugTracker <http://qelectrotech.tuxfamily.org/bugtracker/> to check if the problem is already known. In the negative, please submit a bugreport via the BugTracker.
.SH COPYRIGHT
Copyright © QElectroTech developers.
.br
License : GNU/GPL v2+ : <http://www.gnu.org/licenses/old\-licenses/gpl\-2.0.html>
.br
This program is a free software. You can modify and redistribute it. It is provided as is and WITHOUT ANY WARRANTY.
.SH SEE ALSO
Site officiel : <http://qelectrotech.tuxfamily.org/>

10
man/uncompress_man_pages.sh Executable file
View File

@@ -0,0 +1,10 @@
#!/bin/bash
# Uncompresses every man page
APP=qelectrotech.1
MAN_DIR=$(dirname $0)/files
find ${MAN_DIR} -type f -name "${APP}.gz" -exec gzip -d {} \;
# correct files permissions
find ${MAN_DIR} -type d -exec chmod a+rx {} \;
find ${MAN_DIR} -type f -name "${APP}" -exec chmod a+r {} \;

12
misc/Lancer QET.bat Normal file
View File

@@ -0,0 +1,12 @@
@echo off
rem Se rend dans le dossier qui convient
set current_dir=%~dp0
cd /d %current_dir%
rem Met la collection QET en lecture seule
attrib +r elements/* /S /D
rem lance QElectroTech
set command=bin\qelectrotech.exe --common-elements-dir=elements/ --config-dir=conf/ -style plastique %*
@start %command%

36
misc/launch_qet.sh Executable file
View File

@@ -0,0 +1,36 @@
#!/bin/bash
# configuration
QET_EXE="../qelectrotech"
QET_ELEMENTS_DIR="../elements/"
QET_CONFIG_DIR=""
QET_LANG_DIR="../lang/"
REDEFINE_LANG=""
# checks for the qelectrotech binary executable file
if [ ! -x "${QET_EXE}" ]; then
echo "Errror : executable file not found. Aborting."
exit 1
fi
# checks options that will be given to QET
OPTIONS=""
if [ -d "${QET_ELEMENTS_DIR}" ]; then
OPTIONS="${OPTIONS} --common-elements-dir=${QET_ELEMENTS_DIR}"
fi
if [ -d "${QET_CONFIG_DIR}" ]; then
OPTIONS="${OPTIONS} --config-dir=${QET_CONFIG_DIR}"
fi
if [ -d "${QET_LANG_DIR}" ]; then
OPTIONS="${OPTIONS} --lang-dir=${QET_LANG_DIR}"
fi
if [ "${REDEFINE_LANG}" ]; then
export LANG="${REDEFINE_LANG}"
fi
# launching
${QET_EXE} ${OPTIONS} $*

View File

@@ -2,6 +2,8 @@
defaultauthor= defaultauthor=
defaultcols=15 defaultcols=15
defaultcolsize=50.0 defaultcolsize=50.0
defaultrows=6
defaultrowsize=80.0
defaultconductorhasGround=true defaultconductorhasGround=true
defaultconductorhasNeutral=true defaultconductorhasNeutral=true
defaultconductorphases=1 defaultconductorphases=1
@@ -10,7 +12,6 @@ defaultconductortype=multi
defaultdate=null defaultdate=null
defaultfilename= defaultfilename=
defaultfolio= defaultfolio=
defaultheight=500.0
defaulttitle= defaulttitle=
[elementeditor] [elementeditor]

View File

@@ -4,6 +4,7 @@ Exec=qelectrotech
Icon=qet Icon=qet
Terminal=false Terminal=false
Type=Application Type=Application
MimeType=application/x-qet-project;application/x-qet-element;
Categories=Office;Qt;VectorGraphics;Science;Electricity;Engineering; Categories=Office;Qt;VectorGraphics;Science;Electricity;Engineering;
Comment=An electric diagrams editor. Comment=An electric diagrams editor.
Comment[fr]=Un éditeur de schémas électriques Comment[fr]=Un éditeur de schémas électriques

View File

@@ -2,6 +2,8 @@
defaultauthor= defaultauthor=
defaultcols=15 defaultcols=15
defaultcolsize=50.0 defaultcolsize=50.0
defaultrows=6
defaultrowsize=80.0
defaultconductorhasGround=true defaultconductorhasGround=true
defaultconductorhasNeutral=true defaultconductorhasNeutral=true
defaultconductorphases=1 defaultconductorphases=1
@@ -10,7 +12,6 @@ defaultconductortype=multi
defaultdate=null defaultdate=null
defaultfilename= defaultfilename=
defaultfolio= defaultfolio=
defaultheight=500.0
defaulttitle= defaulttitle=
[elementeditor] [elementeditor]

View File

@@ -0,0 +1,7 @@
Windows Registry Editor Version 5.00
[-HKEY_CLASSES_ROOT\Applications\qelectrotech.exe\shell\open\command]
[-HKEY_CLASSES_ROOT\.qet]
[-HKEY_CLASSES_ROOT\qet_diagram_file]
[-HKEY_CLASSES_ROOT\.elmt]
[-HKEY_CLASSES_ROOT\qet_element_file]

View File

@@ -0,0 +1,90 @@
@echo off
rem Enregistre les associations de fichiers de QElectroTech, a savoir les fichiers .qet
rem detecte le dossier courant et suppose que celui-ci contient bin\qelectrotech.exe ainsi que windows_icon\diagram_icon\qet-diagram.ico
set current_dir=%~dp0
cd /d %current_dir%
set expected_qet_exe=%current_dir%Lancer QET.bat
set expected_project_ico=%current_dir%ico\qet-diagram.ico
set expected_element_ico=%current_dir%ico\qet-element.ico
rem verifie la presence du fichier qelectrotech.exe
if not exist "%expected_qet_exe%" (
echo Le fichier %expected_qet_exe% n'a pas ete trouve. Abandon.
pause
exit /b 1
)
rem verifie la presence du fichier qet-diagram.ico
if not exist "%expected_project_ico%" (
echo Le fichier %expected_project_ico% n'a pas ete trouve. Abandon.
pause
exit /b 1
)
rem verifie la presence du fichier qet-element.ico
if not exist "%expected_element_ico%" (
echo Le fichier %expected_element_ico% n'a pas ete trouve. Abandon.
pause
exit /b 1
)
rem echappe les backslashs dans les chemins absolus
set final_qet_exe=%expected_qet_exe:\=\\%
set final_project_ico=%expected_project_ico:\=\\%
set final_element_ico=%expected_element_ico:\=\\%
rem genere le fichier .reg pour enregistrer les associations de fichiers
set reg_file=qet_install_file_associations.reg
(
echo Windows Registry Editor Version 5.00
echo.
rem Declaration de l'application
echo [HKEY_CLASSES_ROOT\Applications\qelectrotech.exe\shell\open\command]
echo @="\"%final_qet_exe%\" \"%%1\""
rem association de fichier *.qet
echo [HKEY_CLASSES_ROOT\.qet]
echo @="qet_diagram_file"
echo [HKEY_CLASSES_ROOT\qet_diagram_file]
echo @="Schéma QET"
echo "EditFlags"=dword:00000000
echo "BrowserFlags"=dword:00000008
echo [HKEY_CLASSES_ROOT\qet_diagram_file\DefaultIcon]
echo @="%final_project_ico%,0"
echo [HKEY_CLASSES_ROOT\qet_diagram_file\shell\open\command]
echo @="\"%final_qet_exe%\" \"%%1\""
rem association de fichier *.elmt
echo [HKEY_CLASSES_ROOT\.elmt]
echo @="qet_element_file"
echo [HKEY_CLASSES_ROOT\qet_element_file]
echo @="Élément QET"
echo "EditFlags"=dword:00000000
echo "BrowserFlags"=dword:00000008
echo [HKEY_CLASSES_ROOT\qet_element_file\DefaultIcon]
echo @="%final_element_ico%,0"
echo [HKEY_CLASSES_ROOT\qet_element_file\shell\open\command]
echo @="\"%final_qet_exe%\" \"%%1\""
) > %reg_file%
rem verifie que le fichier a bien ete ecrit
if not exist %reg_file% (
echo Impossible de creer le fichier %reg_file%. Abandon.
pause
exit /b 1
)
rem Applique le .reg genere
regedit.exe /s %reg_file%
if errorlevel 1 (
echo La prise en compte du fichier %reg_file% a echoue.
pause
exit /b 1
) else (
echo Les associations de fichier ont bien ete crees.
pause
exit /b 0
)

View File

@@ -0,0 +1,8 @@
[Desktop Entry]
Type=MimeType
MimeType=application/x-qet-element
Icon=qet
DefaultApp=qelectrotech
Patterns=*.elmt;
Comment=QElectroTech element file
Comment[fr]=Fichier élément QElectroTech

5
misc/x-qet-element.xml Normal file
View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<mime-type xmlns="http://www.freedesktop.org/standards/shared-mime-info" type="application/x-qet-element">
<comment>QElectroTech element file</comment>
<comment xml:lang="fr">Fichier élément QElectroTech</comment>
</mime-type>

View File

@@ -0,0 +1,8 @@
[Desktop Entry]
Type=MimeType
MimeType=application/x-qet-project
Icon=qet
DefaultApp=qelectrotech
Patterns=*.qet;
Comment=QElectroTech project file
Comment[fr]=Fichier projet QElectroTech

5
misc/x-qet-project.xml Normal file
View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<mime-type xmlns="http://www.freedesktop.org/standards/shared-mime-info" type="application/x-qet-project">
<comment>QElectroTech project file</comment>
<comment xml:lang="fr">Fichier projet QElectroTech</comment>
</mime-type>

View File

@@ -10,9 +10,13 @@
QET_BINARY_PATH = 'bin/' QET_BINARY_PATH = 'bin/'
QET_COMMON_COLLECTION_PATH = 'share/qelectrotech/elements/' QET_COMMON_COLLECTION_PATH = 'share/qelectrotech/elements/'
QET_LANG_PATH = 'share/qelectrotech/lang/' QET_LANG_PATH = 'share/qelectrotech/lang/'
QET_EXAMPLES_PATH = 'share/qelectrotech/examples/'
QET_LICENSE_PATH = 'doc/qelectrotech/' QET_LICENSE_PATH = 'doc/qelectrotech/'
QET_MIME_XML_PATH = '../share/mime/application/'
QET_MIME_DESKTOP_PATH = '../share/mimelnk/application/'
QET_DESKTOP_PATH = 'share/applications/' QET_DESKTOP_PATH = 'share/applications/'
QET_ICONS_PATH = 'share/icons/' QET_ICONS_PATH = 'share/icons/'
QET_MAN_PATH = 'man/'
} else { } else {
# Chemins Windows # Chemins Windows
COMPIL_PREFIX = './' COMPIL_PREFIX = './'
@@ -32,146 +36,156 @@ DEFINES += QET_ALLOW_OVERRIDE_CD_OPTION
###################################################################### ######################################################################
TEMPLATE = app TEMPLATE = app
DEPENDPATH += . editor lang DEPENDPATH += . sources sources/editor lang
INCLUDEPATH += . editor INCLUDEPATH += sources sources/editor
# Fichiers sources # Fichiers sources
HEADERS += aboutqet.h \ HEADERS += sources/aboutqet.h \
borderinset.h \ sources/borderinset.h \
conductor.h \ sources/borderproperties.h \
conductorprofile.h \ sources/borderpropertieswidget.h \
conductorproperties.h \ sources/conductor.h \
conductorpropertieswidget.h \ sources/conductorprofile.h \
conductorsegment.h \ sources/conductorproperties.h \
conductorsegmentprofile.h \ sources/conductorpropertieswidget.h \
configdialog.h \ sources/conductorsegment.h \
configpages.h \ sources/conductorsegmentprofile.h \
customelement.h \ sources/configdialog.h \
diagram.h \ sources/configpages.h \
diagramcommands.h \ sources/customelement.h \
diagramcontent.h \ sources/diagram.h \
diagramprintdialog.h \ sources/diagramcommands.h \
diagramview.h \ sources/diagramcontent.h \
diagramtextitem.h \ sources/diagramprintdialog.h \
element.h \ sources/diagramview.h \
elementdeleter.h \ sources/diagramtextitem.h \
elementscategorieslist.h \ sources/element.h \
elementscategorieswidget.h \ sources/elementdeleter.h \
elementscategory.h \ sources/elementscategorieslist.h \
elementscategorydeleter.h \ sources/elementscategorieswidget.h \
elementscategoryeditor.h \ sources/elementscategory.h \
elementspanel.h \ sources/elementscategorydeleter.h \
elementspanelwidget.h \ sources/elementscategoryeditor.h \
elementtextitem.h \ sources/elementspanel.h \
exportdialog.h \ sources/elementspanelwidget.h \
fixedelement.h \ sources/elementtextitem.h \
hotspoteditor.h \ sources/exportdialog.h \
insetproperties.h \ sources/fixedelement.h \
insetpropertieswidget.h \ sources/hotspoteditor.h \
nameslist.h \ sources/insetproperties.h \
nameslistwidget.h \ sources/insetpropertieswidget.h \
newelementwizard.h \ sources/nameslist.h \
orientationset.h \ sources/nameslistwidget.h \
orientationsetwidget.h \ sources/newelementwizard.h \
qet.h \ sources/orientationset.h \
qetapp.h \ sources/orientationsetwidget.h \
qetdiagrameditor.h \ sources/qet.h \
qgimanager.h \ sources/qetapp.h \
terminal.h \ sources/qetarguments.h \
editor/arceditor.h \ sources/qetdiagrameditor.h \
editor/circleeditor.h \ sources/qetsingleapplication.h \
editor/customelementgraphicpart.h \ sources/qgimanager.h \
editor/customelementpart.h \ sources/recentfiles.h \
editor/editorcommands.h \ sources/terminal.h \
editor/elementitemeditor.h \ sources/editor/arceditor.h \
editor/elementscene.h \ sources/editor/circleeditor.h \
editor/elementview.h \ sources/editor/customelementgraphicpart.h \
editor/ellipseeditor.h \ sources/editor/customelementpart.h \
editor/lineeditor.h \ sources/editor/editorcommands.h \
editor/partarc.h \ sources/editor/elementitemeditor.h \
editor/partcircle.h \ sources/editor/elementscene.h \
editor/partellipse.h \ sources/editor/elementview.h \
editor/partline.h \ sources/editor/ellipseeditor.h \
editor/partpolygon.h \ sources/editor/lineeditor.h \
editor/partterminal.h \ sources/editor/partarc.h \
editor/parttext.h \ sources/editor/partcircle.h \
editor/parttextfield.h \ sources/editor/partellipse.h \
editor/polygoneditor.h \ sources/editor/partline.h \
editor/qetelementeditor.h \ sources/editor/partpolygon.h \
editor/styleeditor.h \ sources/editor/partterminal.h \
editor/terminaleditor.h \ sources/editor/parttext.h \
editor/texteditor.h \ sources/editor/parttextfield.h \
editor/textfieldeditor.h sources/editor/polygoneditor.h \
SOURCES += aboutqet.cpp \ sources/editor/qetelementeditor.h \
borderinset.cpp \ sources/editor/styleeditor.h \
conductor.cpp \ sources/editor/terminaleditor.h \
conductorprofile.cpp \ sources/editor/texteditor.h \
conductorproperties.cpp \ sources/editor/textfieldeditor.h
conductorpropertieswidget.cpp \ SOURCES += sources/aboutqet.cpp \
conductorsegment.cpp \ sources/borderinset.cpp \
customelement.cpp \ sources/borderproperties.cpp \
configdialog.cpp \ sources/borderpropertieswidget.cpp \
configpages.cpp \ sources/conductor.cpp \
diagram.cpp \ sources/conductorprofile.cpp \
diagramcommands.cpp \ sources/conductorproperties.cpp \
diagramcontent.cpp \ sources/conductorpropertieswidget.cpp \
diagramprintdialog.cpp \ sources/conductorsegment.cpp \
diagramtextitem.cpp \ sources/customelement.cpp \
diagramview.cpp \ sources/configdialog.cpp \
element.cpp \ sources/configpages.cpp \
elementdeleter.cpp \ sources/diagram.cpp \
elementscategorieslist.cpp \ sources/diagramcommands.cpp \
elementscategorieswidget.cpp \ sources/diagramcontent.cpp \
elementscategory.cpp \ sources/diagramprintdialog.cpp \
elementscategorydeleter.cpp \ sources/diagramtextitem.cpp \
elementscategoryeditor.cpp \ sources/diagramview.cpp \
elementspanel.cpp \ sources/element.cpp \
elementspanelwidget.cpp \ sources/elementdeleter.cpp \
elementtextitem.cpp \ sources/elementscategorieslist.cpp \
exportdialog.cpp \ sources/elementscategorieswidget.cpp \
fixedelement.cpp \ sources/elementscategory.cpp \
hotspoteditor.cpp \ sources/elementscategorydeleter.cpp \
insetproperties.cpp \ sources/elementscategoryeditor.cpp \
insetpropertieswidget.cpp \ sources/elementspanel.cpp \
main.cpp \ sources/elementspanelwidget.cpp \
nameslist.cpp \ sources/elementtextitem.cpp \
nameslistwidget.cpp \ sources/exportdialog.cpp \
newelementwizard.cpp \ sources/fixedelement.cpp \
orientationset.cpp \ sources/hotspoteditor.cpp \
orientationsetwidget.cpp \ sources/insetproperties.cpp \
qet.cpp \ sources/insetpropertieswidget.cpp \
qetapp.cpp \ sources/main.cpp \
qetdiagrameditor.cpp \ sources/nameslist.cpp \
qgimanager.cpp \ sources/nameslistwidget.cpp \
terminal.cpp \ sources/newelementwizard.cpp \
editor/arceditor.cpp \ sources/orientationset.cpp \
editor/circleeditor.cpp \ sources/orientationsetwidget.cpp \
editor/customelementgraphicpart.cpp \ sources/qet.cpp \
editor/customelementpart.cpp \ sources/qetapp.cpp \
editor/editorcommands.cpp \ sources/qetarguments.cpp \
editor/elementitemeditor.cpp \ sources/qetdiagrameditor.cpp \
editor/elementscene.cpp \ sources/qetsingleapplication.cpp \
editor/elementview.cpp \ sources/qgimanager.cpp \
editor/ellipseeditor.cpp \ sources/recentfiles.cpp \
editor/lineeditor.cpp \ sources/terminal.cpp \
editor/partarc.cpp \ sources/editor/arceditor.cpp \
editor/partcircle.cpp \ sources/editor/circleeditor.cpp \
editor/partellipse.cpp \ sources/editor/customelementgraphicpart.cpp \
editor/partline.cpp \ sources/editor/customelementpart.cpp \
editor/partpolygon.cpp \ sources/editor/editorcommands.cpp \
editor/partterminal.cpp \ sources/editor/elementitemeditor.cpp \
editor/parttext.cpp \ sources/editor/elementscene.cpp \
editor/parttextfield.cpp \ sources/editor/elementview.cpp \
editor/polygoneditor.cpp \ sources/editor/ellipseeditor.cpp \
editor/qetelementeditor.cpp \ sources/editor/lineeditor.cpp \
editor/styleeditor.cpp \ sources/editor/partarc.cpp \
editor/terminaleditor.cpp \ sources/editor/partcircle.cpp \
editor/texteditor.cpp \ sources/editor/partellipse.cpp \
editor/textfieldeditor.cpp sources/editor/partline.cpp \
sources/editor/partpolygon.cpp \
sources/editor/partterminal.cpp \
sources/editor/parttext.cpp \
sources/editor/parttextfield.cpp \
sources/editor/polygoneditor.cpp \
sources/editor/qetelementeditor.cpp \
sources/editor/styleeditor.cpp \
sources/editor/terminaleditor.cpp \
sources/editor/texteditor.cpp \
sources/editor/textfieldeditor.cpp
RESOURCES += qelectrotech.qrc RESOURCES += qelectrotech.qrc
TRANSLATIONS += lang/qet_en.ts lang/qt_fr.ts TRANSLATIONS += lang/qet_en.ts lang/qt_fr.ts
RC_FILE = ico/windows_icon/application_icon/qelectrotech.rc RC_FILE = ico/windows_icon/application_icon/qelectrotech.rc
QT += xml svg QT += xml svg network
CONFIG += debug_and_release warn_on CONFIG += debug_and_release warn_on
TARGET = qelectrotech TARGET = qelectrotech
@@ -184,10 +198,17 @@ elements.files = elements/*
lang.path = $$join(INSTALL_PREFIX,,,$${QET_LANG_PATH}) lang.path = $$join(INSTALL_PREFIX,,,$${QET_LANG_PATH})
lang.files = $$replace(TRANSLATIONS, '.ts', '.qm') lang.files = $$replace(TRANSLATIONS, '.ts', '.qm')
examples.path = $$join(INSTALL_PREFIX,,,$${QET_EXAMPLES_PATH})
examples.files = examples/*
copyright.path = $$join(INSTALL_PREFIX,,,$${QET_LICENSE_PATH}) copyright.path = $$join(INSTALL_PREFIX,,,$${QET_LICENSE_PATH})
copyright.files = LICENSE \ copyright.files = LICENSE CREDIT README
CREDIT \
README mime_xml.path = $$join(INSTALL_PREFIX,,,$${QET_MIME_XML_PATH})
mime_xml.files = misc/x-qet-*.xml
mime_desktop.path = $$join(INSTALL_PREFIX,,,$${QET_MIME_DESKTOP_PATH})
mime_desktop.files = misc/x-qet-*.desktop
desktop.path = $$join(INSTALL_PREFIX,,,$${QET_DESKTOP_PATH}) desktop.path = $$join(INSTALL_PREFIX,,,$${QET_DESKTOP_PATH})
desktop.files = misc/qelectrotech.desktop desktop.files = misc/qelectrotech.desktop
@@ -195,11 +216,15 @@ desktop.files = misc/qelectrotech.desktop
icons.path = $$join(INSTALL_PREFIX,,,$${QET_ICONS_PATH}) icons.path = $$join(INSTALL_PREFIX,,,$${QET_ICONS_PATH})
icons.files = ico/qet.png icons.files = ico/qet.png
man.path = $$join(INSTALL_PREFIX,,,$${QET_MAN_PATH})
man.files = man/files/*
man.extra = sh man/compress_man_pages.sh
# L'installation comprend la copie du binaire, des elements, des fichiers de langue et du fichier LICENSE # L'installation comprend la copie du binaire, des elements, des fichiers de langue et du fichier LICENSE
INSTALLS += target elements lang copyright INSTALLS += target elements lang copyright
# Sous Unix, on installe egalement l'icone et un fichier .desktop # Sous Unix, on installe egalement l'icone, un fichier .desktop, des fichiers mime et les pages de manuel
unix { unix {
INSTALLS += desktop icons INSTALLS += desktop mime_xml mime_desktop icons man examples
} }
# Options de compilation # Options de compilation

View File

@@ -6,6 +6,7 @@
<file>ico/qelectrotech.png</file> <file>ico/qelectrotech.png</file>
<file>ico/allowed.png</file> <file>ico/allowed.png</file>
<file>ico/add_col.png</file> <file>ico/add_col.png</file>
<file>ico/add_row.png</file>
<file>ico/arc.png</file> <file>ico/arc.png</file>
<file>ico/bring_forward.png</file> <file>ico/bring_forward.png</file>
<file>ico/button_cancel.png</file> <file>ico/button_cancel.png</file>
@@ -57,6 +58,7 @@
<file>ico/redo.png</file> <file>ico/redo.png</file>
<file>ico/reload.png</file> <file>ico/reload.png</file>
<file>ico/remove_col.png</file> <file>ico/remove_col.png</file>
<file>ico/remove_row.png</file>
<file>ico/restaurer.png</file> <file>ico/restaurer.png</file>
<file>ico/saveas.png</file> <file>ico/saveas.png</file>
<file>ico/save.png</file> <file>ico/save.png</file>
@@ -64,6 +66,7 @@
<file>ico/send_backward.png</file> <file>ico/send_backward.png</file>
<file>ico/sortir_fs.png</file> <file>ico/sortir_fs.png</file>
<file>ico/south.png</file> <file>ico/south.png</file>
<file>ico/splash.png</file>
<file>ico/terminal.png</file> <file>ico/terminal.png</file>
<file>ico/text.png</file> <file>ico/text.png</file>
<file>ico/textfield.png</file> <file>ico/textfield.png</file>

View File

@@ -15,6 +15,7 @@
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>. along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include <QtGui>
#include "aboutqet.h" #include "aboutqet.h"
#include "qet.h" #include "qet.h"

View File

@@ -17,7 +17,7 @@
*/ */
#ifndef ABOUTQET_H #ifndef ABOUTQET_H
#define ABOUTQET_H #define ABOUTQET_H
#include <QtGui> #include <QDialog>
/** /**
Cette classe represente la boite de dialogue Cette classe represente la boite de dialogue
« A propos de QElectroTech » « A propos de QElectroTech »

441
sources/borderinset.cpp Normal file
View File

@@ -0,0 +1,441 @@
/*
Copyright 2006-2008 Xavier Guerrin
This file is part of QElectroTech.
QElectroTech is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
QElectroTech is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
*/
#include <QPainter>
#include "borderinset.h"
#include "qetapp.h"
#include "qetdiagrameditor.h"
#include "math.h"
/**
Constructeur simple : construit une bordure en recuperant les dimensions
dans la configuration de l'application.
@param parent QObject parent de ce BorderInset
*/
BorderInset::BorderInset(QObject *parent) : QObject(parent) {
// dimensions par defaut du schema
importBorder(QETDiagramEditor::defaultBorderProperties());
// contenu par defaut du cartouche
importInset(QETDiagramEditor::defaultInsetProperties());
// hauteur du cartouche
inset_height = 50.0;
display_inset = true;
display_border = true;
updateRectangles();
}
/**
Destructeur - ne fait rien
*/
BorderInset::~BorderInset() {
}
/**
@return Le nombre minimum de colonnes qu'un schema doit comporter
*/
int BorderInset::minNbColumns() {
return(3);
}
/**
@return la largeur minimale d'une colonne de schema
*/
qreal BorderInset::minColumnsWidth() {
return(5.0);
}
/**
@return Le nombre minimum de lignes qu'un schema doit comporter
*/
int BorderInset::minNbRows() {
return(2);
}
/**
@return la hauteur minimale d'une ligne de schema
*/
qreal BorderInset::minRowsHeight() {
return(5.0);
}
/**
@return les proprietes du cartouches
*/
InsetProperties BorderInset::exportInset() {
InsetProperties ip;
ip.author = bi_author;
ip.date = bi_date;
ip.title = bi_title;
ip.folio = bi_folio;
ip.filename = bi_filename;
return(ip);
}
/**
@param ip les nouvelles proprietes du cartouche
*/
void BorderInset::importInset(const InsetProperties &ip) {
bi_author = ip.author;
bi_date = ip.date;
bi_title = ip.title;
bi_folio = ip.folio;
bi_filename = ip.filename;
}
/**
@return les proprietes de la bordure
*/
BorderProperties BorderInset::exportBorder() {
BorderProperties bp;
bp.columns_count = nbColumns();
bp.columns_width = columnsWidth();
bp.columns_header_height = columnsHeaderHeight();
bp.display_columns = columnsAreDisplayed();
bp.rows_count = nbRows();
bp.rows_height = rowsHeight();
bp.rows_header_width = rowsHeaderWidth();
bp.display_rows = rowsAreDisplayed();
return(bp);
}
/**
@param ip les nouvelles proprietes de la bordure
*/
void BorderInset::importBorder(const BorderProperties &bp) {
setColumnsHeaderHeight(bp.columns_header_height);
setNbColumns(bp.columns_count);
setColumnsWidth(bp.columns_width);
displayColumns(bp.display_columns);
setRowsHeaderWidth(bp.rows_header_width);
setNbRows(bp.rows_count);
setRowsHeight(bp.rows_height);
displayRows(bp.display_rows);
}
/**
@param di true pour afficher le cartouche, false sinon
*/
void BorderInset::displayInset(bool di) {
bool change = (di != display_inset);
display_inset = di;
if (change) emit(displayChanged());
}
/**
@param dc true pour afficher les entetes des colonnes, false sinon
*/
void BorderInset::displayColumns(bool dc) {
bool change = (dc != display_columns);
display_columns = dc;
if (change) emit(displayChanged());
}
/**
@param dr true pour afficher les entetes des lignes, false sinon
*/
void BorderInset::displayRows(bool dr) {
bool change = (dr != display_rows);
display_rows = dr;
if (change) emit(displayChanged());
}
/**
@param db true pour afficher la bordure du schema, false sinon
*/
void BorderInset::displayBorder(bool db) {
bool change = (db != display_border);
display_border = db;
if (change) emit(displayChanged());
}
/**
Methode recalculant les rectangles composant le cadre et le cartouche en
fonction des attributs de taille
*/
void BorderInset::updateRectangles() {
// rectangle delimitant le schema
QRectF previous_diagram = diagram;
diagram = QRectF(0, 0, diagramWidth(), diagramHeight());
if (diagram != previous_diagram) emit(borderChanged(previous_diagram, diagram));
// rectangles relatifs au cartouche
inset = QRectF(diagram.bottomLeft().x(), diagram.bottomLeft().y(), inset_width, inset_height);
inset_author = QRectF(inset.topLeft(), QSizeF(2.0 * inset_width / 9.0, 0.5 * inset_height));
inset_date = QRectF(inset_author.bottomLeft(), inset_author.size());
inset_title = QRectF(inset_author.topRight(), QSizeF(5.0 * inset_width / 9.0, inset_height));
inset_file = QRectF(inset_title.topRight(), inset_author.size());
inset_folio = QRectF(inset_file.bottomLeft(), inset_author.size());
}
/**
Dessine le cadre et le cartouche
@param qp QPainter a utiliser pour dessiner le cadre et le cartouche
@param x Abscisse du cadre
@param y Ordonnee du cadre
*/
void BorderInset::draw(QPainter *qp, qreal x, qreal y) {
// translate tous les rectangles
diagram .translate(x, y);
inset .translate(x, y);
inset_author.translate(x, y);
inset_date .translate(x, y);
inset_title .translate(x, y);
inset_file .translate(x, y);
inset_folio .translate(x, y);
// prepare le QPainter
qp -> save();
qp -> setPen(Qt::black);
qp -> setBrush(Qt::NoBrush);
// dessine le cadre
if (display_border) qp -> drawRect(diagram);
qp -> setFont(QFont(QETApp::diagramTextsFont(), qp -> font().pointSize()));
// dessine la case vide qui apparait des qu'il y a un entete
if (display_columns || display_rows) {
qp -> setBrush(Qt::white);
QRectF first_rectangle(
diagram.topLeft().x(),
diagram.topLeft().y(),
rows_header_width,
columns_header_height
);
qp -> drawRect(first_rectangle);
}
// dessine la numerotation des colonnes
if (display_columns) {
for (int i = 1 ; i <= nb_columns ; ++ i) {
QRectF numbered_rectangle = QRectF(
diagram.topLeft().x() + (rows_header_width + ((i - 1) * columns_width)),
diagram.topLeft().y(),
columns_width,
columns_header_height
);
qp -> drawRect(numbered_rectangle);
qp -> drawText(numbered_rectangle, Qt::AlignVCenter | Qt::AlignCenter, QString("%1").arg(i));
}
}
// dessine la numerotation des lignes
if (display_rows) {
QString row_string("A");
for (int i = 1 ; i <= nb_rows ; ++ i) {
QRectF lettered_rectangle = QRectF(
diagram.topLeft().x(),
diagram.topLeft().y() + (columns_header_height + ((i - 1) * rows_height)),
rows_header_width,
rows_height
);
qp -> drawRect(lettered_rectangle);
qp -> drawText(lettered_rectangle, Qt::AlignVCenter | Qt::AlignCenter, row_string);
row_string = incrementLetters(row_string);
}
}
// dessine le cartouche
if (display_inset) {
qp -> setBrush(Qt::white);
qp -> drawRect(inset);
qp -> drawRect(inset_author);
qp -> drawText(inset_author, Qt::AlignVCenter | Qt::AlignLeft, tr(" Auteur : ") + bi_author);
qp -> drawRect(inset_date);
qp -> drawText(inset_date, Qt::AlignVCenter | Qt::AlignLeft, tr(" Date : ") + bi_date.toString("dd/MM/yyyy"));
qp -> drawRect(inset_title);
qp -> drawText(inset_title, Qt::AlignVCenter | Qt::AlignCenter, tr("Titre du document : ") + bi_title);
qp -> drawRect(inset_file);
qp -> drawText(inset_file, Qt::AlignVCenter | Qt::AlignLeft, tr(" Fichier : ") + bi_filename);
qp -> drawRect(inset_folio);
qp -> drawText(inset_folio, Qt::AlignVCenter | Qt::AlignLeft, tr(" Folio : ") + bi_folio);
}
qp -> restore();
// annule la translation des rectangles
diagram .translate(-x, -y);
inset .translate(-x, -y);
inset_author.translate(-x, -y);
inset_date .translate(-x, -y);
inset_title .translate(-x, -y);
inset_file .translate(-x, -y);
inset_folio .translate(-x, -y);
}
/**
Ajoute une colonne.
*/
void BorderInset::addColumn() {
setNbColumns(nbColumns() + 1);
}
/**
Enleve une colonne sans passer sous le minimum requis.
@see minNbColumns()
*/
void BorderInset::removeColumn() {
setNbColumns(nbColumns() - 1);
}
/**
Ajoute une ligne.
*/
void BorderInset::addRow() {
setNbRows(nbRows() + 1);
}
/**
Enleve une ligne sans passer sous le minimum requis.
@see minNbRows()
*/
void BorderInset::removeRow() {
setNbRows(nbRows() - 1);
}
/**
Permet de changer le nombre de colonnes.
Si ce nombre de colonnes est inferieur au minimum requis, c'est ce minimum
qui est utilise.
@param nb_c nouveau nombre de colonnes
@see minNbColumns()
*/
void BorderInset::setNbColumns(int nb_c) {
if (nb_c == nbColumns()) return;
nb_columns = qMax(minNbColumns(), nb_c);
setInsetWidth(diagramWidth());
}
/**
Change la largeur des colonnes.
Si la largeur indiquee est inferieure au minimum requis, c'est ce minimum
qui est utilise.
@param new_cw nouvelle largeur des colonnes
@see minColumnsWidth()
*/
void BorderInset::setColumnsWidth(const qreal &new_cw) {
if (new_cw == columnsWidth()) return;
columns_width = qMax(minColumnsWidth(), new_cw);
setInsetWidth(diagramWidth());
}
/**
Change la hauteur des en-tetes contenant les numeros de colonnes. Celle-ci
doit rester comprise entre 5 et 50 px.
@param new_chh nouvelle hauteur des en-tetes de colonnes
*/
void BorderInset::setColumnsHeaderHeight(const qreal &new_chh) {
columns_header_height = qBound(5.0, new_chh, 50.0);
updateRectangles();
}
/**
Permet de changer le nombre de lignes.
Si ce nombre de lignes est inferieur au minimum requis, cette fonction ne
fait rien
@param nb_r nouveau nombre de lignes
@see minNbRows()
*/
void BorderInset::setNbRows(int nb_r) {
if (nb_r == nbRows()) return;
nb_rows = qMax(minNbRows(), nb_r);
setInsetWidth(diagramWidth());
updateRectangles();
}
/**
Change la hauteur des lignes.
Si la hauteur indiquee est inferieure au minimum requis, c'est ce minimum
qui est utilise.
@param rh nouvelle hauteur des lignes
@see minRowsHeight()
*/
void BorderInset::setRowsHeight(const qreal &new_rh) {
if (new_rh == rowsHeight()) return;
rows_height = qMax(minRowsHeight(), new_rh);
updateRectangles();
}
/**
Change la largeur des en-tetes contenant les numeros de lignes. Celle-ci
doit rester comprise entre 5 et 50 px.
@param new_rhw nouvelle largeur des en-tetes des lignes
*/
void BorderInset::setRowsHeaderWidth(const qreal &new_rhw) {
rows_header_width = qBound(5.0, new_rhw, 50.0);
updateRectangles();
}
/**
Cette methode essaye de se rapprocher le plus possible de la hauteur donnee
en parametre en modifiant le nombre de lignes en cours.
*/
void BorderInset::setDiagramHeight(const qreal &height) {
// taille des lignes a utiliser = rows_height
setNbRows(qRound(ceil(height / rows_height)));
}
/**
Change la largeur du cartouche. Cette largeur sera restreinte a celle du
schema.
*/
void BorderInset::setInsetWidth(const qreal &new_iw) {
inset_width = qMin(diagramWidth(), new_iw);
updateRectangles();
}
/**
Change la hauteur du cartouche. Cette hauteur doit rester comprise entre
20px et la hauteur du schema.
*/
void BorderInset::setInsetHeight(const qreal &new_ih) {
inset_height = qMax(20.0, qMin(diagramHeight(), new_ih));
updateRectangles();
}
/**
Ajuste la largeur du cartouche de facon a ce que celui-ci soit aussi large
que le schema
*/
void BorderInset::adjustInsetToColumns() {
setInsetWidth(diagramWidth());
}
QString BorderInset::incrementLetters(const QString &string) {
if (string.isEmpty()) {
return("A");
} else {
// separe les digits precedents du dernier digit
QString first_digits(string.left(string.count() - 1));
QChar last_digit(string.at(string.count() - 1));
if (last_digit != 'Z') {
// incremente le dernier digit
last_digit = last_digit.toAscii() + 1;
return(first_digits + QString(last_digit));
} else {
return(incrementLetters(first_digits) + "A");
}
}
}

View File

@@ -18,10 +18,11 @@
#ifndef BORDERINSET_H #ifndef BORDERINSET_H
#define BORDERINSET_H #define BORDERINSET_H
#include "insetproperties.h" #include "insetproperties.h"
#include "borderproperties.h"
#include <QObject> #include <QObject>
#include <QRectF> #include <QRectF>
#include <QPainter>
#include <QDate> #include <QDate>
class QPainter;
/** /**
Cette classe represente l'ensemble bordure + cartouche qui encadre le Cette classe represente l'ensemble bordure + cartouche qui encadre le
schema electrique. schema electrique.
@@ -39,29 +40,51 @@ class BorderInset : public QObject {
// methodes // methodes
public: public:
static int minNbColumns();
static qreal minColumnsWidth();
static int minNbRows();
static qreal minRowsHeight();
void draw(QPainter *, qreal = 0.0, qreal = 0.0); void draw(QPainter *, qreal = 0.0, qreal = 0.0);
// methodes d'acces en lecture aux dimensions // methodes d'acces en lecture aux dimensions
// colonnes
/// @return le nombre de colonnes du schema /// @return le nombre de colonnes du schema
int nbColumn() const { return(nb_columns); } int nbColumns() const { return(nb_columns); }
/// @return la taille des colonnes en pixels /// @return la largeur des colonnes en pixels
qreal columnsWidth() const { return(columns_width); } qreal columnsWidth() const { return(columns_width); }
/// @return la taille de l'ensemble des colonnes, en-tete des lignes non inclus
qreal columnsTotalWidth() const { return(nb_columns * columns_width); }
/// @return la hauteur, en pixels, des en-tetes des colonnes /// @return la hauteur, en pixels, des en-tetes des colonnes
qreal columnsHeaderHeight() const { return(columns_header_height); } qreal columnsHeaderHeight() const { return(columns_header_height); }
/// @return la hauteur des colonnes, en-tetes inclus
qreal columnsHeight() const { return(columns_height); } // lignes
/// @return la largeur de la bordure /// @return le nombre de lignes du schema
qreal borderWidth() const { return(nb_columns * columns_width); } int nbRows() const { return(nb_rows); }
/// @return la hauteur de la bordure /// @return la hauteur des lignes en pixels
qreal borderHeight() const { return(columns_height + inset_height); } qreal rowsHeight() const { return(rows_height); }
/// @return la taille de l'ensemble des lignes, en-tete des colonnes non inclus
qreal rowsTotalHeight() const { return(nb_rows * rows_height); }
/// @return la largeur, en pixels, des en-tetes des lignes
qreal rowsHeaderWidth() const { return(rows_header_width); }
// cadre sans le cartouche = schema
/// @return la largeur du schema, c'est-a-dire du cadre sans le cartouche
qreal diagramWidth() const { return(columnsTotalWidth() + rowsHeaderWidth()); }
/// @return la hauteurdu schema, c'est-a-dire du cadre sans le cartouche
qreal diagramHeight() const { return(rowsTotalHeight() + columnsHeaderHeight()); }
// cartouche
/// @return la largeur du cartouche /// @return la largeur du cartouche
qreal insetWidth() const { return(inset_width); } qreal insetWidth() const { return(inset_width); }
/// @return la hauteur du cartouche /// @return la hauteur du cartouche
qreal insetHeight() const { return(inset_height); } qreal insetHeight() const { return(inset_height); }
/// @return la hauteur minimale acceptee des colonnes
qreal minColumnsHeight() const { return(min_columns_height); } // cadre avec le cartouche
/// @return le nombre minimum accepte de colonnes /// @return la hauteur de la bordure
int minNbColumns() const { return(min_nb_columns); } qreal borderWidth() const { return(diagramWidth()); }
/// @return la hauteur de la bordure
qreal borderHeight() const { return(diagramHeight() + insetHeight()); }
// methodes d'acces en lecture aux informations du cartouche // methodes d'acces en lecture aux informations du cartouche
/// @return le champ "Auteur" du cartouche /// @return le champ "Auteur" du cartouche
@@ -80,16 +103,23 @@ class BorderInset : public QObject {
bool insetIsDisplayed() const { return(display_inset); } bool insetIsDisplayed() const { return(display_inset); }
/// @return true si les entetes des colonnes sont affiches, false sinon /// @return true si les entetes des colonnes sont affiches, false sinon
bool columnsAreDisplayed() const { return(display_columns); } bool columnsAreDisplayed() const { return(display_columns); }
/// @return true si les entetes des lignes sont affiches, false sinon
bool rowsAreDisplayed() const { return(display_rows); }
/// @return true si la bordure est affichee, false sinon /// @return true si la bordure est affichee, false sinon
bool borderIsDisplayed() const { return(display_border); } bool borderIsDisplayed() const { return(display_border); }
// methodes d'acces en ecriture aux dimensions // methodes d'acces en ecriture aux dimensions
void addColumn (); void addColumn ();
void addRow ();
void removeColumn (); void removeColumn ();
void removeRow ();
void setNbColumns (int); void setNbColumns (int);
void setNbRows (int);
void setColumnsWidth (const qreal &); void setColumnsWidth (const qreal &);
void setRowsHeight (const qreal &);
void setColumnsHeaderHeight(const qreal &); void setColumnsHeaderHeight(const qreal &);
void setColumnsHeight (const qreal &); void setRowsHeaderWidth (const qreal &);
void setDiagramHeight (const qreal &);
void setInsetWidth (const qreal &); void setInsetWidth (const qreal &);
void setInsetHeight (const qreal &); void setInsetHeight (const qreal &);
void adjustInsetToColumns (); void adjustInsetToColumns ();
@@ -106,36 +136,20 @@ class BorderInset : public QObject {
/// @param filename le nouveau contenu du champ "Fichier" /// @param filename le nouveau contenu du champ "Fichier"
void setFileName (const QString &filename) { bi_filename = filename; } void setFileName (const QString &filename) { bi_filename = filename; }
/// @return les proprietes du cartouches InsetProperties exportInset();
InsetProperties exportInset() { void importInset(const InsetProperties &);
InsetProperties ip; BorderProperties exportBorder();
ip.author = bi_author; void importBorder(const BorderProperties &);
ip.date = bi_date;
ip.title = bi_title;
ip.folio = bi_folio;
ip.filename = bi_filename;
return(ip);
}
/// @param ip les nouvelles proprietes du cartouche
void importInset(const InsetProperties &ip) {
bi_author = ip.author;
bi_date = ip.date;
bi_title = ip.title;
bi_folio = ip.folio;
bi_filename = ip.filename;
}
// methodes d'acces en ecriture aux options // methodes d'acces en ecriture aux options
/// @param di true pour afficher le cartouche, false sinon void displayInset(bool);
void displayInset (bool di) { display_inset = di; } void displayColumns(bool);
/// @param dc true pour afficher les entetes des colonnes, false sinon void displayRows(bool);
void displayColumns (bool dc) { display_columns = dc; } void displayBorder(bool);
/// @param db true pour afficher la bordure du schema, false sinon
void displayBorder (bool db) { display_border = db; }
private: private:
void updateRectangles(); void updateRectangles();
QString incrementLetters(const QString &);
// signaux // signaux
signals: signals:
@@ -145,6 +159,10 @@ class BorderInset : public QObject {
@param new_border Nouvelle bordure @param new_border Nouvelle bordure
*/ */
void borderChanged(QRectF old_border, QRectF new_border); void borderChanged(QRectF old_border, QRectF new_border);
/**
Signal emise lorsque des options d'affichage change
*/
void displayChanged();
// attributs // attributs
private: private:
@@ -155,18 +173,23 @@ class BorderInset : public QObject {
QString bi_folio; QString bi_folio;
QString bi_filename; QString bi_filename;
// dimensions du cadre et du cartouche // dimensions du cadre (lignes et colonnes)
// colonnes : nombres et dimensions
int nb_columns; int nb_columns;
int min_nb_columns;
qreal columns_width; qreal columns_width;
qreal columns_header_height; qreal columns_header_height;
qreal columns_height;
qreal min_columns_height; // lignes : nombres et dimensions
int nb_rows;
qreal rows_height;
qreal rows_header_width;
// dimensions du cartouche
qreal inset_width; qreal inset_width;
qreal inset_height; qreal inset_height;
// rectangles utilises pour le dessin // rectangles utilises pour le dessin
QRectF border; QRectF diagram;
QRectF inset; QRectF inset;
QRectF inset_author; QRectF inset_author;
QRectF inset_date; QRectF inset_date;
@@ -177,6 +200,7 @@ class BorderInset : public QObject {
// booleens pour les options de dessin // booleens pour les options de dessin
bool display_inset; bool display_inset;
bool display_columns; bool display_columns;
bool display_rows;
bool display_border; bool display_border;
}; };
#endif #endif

View File

@@ -0,0 +1,55 @@
/*
Copyright 2006-2008 Xavier Guerrin
This file is part of QElectroTech.
QElectroTech is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
QElectroTech is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
*/
#include "borderproperties.h"
/**
Constructeur
*/
BorderProperties::BorderProperties() {
}
/**
Destructeur
*/
BorderProperties::~BorderProperties() {
}
/**
@param bp autre conteneur BorderProperties
@return true si ip et ce conteneur sont identiques, false sinon
*/
bool BorderProperties::operator==(const BorderProperties &bp) {
return(
bp.columns_count == columns_count &&\
bp.columns_width == columns_width &&\
bp.columns_header_height == columns_header_height &&\
bp.display_columns == display_columns &&\
bp.rows_count == rows_count &&\
bp.rows_height == rows_height &&\
bp.rows_header_width == rows_header_width &&\
bp.display_rows == display_rows
);
}
/**
@param bp autre conteneur BorderProperties
@return false si bp et ce conteneur sont identiques, true sinon
*/
bool BorderProperties::operator!=(const BorderProperties &bp) {
return(!(*this == bp));
}

View File

@@ -0,0 +1,45 @@
/*
Copyright 2006-2008 Xavier Guerrin
This file is part of QElectroTech.
QElectroTech is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
QElectroTech is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef BORDER_PROPERTIES_H
#define BORDER_PROPERTIES_H
#include <QtCore>
/**
Cette classe est un conteneur pour les dimensions et proprietes d'affichage
d'un schema : affichage, nombre et dimensions des colonnes et lignes, ...
*/
class BorderProperties {
public:
// constructeur, destructeur, operateurs
BorderProperties();
virtual ~BorderProperties();
bool operator==(const BorderProperties &);
bool operator!=(const BorderProperties &);
// attributs
int columns_count; ///< Nombre de colonnes
qreal columns_width; ///< Largeur des colonnes
qreal columns_header_height; ///< Hauteur des entetes des colonnes
bool display_columns; ///< Afficher ou non les entetes des colonnes
int rows_count; ///< Nombre de lignes
qreal rows_height; ///< Hauteur des lignes
qreal rows_header_width; ///< Largeur des entetes des lignes
bool display_rows; ///< Afficher ou non les entetes des lignes
};
#endif

View File

@@ -0,0 +1,119 @@
/*
Copyright 2006-2008 Xavier Guerrin
This file is part of QElectroTech.
QElectroTech is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
QElectroTech is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
*/
#include "borderpropertieswidget.h"
#include <QtGui>
#include "qetapp.h"
#include "borderinset.h"
/**
Constructeur
Construit un widget editant les proprietes d'une bordure
@param bp proprietes a editer
@param parent QWidget parent
*/
BorderPropertiesWidget::BorderPropertiesWidget(const BorderProperties &bp, QWidget *parent) :
QWidget(parent)
{
build();
setEditedBorder(bp);
}
/**
Destructeur
*/
BorderPropertiesWidget::~BorderPropertiesWidget() {
}
/**
@return the border properties edited and modified by
*/
const BorderProperties &BorderPropertiesWidget::borderProperties() {
border_.columns_count = columns_count -> value();
border_.columns_width = columns_width -> value();
border_.display_columns = display_columns -> isChecked();
border_.rows_count = rows_count -> value();
border_.rows_height = rows_height -> value();
border_.display_rows = display_rows -> isChecked();
return(border_);
}
/**
Definit les proprietes a editer
@param bp Nouvelles proprietes
*/
void BorderPropertiesWidget::setEditedBorder(const BorderProperties &bp) {
border_ = bp;
columns_count -> setValue(border_.columns_count);
columns_width -> setValue(border_.columns_width);
display_columns -> setChecked(border_.display_columns);
rows_count -> setValue(border_.rows_count);
rows_height -> setValue(border_.rows_height);
display_rows -> setChecked(border_.display_rows);
}
/**
Construit le widget
*/
void BorderPropertiesWidget::build() {
QVBoxLayout *widget_layout = new QVBoxLayout();
widget_layout -> setContentsMargins(0, 0, 0, 0);
QGroupBox *diagram_size_box = new QGroupBox(tr("Dimensions du sch\351ma"));
QGridLayout *diagram_size_box_layout = new QGridLayout(diagram_size_box);
// colonnes : nombre et largeur
QLabel *ds1 = new QLabel(tr("Colonnes :"));
columns_count = new QSpinBox(diagram_size_box);
columns_count -> setMinimum(BorderInset::minNbColumns());
columns_width = new QSpinBox(diagram_size_box);
columns_width -> setMinimum(qRound(BorderInset::minColumnsWidth()));
columns_width -> setSingleStep(10);
columns_width -> setPrefix(tr("\327"));
columns_width -> setSuffix(tr("px"));
display_columns = new QCheckBox(tr("Afficher les en-têtes"), diagram_size_box);
// lignes : nombre et largeur
QLabel *ds2 = new QLabel(tr("Lignes :"));
rows_count = new QSpinBox(diagram_size_box);
rows_count -> setMinimum(BorderInset::minNbRows());
rows_height = new QSpinBox(diagram_size_box);
rows_height -> setMinimum(qRound(BorderInset::minRowsHeight()));
rows_height -> setSingleStep(10);
rows_height -> setPrefix(tr("\327"));
rows_height -> setSuffix(tr("px"));
display_rows = new QCheckBox(tr("Afficher les en-têtes"), diagram_size_box);
// layout
diagram_size_box_layout -> addWidget(ds1, 0, 0);
diagram_size_box_layout -> addWidget(columns_count, 0, 1);
diagram_size_box_layout -> addWidget(columns_width, 0, 2);
diagram_size_box_layout -> addWidget(display_columns,0, 3);
diagram_size_box_layout -> addWidget(ds2, 1, 0);
diagram_size_box_layout -> addWidget(rows_count, 1, 1);
diagram_size_box_layout -> addWidget(rows_height, 1, 2);
diagram_size_box_layout -> addWidget(display_rows, 1, 3);
widget_layout -> addWidget(diagram_size_box);
setLayout(widget_layout);
}

View File

@@ -0,0 +1,57 @@
/*
Copyright 2006-2008 Xavier Guerrin
This file is part of QElectroTech.
QElectroTech is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
QElectroTech is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef BORDER_PROPERTIES_WIDGET_H
#define BORDER_PROPERTIES_WIDGET_H
#include <QWidget>
#include "borderproperties.h"
class QCheckBox;
class QSpinBox;
/**
Cette classe represente un widget permettant d'editer les dimensions et les
options d'affichage d'un schema, cartouche non inclus.
@see InsetPropertiesWidget
*/
class BorderPropertiesWidget : public QWidget {
Q_OBJECT
// constructeurs, destructeur
public:
BorderPropertiesWidget(const BorderProperties &, QWidget * = 0);
virtual ~BorderPropertiesWidget();
private:
BorderPropertiesWidget(const BorderPropertiesWidget &);
// methodes
public:
const BorderProperties &borderProperties();
private:
void setEditedBorder(const BorderProperties &);
void build();
// attributs
private:
BorderProperties border_; ///< Proprietes editees
QSpinBox *columns_count; ///< Widget d'edition du nombre de colonnes
QSpinBox *columns_width; ///< Widget d'edition de la largeur des colonnes
QCheckBox *display_columns; ///< Case a cocher pour afficher ou non les entetes des colonnes
QSpinBox *rows_count; ///< Widget d'edition du nombre de lignes
QSpinBox *rows_height; ///< Widget d'edition de la hauteur des lignes
QCheckBox *display_rows; ///< Case a cocher pour afficher ou non les entetes des lignes
};
#endif

View File

@@ -16,9 +16,11 @@
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>. along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include <QtDebug> #include <QtDebug>
#include <limits>
#include "conductor.h" #include "conductor.h"
#include "conductorsegment.h" #include "conductorsegment.h"
#include "conductorsegmentprofile.h" #include "conductorsegmentprofile.h"
#include "diagramtextitem.h"
#include "element.h" #include "element.h"
#include "diagram.h" #include "diagram.h"
#include "diagramcommands.h" #include "diagramcommands.h"
@@ -36,6 +38,7 @@ QBrush Conductor::square_brush = QBrush(Qt::darkGreen);
@param scene QGraphicsScene a laquelle appartient le conducteur @param scene QGraphicsScene a laquelle appartient le conducteur
*/ */
Conductor::Conductor(Terminal *p1, Terminal* p2, Element *parent, QGraphicsScene *scene) : Conductor::Conductor(Terminal *p1, Terminal* p2, Element *parent, QGraphicsScene *scene) :
QObject(),
QGraphicsPathItem(parent, scene), QGraphicsPathItem(parent, scene),
terminal1(p1), terminal1(p1),
terminal2(p2), terminal2(p2),
@@ -85,6 +88,12 @@ Conductor::Conductor(Terminal *p1, Terminal* p2, Element *parent, QGraphicsScene
text_item -> previous_text = properties_.text; text_item -> previous_text = properties_.text;
calculateTextItemPosition(); calculateTextItemPosition();
text_item -> setParentItem(this); text_item -> setParentItem(this);
connect(
text_item,
SIGNAL(diagramTextChanged(DiagramTextItem *, const QString &, const QString &)),
this,
SLOT(displayedTextChanged())
);
} }
/** /**
@@ -922,7 +931,7 @@ QDomElement Conductor::toXml(QDomDocument &d, QHash<Terminal *, int> &table_adr_
foreach(ConductorSegment *segment, segmentsList()) { foreach(ConductorSegment *segment, segmentsList()) {
current_segment = d.createElement("segment"); current_segment = d.createElement("segment");
current_segment.setAttribute("orientation", segment -> isHorizontal() ? "horizontal" : "vertical"); current_segment.setAttribute("orientation", segment -> isHorizontal() ? "horizontal" : "vertical");
current_segment.setAttribute("length", segment -> length()); current_segment.setAttribute("length", QString("%1").arg(segment -> length()));
e.appendChild(current_segment); e.appendChild(current_segment);
} }
} }
@@ -1082,6 +1091,25 @@ void Conductor::readProperties() {
text_item -> setVisible(properties_.type == ConductorProperties::Multi); text_item -> setVisible(properties_.type == ConductorProperties::Multi);
} }
/**
Met a jour les proprietes du conducteur apres modification du champ de texte affiche
*/
void Conductor::displayedTextChanged() {
// verifie que le texte a reellement change
if (text_item -> toPlainText() == properties_.text) return;
// initialise l'objet UndoCommand correspondant
if (Diagram *my_diagram = diagram()) {
ConductorProperties new_properties(properties_);
new_properties.text = text_item -> toPlainText();
ChangeConductorPropertiesCommand *ccpc = new ChangeConductorPropertiesCommand(this);
ccpc -> setOldSettings(properties_);
ccpc -> setNewSettings(new_properties);
my_diagram -> undoStack().push(ccpc);
}
}
/** /**
@return les conducteurs avec lesquels ce conducteur partage des bornes @return les conducteurs avec lesquels ce conducteur partage des bornes
communes communes

View File

@@ -21,15 +21,17 @@
#include "terminal.h" #include "terminal.h"
#include "conductorprofile.h" #include "conductorprofile.h"
#include "conductorproperties.h" #include "conductorproperties.h"
#include "diagramtextitem.h"
class ConductorSegment; class ConductorSegment;
class DiagramTextItem;
class Element; class Element;
typedef QPair<QPointF, Qt::Corner> ConductorBend; typedef QPair<QPointF, Qt::Corner> ConductorBend;
typedef QHash<Qt::Corner, ConductorProfile> ConductorProfilesGroup; typedef QHash<Qt::Corner, ConductorProfile> ConductorProfilesGroup;
/** /**
Cette classe represente un conducteur. Un conducteur relie deux bornes d'element. Cette classe represente un conducteur. Un conducteur relie deux bornes d'element.
*/ */
class Conductor : public QGraphicsPathItem { class Conductor : public QObject, public QGraphicsPathItem {
Q_OBJECT
// constructeurs, destructeur // constructeurs, destructeur
public: public:
@@ -81,6 +83,9 @@ class Conductor : public QGraphicsPathItem {
ConductorProfilesGroup profiles() const; ConductorProfilesGroup profiles() const;
void readProperties(); void readProperties();
public slots:
void displayedTextChanged();
protected: protected:
virtual void mousePressEvent(QGraphicsSceneMouseEvent *); virtual void mousePressEvent(QGraphicsSceneMouseEvent *);
virtual void mouseMoveEvent(QGraphicsSceneMouseEvent *); virtual void mouseMoveEvent(QGraphicsSceneMouseEvent *);

View File

@@ -16,6 +16,7 @@
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>. along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "conductorpropertieswidget.h" #include "conductorpropertieswidget.h"
#include <QtGui>
#include "conductor.h" #include "conductor.h"
/** /**
@@ -46,6 +47,7 @@ void ConductorPropertiesWidget::buildInterface() {
setMinimumSize(380, 280); setMinimumSize(380, 280);
QVBoxLayout *main_layout = new QVBoxLayout(this); QVBoxLayout *main_layout = new QVBoxLayout(this);
main_layout -> setContentsMargins(0, 0, 0, 0);
QGroupBox *groupbox = new QGroupBox(tr("Type de conducteur")); QGroupBox *groupbox = new QGroupBox(tr("Type de conducteur"));
main_layout -> addWidget(groupbox); main_layout -> addWidget(groupbox);

View File

@@ -17,8 +17,9 @@
*/ */
#ifndef CONDUCTOR_PROPERTIES_WIDGET_H #ifndef CONDUCTOR_PROPERTIES_WIDGET_H
#define CONDUCTOR_PROPERTIES_WIDGET_H #define CONDUCTOR_PROPERTIES_WIDGET_H
#include "conductor.h" #include "conductorproperties.h"
#include <QtGui> #include <QWidget>
/** /**
Ce widget permet a l utilisateur d'editer les proprietes d'un conducteur. Ce widget permet a l utilisateur d'editer les proprietes d'un conducteur.
Par proprietes, on entend non pas le trajet effectue par le conducteur mais Par proprietes, on entend non pas le trajet effectue par le conducteur mais

View File

@@ -16,7 +16,12 @@
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>. along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "configpages.h" #include "configpages.h"
#include "borderpropertieswidget.h"
#include "conductorpropertieswidget.h"
#include "insetpropertieswidget.h"
#include "qetapp.h" #include "qetapp.h"
#include "qetdiagrameditor.h"
#include "borderinset.h"
/** /**
Constructeur Constructeur
@@ -27,10 +32,17 @@ NewDiagramPage::NewDiagramPage(QWidget *parent) : ConfigPage(parent) {
// acces a la configuration de QElectroTech // acces a la configuration de QElectroTech
QSettings &settings = QETApp::settings(); QSettings &settings = QETApp::settings();
// recupere les dimensions du schema // dimensions par defaut d'un schema
int columns_count_value = settings.value("diagrameditor/defaultcols", 15).toInt(); bpw = new BorderPropertiesWidget(QETDiagramEditor::defaultBorderProperties());
int columns_width_value = qRound(settings.value("diagrameditor/defaultcolsize", 50.0).toDouble());
int columns_height_value = qRound(settings.value("diagrameditor/defaultheight", 500.0).toDouble()); // proprietes par defaut d'un cartouche
ipw = new InsetPropertiesWidget(QETDiagramEditor::defaultInsetProperties(), true);
// proprietes par defaut des conducteurs
ConductorProperties cp;
cp.fromSettings(settings, "diagrameditor/defaultconductor");
cpw = new ConductorPropertiesWidget(cp);
cpw -> setContentsMargins(0, 0, 0, 0);
QVBoxLayout *vlayout1 = new QVBoxLayout(); QVBoxLayout *vlayout1 = new QVBoxLayout();
@@ -44,45 +56,9 @@ NewDiagramPage::NewDiagramPage(QWidget *parent) : ConfigPage(parent) {
QHBoxLayout *hlayout1 = new QHBoxLayout(); QHBoxLayout *hlayout1 = new QHBoxLayout();
QVBoxLayout *vlayout2 = new QVBoxLayout(); QVBoxLayout *vlayout2 = new QVBoxLayout();
QGroupBox *diagram_size_box = new QGroupBox(tr("Dimensions du sch\351ma")); vlayout2 -> addWidget(bpw);
diagram_size_box -> setMinimumWidth(300);
QGridLayout *diagram_size_box_layout = new QGridLayout(diagram_size_box);
QLabel *ds1 = new QLabel(tr("Colonnes :"));
columns_count = new QSpinBox(diagram_size_box);
columns_count -> setMinimum(3); /// @todo methode statique pour recuperer ca
columns_count -> setValue(columns_count_value);
columns_width = new QSpinBox(diagram_size_box);
columns_width -> setMinimum(1);
columns_width -> setSingleStep(10);
columns_width -> setValue(columns_width_value);
columns_width -> setPrefix(tr("\327"));
columns_width -> setSuffix(tr("px"));
QLabel *ds2 = new QLabel(tr("Hauteur :"));
columns_height = new QSpinBox(diagram_size_box);
columns_height -> setRange(80, 10000); /// @todo methode statique pour recuperer ca
columns_height -> setSingleStep(80);
columns_height -> setValue(columns_height_value);
diagram_size_box_layout -> addWidget(ds1, 0, 0);
diagram_size_box_layout -> addWidget(columns_count, 0, 1);
diagram_size_box_layout -> addWidget(columns_width, 0, 2);
diagram_size_box_layout -> addWidget(ds2, 1, 0);
diagram_size_box_layout -> addWidget(columns_height, 1, 1);
ipw = new InsetPropertiesWidget(QETDiagramEditor::defaultInsetProperties(), true, this);
// proprietes par defaut des conducteurs
ConductorProperties cp;
cp.fromSettings(settings, "diagrameditor/defaultconductor");
cpw = new ConductorPropertiesWidget(cp);
vlayout2 -> addWidget(diagram_size_box);
vlayout2 -> addWidget(ipw); vlayout2 -> addWidget(ipw);
vlayout2 -> setSpacing(5);
hlayout1 -> addLayout(vlayout2); hlayout1 -> addLayout(vlayout2);
hlayout1 -> addWidget(cpw); hlayout1 -> addWidget(cpw);
vlayout1 -> addLayout(hlayout1); vlayout1 -> addLayout(hlayout1);
@@ -102,9 +78,13 @@ void NewDiagramPage::applyConf() {
QSettings &settings = QETApp::settings(); QSettings &settings = QETApp::settings();
// dimensions des nouveaux schemas // dimensions des nouveaux schemas
settings.setValue("diagrameditor/defaultcols", columns_count -> value()); BorderProperties border = bpw -> borderProperties();
settings.setValue("diagrameditor/defaultcolsize", columns_width -> value()); settings.setValue("diagrameditor/defaultcols", border.columns_count);
settings.setValue("diagrameditor/defaultheight", columns_height -> value()); settings.setValue("diagrameditor/defaultcolsize", border.columns_width);
settings.setValue("diagrameditor/defaultdisplaycols", border.display_columns);
settings.setValue("diagrameditor/defaultrows", border.rows_count);
settings.setValue("diagrameditor/defaultrowsize", border.rows_height);
settings.setValue("diagrameditor/defaultdisplayrows", border.display_rows);
// proprietes du cartouche // proprietes du cartouche
InsetProperties inset = ipw-> insetProperties(); InsetProperties inset = ipw-> insetProperties();

View File

@@ -18,8 +18,9 @@
#ifndef CONFIG_PAGES_H #ifndef CONFIG_PAGES_H
#define CONFIG_PAGES_H #define CONFIG_PAGES_H
#include <QtGui> #include <QtGui>
#include "conductorpropertieswidget.h" class BorderPropertiesWidget;
#include "insetpropertieswidget.h" class ConductorPropertiesWidget;
class InsetPropertiesWidget;
/** /**
Cette classe abstraite contient les methodes que toutes les pages de Cette classe abstraite contient les methodes que toutes les pages de
@@ -63,9 +64,7 @@ class NewDiagramPage : public ConfigPage {
// attributs // attributs
public: public:
QSpinBox *columns_count; ///< Widget d'edition du nombre par defaut de colonnes BorderPropertiesWidget *bpw; ///< Widget d'edition des dimensions du schema
QSpinBox *columns_width; ///< Widget d'edition de la largeur par defaut des colonnes
QSpinBox *columns_height; ///< Widget d'edition de la hauteur par defaut des colonnes
InsetPropertiesWidget *ipw; ///< Widget d'edition des proprietes par defaut du cartouche InsetPropertiesWidget *ipw; ///< Widget d'edition des proprietes par defaut du cartouche
ConductorPropertiesWidget *cpw; ///< Widget d'edition des proprietes par defaut des conducteurs ConductorPropertiesWidget *cpw; ///< Widget d'edition des proprietes par defaut des conducteurs
}; };

View File

@@ -86,7 +86,7 @@ CustomElement::CustomElement(QString &nom_fichier, QGraphicsItem *qgi, Diagram *
QObject::tr("Avertissement : l'\351l\351ment ") + nom_fichier QObject::tr("Avertissement : l'\351l\351ment ") + nom_fichier
+ QObject::tr(" a \351t\351 enregistr\351 avec une version" + QObject::tr(" a \351t\351 enregistr\351 avec une version"
" ult\351rieure de QElectroTech.") " ult\351rieure de QElectroTech.")
); ) << std::endl;
} }
} }
@@ -418,7 +418,6 @@ bool CustomElement::parseInput(QDomElement &e) {
) return(false); ) return(false);
ElementTextItem *eti = new ElementTextItem(e.attribute("text"), this); ElementTextItem *eti = new ElementTextItem(e.attribute("text"), this);
eti -> setFont(QFont(QETApp::diagramTextsFont(), size));
eti -> setPos(pos_x, pos_y); eti -> setPos(pos_x, pos_y);
eti -> setOriginalPos(QPointF(pos_x, pos_y)); eti -> setOriginalPos(QPointF(pos_x, pos_y));
if (e.attribute("rotate") == "true") eti -> setFollowParentRotations(true); if (e.attribute("rotate") == "true") eti -> setFollowParentRotations(true);

View File

@@ -37,9 +37,10 @@ Diagram::Diagram(QObject *parent) :
draw_grid(true), draw_grid(true),
use_border(true), use_border(true),
moved_elements_fetched(false), moved_elements_fetched(false),
qgi_manager(this),
draw_terminals(true) draw_terminals(true)
{ {
undo_stack = new QUndoStack();
qgi_manager = new QGIManager(this);
setBackgroundBrush(Qt::white); setBackgroundBrush(Qt::white);
conductor_setter = new QGraphicsLineItem(0, 0); conductor_setter = new QGraphicsLineItem(0, 0);
conductor_setter -> setZValue(1000000); conductor_setter -> setZValue(1000000);
@@ -59,8 +60,23 @@ Diagram::Diagram(QObject *parent) :
Destructeur Destructeur
*/ */
Diagram::~Diagram() { Diagram::~Diagram() {
if (conductor_setter -> scene()) removeItem(conductor_setter); // suppression de la liste des annulations - l'undo stack fait appel au qgimanager pour supprimer certains elements
delete conductor_setter; delete undo_stack;
// suppression du QGIManager - tous les elements qu'il connait sont supprimes
delete qgi_manager;
// recense les items supprimables
QList<QGraphicsItem *> deletable_items;
foreach(QGraphicsItem *qgi, items()) {
if (qgi -> parentItem()) continue;
if (qgraphicsitem_cast<Conductor *>(qgi)) continue;
deletable_items << qgi;
}
// suppression des items supprimables
foreach(QGraphicsItem *qgi_d, deletable_items) {
delete qgi_d;
}
} }
/** /**
@@ -231,9 +247,14 @@ QDomDocument Diagram::toXml(bool diagram) {
if (!border_and_inset.title().isNull()) racine.setAttribute("title", border_and_inset.title()); if (!border_and_inset.title().isNull()) racine.setAttribute("title", border_and_inset.title());
if (!border_and_inset.fileName().isNull()) racine.setAttribute("filename", border_and_inset.fileName()); if (!border_and_inset.fileName().isNull()) racine.setAttribute("filename", border_and_inset.fileName());
if (!border_and_inset.folio().isNull()) racine.setAttribute("folio", border_and_inset.folio()); if (!border_and_inset.folio().isNull()) racine.setAttribute("folio", border_and_inset.folio());
racine.setAttribute("cols", border_and_inset.nbColumn()); racine.setAttribute("cols", border_and_inset.nbColumns());
racine.setAttribute("colsize", border_and_inset.columnsWidth()); racine.setAttribute("colsize", QString("%1").arg(border_and_inset.columnsWidth()));
racine.setAttribute("height", border_and_inset.columnsHeight()); racine.setAttribute("rows", border_and_inset.nbRows());
racine.setAttribute("rowsize", QString("%1").arg(border_and_inset.rowsHeight()));
// attribut datant de la version 0.1 - laisse pour retrocompatibilite
racine.setAttribute("height", QString("%1").arg(border_and_inset.diagramHeight()));
racine.setAttribute("displaycols", border_and_inset.columnsAreDisplayed() ? "true" : "false");
racine.setAttribute("displayrows", border_and_inset.rowsAreDisplayed() ? "true" : "false");
// type de conducteur par defaut // type de conducteur par defaut
QDomElement default_conductor = document.createElement("defaultconductor"); QDomElement default_conductor = document.createElement("defaultconductor");
@@ -337,9 +358,24 @@ bool Diagram::fromXml(QDomDocument &document, QPointF position, bool consider_in
double col_size = root.attribute("colsize").toDouble(&ok); double col_size = root.attribute("colsize").toDouble(&ok);
if (ok) border_and_inset.setColumnsWidth(col_size); if (ok) border_and_inset.setColumnsWidth(col_size);
// retrocompatibilite : les schemas enregistres avec la 0.1 ont un attribut "height"
if (root.hasAttribute("rows") && root.hasAttribute("rowsize")) {
// nombre de lignes
int nb_rows = root.attribute("rows").toInt(&ok);
if (ok) border_and_inset.setNbRows(nb_rows);
// taille des lignes
double row_size = root.attribute("rowsize").toDouble(&ok);
if (ok) border_and_inset.setRowsHeight(row_size);
} else {
// hauteur du schema // hauteur du schema
double height = root.attribute("height").toDouble(&ok); double height = root.attribute("height").toDouble(&ok);
if (ok) border_and_inset.setColumnsHeight(height); if (ok) border_and_inset.setDiagramHeight(height);
}
// affichage des lignes et colonnes
border_and_inset.displayColumns(root.attribute("displaycols") != "false");
border_and_inset.displayRows(root.attribute("displayrows") != "false");
border_and_inset.adjustInsetToColumns(); border_and_inset.adjustInsetToColumns();
@@ -461,6 +497,17 @@ bool Diagram::fromXml(QDomDocument &document, QPointF position, bool consider_in
return(true); return(true);
} }
/**
Gere le fait qu'un texte du schema ait ete modifie
@param text_item Texte modifie
@param old_text Ancien texte
@param new_text Nouveau texte
*/
void Diagram::diagramTextChanged(DiagramTextItem *text_item, const QString &old_text, const QString &new_text) {
if (!text_item) return;
undo_stack -> push(new ChangeDiagramTextCommand(text_item, old_text, new_text));
}
/** /**
Verifie si la selection est passe d'un etat ou elle est vide a un etat ou Verifie si la selection est passe d'un etat ou elle est vide a un etat ou
elle ne l'est pas, et inversement. Si c'est le cas, le signal elle ne l'est pas, et inversement. Si c'est le cas, le signal

View File

@@ -75,8 +75,8 @@ class Diagram : public QGraphicsScene {
QSet<Conductor *> conductors_to_move; QSet<Conductor *> conductors_to_move;
QHash<Conductor *, Terminal *> conductors_to_update; QHash<Conductor *, Terminal *> conductors_to_update;
QSet<DiagramTextItem *> texts_to_move; QSet<DiagramTextItem *> texts_to_move;
QGIManager qgi_manager; QGIManager *qgi_manager;
QUndoStack undo_stack; QUndoStack *undo_stack;
bool draw_terminals; bool draw_terminals;
// methodes // methodes
@@ -126,6 +126,9 @@ class Diagram : public QGraphicsScene {
QUndoStack &undoStack(); QUndoStack &undoStack();
QGIManager &qgiManager(); QGIManager &qgiManager();
public slots:
void diagramTextChanged(DiagramTextItem *, const QString &, const QString &);
private slots: private slots:
void slot_checkSelectionEmptinessChange(); void slot_checkSelectionEmptinessChange();
@@ -250,12 +253,12 @@ inline const QSet<DiagramTextItem *> &Diagram::textsToMove() {
/// @return la pile d'annulations de ce schema /// @return la pile d'annulations de ce schema
inline QUndoStack &Diagram::undoStack() { inline QUndoStack &Diagram::undoStack() {
return(undo_stack); return(*undo_stack);
} }
/// @return le egstionnaire de QGraphicsItem de ce schema /// @return le egstionnaire de QGraphicsItem de ce schema
inline QGIManager &Diagram::qgiManager() { inline QGIManager &Diagram::qgiManager() {
return(qgi_manager); return(*qgi_manager);
} }
/// @return true si les bornes sont affichees, false sinon /// @return true si les bornes sont affichees, false sinon

View File

@@ -81,11 +81,23 @@ AddTextCommand::~AddTextCommand() {
/// Annule l'ajout /// Annule l'ajout
void AddTextCommand::undo() { void AddTextCommand::undo() {
QObject::disconnect(
textitem,
SIGNAL(diagramTextChanged(DiagramTextItem *, const QString &, const QString &)),
diagram,
SLOT(diagramTextChanged(DiagramTextItem *, const QString &, const QString &))
);
diagram -> removeItem(textitem); diagram -> removeItem(textitem);
} }
/// Refait l'ajour /// Refait l'ajour
void AddTextCommand::redo() { void AddTextCommand::redo() {
QObject::connect(
textitem,
SIGNAL(diagramTextChanged(DiagramTextItem *, const QString &, const QString &)),
diagram,
SLOT(diagramTextChanged(DiagramTextItem *, const QString &, const QString &))
);
diagram -> addItem(textitem); diagram -> addItem(textitem);
textitem -> setPos(position); textitem -> setPos(position);
} }
@@ -524,13 +536,11 @@ void ChangeInsetCommand::redo() {
@param dia Schema modifie @param dia Schema modifie
@param parent QUndoCommand parent @param parent QUndoCommand parent
*/ */
ChangeBorderCommand::ChangeBorderCommand(Diagram *dia, QUndoCommand *parent) : ChangeBorderCommand::ChangeBorderCommand(Diagram *dia, const BorderProperties &old_bp, const BorderProperties &new_bp, QUndoCommand *parent) :
QUndoCommand(QObject::tr("modifier les dimensions du sch\351ma"), parent), QUndoCommand(QObject::tr("modifier les dimensions du sch\351ma"), parent),
diagram(dia), diagram(dia),
columnsCountDifference(0), old_properties(old_bp),
columnsHeightDifference(0.0), new_properties(new_bp)
columnsWidthDifference(0.0),
headersHeightDifference(0.0)
{ {
} }
@@ -538,39 +548,14 @@ ChangeBorderCommand::ChangeBorderCommand(Diagram *dia, QUndoCommand *parent) :
ChangeBorderCommand::~ChangeBorderCommand() { ChangeBorderCommand::~ChangeBorderCommand() {
} }
/**
Applique les changements au schema
@param coeff comme les changements s'expriment sous forme de nombres dont
il suffit d'inverser le signe pour les annuler, ces valeurs sont ici
multipliees par le coefficient passe en parametre avant d'etre appliquees.
Pour resumer : 1 pour refaire, -1 pour annuler.
*/
void ChangeBorderCommand::applyChanges(int coeff) {
// reference vers l'objet border_and_inset du schema
BorderInset &border = diagram -> border_and_inset;
if (columnsCountDifference) {
border.setNbColumns(border.nbColumn() + (columnsCountDifference * coeff));
}
if (columnsHeightDifference) {
border.setColumnsHeight(border.columnsHeight() + (columnsHeightDifference * coeff));
}
if (columnsWidthDifference) {
border.setColumnsWidth(border.columnsWidth() + (columnsWidthDifference * coeff));
}
if (headersHeightDifference) {
border.setColumnsHeaderHeight(border.columnsHeaderHeight() + (headersHeightDifference * coeff));
}
border.adjustInsetToColumns();
}
/// Annule les changements apportes au schema /// Annule les changements apportes au schema
void ChangeBorderCommand::undo() { void ChangeBorderCommand::undo() {
applyChanges(-1); diagram -> border_and_inset.importBorder(old_properties);
} }
/// Refait les changements apportes au schema /// Refait les changements apportes au schema
void ChangeBorderCommand::redo() { void ChangeBorderCommand::redo() {
applyChanges(1); diagram -> border_and_inset.importBorder(new_properties);
} }
/** /**

View File

@@ -22,7 +22,9 @@
#include "diagramcontent.h" #include "diagramcontent.h"
#include "diagramtextitem.h" #include "diagramtextitem.h"
#include "conductor.h" #include "conductor.h"
#include "borderproperties.h"
#include "conductorproperties.h" #include "conductorproperties.h"
#include "insetproperties.h"
#include <QtGui> #include <QtGui>
/** /**
Cette classe represente l'action d'ajouter un element au schema Cette classe represente l'action d'ajouter un element au schema
@@ -325,16 +327,12 @@ class ChangeInsetCommand : public QUndoCommand {
}; };
/** /**
Cette classe represente l'action de modifier : Cette classe represente l'action de modifier les dimensions d'un schema
-le nombre de colonnes d'un schema
-la hauteur des colonnes
-la largeur des colonnes
-la hauteur des en-tetes des colonnes
*/ */
class ChangeBorderCommand : public QUndoCommand { class ChangeBorderCommand : public QUndoCommand {
// constructeurs, destructeur // constructeurs, destructeur
public: public:
ChangeBorderCommand(Diagram *, QUndoCommand * = 0); ChangeBorderCommand(Diagram *, const BorderProperties &, const BorderProperties &, QUndoCommand * = 0);
virtual ~ChangeBorderCommand(); virtual ~ChangeBorderCommand();
private: private:
ChangeBorderCommand(const ChangeBorderCommand &); ChangeBorderCommand(const ChangeBorderCommand &);
@@ -343,22 +341,16 @@ class ChangeBorderCommand : public QUndoCommand {
public: public:
virtual void undo(); virtual void undo();
virtual void redo(); virtual void redo();
private:
virtual void applyChanges(int = 1);
// attributs // attributs
private: private:
/// schema modifie /// schema modifie
Diagram *diagram; Diagram *diagram;
public: public:
/// nombre de colonnes ajoutees / enlevees /// anciennes dimensions du schema
int columnsCountDifference; BorderProperties old_properties;
/// delta pour la hauteur des colonnes /// nouvelles dimensions du schema
qreal columnsHeightDifference; BorderProperties new_properties;
/// delta pour la largeur des colonnes
qreal columnsWidthDifference;
/// delta pour la hauteur des entetes des colonnes
qreal headersHeightDifference;
}; };
/** /**

View File

@@ -119,12 +119,15 @@ QString DiagramContent::sentence(int filter) const {
@param d Object QDebug a utiliser pour l'affichage des informations de debug @param d Object QDebug a utiliser pour l'affichage des informations de debug
@param c Contenu de schema a debugger @param c Contenu de schema a debugger
*/ */
QDebug &operator<<(QDebug d, DiagramContent &c) { QDebug &operator<<(QDebug d, DiagramContent &) {
d << "DiagramContent {" << "\n"; d << "DiagramContent {" << "\n";
/*
FIXME Le double-heritage QObject / QGraphicsItem a casse cet operateur
d << " elements :" << c.elements << "\n"; d << " elements :" << c.elements << "\n";
d << " conductorsToUpdate :" << c.conductorsToUpdate.keys() << "\n"; d << " conductorsToUpdate :" << c.conductorsToUpdate.keys() << "\n";
d << " conductorsToMove :" << c.conductorsToMove << "\n"; d << " conductorsToMove :" << c.conductorsToMove << "\n";
d << " otherConductors :" << c.otherConductors << "\n"; d << " otherConductors :" << c.otherConductors << "\n";
*/
d << "}"; d << "}";
return(d.space()); return(d.space());
} }

View File

@@ -31,6 +31,9 @@ DiagramPrintDialog::DiagramPrintDialog(Diagram *dia, QWidget *parent) :
{ {
// initialise l'imprimante // initialise l'imprimante
printer = new QPrinter(); printer = new QPrinter();
// orientation paysage par defaut
printer -> setOrientation(QPrinter::Landscape);
} }
/** /**
@@ -55,17 +58,35 @@ QString DiagramPrintDialog::PDFName() const {
return(pdf_name); return(pdf_name);
} }
/**
Definit le nom du document
*/
void DiagramPrintDialog::setDocName(const QString &name) {
doc_name = name;
}
/**
@return le nom du document
*/
QString DiagramPrintDialog::docName() const {
return(doc_name);
}
/** /**
Execute le dialogue d'impression Execute le dialogue d'impression
*/ */
void DiagramPrintDialog::exec() { void DiagramPrintDialog::exec() {
// affichage du dialogue d'impression standard
QPrintDialog print_dialog(printer);
print_dialog.setEnabledOptions(QAbstractPrintDialog::PrintToFile);
#ifndef Q_OS_WIN32 #ifndef Q_OS_WIN32
if (!pdf_name.isEmpty()) printer -> setOutputFileName(pdf_name); if (!pdf_name.isEmpty()) printer -> setOutputFileName(pdf_name);
if (!doc_name.isEmpty()) printer -> setDocName(doc_name);
#endif #endif
// affichage du dialogue d'impression standard
QPrintDialog print_dialog(printer, parentWidget());
print_dialog.setWindowTitle(tr("Options d'impression"));
print_dialog.setEnabledOptions(QAbstractPrintDialog::PrintToFile | QAbstractPrintDialog::PrintShowPageSize);
if (print_dialog.exec() == QDialog::Rejected) return; if (print_dialog.exec() == QDialog::Rejected) return;
/* /*
@@ -124,12 +145,28 @@ int DiagramPrintDialog::verticalPagesCount(bool fullpage) const {
Construit un dialogue non standard pour demander les pages a imprimer a l'utilisateur Construit un dialogue non standard pour demander les pages a imprimer a l'utilisateur
*/ */
void DiagramPrintDialog::buildDialog() { void DiagramPrintDialog::buildDialog() {
dialog = new QDialog(); dialog = new QDialog(parentWidget());
dialog -> setMinimumWidth(460);
dialog -> setWindowTitle(tr("Options d'impression")); dialog -> setWindowTitle(tr("Options d'impression"));
options_label = new QLabel(); options_label = new QLabel();
use_full_page = new QCheckBox(tr("Utiliser toute la feuille")); use_full_page = new QCheckBox(tr("Utiliser toute la feuille"));
use_full_page_label_ = new QLabel(tr(
"Si cette option est coch\351e, les marges de la feuille seront "
"ignor\351es et toute sa surface sera utilis\351e pour l'impression. "
"Cela peut ne pas \352tre support\351 par votre imprimante."
));
use_full_page_label_ -> setWordWrap(true);
use_full_page_label_ -> setContentsMargins(20, 0, 0, 0);
fit_diagram_to_page = new QCheckBox(tr("Adapter le sch\351ma \340 la page")); fit_diagram_to_page = new QCheckBox(tr("Adapter le sch\351ma \340 la page"));
range_from_label = new QLabel(tr("Plage de ")); fit_diagram_to_page_label_ = new QLabel(tr(
"Si cette option est coch\351e, le sch\351ma sera agrandi ou "
"r\351tr\351ci de fa\347on \340 remplir toute la surface imprimable "
"d'une et une seule page."
));
fit_diagram_to_page_label_ -> setWordWrap(true);
fit_diagram_to_page_label_ -> setContentsMargins(20, 0, 0, 0);
fit_diagram_to_page -> setChecked(true);
range_from_label = new QLabel(tr("Pages \340 imprimer : plage de "));
start_page = new QSpinBox(); start_page = new QSpinBox();
to_label = new QLabel(tr(" \340 ")); to_label = new QLabel(tr(" \340 "));
end_page = new QSpinBox(); end_page = new QSpinBox();
@@ -140,11 +177,14 @@ void DiagramPrintDialog::buildDialog() {
pages_layout -> addWidget(start_page); pages_layout -> addWidget(start_page);
pages_layout -> addWidget(to_label); pages_layout -> addWidget(to_label);
pages_layout -> addWidget(end_page); pages_layout -> addWidget(end_page);
pages_layout -> addStretch();
QVBoxLayout *dialog_layout = new QVBoxLayout(dialog); QVBoxLayout *dialog_layout = new QVBoxLayout(dialog);
dialog_layout -> addWidget(options_label); dialog_layout -> addWidget(options_label);
dialog_layout -> addWidget(use_full_page); dialog_layout -> addWidget(use_full_page);
dialog_layout -> addWidget(use_full_page_label_);
dialog_layout -> addWidget(fit_diagram_to_page); dialog_layout -> addWidget(fit_diagram_to_page);
dialog_layout -> addWidget(fit_diagram_to_page_label_);
dialog_layout -> addLayout(pages_layout); dialog_layout -> addLayout(pages_layout);
dialog_layout -> addStretch(); dialog_layout -> addStretch();
dialog_layout -> addWidget(buttons); dialog_layout -> addWidget(buttons);
@@ -227,11 +267,7 @@ void DiagramPrintDialog::print() {
// impression physique (!= fichier PDF) // impression physique (!= fichier PDF)
if (printer -> outputFileName().isEmpty()) { if (printer -> outputFileName().isEmpty()) {
// lorsqu'on imprime en paysage sur imprimante reelle, il faut pivoter soi-meme le rendu // utiliser cette condition pour agir differemment en cas d'impression physique
if (printer -> orientation() == QPrinter::Landscape) {
qp.rotate(90.0);
qp.translate(0.0, -printer -> pageRect().height());
}
} }
diagram -> setDisplayGrid(false); diagram -> setDisplayGrid(false);

View File

@@ -38,6 +38,8 @@ class DiagramPrintDialog : public QWidget {
public: public:
void setPDFName(const QString &); void setPDFName(const QString &);
QString PDFName() const; QString PDFName() const;
void setDocName(const QString &);
QString docName() const;
int pagesCount(bool = false) const; int pagesCount(bool = false) const;
int horizontalPagesCount(bool = false) const; int horizontalPagesCount(bool = false) const;
int verticalPagesCount(bool = false) const; int verticalPagesCount(bool = false) const;
@@ -57,13 +59,16 @@ class DiagramPrintDialog : public QWidget {
private: private:
Diagram *diagram; Diagram *diagram;
QPrinter *printer; QPrinter *printer;
QString doc_name;
QString pdf_name; QString pdf_name;
QDialog *dialog; QDialog *dialog;
QLabel *options_label; QLabel *options_label;
QLabel *range_from_label; QLabel *range_from_label;
QLabel *to_label; QLabel *to_label;
QCheckBox *use_full_page; QCheckBox *use_full_page;
QLabel *use_full_page_label_;
QCheckBox *fit_diagram_to_page; QCheckBox *fit_diagram_to_page;
QLabel *fit_diagram_to_page_label_;
QSpinBox *start_page; QSpinBox *start_page;
QSpinBox *end_page; QSpinBox *end_page;
QDialogButtonBox *buttons; QDialogButtonBox *buttons;

View File

@@ -17,6 +17,7 @@
*/ */
#include "diagramtextitem.h" #include "diagramtextitem.h"
#include "diagramcommands.h" #include "diagramcommands.h"
#include "qetapp.h"
/** /**
Constructeur Constructeur
@@ -27,6 +28,7 @@ DiagramTextItem::DiagramTextItem(QGraphicsItem *parent, QGraphicsScene *scene) :
QGraphicsTextItem(parent, scene) QGraphicsTextItem(parent, scene)
{ {
setDefaultTextColor(Qt::black); setDefaultTextColor(Qt::black);
setFont(QFont(QETApp::diagramTextsFont(), 9));
setFlags(QGraphicsItem::ItemIsSelectable|QGraphicsItem::ItemIsMovable); setFlags(QGraphicsItem::ItemIsSelectable|QGraphicsItem::ItemIsMovable);
connect(this, SIGNAL(lostFocus()), this, SLOT(setNonFocusable())); connect(this, SIGNAL(lostFocus()), this, SLOT(setNonFocusable()));
} }
@@ -42,6 +44,7 @@ DiagramTextItem::DiagramTextItem(const QString &text, QGraphicsItem *parent, QGr
previous_text(text) previous_text(text)
{ {
setDefaultTextColor(Qt::black); setDefaultTextColor(Qt::black);
setFont(QFont(QETApp::diagramTextsFont(), 9));
setFlags(QGraphicsItem::ItemIsSelectable|QGraphicsItem::ItemIsMovable); setFlags(QGraphicsItem::ItemIsSelectable|QGraphicsItem::ItemIsMovable);
connect(this, SIGNAL(lostFocus()), this, SLOT(setNonFocusable())); connect(this, SIGNAL(lostFocus()), this, SLOT(setNonFocusable()));
} }
@@ -60,13 +63,11 @@ Diagram *DiagramTextItem::diagram() const {
*/ */
void DiagramTextItem::focusOutEvent(QFocusEvent *e) { void DiagramTextItem::focusOutEvent(QFocusEvent *e) {
QGraphicsTextItem::focusOutEvent(e); QGraphicsTextItem::focusOutEvent(e);
// si le texte a ete modifie // signale la modification du texte si besoin
if (toPlainText() != previous_text) { if (toPlainText() != previous_text) {
if (Diagram *dia = diagram()) { emit(diagramTextChanged(this, previous_text, toPlainText()));
dia -> undoStack().push(new ChangeDiagramTextCommand(this, previous_text, toPlainText()));
previous_text = toPlainText(); previous_text = toPlainText();
} }
}
// deselectionne le texte // deselectionne le texte
QTextCursor cursor = textCursor(); QTextCursor cursor = textCursor();
@@ -98,8 +99,8 @@ void DiagramTextItem::fromXml(const QDomElement &e) {
*/ */
QDomElement DiagramTextItem::toXml(QDomDocument &document) const { QDomElement DiagramTextItem::toXml(QDomDocument &document) const {
QDomElement result = document.createElement("input"); QDomElement result = document.createElement("input");
result.setAttribute("x", pos().x()); result.setAttribute("x", QString("%1").arg(pos().x()));
result.setAttribute("y", pos().y()); result.setAttribute("y", QString("%1").arg(pos().y()));
result.setAttribute("text", toPlainText()); result.setAttribute("text", toPlainText());
return(result); return(result);
} }

View File

@@ -59,6 +59,8 @@ class DiagramTextItem : public QGraphicsTextItem {
signals: signals:
/// signal emis lorsque le champ de texte perd le focus /// signal emis lorsque le champ de texte perd le focus
void lostFocus(); void lostFocus();
/// signal emis lorsque le champ de texte a ete modifie
void diagramTextChanged(DiagramTextItem *, const QString &, const QString &);
// slots // slots
public slots: public slots:

View File

@@ -24,12 +24,14 @@
#include "diagramcommands.h" #include "diagramcommands.h"
#include "conductorpropertieswidget.h" #include "conductorpropertieswidget.h"
#include "insetpropertieswidget.h" #include "insetpropertieswidget.h"
#include "borderpropertieswidget.h"
/** /**
Constructeur Constructeur
@param parent Le QWidegt parent de cette vue de schema @param parent Le QWidget parent de cette vue de schema
*/ */
DiagramView::DiagramView(QWidget *parent) : QGraphicsView(parent), is_adding_text(false) { DiagramView::DiagramView(QWidget *parent) : QGraphicsView(parent), is_adding_text(false) {
setAttribute(Qt::WA_DeleteOnClose, true);
setInteractive(true); setInteractive(true);
setCacheMode(QGraphicsView::CacheBackground); setCacheMode(QGraphicsView::CacheBackground);
setOptimizationFlags(QGraphicsView::DontSavePainterState|QGraphicsView::DontAdjustForAntialiasing); setOptimizationFlags(QGraphicsView::DontSavePainterState|QGraphicsView::DontAdjustForAntialiasing);
@@ -56,6 +58,7 @@ DiagramView::DiagramView(QWidget *parent) : QGraphicsView(parent), is_adding_tex
connect(scene, SIGNAL(selectionEmptinessChanged()), this, SIGNAL(selectionChanged())); connect(scene, SIGNAL(selectionEmptinessChanged()), this, SIGNAL(selectionChanged()));
connect(&(scene -> border_and_inset), SIGNAL(borderChanged(QRectF, QRectF)), this, SLOT(adjustSceneRect())); connect(&(scene -> border_and_inset), SIGNAL(borderChanged(QRectF, QRectF)), this, SLOT(adjustSceneRect()));
connect(&(scene -> border_and_inset), SIGNAL(displayChanged()), this, SLOT(adjustSceneRect()));
connect(&(scene -> undoStack()), SIGNAL(cleanChanged(bool)), this, SLOT(updateWindowTitle())); connect(&(scene -> undoStack()), SIGNAL(cleanChanged(bool)), this, SLOT(updateWindowTitle()));
} }
@@ -66,7 +69,7 @@ DiagramView::~DiagramView() {
} }
/** /**
appelle la methode select sur tous les elements de la liste d'elements Appelle la methode select sur tous les elements de la liste d'elements
*/ */
void DiagramView::selectAll() { void DiagramView::selectAll() {
if (scene -> items().isEmpty()) return; if (scene -> items().isEmpty()) return;
@@ -116,7 +119,7 @@ void DiagramView::rotateSelection() {
} }
/** /**
accepte ou refuse le drag'n drop en fonction du type de donnees entrant Accepte ou refuse le drag'n drop en fonction du type de donnees entrant
@param e le QDragEnterEvent correspondant au drag'n drop tente @param e le QDragEnterEvent correspondant au drag'n drop tente
*/ */
void DiagramView::dragEnterEvent(QDragEnterEvent *e) { void DiagramView::dragEnterEvent(QDragEnterEvent *e) {
@@ -125,14 +128,14 @@ void DiagramView::dragEnterEvent(QDragEnterEvent *e) {
} }
/** /**
gere les dragleaveevent Gere les dragleaveevent
@param e le QDragEnterEvent correspondant au drag'n drop sortant @param e le QDragEnterEvent correspondant au drag'n drop sortant
*/ */
void DiagramView::dragLeaveEvent(QDragLeaveEvent *) { void DiagramView::dragLeaveEvent(QDragLeaveEvent *) {
} }
/** /**
accepte ou refuse le drag'n drop en fonction du type de donnees entrant Accepte ou refuse le drag'n drop en fonction du type de donnees entrant
@param e le QDragMoveEvent correspondant au drag'n drop tente @param e le QDragMoveEvent correspondant au drag'n drop tente
*/ */
void DiagramView::dragMoveEvent(QDragMoveEvent *e) { void DiagramView::dragMoveEvent(QDragMoveEvent *e) {
@@ -141,7 +144,7 @@ void DiagramView::dragMoveEvent(QDragMoveEvent *e) {
} }
/** /**
gere les depots (drop) acceptes sur le Diagram Gere les depots (drop) acceptes sur le Diagram
@param e le QDropEvent correspondant au drag'n drop effectue @param e le QDropEvent correspondant au drag'n drop effectue
*/ */
void DiagramView::dropEvent(QDropEvent *e) { void DiagramView::dropEvent(QDropEvent *e) {
@@ -209,7 +212,7 @@ void DiagramView::zoomReset() {
} }
/** /**
copie les elements selectionnes du schema dans le presse-papier puis les supprime Copie les elements selectionnes du schema dans le presse-papier puis les supprime
*/ */
void DiagramView::cut() { void DiagramView::cut() {
copy(); copy();
@@ -219,7 +222,7 @@ void DiagramView::cut() {
} }
/** /**
copie les elements selectionnes du schema dans le presse-papier Copie les elements selectionnes du schema dans le presse-papier
*/ */
void DiagramView::copy() { void DiagramView::copy() {
QClipboard *presse_papier = QApplication::clipboard(); QClipboard *presse_papier = QApplication::clipboard();
@@ -259,20 +262,17 @@ void DiagramView::pasteHere() {
} }
/** /**
gere les clics et plus particulierement le clic du milieu (= coller pour X11) Gere les clics et plus particulierement :
* le clic du milieu (= coller pour X11)
* le clic pour ajouter un champ de texte independant
*/ */
void DiagramView::mousePressEvent(QMouseEvent *e) { void DiagramView::mousePressEvent(QMouseEvent *e) {
if (e -> buttons() == Qt::MidButton) { if (e -> buttons() == Qt::MidButton) {
paste(mapToScene(e -> pos()), QClipboard::Selection); paste(mapToScene(e -> pos()), QClipboard::Selection);
} else { } else {
if (is_adding_text && e -> buttons() == Qt::LeftButton) { if (is_adding_text && e -> buttons() == Qt::LeftButton) {
DiagramTextItem *dti = new DiagramTextItem(); addDiagramTextAtPos(mapToScene(e -> pos()));
dti -> setPlainText("_");
dti -> previous_text = "_";
scene -> undoStack().push(new AddTextCommand(scene, dti, e -> pos()));
adjustSceneRect();
is_adding_text = false; is_adding_text = false;
emit(textAdded(false));
} }
QGraphicsView::mousePressEvent(e); QGraphicsView::mousePressEvent(e);
} }
@@ -340,7 +340,7 @@ bool DiagramView::open(QString n_fichier, int *erreur) {
qreal diagram_version = root.attribute("version").toDouble(&conv_ok); qreal diagram_version = root.attribute("version").toDouble(&conv_ok);
if (conv_ok && QET::version.toDouble() < diagram_version) { if (conv_ok && QET::version.toDouble() < diagram_version) {
QMessageBox::warning( QMessageBox::warning(
0, this,
tr("Avertissement"), tr("Avertissement"),
tr("Ce document semble avoir \351t\351 enregistr\351 avec une " tr("Ce document semble avoir \351t\351 enregistr\351 avec une "
"version ult\351rieure de QElectroTech. Il est possible que " "version ult\351rieure de QElectroTech. Il est possible que "
@@ -425,10 +425,8 @@ void DiagramView::closeEvent(QCloseEvent *event) {
default: retour = true; // l'utilisateur dit non ou ferme le dialogue: c'est reussi default: retour = true; // l'utilisateur dit non ou ferme le dialogue: c'est reussi
} }
} }
if (retour) { if (retour) event -> accept();
event -> accept(); else event -> ignore();
delete this;
} else event -> ignore();
} }
@@ -523,7 +521,7 @@ bool DiagramView::saveDiagramToFile(QString &n_fichier) {
Exporte le schema. Exporte le schema.
*/ */
void DiagramView::dialogExport() { void DiagramView::dialogExport() {
ExportDialog ed(scene, this); ExportDialog ed(scene, diagramEditor());
ed.exec(); ed.exec();
} }
@@ -532,17 +530,21 @@ void DiagramView::dialogExport() {
*/ */
void DiagramView::dialogPrint() { void DiagramView::dialogPrint() {
// determine un nom possible pour le pdf // determine un nom possible pour le document et le pdf
QString doc_name;
QString pdf_file_name; QString pdf_file_name;
if (!file_name.isEmpty()) { if (!file_name.isEmpty()) {
doc_name = QFileInfo(file_name).fileName();
pdf_file_name = file_name; pdf_file_name = file_name;
pdf_file_name.replace(QRegExp("\\.qet$", Qt::CaseInsensitive), ""); pdf_file_name.replace(QRegExp("\\.qet$", Qt::CaseInsensitive), "");
} else { } else {
pdf_file_name = QDir::homePath() + tr("schema"); doc_name = tr("schema");
pdf_file_name = QDir::toNativeSeparators(QDir::homePath() + "/" + tr("schema"));
} }
pdf_file_name += ".pdf"; pdf_file_name += ".pdf";
DiagramPrintDialog print_dialog(scene, this); DiagramPrintDialog print_dialog(scene, this);
print_dialog.setDocName(doc_name);
print_dialog.setPDFName(pdf_file_name); print_dialog.setPDFName(pdf_file_name);
print_dialog.exec(); print_dialog.exec();
} }
@@ -551,52 +553,16 @@ void DiagramView::dialogPrint() {
Edite les informations du schema. Edite les informations du schema.
*/ */
void DiagramView::dialogEditInfos() { void DiagramView::dialogEditInfos() {
// recupere le cartouche du schema // recupere le cartouche et les dimensions du schema
InsetProperties inset = scene -> border_and_inset.exportInset(); InsetProperties inset = scene -> border_and_inset.exportInset();
BorderProperties border = scene -> border_and_inset.exportBorder();
// recupere les dimensions du schema
int columns_count_value = scene -> border_and_inset.nbColumn();
int columns_width_value = qRound(scene -> border_and_inset.columnsWidth());
int columns_height_value = qRound(scene -> border_and_inset.columnsHeight());
// construit le dialogue // construit le dialogue
QDialog popup; QDialog popup(diagramEditor());
popup.setMinimumWidth(400); popup.setMinimumWidth(400);
popup.setWindowTitle(tr("Propri\351t\351s du sch\351ma")); popup.setWindowTitle(tr("Propri\351t\351s du sch\351ma"));
QGroupBox *diagram_size_box = new QGroupBox(tr("Dimensions du sch\351ma"), &popup); BorderPropertiesWidget *border_infos = new BorderPropertiesWidget(border, &popup);
QGridLayout diagram_size_box_layout(diagram_size_box);
QLabel *ds1 = new QLabel(tr("Colonnes :"));
QSpinBox *columns_count = new QSpinBox(diagram_size_box);
columns_count -> setMinimum(scene -> border_and_inset.minNbColumns());
columns_count -> setValue(columns_count_value);
QSpinBox *columns_width = new QSpinBox(diagram_size_box);
columns_width -> setMinimum(1);
columns_width -> setSingleStep(10);
columns_width -> setValue(columns_width_value);
columns_width -> setPrefix(tr("\327"));
columns_width -> setSuffix(tr("px"));
QLabel *ds2 = new QLabel(tr("Hauteur :"));
QSpinBox *columns_height = new QSpinBox(diagram_size_box);
columns_height -> setRange(qRound(scene -> border_and_inset.minColumnsHeight()), 10000);
columns_height -> setSingleStep(80);
columns_height -> setValue(columns_height_value);
diagram_size_box_layout.addWidget(ds1, 0, 0);
diagram_size_box_layout.addWidget(columns_count, 0, 1);
diagram_size_box_layout.addWidget(columns_width, 0, 2);
diagram_size_box_layout.addWidget(ds2, 1, 0);
diagram_size_box_layout.addWidget(columns_height, 1, 1);
diagram_size_box_layout.setColumnStretch(0, 1);
diagram_size_box_layout.setColumnStretch(1, 1);
diagram_size_box_layout.setColumnStretch(2, 1);
diagram_size_box_layout.setColumnStretch(3, 500);
InsetPropertiesWidget *inset_infos = new InsetPropertiesWidget(inset, false, &popup); InsetPropertiesWidget *inset_infos = new InsetPropertiesWidget(inset, false, &popup);
// boutons // boutons
@@ -606,30 +572,22 @@ void DiagramView::dialogEditInfos() {
// ajout dans une disposition verticale // ajout dans une disposition verticale
QVBoxLayout layout_v(&popup); QVBoxLayout layout_v(&popup);
layout_v.addWidget(diagram_size_box); layout_v.addWidget(border_infos);
layout_v.addWidget(inset_infos); layout_v.addWidget(inset_infos);
layout_v.addStretch(); layout_v.addStretch();
layout_v.addWidget(&boutons); layout_v.addWidget(&boutons);
// si le dialogue est accepte // si le dialogue est accepte
if (popup.exec() == QDialog::Accepted) { if (popup.exec() == QDialog::Accepted) {
InsetProperties new_inset = inset_infos -> insetProperties(); InsetProperties new_inset = inset_infos -> insetProperties();
BorderProperties new_border = border_infos -> borderProperties();
// s'il y a des modifications au cartouche // s'il y a des modifications au cartouche
if (new_inset != inset) { if (new_inset != inset) {
scene -> undoStack().push(new ChangeInsetCommand(scene, inset, new_inset)); scene -> undoStack().push(new ChangeInsetCommand(scene, inset, new_inset));
} }
// s'il y a des modifications aux dimensions du schema // s'il y a des modifications aux dimensions du schema
if ( if (new_border != border) {
columns_count_value != columns_count -> value() ||\ scene -> undoStack().push(new ChangeBorderCommand(scene, border, new_border));
columns_width_value != columns_width -> value() ||\
columns_height_value != columns_height -> value()
) {
ChangeBorderCommand *cbc = new ChangeBorderCommand(scene);
cbc -> columnsCountDifference = columns_count -> value() - columns_count_value;
cbc -> columnsWidthDifference = columns_width -> value() - columns_width_value;
cbc -> columnsHeightDifference = columns_height -> value() - columns_height_value;
scene -> undoStack().push(cbc);
} }
} }
} }
@@ -645,36 +603,40 @@ bool DiagramView::hasSelectedItems() {
Ajoute une colonne au schema. Ajoute une colonne au schema.
*/ */
void DiagramView::addColumn() { void DiagramView::addColumn() {
ChangeBorderCommand *cbc = new ChangeBorderCommand(scene); BorderProperties old_bp = scene -> border_and_inset.exportBorder();
cbc -> columnsCountDifference = 1; BorderProperties new_bp = scene -> border_and_inset.exportBorder();
scene -> undoStack().push(cbc); new_bp.columns_count += 1;
scene -> undoStack().push(new ChangeBorderCommand(scene, old_bp, new_bp));
} }
/** /**
Enleve une colonne au schema. Enleve une colonne au schema.
*/ */
void DiagramView::removeColumn() { void DiagramView::removeColumn() {
ChangeBorderCommand *cbc = new ChangeBorderCommand(scene); BorderProperties old_bp = scene -> border_and_inset.exportBorder();
cbc -> columnsCountDifference = -1; BorderProperties new_bp = scene -> border_and_inset.exportBorder();
scene -> undoStack().push(cbc); new_bp.columns_count -= 1;
scene -> undoStack().push(new ChangeBorderCommand(scene, old_bp, new_bp));
} }
/** /**
Agrandit le schema en hauteur Agrandit le schema en hauteur
*/ */
void DiagramView::expand() { void DiagramView::addRow() {
ChangeBorderCommand *cbc = new ChangeBorderCommand(scene); BorderProperties old_bp = scene -> border_and_inset.exportBorder();
cbc -> columnsHeightDifference = 80.0; BorderProperties new_bp = scene -> border_and_inset.exportBorder();
scene -> undoStack().push(cbc); new_bp.rows_count += 1;
scene -> undoStack().push(new ChangeBorderCommand(scene, old_bp, new_bp));
} }
/** /**
Retrecit le schema en hauteur Retrecit le schema en hauteur
*/ */
void DiagramView::shrink() { void DiagramView::removeRow() {
ChangeBorderCommand *cbc = new ChangeBorderCommand(scene); BorderProperties old_bp = scene -> border_and_inset.exportBorder();
cbc -> columnsHeightDifference = -80.0; BorderProperties new_bp = scene -> border_and_inset.exportBorder();
scene -> undoStack().push(cbc); new_bp.rows_count -= 1;
scene -> undoStack().push(new ChangeBorderCommand(scene, old_bp, new_bp));
} }
/** /**
@@ -763,7 +725,7 @@ void DiagramView::editConductor(Conductor *edited_conductor) {
ConductorPropertiesWidget *cpw = new ConductorPropertiesWidget(old_properties); ConductorPropertiesWidget *cpw = new ConductorPropertiesWidget(old_properties);
// l'insere dans un dialogue // l'insere dans un dialogue
QDialog conductor_dialog; QDialog conductor_dialog(diagramEditor());
conductor_dialog.setWindowTitle(tr("\311diter les propri\351t\351s d'un conducteur")); conductor_dialog.setWindowTitle(tr("\311diter les propri\351t\351s d'un conducteur"));
QVBoxLayout *dialog_layout = new QVBoxLayout(&conductor_dialog); QVBoxLayout *dialog_layout = new QVBoxLayout(&conductor_dialog);
dialog_layout -> addWidget(cpw); dialog_layout -> addWidget(cpw);
@@ -822,7 +784,7 @@ void DiagramView::editDefaultConductorProperties() {
ConductorPropertiesWidget *cpw = new ConductorPropertiesWidget(scene -> defaultConductorProperties); ConductorPropertiesWidget *cpw = new ConductorPropertiesWidget(scene -> defaultConductorProperties);
// l'insere dans un dialogue // l'insere dans un dialogue
QDialog conductor_dialog; QDialog conductor_dialog(diagramEditor());
conductor_dialog.setWindowTitle(tr("\311diter les propri\351t\351s par d\351faut des conducteurs")); conductor_dialog.setWindowTitle(tr("\311diter les propri\351t\351s par d\351faut des conducteurs"));
QVBoxLayout *dialog_layout = new QVBoxLayout(&conductor_dialog); QVBoxLayout *dialog_layout = new QVBoxLayout(&conductor_dialog);
dialog_layout -> addWidget(cpw); dialog_layout -> addWidget(cpw);
@@ -859,6 +821,28 @@ void DiagramView::addText() {
is_adding_text = true; is_adding_text = true;
} }
/**
Cree un nouveau champ de texte et le place a la position pos
en gerant l'annulation ; enfin, le signal textAdded est emis.
@param pos Position du champ de texte ajoute
@return le champ de texte ajoute
*/
DiagramTextItem *DiagramView::addDiagramTextAtPos(const QPointF &pos) {
// cree un nouveau champ de texte
DiagramTextItem *dti = new DiagramTextItem();
dti -> setPlainText("_");
dti -> previous_text = "_";
// le place a la position pos en gerant l'annulation
scene -> undoStack().push(new AddTextCommand(scene, dti, pos));
adjustSceneRect();
// emet le signal textAdded
emit(textAdded(false));
return(dti);
}
/** /**
Gere le menu contextuel Gere le menu contextuel
@param e Evenement decrivant la demande de menu contextuel @param e Evenement decrivant la demande de menu contextuel
@@ -879,8 +863,8 @@ void DiagramView::contextMenuEvent(QContextMenuEvent *e) {
context_menu -> addAction(qde -> infos_diagram); context_menu -> addAction(qde -> infos_diagram);
context_menu -> addAction(qde -> add_column); context_menu -> addAction(qde -> add_column);
context_menu -> addAction(qde -> remove_column); context_menu -> addAction(qde -> remove_column);
context_menu -> addAction(qde -> expand_diagram); context_menu -> addAction(qde -> add_row);
context_menu -> addAction(qde -> shrink_diagram); context_menu -> addAction(qde -> remove_row);
} else { } else {
context_menu -> addAction(qde -> cut); context_menu -> addAction(qde -> cut);
context_menu -> addAction(qde -> copy); context_menu -> addAction(qde -> copy);
@@ -918,7 +902,7 @@ void DiagramView::mouseDoubleClickEvent(QMouseEvent *e) {
// recupere le rectangle corespondant au cartouche // recupere le rectangle corespondant au cartouche
QRectF inset_rect( QRectF inset_rect(
Diagram::margin, Diagram::margin,
Diagram::margin + bi.columnsHeight(), Diagram::margin + bi.diagramHeight(),
bi.insetWidth(), bi.insetWidth(),
bi.insetHeight() bi.insetHeight()
); );
@@ -931,6 +915,14 @@ void DiagramView::mouseDoubleClickEvent(QMouseEvent *e) {
bi.columnsHeaderHeight() bi.columnsHeaderHeight()
); );
// recupere le rectangle correspondant aux en-tetes des lignes
QRectF rows_rect(
Diagram::margin,
Diagram::margin,
bi.rowsHeaderWidth(),
bi.diagramHeight()
);
// coordonnees du clic par rapport au schema // coordonnees du clic par rapport au schema
QPointF click_pos = viewportTransform().inverted().map(e -> pos()); QPointF click_pos = viewportTransform().inverted().map(e -> pos());
@@ -941,7 +933,7 @@ void DiagramView::mouseDoubleClickEvent(QMouseEvent *e) {
} else { } else {
QGraphicsView::mouseDoubleClickEvent(e); QGraphicsView::mouseDoubleClickEvent(e);
} }
} else if (inset_rect.contains(click_pos) || columns_rect.contains(click_pos)) { } else if (inset_rect.contains(click_pos) || columns_rect.contains(click_pos) || rows_rect.contains(click_pos)) {
// edite les proprietes du schema // edite les proprietes du schema
dialogEditInfos(); dialogEditInfos();
} else { } else {

View File

@@ -19,6 +19,7 @@
#define DIAGRAMVIEW_H #define DIAGRAMVIEW_H
#include <QtGui> #include <QtGui>
class Diagram; class Diagram;
class DiagramTextItem;
class QETDiagramEditor; class QETDiagramEditor;
class Conductor; class Conductor;
/** /**
@@ -58,13 +59,14 @@ class DiagramView : public QGraphicsView {
void dialogPrint(); void dialogPrint();
void addColumn(); void addColumn();
void removeColumn(); void removeColumn();
void expand(); void addRow();
void shrink(); void removeRow();
/// @return Le schema visualise par ce DiagramView /// @return Le schema visualise par ce DiagramView
Diagram *diagram() { return(scene); } Diagram *diagram() { return(scene); }
QETDiagramEditor *diagramEditor() const; QETDiagramEditor *diagramEditor() const;
bool hasSelectedItems(); bool hasSelectedItems();
void addText(); void addText();
DiagramTextItem *addDiagramTextAtPos(const QPointF &);
protected: protected:
virtual void mouseDoubleClickEvent(QMouseEvent *); virtual void mouseDoubleClickEvent(QMouseEvent *);

View File

@@ -536,9 +536,8 @@ void ElementScene::slot_delete() {
*/ */
void ElementScene::slot_editSizeHotSpot() { void ElementScene::slot_editSizeHotSpot() {
// cree un dialogue // cree un dialogue
QDialog dialog_sh; QDialog dialog_sh(element_editor);
dialog_sh.setModal(true); dialog_sh.setModal(true);
dialog_sh.setMinimumSize(400, 230);
dialog_sh.setWindowTitle(tr("\311diter la taille et le point de saisie")); dialog_sh.setWindowTitle(tr("\311diter la taille et le point de saisie"));
QVBoxLayout *dialog_layout = new QVBoxLayout(&dialog_sh); QVBoxLayout *dialog_layout = new QVBoxLayout(&dialog_sh);
@@ -576,7 +575,7 @@ void ElementScene::slot_editSizeHotSpot() {
void ElementScene::slot_editOrientations() { void ElementScene::slot_editOrientations() {
// cree un dialogue // cree un dialogue
QDialog dialog_ori; QDialog dialog_ori(element_editor);
dialog_ori.setModal(true); dialog_ori.setModal(true);
dialog_ori.setMinimumSize(400, 260); dialog_ori.setMinimumSize(400, 260);
dialog_ori.setWindowTitle(tr("\311diter les orientations")); dialog_ori.setWindowTitle(tr("\311diter les orientations"));
@@ -622,7 +621,7 @@ void ElementScene::slot_editOrientations() {
void ElementScene::slot_editNames() { void ElementScene::slot_editNames() {
// cree un dialogue // cree un dialogue
QDialog dialog; QDialog dialog(element_editor);
dialog.setModal(true); dialog.setModal(true);
dialog.setMinimumSize(400, 330); dialog.setMinimumSize(400, 330);
dialog.setWindowTitle(tr("\311diter les noms")); dialog.setWindowTitle(tr("\311diter les noms"));

View File

@@ -80,12 +80,12 @@ void PartArc::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget
const QDomElement PartArc::toXml(QDomDocument &xml_document) const { const QDomElement PartArc::toXml(QDomDocument &xml_document) const {
QDomElement xml_element = xml_document.createElement("arc"); QDomElement xml_element = xml_document.createElement("arc");
QPointF top_left(sceneTopLeft()); QPointF top_left(sceneTopLeft());
xml_element.setAttribute("x", top_left.x()); xml_element.setAttribute("x", QString("%1").arg(top_left.x()));
xml_element.setAttribute("y", top_left.y()); xml_element.setAttribute("y", QString("%1").arg(top_left.y()));
xml_element.setAttribute("width", rect().width()); xml_element.setAttribute("width", QString("%1").arg(rect().width()));
xml_element.setAttribute("height", rect().height()); xml_element.setAttribute("height", QString("%1").arg(rect().height()));
xml_element.setAttribute("start", start_angle); xml_element.setAttribute("start", QString("%1").arg(start_angle));
xml_element.setAttribute("angle", _angle); xml_element.setAttribute("angle", QString("%1").arg(_angle));
stylesToXml(xml_element); stylesToXml(xml_element);
return(xml_element); return(xml_element);
} }

View File

@@ -68,9 +68,9 @@ void PartCircle::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWid
const QDomElement PartCircle::toXml(QDomDocument &xml_document) const { const QDomElement PartCircle::toXml(QDomDocument &xml_document) const {
QDomElement xml_element = xml_document.createElement("circle"); QDomElement xml_element = xml_document.createElement("circle");
QPointF top_left(sceneTopLeft()); QPointF top_left(sceneTopLeft());
xml_element.setAttribute("x", top_left.x()); xml_element.setAttribute("x", QString("%1").arg(top_left.x()));
xml_element.setAttribute("y", top_left.y()); xml_element.setAttribute("y", QString("%1").arg(top_left.y()));
xml_element.setAttribute("diameter", rect().width()); xml_element.setAttribute("diameter", QString("%1").arg(rect().width()));
stylesToXml(xml_element); stylesToXml(xml_element);
return(xml_element); return(xml_element);
} }

View File

@@ -68,10 +68,10 @@ void PartEllipse::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWi
const QDomElement PartEllipse::toXml(QDomDocument &xml_document) const { const QDomElement PartEllipse::toXml(QDomDocument &xml_document) const {
QDomElement xml_element = xml_document.createElement("ellipse"); QDomElement xml_element = xml_document.createElement("ellipse");
QPointF top_left(sceneTopLeft()); QPointF top_left(sceneTopLeft());
xml_element.setAttribute("x", top_left.x()); xml_element.setAttribute("x", QString("%1").arg(top_left.x()));
xml_element.setAttribute("y", top_left.y()); xml_element.setAttribute("y", QString("%1").arg(top_left.y()));
xml_element.setAttribute("width", rect().width()); xml_element.setAttribute("width", QString("%1").arg(rect().width()));
xml_element.setAttribute("height", rect().height()); xml_element.setAttribute("height", QString("%1").arg(rect().height()));
stylesToXml(xml_element); stylesToXml(xml_element);
return(xml_element); return(xml_element);
} }

Some files were not shown because too many files have changed in this diff Show More