Vuo  2.1.0
VuoNodePopover.hh
Go to the documentation of this file.
1 
10 #pragma once
11 
12 #include "VuoPanelDocumentation.hh"
13 
14 class VuoNode;
15 class VuoNodeClass;
16 class VuoNodeSet;
17 class VuoCompiler;
18 class VuoRendererNode;
19 
24 {
25  Q_OBJECT
26 public:
27  explicit VuoNodePopover(VuoNodeClass *nodeClass, VuoCompiler *compiler, QWidget *parent=0);
28  void cleanup();
30  int getTextWidth();
32  bool containsImage();
35  QString getSelectedText();
36 
37  static QString generateTextStyleString(void);
38 
39 protected:
40  void mouseMoveEvent(QMouseEvent *event);
41  void mouseDoubleClickEvent(QMouseEvent *event);
42  void contextMenuEvent(QContextMenuEvent *event);
43 
44 public slots:
45  void setTextWidth(int width);
46 
47 private slots:
48  void updateColor(bool isDark);
49 
50 signals:
51  void popoverDisplayRequested(QWidget *, QString);
52 
53 private:
54  static const int defaultPopoverTextWidth;
55  static const int margin;
56  QString generateNodePopoverTextHeader();
57  QString generateNodePopoverText(bool isDark);
58  QString generateNodeClassDescription(string smallTextColor);
59  VuoNodeClass *nodeClass;
60  VuoNodeSet *nodeSet;
61  VuoNode *node;
62  QLabel *headerLabel;
63  QLabel *textLabel;
64  bool displayModelNode;
65  VuoRendererNode *modelNode;
66  QGraphicsView *modelNodeView;
67  QVBoxLayout *layout;
68  VuoCompiler *compiler;
69  bool popoverHasBeenShown;
70 
71  void initialize();
72 
73  // Style
74  void setStyle();
75 
76 #if VUO_PRO
77 #include "pro/VuoNodePopover_Pro.hh"
78 #endif
79 };
80