3131
3232#include < QGraphicsView>
3333#include < QGraphicsTextItem>
34+ #include < QGraphicsProxyWidget>
35+ #include " ui_NetworkSearch.h"
3436#ifndef Q_MOC_RUN
3537#include < boost/shared_ptr.hpp>
3638#include < atomic>
@@ -87,7 +89,7 @@ namespace Gui {
8789 {
8890 Q_OBJECT
8991 public:
90- explicit ErrorItem (const QString& text, std::function<void ()> showModule, QGraphicsItem* parent = 0 );
92+ explicit ErrorItem (const QString& text, std::function<void ()> showModule, QGraphicsItem* parent = nullptr );
9193 ~ErrorItem ();
9294 int num () const { return counter_; }
9395 protected:
@@ -104,6 +106,20 @@ namespace Gui {
104106 static std::atomic<int > instanceCounter_;
105107 };
106108
109+ class NetworkSearchWidget : public QWidget , public Ui ::NetworkSearch
110+ {
111+ Q_OBJECT
112+ public:
113+ explicit NetworkSearchWidget (class NetworkEditor * ned);
114+ };
115+
116+ class NetworkSearchWidgetProxy : public QGraphicsProxyWidget
117+ {
118+ Q_OBJECT
119+ public:
120+ explicit NetworkSearchWidgetProxy (NetworkSearchWidget* base);
121+ };
122+
107123 class ModuleEventProxy : public QObject
108124 {
109125 Q_OBJECT
@@ -221,6 +237,7 @@ namespace Gui {
221237 virtual void wheelEvent (QWheelEvent* event) override ;
222238 virtual void contextMenuEvent (QContextMenuEvent *event) override ;
223239 virtual void mousePressEvent (QMouseEvent *event) override ;
240+ virtual void mouseDoubleClickEvent (QMouseEvent* event) override ;
224241
225242 public Q_SLOTS:
226243 void addModuleWidget (const std::string& name, SCIRun::Dataflow::Networks::ModuleHandle module , const SCIRun::Dataflow::Engine::ModuleCounter& count);
@@ -284,6 +301,7 @@ namespace Gui {
284301 void paste ();
285302 void bringToFront ();
286303 void sendToBack ();
304+ void hideSearchBox ();
287305
288306 private:
289307 typedef QPair<ModuleWidget*, ModuleWidget*> ModulePair;
@@ -324,6 +342,7 @@ namespace Gui {
324342 bool insertingNewModuleAlongConnection_ { false };
325343 PreexecuteFunc preexecute_;
326344 bool showTagGroupsOnFileLoad_ { false };
345+ QGraphicsProxyWidget* search_ { nullptr };
327346 };
328347}
329348}
0 commit comments