From f95b6d079ab29a149471138dfc0db405c64c45ae Mon Sep 17 00:00:00 2001 From: xavier Date: Sun, 20 Mar 2011 03:13:32 +0000 Subject: [PATCH] Circumvented the loading problem that occured on Windows. git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/branches/0.3@1220 bfdf4180-ca20-0410-9c96-a3a8aa849046 --- sources/elementspanel.cpp | 8 +++++--- sources/elementspanel.h | 1 + 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/sources/elementspanel.cpp b/sources/elementspanel.cpp index 274139c98..31d2e9948 100644 --- a/sources/elementspanel.cpp +++ b/sources/elementspanel.cpp @@ -86,7 +86,8 @@ ElementsPanel::ElementsPanel(QWidget *parent) : QTreeWidget(parent), common_collection_item_(0), custom_collection_item_(0), - first_activation_(true) + first_activation_(true), + first_reload_(true) { // selection unique @@ -544,7 +545,7 @@ void ElementsPanel::startDrag(Qt::DropActions supportedActions) { */ bool ElementsPanel::event(QEvent *event) { if (first_activation_ && event -> type() == QEvent::WindowActivate) { - reload(false); + QTimer::singleShot(250, this, SLOT(reload())); first_activation_ = false; } return(QTreeWidget::event(event)); @@ -802,7 +803,8 @@ void ElementsPanel::reload(bool reload_collections) { custom_collection_item_ = addCollection(invisibleRootItem(), QETApp::customElementsCollection(), tr("Collection utilisateur"), QIcon(":/ico/16x16/go-home.png")); // the first time, expand the first level of collections - if (first_activation_) { + if (first_reload_) { + first_reload_ = true; common_collection_item_ -> setExpanded(true); custom_collection_item_ -> setExpanded(true); } diff --git a/sources/elementspanel.h b/sources/elementspanel.h index b388fec12..1a6b2710f 100644 --- a/sources/elementspanel.h +++ b/sources/elementspanel.h @@ -143,5 +143,6 @@ class ElementsPanel : public QTreeWidget { QTreeWidgetItem *custom_collection_item_; int loading_progress_; bool first_activation_; + bool first_reload_; }; #endif