From 326501f1f771ac5d458f6d4ad71038c6813a1f79 Mon Sep 17 00:00:00 2001 From: thunder2 Date: Mon, 9 Feb 2015 21:13:07 +0000 Subject: [PATCH] Added placeholder text to RSFeedWidget git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7933 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- retroshare-gui/src/gui/common/RSFeedWidget.cpp | 10 ++++++++++ retroshare-gui/src/gui/common/RSFeedWidget.h | 3 +++ retroshare-gui/src/gui/common/RSFeedWidget.ui | 9 ++++++++- retroshare-gui/src/gui/common/RSTreeWidget.h | 1 + 4 files changed, 22 insertions(+), 1 deletion(-) diff --git a/retroshare-gui/src/gui/common/RSFeedWidget.cpp b/retroshare-gui/src/gui/common/RSFeedWidget.cpp index 0551c6e92..2bf42de87 100644 --- a/retroshare-gui/src/gui/common/RSFeedWidget.cpp +++ b/retroshare-gui/src/gui/common/RSFeedWidget.cpp @@ -139,6 +139,16 @@ void RSFeedWidget::disconnectSignals(FeedItem *feedItem) disconnect(feedItem, SIGNAL(sizeChanged(FeedItem*)), this, SLOT(feedItemSizeChanged(FeedItem*))); } +QString RSFeedWidget::placeholderText() +{ + return ui->treeWidget->placeholderText(); +} + +void RSFeedWidget::setPlaceholderText(const QString &placeholderText) +{ + ui->treeWidget->setPlaceholderText(placeholderText); +} + FeedItem *RSFeedWidget::feedItemFromTreeItem(QTreeWidgetItem *treeItem) { return dynamic_cast(ui->treeWidget->itemWidget(treeItem, COLUMN_FEED)); diff --git a/retroshare-gui/src/gui/common/RSFeedWidget.h b/retroshare-gui/src/gui/common/RSFeedWidget.h index f93b5a4d4..205554bc0 100644 --- a/retroshare-gui/src/gui/common/RSFeedWidget.h +++ b/retroshare-gui/src/gui/common/RSFeedWidget.h @@ -51,6 +51,9 @@ public: RSFeedWidget(QWidget *parent = 0); virtual ~RSFeedWidget(); + QString placeholderText(); + void setPlaceholderText(const QString &placeholderText); + void addFeedItem(FeedItem *feedItem, Qt::ItemDataRole sortRole, const QVariant &value); void addFeedItem(FeedItem *feedItem, const QMap &sort); diff --git a/retroshare-gui/src/gui/common/RSFeedWidget.ui b/retroshare-gui/src/gui/common/RSFeedWidget.ui index 6f3aaeb62..e88deef40 100644 --- a/retroshare-gui/src/gui/common/RSFeedWidget.ui +++ b/retroshare-gui/src/gui/common/RSFeedWidget.ui @@ -27,7 +27,7 @@ 0 - + QAbstractItemView::NoEditTriggers @@ -55,6 +55,13 @@ + + + RSTreeWidget + QTreeWidget +
gui/common/RSTreeWidget.h
+
+
diff --git a/retroshare-gui/src/gui/common/RSTreeWidget.h b/retroshare-gui/src/gui/common/RSTreeWidget.h index 3cda62a13..0a06fb307 100644 --- a/retroshare-gui/src/gui/common/RSTreeWidget.h +++ b/retroshare-gui/src/gui/common/RSTreeWidget.h @@ -32,6 +32,7 @@ class RSTreeWidget : public QTreeWidget public: RSTreeWidget(QWidget *parent = 0); + QString placeholderText() { return mPlaceholderText; } void setPlaceholderText(const QString &text); void filterItems(int filterColumn, const QString &text);