1 /*************************************************************************** 2 qgslayertreeviewmemoryindicator.h 3 -------------------------------------- 4 Date : July 2018 5 Copyright : (C) 2018 by Nyall Dawson 6 Email : nyall dot dawson at gmail dot com 7 *************************************************************************** 8 * * 9 * This program is free software; you can redistribute it and/or modify * 10 * it under the terms of the GNU General Public License as published by * 11 * the Free Software Foundation; either version 2 of the License, or * 12 * (at your option) any later version. * 13 * * 14 ***************************************************************************/ 15 16 #ifndef QGSLAYERTREEVIEWMEMORYINDICATOR_H 17 #define QGSLAYERTREEVIEWMEMORYINDICATOR_H 18 19 #include "qgslayertreeviewindicatorprovider.h" 20 21 //! Adds indicators showing whether layers are memory layers. 22 class QgsLayerTreeViewMemoryIndicatorProvider : public QgsLayerTreeViewIndicatorProvider 23 { 24 Q_OBJECT 25 public: 26 explicit QgsLayerTreeViewMemoryIndicatorProvider( QgsLayerTreeView *view ); 27 28 protected slots: 29 30 void onIndicatorClicked( const QModelIndex &index ) override; 31 32 private: 33 bool acceptLayer( QgsMapLayer *layer ) override; 34 QString iconName( QgsMapLayer *layer ) override; 35 QString tooltipText( QgsMapLayer *layer ) override; 36 }; 37 38 #endif // QGSLAYERTREEVIEWMEMORYINDICATOR_H 39