QElectroTech  0.70
elementscollectionwidget.cpp
Go to the documentation of this file.
1 /*
2  Copyright 2006-2019 The QElectroTech Team
3  This file is part of QElectroTech.
4 
5  QElectroTech is free software: you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation, either version 2 of the License, or
8  (at your option) any later version.
9 
10  QElectroTech is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
17 */
20 #include "elementcollectionitem.h"
21 #include "qeticons.h"
23 #include "elementslocation.h"
24 #include "qetapp.h"
25 #include "qetmessagebox.h"
26 #include "elementscategoryeditor.h"
27 #include "newelementwizard.h"
29 #include "qetproject.h"
30 #include "qetelementeditor.h"
31 #include "elementstreeview.h"
32 #include "qetdiagrameditor.h"
33 
34 #include <QVBoxLayout>
35 #include <QMenu>
36 #include <QDesktopServices>
37 #include <QUrl>
38 #include <QTimer>
39 
46  QWidget(parent),
47  m_model(nullptr)
48 {
49  //The connection in the method ElementsCollectionWidget::reload return a warning message at compilation :
50  //**********
51  //QObject::connect: Cannot queue arguments of type 'QVector<int>'
52  //(Make sure 'QVector<int>' is registered using qRegisterMetaType().)
53  //**********
54  //Register meta type has recommended by the message.
55  qRegisterMetaType<QVector<int>>();
56 
57  setUpWidget();
58  setUpAction();
60 
61  //Timer is used to avoid launching a new search for each letter typed by user
62  //Timer is started or restarted at every time user type a new letter.
63  //When the timer emit timeout, we start the search.
64  m_search_timer.setInterval(500);
65  m_search_timer.setSingleShot(true);
66 }
67 
73 {
74  if (!m_model)
75  return;
76 
77  for (int i=0; i < m_model->rowCount() ; i++)
78  showAndExpandItem(m_model->index(i, 0), false);
79 }
80 
87  if (m_model) {
88  QList <QETProject *> prj; prj.append(project);
89  m_progress_bar->show();
90  connect(m_model, &ElementsCollectionModel::loadingMaxValue, m_progress_bar, &QProgressBar::setMaximum);
91  connect(m_model, &ElementsCollectionModel::loadingProgressValue, m_progress_bar, &QProgressBar::setValue);
92  m_model->loadCollections(false,false, prj);
93  disconnect(m_model, &ElementsCollectionModel::loadingMaxValue, m_progress_bar, &QProgressBar::setMaximum);
94  disconnect(m_model, &ElementsCollectionModel::loadingProgressValue, m_progress_bar, &QProgressBar::setValue);
95  m_progress_bar->hide();
97  }
98  else
99  m_waiting_project.append(project);
100 }
101 
103  if (m_model)
104  m_model->removeProject(project);
105 }
106 
113 {
114  if (m_model)
116 }
117 
124 {
125  if (!location.exist())
126  return;
127 
128  m_tree_view->setCurrentIndex(m_model->indexFromLocation(location));
129 }
130 
132 {
134  qde->statusBar()->clearMessage();
135 
136  QWidget::leaveEvent(event);
137 }
138 
140 {
141  m_open_dir = new QAction(QET::Icons::FolderOpen, tr("Ouvrir le dossier correspondant"), this);
142  m_edit_element = new QAction(QET::Icons::ElementEdit, tr("Éditer l'élément"), this);
143  m_delete_element = new QAction(QET::Icons::ElementDelete, tr("Supprimer l'élément"), this);
144  m_delete_dir = new QAction(QET::Icons::FolderDelete, tr("Supprimer le dossier"), this);
145  m_reload = new QAction(QET::Icons::ViewRefresh, tr("Recharger les collections"), this);
146  m_edit_dir = new QAction(QET::Icons::FolderEdit, tr("Éditer le dossier"), this);
147  m_new_directory = new QAction(QET::Icons::FolderNew, tr("Nouveau dossier"), this);
148  m_new_element = new QAction(QET::Icons::ElementNew, tr("Nouvel élément"), this);
149  m_show_this_dir = new QAction(QET::Icons::FolderOnlyThis, tr("Afficher uniquement ce dossier"), this);
150  m_show_all_dir = new QAction(QET::Icons::FolderShowAll, tr("Afficher tous les dossiers"), this);
151  m_dir_propertie = new QAction(QET::Icons::FolderProperties, tr("Propriété du dossier"), this);
152 }
153 
159 {
160  //Setup the main layout
161  m_main_vlayout = new QVBoxLayout(this);
162  this->setLayout(m_main_vlayout);
163 
164  m_search_field = new QLineEdit(this);
165  m_search_field->setPlaceholderText(tr("Rechercher"));
166  m_search_field->setClearButtonEnabled(true);
167  m_main_vlayout->addWidget(m_search_field);
168 
169  //Setup the tree view
170  m_tree_view = new ElementsTreeView(this);
171  m_tree_view->setHeaderHidden(true);
172  m_tree_view->setIconSize(QSize(50, 50));
173  m_tree_view->setDragDropMode(QAbstractItemView::DragDrop);
174  m_tree_view->setContextMenuPolicy(Qt::CustomContextMenu);
175  m_tree_view->setAutoExpandDelay(500);
176  m_tree_view->setAnimated(true);
177  m_tree_view->setMouseTracking(true);
178  m_tree_view->setVerticalScrollMode(QAbstractItemView::ScrollPerPixel);
179  m_main_vlayout->addWidget(m_tree_view);
180 
181  //Setup the progress bar
182  m_progress_bar = new QProgressBar(this);
183  m_progress_bar->setFormat(QObject::tr("chargement %p% (%v sur %m)"));
184 
185  m_main_vlayout->addWidget(m_progress_bar);
186  m_progress_bar->hide();
187 
188  m_context_menu = new QMenu(this);
189 }
190 
196 {
197  connect(m_tree_view, &QTreeView::customContextMenuRequested, this, &ElementsCollectionWidget::customContextMenu);
198  connect(m_search_field, &QLineEdit::textEdited, [this]() {m_search_timer.start();});
199  connect(&m_search_timer, &QTimer::timeout, this, &ElementsCollectionWidget::search);
200  connect(m_open_dir, &QAction::triggered, this, &ElementsCollectionWidget::openDir);
201  connect(m_edit_element, &QAction::triggered, this, &ElementsCollectionWidget::editElement);
202  connect(m_delete_element, &QAction::triggered, this, &ElementsCollectionWidget::deleteElement);
203  connect(m_delete_dir, &QAction::triggered, this, &ElementsCollectionWidget::deleteDirectory);
204  connect(m_reload, &QAction::triggered, this, &ElementsCollectionWidget::reload);
205  connect(m_edit_dir, &QAction::triggered, this, &ElementsCollectionWidget::editDirectory);
206  connect(m_new_directory, &QAction::triggered, this, &ElementsCollectionWidget::newDirectory);
207  connect(m_new_element, &QAction::triggered, this, &ElementsCollectionWidget::newElement);
208  connect(m_show_this_dir, &QAction::triggered, this, &ElementsCollectionWidget::showThisDir);
209  connect(m_show_all_dir, &QAction::triggered, this, &ElementsCollectionWidget::resetShowThisDir);
210  connect(m_dir_propertie, &QAction::triggered, this, &ElementsCollectionWidget::dirProperties);
211 
212  connect(m_tree_view, &QTreeView::doubleClicked, [this](const QModelIndex &index) {
213  this->m_index_at_context_menu = index ;
214  this->editElement();});
215 
216  connect(m_tree_view, &QTreeView::entered, [this] (const QModelIndex &index) {
219  if (qde && eci)
220  qde->statusBar()->showMessage(eci->localName());
221  });
222 }
223 
230 {
231  m_index_at_context_menu = m_tree_view->indexAt(point);
232  if (!m_index_at_context_menu.isValid()) return;
233 
234  m_context_menu->clear();
235 
237  bool add_open_dir = false;
238 
239  if (eci->isElement())
240  m_context_menu->addAction(m_edit_element);
241 
243  {
244  add_open_dir = true;
245  FileElementCollectionItem *feci = static_cast<FileElementCollectionItem*>(eci);
246  if (!feci->isCommonCollection())
247  {
248  if (feci->isDir())
249  {
250  m_context_menu->addAction(m_new_element);
251  m_context_menu->addAction(m_new_directory);
252  if (!feci->isCollectionRoot())
253  {
254  m_context_menu->addAction(m_edit_dir);
255  m_context_menu->addAction(m_delete_dir);
256  }
257  }
258  else
259  m_context_menu->addAction(m_delete_element);
260  }
261  }
263  {
265  if (xpeci->isCollectionRoot())
266  add_open_dir = true;
267  }
268 
269  m_context_menu->addSeparator();
270  if (eci->isDir())
271  {
272  m_context_menu->addAction(m_show_this_dir);
273  //there is a current filtered dir, add entry to reset it
274  if (m_showed_index.isValid())
275  m_context_menu->addAction(m_show_all_dir);
276 
277  m_context_menu->addAction(m_dir_propertie);
278  }
279  if (add_open_dir)
280  m_context_menu->addAction(m_open_dir);
281  m_context_menu->addAction(m_reload);
282 
283  m_context_menu->popup(mapToGlobal(m_tree_view->mapToParent(point)));
284 }
285 
291 {
293  if (!eci) return;
294 
296 
297 #ifdef Q_OS_LINUX
298  QDesktopServices::openUrl(static_cast<FileElementCollectionItem*>(eci)->dirPath());
299 #else
300  QDesktopServices::openUrl(QUrl("file:///" + static_cast<FileElementCollectionItem*>(eci)->dirPath()));
301 #endif
302  else if (eci->type() == XmlProjectElementCollectionItem::Type)
303 
304 #ifdef Q_OS_LINUX
305  QDesktopServices::openUrl(static_cast<XmlProjectElementCollectionItem*>(eci)->project()->currentDir());
306 #else
307  QDesktopServices::openUrl(QUrl("file:///" + static_cast<XmlProjectElementCollectionItem*>(eci)->project()->currentDir()));
308 #endif
309 
310 }
311 
317 {
319 
320  if ( !(eci && eci->isElement()) ) return;
321 
322  ElementsLocation location(eci->collectionPath());
323 
324  QETApp *app = QETApp::instance();
325  app->openElementLocations(QList<ElementsLocation>() << location);
326 
327  foreach (QETElementEditor *element_editor, app->elementEditors())
329 }
330 
336 {
338 
339  if (!eci) return;
340 
341  ElementsLocation loc(eci->collectionPath());
342  if (! (loc.isElement() && loc.exist() && loc.isFileSystem() && loc.collectionPath().startsWith("custom://")) ) return;
343 
345  tr("Supprimer l'élément ?", "message box title"),
346  tr("Êtes-vous sûr de vouloir supprimer cet élément ?\n", "message box content"),
347  QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes)
348  {
349  QFile file(loc.fileSystemPath());
350  if (file.remove())
351  {
352  m_model->removeRows(m_index_at_context_menu.row(), 1, m_index_at_context_menu.parent());
353  }
354  else
355  {
357  tr("Suppression de l'élément", "message box title"),
358  tr("La suppression de l'élément a échoué.", "message box content"));
359  }
360  }
361 }
362 
368 {
370 
371  if (!eci) return;
372 
373  ElementsLocation loc (eci->collectionPath());
374  if (! (loc.isDirectory() && loc.exist() && loc.isFileSystem() && loc.collectionPath().startsWith("custom://")) ) return;
375 
377  tr("Supprimer le dossier?", "message box title"),
378  tr("Êtes-vous sûr de vouloir supprimer le dossier ?\n"
379  "Tout les éléments et les dossier contenus dans ce dossier seront supprimés.",
380  "message box content"),
381  QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes)
382  {
383  QDir dir (loc.fileSystemPath());
384  if (dir.removeRecursively())
385  {
386  m_model->removeRows(m_index_at_context_menu.row(), 1, m_index_at_context_menu.parent());
387  }
388  else
389  {
391  tr("Suppression du dossier", "message box title"),
392  tr("La suppression du dossier a échoué.", "message box content"));
393  }
394  }
395 }
396 
402 {
404 
405  if (eci->type() != FileElementCollectionItem::Type) return;
406 
407  FileElementCollectionItem *feci = static_cast<FileElementCollectionItem*>(eci);
408  if(feci->isCommonCollection()) return;
409 
410  ElementsLocation location(feci->collectionPath());
411  ElementsCategoryEditor ece(location, true, this);
412 
413  if (ece.exec() == QDialog::Accepted)
414  eci->clearData();
415 }
416 
422 {
424 
425  if (eci->type() != FileElementCollectionItem::Type) return;
426 
427  FileElementCollectionItem *feci = static_cast<FileElementCollectionItem*>(eci);
428  if(feci->isCommonCollection()) return;
429 
430  ElementsLocation location(feci->collectionPath());
431  ElementsCategoryEditor new_dir_editor(location, false, this);
432  if (new_dir_editor.exec() == QDialog::Accepted)
433  m_model->addLocation(new_dir_editor.createdLocation());
434 }
435 
441 {
443 
444  if (eci->type() != FileElementCollectionItem::Type) {
445  return;
446  }
447 
448  FileElementCollectionItem *feci = static_cast<FileElementCollectionItem*>(eci);
449  if(feci->isCommonCollection()) {
450  return;
451  }
452 
453  NewElementWizard elmt_wizard(this);
454  ElementsLocation loc(feci->collectionPath());
455  elmt_wizard.preselectedLocation(loc);
456  elmt_wizard.exec();
457 
458  foreach (QETElementEditor *element_editor, QETApp::instance()->elementEditors())
460 }
461 
467 {
468  //Disable the yellow background of the previous index
469  if (m_showed_index.isValid())
470  {
472  if (eci)
473  eci->setBackground(QBrush());
474  }
475 
477  if (m_showed_index.isValid())
478  {
479  hideCollection(true);
480  showAndExpandItem(m_showed_index, true, true);
482  if (eci)
483  eci->setBackground(QBrush(QColor(255, 204, 0, 255)));
484  search();
485  }
486  else
488 }
489 
496 {
497  if (m_showed_index.isValid())
498  {
500  if (eci)
501  eci->setBackground(QBrush());
502  }
503 
504  m_showed_index = QModelIndex();
505  search();
506 }
507 
513 {
515  if (eci && eci->isDir()) {
516  QString txt1 = tr("Le dossier %1 contient").arg(eci->localName());
517  QString txt2 = tr("%n élément(s), répartie(s)", "", eci->elementsChild().size());
518  QString txt3 = tr("dans %n dossier(s).", "" , eci->directoriesChild().size());
519  QString txt4 = tr("Chemin de la collection : %1").arg(eci->collectionPath());
520  QString txt5;
521  if (eci->type() == FileElementCollectionItem::Type) {
522  txt5 = tr("Chemin dans le système de fichiers : %1").arg(static_cast<FileElementCollectionItem*>(eci)->fileSystemPath());
523  }
525  tr("Propriété du dossier %1").arg(eci->localName()),
526  txt1 + " " + txt2 + " " + txt3 + "\n\n" + txt4 + "\n" + txt5);
527  }
528 }
529 
534 {
535  m_progress_bar->show();
537 
538  QList <QETProject *> project_list;
539  project_list.append(m_waiting_project);
540  m_waiting_project.clear();
541  if (m_model)
542  project_list.append(m_model->project());
543 
544 
545  connect(new_model, &ElementsCollectionModel::loadingMaxValue, m_progress_bar, &QProgressBar::setMaximum);
546  connect(new_model, &ElementsCollectionModel::loadingProgressValue, m_progress_bar, &QProgressBar::setValue);
547 
548  new_model->loadCollections(true, true, project_list);
549 
550  disconnect(new_model, &ElementsCollectionModel::loadingMaxValue, m_progress_bar, &QProgressBar::setMaximum);
551  disconnect(new_model, &ElementsCollectionModel::loadingProgressValue, m_progress_bar, &QProgressBar::setValue);
552 
553  new_model->highlightUnusedElement();
554  m_tree_view->setModel(new_model);
555  m_index_at_context_menu = QModelIndex();
556  m_showed_index = QModelIndex();
557  if (m_model) delete m_model;
558  m_model = new_model;
560  m_progress_bar->hide();
561 }
562 
570 {
571  //Because this method update an item in the model, location must
572  //represente an existing element (in file system of project)
573  if (!location.exist())
574  return;
575 
576  QModelIndex index = m_model->indexFromLocation(location);
577 
578  if (index.isValid()) {
579  QStandardItem *item = m_model->itemFromIndex(index);
580  if (item) {
581  static_cast<ElementCollectionItem *>(item)->clearData();
582  static_cast<ElementCollectionItem *>(item)->setUpData();
583  }
584  }
585  else {
586  m_model->addLocation(location);
587  }
588 }
589 
596 {
597  QString text = m_search_field->text();
598  //Reset the search
599  if (text.isEmpty())
600  {
601  QModelIndex current_index = m_tree_view->currentIndex();
602  m_tree_view->reset();
603 
604  if (m_showed_index.isValid())
605  {
606  hideCollection(true);
607  showAndExpandItem(m_showed_index, true, true);
608  }
609  else
611 
612  //Expand the tree and scroll to the last selected index
613  if (current_index.isValid())
614  {
615  showAndExpandItem(current_index);
616  m_tree_view->setCurrentIndex(current_index);
617  m_tree_view->scrollTo(current_index);
618  }
619  return;
620  }
621 
622  hideCollection(true);
623  QStringList text_list = text.split("+", QString::SkipEmptyParts);
624  QModelIndexList match_index;
625  foreach (QString txt, text_list) {
626  match_index << m_model->match(m_showed_index.isValid() ? m_model->index(0,0,m_showed_index) : m_model->index(0,0),
627  Qt::UserRole+1, QVariant(txt), -1, Qt::MatchContains | Qt::MatchRecursive);
628  }
629 
630  foreach(QModelIndex index, match_index)
631  showAndExpandItem(index);
632 }
633 
640 {
641  for (int i=0 ; i <m_model->rowCount() ; i++)
642  hideItem(hide, m_model->index(i, 0), true);
643 }
644 
652 void ElementsCollectionWidget::hideItem(bool hide, const QModelIndex &index, bool recursive)
653 {
654  m_tree_view->setRowHidden(index.row(), index.parent(), hide);
655 
656  if (recursive)
657  for (int i=0 ; i<m_model->rowCount(index) ; i++)
658  hideItem(hide, m_model->index(i, 0, index), recursive);
659 }
660 
670 void ElementsCollectionWidget::showAndExpandItem(const QModelIndex &index, bool parent, bool child)
671 {
672  if (index.isValid()) {
673  if (parent)
674  showAndExpandItem(index.parent(), parent);
675 
676  hideItem(false, index, child);
677  m_tree_view->expand(index);
678  }
679 }
680 
687  if (!index.isValid())
688  return nullptr;
689 
690  return static_cast<ElementCollectionItem*>(m_model->itemFromIndex(index));
691 }
The ElementCollectionItem class This class represent a item (a directory or an element) in a element ...
virtual void clearData()
ElementCollectionItem::clearData Reset the data.
void locationWasSaved(const ElementsLocation &location)
ElementsCollectionWidget::locationWasSaved This method is connected with the signal savedToLocation o...
QList< QETProject * > m_waiting_project
void saveToLocation(ElementsLocation loc)
void addProject(QETProject *project)
ElementsCollectionWidget::addProject Add to be displayed.
void deleteElement()
ElementsCollectionWidget::deleteElement Delete the element represented by the current selected item...
int type() const override
void editDirectory()
ElementsCollectionWidget::editDirectory Edit the directory represented by the current selected item...
void editElement()
ElementsCollectionWidget::editElement Edit the element represented by the current selected item...
ElementCollectionItem * elementCollectionItemForIndex(const QModelIndex &index)
ElementsCollectionWidget::elementCollectionItemForIndex.
void preselectedLocation(const ElementsLocation &location)
NewElementWizard::preselectedLocation Select item in the tree view represented by location...
QIcon FolderEdit
Definition: qeticons.cpp:96
void highlightUnusedElement()
ElementsCollectionModel::highlightUnusedElement Highlight every unused element of managed project...
The ElementsTreeView class This class just reimplement startDrag from QTreeView, for set a custom pix...
QList< ElementCollectionItem * > directoriesChild() const
ElementCollectionItem::directoriesChild.
QIcon FolderOnlyThis
Definition: qeticons.cpp:98
QString collectionPath() const override
FileElementCollectionItem::collectionPath.
void newElement()
ElementsCollectionWidget::newElement Create a new element.
The ElementsCategoryEditor class This class provides a dialog to edit an existing category or create ...
QIcon FolderNew
Definition: qeticons.cpp:97
QIcon ViewRefresh
Definition: qeticons.cpp:173
void loadingProgressValue(int)
void openDir()
ElementsCollectionWidget::openDir Open the directory represented by the current selected item...
QList< QETProject * > project() const
ElementsCollectionModel::project.
QList< ElementCollectionItem * > elementsChild() const
ElementCollectionItem::elementsChild.
void setUpData(ElementCollectionItem *eci)
void deleteDirectory()
ElementsCollectionWidget::deleteDirectory Delete directory represented by the current selected item...
The XmlProjectElementCollectionItem class This class specialise ElementCollectionItem for manage an x...
void removeProject(QETProject *project)
ElementsCollectionModel::removeProject Remove project from this model.
QIcon FolderProperties
Definition: qeticons.cpp:100
void showThisDir()
ElementsCollectionWidget::showThisDir Hide all directories except the pointed dir;.
void removeProject(QETProject *project)
void loadCollections(bool common_collection, bool custom_collection, QList< QETProject *> projects)
ElementsCollectionModel::loadCollections Load the several collections in this model. Prefer use this method instead of addCommonCollection, addCustomCollection and addProject, because it use multithreading to speed up the loading. This method emit loadingMaxValue(int) for know the maximum progress value This method emit loadingProgressValue(int) for know the current progress value.
void hideCollection(bool hide=true)
ElementsCollectionWidget::hideCollection Hide all collection displayed in this tree.
void reload()
ElementsCollectionWidget::reload, the displayed collections.
QIcon FolderShowAll
Definition: qeticons.cpp:101
void dirProperties()
ElementsCollectionWidget::dirProperties Open an informative dialog about the curent index...
void newDirectory()
ElementsCollectionWidget::newDirectory Create a new directory.
bool isCommonCollection() const
FileElementCollectionItem::isCommonCollection.
Definition: qetapp.h:53
void highlightUnusedElement()
ElementsCollectionWidget::highlightUnusedElement highlight the unused element ElementsCollectionMode...
QIcon tr
Definition: qeticons.cpp:204
void showAndExpandItem(const QModelIndex &index, bool parent=true, bool child=false)
ElementsCollectionWidget::showAndExpandItem Show the item and expand it. If parent is true...
void addLocation(const ElementsLocation &location)
ElementsCollectionModel::addLocation Add the element or directory to this model. If the location is a...
QIcon ElementNew
Definition: qeticons.cpp:86
QIcon ElementDelete
Definition: qeticons.cpp:84
void search()
ElementsCollectionWidget::search Search every item (directory or element) that match the text of m_se...
void setCurrentLocation(const ElementsLocation &location)
ElementsCollectionWidget::setCurrentLocation Set the current item to be the item for ...
void leaveEvent(QEvent *event) override
bool exist() const
ElementsLocation::exist.
ElementsCollectionWidget(QWidget *parent=nullptr)
ElementsCollectionWidget::ElementsCollectionWidget Default constructor.
void resetShowThisDir()
ElementsCollectionWidget::resetShowThisDir reset show this dir, all collection are show...
virtual bool isElement() const =0
The FileElementCollectionItem class This class specialise ElementCollectionItem for manage a collecti...
ElementsCollectionModel * m_model
virtual QString collectionPath() const =0
virtual bool isDir() const =0
static QETDiagramEditor * diagramEditorAncestorOf(const QWidget *child)
QETApp::diagramEditorAncestorOf.
Definition: qetapp.cpp:796
void customContextMenu(const QPoint &point)
ElementsCollectionWidget::customContextMenu Display the context menu of this widget at ...
QIcon FolderDelete
Definition: qeticons.cpp:95
QMessageBox::StandardButton question(QWidget *, const QString &, const QString &, QMessageBox::StandardButtons=QMessageBox::Ok, QMessageBox::StandardButton=QMessageBox::NoButton)
QIcon ElementEdit
Definition: qeticons.cpp:85
QMessageBox::StandardButton information(QWidget *, const QString &, const QString &, QMessageBox::StandardButtons=QMessageBox::Ok, QMessageBox::StandardButton=QMessageBox::NoButton)
void setUpWidget()
ElementsCollectionWidget::setUpWidget Setup this widget.
void expandFirstItems()
ElementsCollectionWidget::expandFirstItems Expand each first item in the tree view.
void setUpConnection()
ElementsCollectionWidget::setUpConnection Setup the connection used in this widget.
bool isCollectionRoot() const override
FileElementCollectionItem::isCollectionRoot.
void hideItem(bool hide, const QModelIndex &index=QModelIndex(), bool recursive=true)
ElementsCollectionWidget::hideItem Hide the item . If is true, hide all subchilds of ...
bool isCollectionRoot() const override
XmlProjectElementCollectionItem::isCollectionRoot.
bool isDir() const override
FileElementCollectionItem::isDir.
static QETApp * instance()
Definition: qetapp.cpp:143
virtual QString localName()=0
QIcon FolderOpen
Definition: qeticons.cpp:99
QMessageBox::StandardButton warning(QWidget *, const QString &, const QString &, QMessageBox::StandardButtons=QMessageBox::Ok, QMessageBox::StandardButton=QMessageBox::NoButton)
QModelIndex indexFromLocation(const ElementsLocation &location)
ElementsCollectionModel::indexFromLocation Return the index who represent . Index can be non valid...