Element panel : elements can be searched by their name but also with by all their informations.

git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@5698 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
blacksun
2019-01-04 22:06:34 +00:00
parent d735983c16
commit 58ef54090e
7 changed files with 66 additions and 18 deletions

View File

@@ -1,7 +1,7 @@
====== ChangeLog from 0.6 to 0.7 ====== ====== ChangeLog from 0.6 to 0.7 ======
* Element editor : * Element editor :
* Element informations (manufacturer, reference etc...) can be created directly from the element editor. For that go to the widget "Element Property" * Element informations (manufacturer, reference etc...) can be created directly from the element editor. For that go to the widget "Element Property"
* It is no longer required to have a text field, for save the edited element. * It is no longer required to have a text field, for save the edited element.
* Improve the behavior with the arrow keys (depending to the current selection (nothing / one / several). * Improve the behavior with the arrow keys (depending to the current selection (nothing / one / several).
@@ -12,7 +12,7 @@
* Rectangle can have rounded corner. * Rectangle can have rounded corner.
* Diagram editor : * Diagram editor :
* Conductors can now be drawn with two colors. * Conductors can now be drawn with two colors.
* Improve High-DPI support on Windows and Linux plateform. * Improve High-DPI support on Windows and Linux plateform.
* The code for the resize handles has been almost completely redesigned. * The code for the resize handles has been almost completely redesigned.
@@ -40,11 +40,12 @@ This commit fix it, now the search function search for every terminals of a term
* QETshapeItem rectangle can have rounded corner. * QETshapeItem rectangle can have rounded corner.
* Add in config the possibility to start the numbering of the columns of titleblocks at 0. * Add in config the possibility to start the numbering of the columns of titleblocks at 0.
* Add new function Search and replace widget Crtl +F * Add new function Search and replace widget Crtl +F
Diagram properties, Element properties, Independent text item can be changed (and mass changed) through the search and replace widget. * Diagram properties, Element properties, Independent text item can be changed (and mass changed) through the search and replace widget.
* Added 4 tools for edit the depth (Z value) of items. * Added 4 tools for edit the depth (Z value) of items.
* Element panel : elements can be searched by their name but also with by all their informations.
* Title block editor : * Title block editor :
Added new title block variables %projectpath, %projectfilename, %projecttitle, previous-folio-num and next-folio-num Added new title block variables %projectpath, %projectfilename, %projecttitle, previous-folio-num and next-folio-num
"%saveddate, %savedtime, %savedfilename and %savedfilepath" they variables should be updated after file save or save as dialog is confirmed, "%saveddate, %savedtime, %savedfilename and %savedfilepath" they variables should be updated after file save or save as dialog is confirmed,
before file is saved. before file is saved.
@@ -52,7 +53,7 @@ before file is saved.
* Improve for new qet_tb_generator plug-in : added the full path of the current project as * Improve for new qet_tb_generator plug-in : added the full path of the current project as
an argument when calling the plug-in from QET if a project is open. an argument when calling the plug-in from QET if a project is open.
If not a file dialog is showed to select the QET project. If not a file dialog is showed to select the QET project.
@@ -71,7 +72,7 @@ If not a file dialog is showed to select the QET project.
* DXF export : add some colors for basic shapes inside dxf. * DXF export : add some colors for basic shapes inside dxf.
* Bug fix : * Bug fix :
* Fix compilation warning (clang and gcc). * Fix compilation warning (clang and gcc).
* Fix element text item alignment work well when text rotation != 0. * Fix element text item alignment work well when text rotation != 0.
@@ -110,7 +111,7 @@ In the official collection, there are now 4106 elements, and 539 categoris for a
* In the panel left split the view into a several docks. * In the panel left split the view into a several docks.
* High-DPI support (Qt 5.6.0) * High-DPI support (Qt 5.6.0)
* new python plugin to generate terminal block. * new python plugin to generate terminal block.
* Windows packages are now created on a Debian operating system using cross-compilation and targeted to make executable binary files for these operating systems. * Windows packages are now created on a Debian operating system using cross-compilation and targeted to make executable binary files for these operating systems.
This technical evolution allows a significant time saving during the creation of the packages. And we can provide also in the same time Windows XP and Vista packages by cross-compil with Qt 5.7.1 environment This technical evolution allows a significant time saving during the creation of the packages. And we can provide also in the same time Windows XP and Vista packages by cross-compil with Qt 5.7.1 environment
* The Mac OS X executable binary files are created on a virtual environment, moved compiler to latest LLVM clan version, improved dmg packages with added Info.plist. * The Mac OS X executable binary files are created on a virtual environment, moved compiler to latest LLVM clan version, improved dmg packages with added Info.plist.
* An annoying memory leak has been found and solved. Afters hours of use, some users noticed that the RAM consumption growed steadily, up to 10GB or more. This problem is now solved. * An annoying memory leak has been found and solved. Afters hours of use, some users noticed that the RAM consumption growed steadily, up to 10GB or more. This problem is now solved.
@@ -166,29 +167,29 @@ Qet detects the Windows version and applies the appropriate graphic style, depen
====== ChangeLog from 0.3 rc to 0.3 ====== ====== ChangeLog from 0.3 rc to 0.3 ======
First, the collection of symbols has made a big step forward, with about 1560 new elements. First, the collection of symbols has made a big step forward, with about 1560 new elements.
There are now symbols for pneumatics, hydraulics, process, solar, cold, etc. Considerable effort has been done to organize the collection in a better way. There are now symbols for pneumatics, hydraulics, process, solar, cold, etc. Considerable effort has been done to organize the collection in a better way.
We hope that the new organisation is clearer for all. We would like to thank all the contributors who send us symbols. We hope that the new organisation is clearer for all. We would like to thank all the contributors who send us symbols.
=====-Element Editor: ===== =====-Element Editor: =====
Considerable work has be done to replace the manual defining zone of the symbol, aka hotspot.And fix bugs, It is now automatic. You do not have to care about it anymore. Considerable work has be done to replace the manual defining zone of the symbol, aka hotspot.And fix bugs, It is now automatic. You do not have to care about it anymore.
Primary colors have been added for the drawing shapes. Primary colors have been added for the drawing shapes.
A contextual menu (right click) has been added. So, you can now work more quickly with symbols. It is also more user-friendly. A contextual menu (right click) has been added. So, you can now work more quickly with symbols. It is also more user-friendly.
====== ChangeLog from v0.3 rc ====== ====== ChangeLog from v0.3 rc ======
=====-Element Editor: ===== =====-Element Editor: =====
* Replacing checkboxes with lists of colors. * Replacing checkboxes with lists of colors.
* Removed the manual hotspot, it is now automatic and you do not have to worry. * Removed the manual hotspot, it is now automatic and you do not have to worry.
Officially Collection: a large classification work on the structure was realized. It should be clear to everyone. Officially Collection: a large classification work on the structure was realized. It should be clear to everyone.
The collection is enriched with 1711 items in 286 categories (ie 1997 files) The collection is enriched with 1711 items in 286 categories (ie 1997 files)
=====-Schema Editor:===== =====-Schema Editor:=====
* Added import image, image rotation, image resizing and saving the file in the project. * Added import image, image rotation, image resizing and saving the file in the project.
(Double click on the image called a widget and cursor that reduce or enlarge the selected image.) (Double click on the image called a widget and cursor that reduce or enlarge the selected image.)
NB: Following the "edit image" entry will also be added in the right click menu. NB: Following the "edit image" entry will also be added in the right click menu.
* F5 keyboard shortcut can recharge symbol collections. * F5 keyboard shortcut can recharge symbol collections.
Some bugs have been resolved, and the translation status continues to grow. Some bugs have been resolved, and the translation status continues to grow.
======ChangeLog from v0.3 beta ====== ======ChangeLog from v0.3 beta ======
@@ -365,4 +366,4 @@ Le dialogue "Exporter" (pour générer un fichier image d'un schéma) a égaleme
* Affinage du constructeur de la classe QETApp * Affinage du constructeur de la classe QETApp
* Moins d'avertissements à la compilation (testé avec gcc 4.3) * Moins d'avertissements à la compilation (testé avec gcc 4.3)
* Moins d'inclusions non pertinentes * Moins d'inclusions non pertinentes
* Nettoyage du trunk : déplacement des sources dans un sous-répertoire * Nettoyage du trunk : déplacement des sources dans un sous-répertoire

View File

@@ -34,6 +34,7 @@ void ElementCollectionItem::clearData()
setText(QString()); setText(QString());
setToolTip(QString()); setToolTip(QString());
setIcon(QIcon()); setIcon(QIcon());
setData(QString());
} }
/** /**

View File

@@ -624,7 +624,7 @@ void ElementsCollectionWidget::search()
QModelIndexList match_index; QModelIndexList match_index;
foreach (QString txt, text_list) { foreach (QString txt, text_list) {
match_index << m_model->match(m_showed_index.isValid() ? m_model->index(0,0,m_showed_index) : m_model->index(0,0), match_index << m_model->match(m_showed_index.isValid() ? m_model->index(0,0,m_showed_index) : m_model->index(0,0),
Qt::DisplayRole, QVariant(txt), -1, Qt::MatchContains | Qt::MatchRecursive); Qt::UserRole+1, QVariant(txt), -1, Qt::MatchContains | Qt::MatchRecursive);
} }
foreach(QModelIndex index, match_index) foreach(QModelIndex index, match_index)

View File

@@ -681,6 +681,23 @@ QString ElementsLocation::fileName() const
else return qsl.last(); else return qsl.last();
} }
/**
* @brief ElementsLocation::elementInformations
* @return the element information of the element represented by this location.
* If the location is a directory, the returned diagram context is empty
*/
DiagramContext ElementsLocation::elementInformations() const
{
DiagramContext context;
if (isDirectory()) {
return context;
}
QDomElement dom = this->xml().firstChildElement("elementInformations");
context.fromXml(dom, "elementInformation");
return context;
}
/** /**
@param location A standard element location @param location A standard element location
@return a hash identifying this location @return a hash identifying this location

View File

@@ -19,6 +19,7 @@
#define ELEMENTS_LOCATION_H #define ELEMENTS_LOCATION_H
#include "nameslist.h" #include "nameslist.h"
#include "diagramcontext.h"
#include <QString> #include <QString>
#include <QIcon> #include <QIcon>
@@ -77,6 +78,7 @@ class ElementsLocation
QIcon icon() const; QIcon icon() const;
QString name() const; QString name() const;
QString fileName() const; QString fileName() const;
DiagramContext elementInformations() const;
private: private:
QString m_collection_path; QString m_collection_path;

View File

@@ -240,7 +240,20 @@ void FileElementCollectionItem::setUpData()
if (isDir()) if (isDir())
setFlags(Qt::ItemIsSelectable | Qt::ItemIsDragEnabled | Qt::ItemIsDropEnabled | Qt::ItemIsEnabled); setFlags(Qt::ItemIsSelectable | Qt::ItemIsDragEnabled | Qt::ItemIsDropEnabled | Qt::ItemIsEnabled);
else else
{
setFlags(Qt::ItemIsSelectable | Qt::ItemIsDragEnabled | Qt::ItemIsEnabled); setFlags(Qt::ItemIsSelectable | Qt::ItemIsDragEnabled | Qt::ItemIsEnabled);
//Set the local name and all informations of the element
//in the data Qt::UserRole+1, these data will be use for search.
ElementsLocation location(collectionPath());
DiagramContext context = location.elementInformations();
QStringList search_list;
for (QString key : context.keys()) {
search_list.append(context.value(key).toString());
}
search_list.append(localName());
setData(search_list.join(" "));
}
setToolTip(collectionPath()); setToolTip(collectionPath());
} }

View File

@@ -189,10 +189,24 @@ void XmlProjectElementCollectionItem::setUpData()
//Setup the displayed name //Setup the displayed name
localName(); localName();
if (isDir()) if (isDir()) {
setFlags(Qt::ItemIsSelectable | Qt::ItemIsDragEnabled | Qt::ItemIsDropEnabled | Qt::ItemIsEnabled); setFlags(Qt::ItemIsSelectable | Qt::ItemIsDragEnabled | Qt::ItemIsDropEnabled | Qt::ItemIsEnabled);
}
else else
{
setFlags(Qt::ItemIsSelectable | Qt::ItemIsDragEnabled | Qt::ItemIsEnabled); setFlags(Qt::ItemIsSelectable | Qt::ItemIsDragEnabled | Qt::ItemIsEnabled);
//Set the local name and all informations of the element
//in the data Qt::UserRole+1, these data will be use for search.
ElementsLocation location(embeddedPath(), m_project);
DiagramContext context = location.elementInformations();
QStringList search_list;
for (QString key : context.keys()) {
search_list.append(context.value(key).toString());
}
search_list.append(localName());
setData(search_list.join(" "));
}
setToolTip(collectionPath()); setToolTip(collectionPath());
} }