mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-04-02 01:19:59 +02:00
Old element panel : Remove the management of the elements collection. Now the element panel only manage the title block and folio.
Remove the management of custom and common elements collection in the class qetapp. git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@4529 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -17,17 +17,12 @@
|
||||
*/
|
||||
#ifndef PANELAPPAREILS_H
|
||||
#define PANELAPPAREILS_H
|
||||
#include <QtWidgets>
|
||||
|
||||
#include "genericpanel.h"
|
||||
#include "elementslocation.h"
|
||||
#include "templatelocation.h"
|
||||
|
||||
class QETProject;
|
||||
class Diagram;
|
||||
class ElementsCollection;
|
||||
class ElementsCollectionItem;
|
||||
class ElementsCategory;
|
||||
class ElementDefinition;
|
||||
class ElementsCollectionCache;
|
||||
class TitleBlockTemplatesFilesCollection;
|
||||
|
||||
/**
|
||||
@@ -50,29 +45,15 @@ class ElementsPanel : public GenericPanel {
|
||||
// methods
|
||||
public:
|
||||
// methods used to determine what is represented by a particular visual item
|
||||
bool itemIsWritable(QTreeWidgetItem *) const;
|
||||
bool selectedItemIsWritable() const;
|
||||
|
||||
// methods used to get what is represented by a particular visual item
|
||||
ElementsCollectionItem *collectionItemForItem(QTreeWidgetItem *) const;
|
||||
ElementsCollectionItem *selectedItem() const;
|
||||
ElementsCategory *categoryForItem(QTreeWidgetItem *);
|
||||
ElementsCategory *categoryForPos(const QPoint &);
|
||||
QString dirPathForItem(QTreeWidgetItem *);
|
||||
QString filePathForItem(QTreeWidgetItem *);
|
||||
|
||||
void reloadCollections();
|
||||
int elementsCollectionItemsCount();
|
||||
|
||||
signals:
|
||||
void requestForProject(QETProject *);
|
||||
void requestForDiagram(Diagram *);
|
||||
void requestForCollectionItem(const ElementsLocation &);
|
||||
void requestForTitleBlockTemplate(const TitleBlockTemplateLocation &);
|
||||
void readingAboutToBegin();
|
||||
void readingFinished();
|
||||
void loadingProgressed(int, int);
|
||||
void loadingFinished();
|
||||
|
||||
public slots:
|
||||
void slot_doubleClick(QTreeWidgetItem *, int);
|
||||
@@ -80,17 +61,13 @@ class ElementsPanel : public GenericPanel {
|
||||
void filter(const QString &, QET::Filtering = QET::RegularFilter);
|
||||
void projectWasOpened(QETProject *);
|
||||
void projectWasClosed(QETProject *);
|
||||
bool scrollToElement(const ElementsLocation &);
|
||||
void buildFilterList();
|
||||
void applyCurrentFilter(const QList<QTreeWidgetItem *> &);
|
||||
void ensureHierarchyIsVisible(const QList<QTreeWidgetItem *> &);
|
||||
void scrollToSelectedItem();
|
||||
|
||||
protected:
|
||||
void dragEnterEvent(QDragEnterEvent *);
|
||||
void dragMoveEvent(QDragMoveEvent *);
|
||||
void startDrag(Qt::DropActions);
|
||||
void startElementDrag(const ElementsLocation &);
|
||||
void startTitleBlockTemplateDrag(const TitleBlockTemplateLocation &);
|
||||
bool matchesCurrentFilter(const QTreeWidgetItem *) const;
|
||||
bool matchesFilter(const QTreeWidgetItem *, QString) const;
|
||||
@@ -100,24 +77,17 @@ class ElementsPanel : public GenericPanel {
|
||||
|
||||
private:
|
||||
virtual QTreeWidgetItem *addProject (QETProject *);
|
||||
virtual QTreeWidgetItem *addCollection(ElementsCollection *);
|
||||
virtual QTreeWidgetItem *updateTemplatesCollectionItem(QTreeWidgetItem *, TitleBlockTemplatesCollection *, PanelOptions = AddAllChild, bool = false);
|
||||
virtual QTreeWidgetItem *updateTemplateItem (QTreeWidgetItem *, const TitleBlockTemplateLocation &, PanelOptions, bool = false);
|
||||
virtual QTreeWidgetItem *updateElementsCategoryItem(QTreeWidgetItem *, ElementsCategory *, PanelOptions, bool = false);
|
||||
virtual QTreeWidgetItem *updateElementsCollectionItem(QTreeWidgetItem *, ElementsCollection *, PanelOptions, bool = false);
|
||||
virtual QTreeWidgetItem *updateElementItem (QTreeWidgetItem *, ElementDefinition *, PanelOptions, bool = false);
|
||||
|
||||
// attributes
|
||||
private:
|
||||
QSet<QETProject *> projects_to_display_; ///< list of projects that have been added to this panel
|
||||
QTreeWidgetItem *common_collection_item_; ///< pointer to the item representing the common elements collection
|
||||
QTreeWidgetItem *common_tbt_collection_item_; ///< pointer to the item representing the common templates collection
|
||||
QTreeWidgetItem *custom_collection_item_; ///< pointer to the item representing the user elements collection
|
||||
QTreeWidgetItem *custom_tbt_collection_item_; ///< pointer to the item representing the user templates collection
|
||||
int loading_progress_; ///< used to track the loading progress of elements collections
|
||||
bool first_reload_; ///< used to distinguish the first time this panel is reloaded
|
||||
QString filter_; ///< Currently applied filter
|
||||
QStringList filter_list_; ///< Currently applied list of filter
|
||||
QTreeWidgetItem *it_prev_, *it_;
|
||||
};
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user