Remove unused methods in generic panel and elements panel.

Remove the class tree color animation


git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@4517 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
blacksun
2016-05-24 20:06:04 +00:00
parent cd9fb540b9
commit e5f85c542c
7 changed files with 0 additions and 243 deletions

View File

@@ -26,7 +26,6 @@
#include "fileelementdefinition.h"
#include "qeticons.h"
#include "templatescollection.h"
#include "treecoloranimation.h"
#include "element.h"
/*
@@ -347,34 +346,6 @@ void ElementsPanel::panelContentChange() {
}
}
/**
Inform this panel the project \a project has integrated the element at \a location
*/
QList<ElementsLocation> ElementsPanel::elementIntegrated(QETProject *project, const ElementsLocation &location) {
// the base implementation simply refreshes the adequate category and returns the list of added locations
QList<ElementsLocation> added_locations = GenericPanel::elementIntegrated(project, location);
if (!added_locations.count() || !mustHighlightIntegratedElements()) {
return(added_locations);
}
// the additional job of this method consists in displaying the integrated elements...
if (QTreeWidgetItem *integrated_element_qtwi = itemForElementsLocation(location)) {
ensureHierarchyIsVisible(QList<QTreeWidgetItem *>() << integrated_element_qtwi);
scrollToItem(integrated_element_qtwi, QAbstractItemView::PositionAtCenter);
}
// and make them "flash" (not too obviously though) so the user notices they have been integrated.
QList<QTreeWidgetItem *> items;
foreach (ElementsLocation loc, added_locations) {
if (QTreeWidgetItem *added_item = itemForElementsLocation(loc)) {
items << added_item;
}
}
highlightItems(items, this, SLOT(scrollToSelectedItem()));
return(added_locations);
}
/**
Methode permettant d'ajouter un projet au panel d'elements.
@param qtwi_parent QTreeWidgetItem parent sous lequel sera insere le projet
@@ -548,15 +519,6 @@ int ElementsPanel::elementsCollectionItemsCount() {
return(items_count);
}
/**
@return true if freshly integrated elements should be highlighted, false otherwise.
*/
bool ElementsPanel::mustHighlightIntegratedElements() const
{
QSettings settings;
return(settings.value("diagrameditor/highlight-integrated-elements", true).toBool());
}
/**
* @brief ElementsPanel::reload
* Reload the elements tree
@@ -896,30 +858,3 @@ void ElementsPanel::scrollToSelectedItem() {
scrollToItem(selected_items.first(), QAbstractItemView::PositionAtCenter);
}
}
/**
Scroll to and highlight \a items. Once the animation is finished, the slot
\a method is called on the object \a receiver.
*/
void ElementsPanel::highlightItems(const QList<QTreeWidgetItem *> &items, const QObject *receiver, const char *method) {
TreeColorAnimation *animation1 = new TreeColorAnimation(items);
animation1 -> setStartValue(QColor(Qt::white));
animation1 -> setEndValue(QColor(Qt::yellow));
animation1 -> setDuration(400);
animation1 -> setEasingCurve(QEasingCurve::InQuad);
TreeColorAnimation *animation2 = new TreeColorAnimation(items);
animation2 -> setStartValue(QColor(Qt::yellow));
animation2 -> setEndValue(QColor(Qt::white));
animation2 -> setDuration(500);
animation2 -> setEasingCurve(QEasingCurve::OutInQuint);
QSequentialAnimationGroup *animation = new QSequentialAnimationGroup(this);
animation -> addAnimation(animation1);
animation -> addAnimation(new QPauseAnimation(700));
animation -> addAnimation(animation2);
if (receiver) {
connect(animation, SIGNAL(finished()), receiver, method);
}
animation -> start(QAbstractAnimation::DeleteWhenStopped);
}