From 1502004c588334c899e7fbe790f5e2f1bdf2d055 Mon Sep 17 00:00:00 2001 From: Martin Rotter Date: Mon, 2 May 2016 10:19:13 +0200 Subject: [PATCH] Fix comp? --- src/gui/feedsview.cpp | 15 ++++++++------- src/gui/feedsview.h | 1 + 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/gui/feedsview.cpp b/src/gui/feedsview.cpp index 1d31a32d3..e2a8116e7 100755 --- a/src/gui/feedsview.cpp +++ b/src/gui/feedsview.cpp @@ -59,13 +59,7 @@ FeedsView::FeedsView(QWidget *parent) connect(m_sourceModel, SIGNAL(itemExpandRequested(QList,bool)), this, SLOT(onItemExpandRequested(QList,bool))); connect(m_sourceModel, SIGNAL(itemExpandStateSaveRequested(RootItem*)), this, SLOT(onItemExpandStateSaveRequested(RootItem*))); connect(header(), SIGNAL(sortIndicatorChanged(int,Qt::SortOrder)), this, SLOT(saveSortState(int,Qt::SortOrder))); - - connect(m_proxyModel, &FeedsProxyModel::expandAfterFilterIn, [=](const QModelIndex &idx) { - QTimer::singleShot(100, this, [=] { - // TODO: Z nastavení. - setExpanded(m_proxyModel->mapFromSource(idx), true); - }); - }); + connect(m_proxyModel, &FeedsProxyModel::expandAfterFilterIn, this, &FeedsView::expandItemDelayed); setModel(m_proxyModel); setupAppearance(); @@ -359,6 +353,13 @@ void FeedsView::switchVisibility() { setVisible(!isVisible()); } +void FeedsView::expandItemDelayed(const QModelIndex &idx) { + QTimer::singleShot(100, this, [=] { + // TODO: Z nastavení. + setExpanded(m_proxyModel->mapFromSource(idx), true); + }); +} + QMenu *FeedsView::initializeContextMenuCategories(RootItem *clicked_item) { if (m_contextMenuCategories == NULL) { m_contextMenuCategories = new QMenu(tr("Context menu for categories"), this); diff --git a/src/gui/feedsview.h b/src/gui/feedsview.h index ac983d090..87ca5648c 100755 --- a/src/gui/feedsview.h +++ b/src/gui/feedsview.h @@ -102,6 +102,7 @@ class FeedsView : public QTreeView { void openMessagesInNewspaperView(RootItem *root, const QList &messages); private slots: + void expandItemDelayed(const QModelIndex &idx); void markSelectedItemReadStatus(RootItem::ReadStatus read); void markAllItemsReadStatus(RootItem::ReadStatus read);