Skip to content

Commit e675ebb

Browse files
committed
Stub for qt wtf
1 parent 1041f53 commit e675ebb

File tree

5 files changed

+24
-5
lines changed

5 files changed

+24
-5
lines changed

src/Interface/Application/ModuleProxyWidget.cc

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ void ModuleProxyWidget::showAndColorImpl(const QColor& color, int milliseconds)
151151
{
152152
if (timeLine_)
153153
return;
154-
154+
155155
animateColor_ = color;
156156
timeLine_ = new QTimeLine(milliseconds, this);
157157
connect(timeLine_, SIGNAL(valueChanged(qreal)), this, SLOT(colorAnimate(qreal)));
@@ -369,6 +369,11 @@ bool ModuleProxyWidget::isSubwidget(QWidget* alienWidget) const
369369
qobject_cast<QProgressBar*>(alienWidget);
370370
}
371371

372+
void ModuleProxyWidget::menuFunction()
373+
{
374+
module_->menuFunction();
375+
}
376+
372377
void ModuleProxyWidget::highlightIfSelected()
373378
{
374379
if (!isSelected_ && isSelected())
@@ -409,9 +414,9 @@ void ModuleProxyWidget::createPortPositionProviders()
409414

410415
int extraPadding = p->isHighlighted() ? 4 : 0;
411416
auto pp(boost::make_shared<ProxyWidgetPosition>(this, realPosition + QPointF(p->properWidth() / 2 + extraPadding, 5)));
412-
417+
413418
//qDebug() << "PWP real " << realPosition + QPointF(p->properWidth() / 2 + extraPadding, 5);
414-
419+
415420
p->setPositionObject(pp);
416421
}
417422
if (pos() == QPointF(0, 0) && cachedPosition_ != pos())

src/Interface/Application/ModuleProxyWidget.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ namespace SCIRun
5252
void createStartupNote();
5353
void adjustHeight(int delta);
5454
void adjustWidth(int delta);
55+
void menuFunction();
5556

5657
//TODO: move to utility
5758
static void ensureItemVisible(QGraphicsItem* item);

src/Interface/Application/ModuleWidget.cc

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -569,6 +569,13 @@ void ModuleWidget::fillReplaceWithMenu()
569569
fullWidgetDisplay_->getModuleActionButton());
570570
}
571571

572+
void ModuleWidget::menuFunction()
573+
{
574+
qDebug() << "ModuleWidget::menuFunction";
575+
// fullWidgetDisplay_->getModuleActionButton()->setMenu(nullptr);
576+
// actionsMenu_.reset();
577+
}
578+
572579
QMenu* ModuleWidget::getReplaceWithMenu()
573580
{
574581
return actionsMenu_->getAction("Replace With")->menu();
@@ -965,8 +972,6 @@ ModuleWidget::NetworkClearingScope::~NetworkClearingScope()
965972

966973
ModuleWidget::~ModuleWidget()
967974
{
968-
actionsMenu_->getAction("Replace With")->setMenu(nullptr);
969-
970975
disconnect(this, SIGNAL(dynamicPortChanged(const std::string&, bool)), this, SLOT(updateDialogForDynamicPortChange(const std::string&, bool)));
971976
disconnect(this, SIGNAL(connectionDeleted(const SCIRun::Dataflow::Networks::ConnectionId&)), this, SLOT(fillReplaceWithMenu()));
972977

src/Interface/Application/ModuleWidget.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,7 @@ public Q_SLOTS:
194194
void updateMetadata(bool active);
195195
void updatePortSpacing(bool highlighted);
196196
void replaceMe();
197+
void menuFunction();
197198
Q_SIGNALS:
198199
void removeModule(const SCIRun::Dataflow::Networks::ModuleId& moduleId);
199200
void interrupt(const SCIRun::Dataflow::Networks::ModuleId& moduleId);

src/Interface/Application/Subnetworks.cc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,13 @@ void NetworkEditor::sendItemsToParent()
124124
{
125125
conn->deleteCompanion();
126126
}
127+
128+
auto module = getModule(item);
129+
if (module)
130+
{
131+
module->menuFunction();
132+
}
133+
127134
parentNetwork_->scene_->addItem(item);
128135
item->setVisible(true);
129136
item->setData(SUBNET_KEY, 0);

0 commit comments

Comments
 (0)