From c082dfb79717616665bdec7a6ccf08fbb3a33847 Mon Sep 17 00:00:00 2001 From: blacksun Date: Sat, 14 Nov 2015 10:44:24 +0000 Subject: [PATCH] minor change git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@4260 bfdf4180-ca20-0410-9c96-a3a8aa849046 --- sources/elementspanel.cpp | 23 ++++++----------------- sources/elementspanel.h | 1 - 2 files changed, 6 insertions(+), 18 deletions(-) diff --git a/sources/elementspanel.cpp b/sources/elementspanel.cpp index 8de1ff915..53b7c9036 100644 --- a/sources/elementspanel.cpp +++ b/sources/elementspanel.cpp @@ -83,22 +83,15 @@ ElementsPanel::ElementsPanel(QWidget *parent) : qp.setColor(QPalette::HighlightedText, Qt::black); setPalette(qp); - // we handle double click on items ourselves - connect( - this, - SIGNAL(itemDoubleClicked(QTreeWidgetItem *, int)), - this, - SLOT(slot_doubleClick(QTreeWidgetItem *, int)) - ); + // we handle double click on items ourselves + connect(this, &ElementsPanel::itemDoubleClicked, this, &ElementsPanel::slot_doubleClick); + connect(this, &GenericPanel::firstActivated, [this]() {QTimer::singleShot(250, this, SLOT(reload()));}); + connect(this, &ElementsPanel::panelContentChanged, this, &ElementsPanel::panelContentChange); - connect(this, SIGNAL(firstActivated()), this, SLOT(firstActivation())); - connect(this, SIGNAL(panelContentChanged()), this, SLOT(panelContentChange())); - - // emet un signal au lieu de gerer son menu contextuel + //Emit a signal instead au manage is own context menu setContextMenuPolicy(Qt::CustomContextMenu); - setElementsCache(QETApp::collectionCache()); - + setElementsCache(QETApp::collectionCache()); } /** @@ -343,10 +336,6 @@ void ElementsPanel::startTitleBlockTemplateDrag(const TitleBlockTemplateLocation drag -> start(Qt::CopyAction); } -void ElementsPanel::firstActivation() { - QTimer::singleShot(250, this, SLOT(reload())); -} - /** Ensure the filter is applied again after the panel content has changed. */ diff --git a/sources/elementspanel.h b/sources/elementspanel.h index 9a632c5d4..d84876d40 100644 --- a/sources/elementspanel.h +++ b/sources/elementspanel.h @@ -100,7 +100,6 @@ class ElementsPanel : public GenericPanel { bool matchesFilter(const QTreeWidgetItem *, QString) const; protected slots: - void firstActivation(); void panelContentChange(); virtual QList elementIntegrated(QETProject *, const ElementsLocation &);