1 /*************************************************************************** 2 rkvalueselector - description 3 ------------------- 4 begin : Weg May 8 2013 5 copyright : (C) 2013-2014 by Thomas Friedrichsmeier 6 email : thomas.friedrichsmeier@kdemail.net 7 ***************************************************************************/ 8 9 /*************************************************************************** 10 * * 11 * This program is free software; you can redistribute it and/or modify * 12 * it under the terms of the GNU General Public License as published by * 13 * the Free Software Foundation; either version 2 of the License, or * 14 * (at your option) any later version. * 15 * * 16 ***************************************************************************/ 17 18 #ifndef RKVALUESELECTOR_H 19 #define RKVALUESELECTOR_H 20 21 #include "rkcomponent.h" 22 #include "rkcomponentproperties.h" 23 24 class QTreeView; 25 class QStringListModel; 26 class QDomElement; 27 28 /** Like RKVarSelector, but provides selection among an arbitrary list of strings. 29 30 @author Thomas Friedrichsmeier 31 */ 32 class RKValueSelector : public RKComponent { 33 Q_OBJECT 34 public: 35 RKValueSelector (const QDomElement &element, RKComponent *parent_component, QWidget *parent_widget); 36 ~RKValueSelector (); type()37 int type () override { return ComponentValueSelector; }; 38 QVariant value (const QString &modifier=QString ()) override; 39 QStringList getUiLabelPair () const override; 40 private slots: 41 void selectionPropertyChanged (); 42 void listSelectionChanged (); 43 void labelsPropertyChanged (); 44 void availablePropertyChanged (); 45 private: 46 QTreeView *list_view; 47 QStringListModel *model; 48 bool updating; 49 bool standalone; 50 RKComponentPropertyStringList *selected; 51 RKComponentPropertyStringList *labels; 52 RKComponentPropertyStringList *available; 53 QStringList purged_selected_indexes; 54 QString label_string; 55 }; 56 57 #endif 58