Advertisement
Guest User

taglist.h

a guest
Aug 11th, 2019
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #ifndef TAGLIST_H
  2. #define TAGLIST_H
  3.  
  4. #include <QWidget>
  5. #include <QStackedLayout>
  6. #include <QListWidget>
  7. #include <QMenu>
  8. #include <QString>
  9. #include <QLabel>
  10.  
  11. #include "tagtuple.h"
  12. #include "tagcolor.h"
  13.  
  14. class TagList : public QWidget
  15. {
  16.     Q_OBJECT
  17.  
  18. public:
  19.     explicit TagList(QWidget *parent = nullptr);
  20.  
  21.     void clear();
  22.     void addTag(const TagTuple& tag, TagColor color);
  23.  
  24. private:
  25.     QStackedLayout* layout;
  26.     QListWidget* viewingArea;
  27.     QString styleSheetGreen;
  28.     QString styleSheetRed;
  29.  
  30.     void createLayout();
  31.     void createStyleSheets();
  32.     void createViewingArea();
  33.     void relaySignals();
  34.  
  35.     bool somethingIsSelected();
  36.     void removeTag(QListWidgetItem* tag);
  37.  
  38. signals:
  39.     void tagToBeRemovedFromSelectedFile(int id);
  40.     void tagToBeRemovedFromSearch(int id);
  41.     void tagClicked(int tagId);
  42.  
  43. public slots:
  44.     void showContextMenu(const QPoint& point);
  45.     void removeSelectedTags();
  46.     void tagClickedEmitter(QListWidgetItem* item);
  47. };
  48.  
  49. #endif // TAGLIST_H
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement