This commit is contained in:
Nav
2021-10-21 19:24:48 +01:00
parent 9b21e55815
commit 6b11956c90
27 changed files with 93 additions and 93 deletions

View File

@@ -114,14 +114,14 @@ void Insight::startup() {
* This allows us to use Qt's event loop whilst still being able to process our own events.
*/
auto eventDispatchTimer = new QTimer(&(this->application));
this->connect(eventDispatchTimer, &QTimer::timeout, this, &Insight::dispatchEvents);
QObject::connect(eventDispatchTimer, &QTimer::timeout, this, &Insight::dispatchEvents);
eventDispatchTimer->start(100);
this->connect(this->insightWorker, &InsightWorker::targetControllerSuspended, this->mainWindow, &InsightWindow::onTargetControllerSuspended);
this->connect(this->insightWorker, &InsightWorker::targetControllerResumed, this->mainWindow, &InsightWindow::onTargetControllerResumed);
this->connect(this->insightWorker, &InsightWorker::targetStateUpdated, this->mainWindow, &InsightWindow::onTargetStateUpdate);
this->connect(this->insightWorker, &InsightWorker::targetProgramCounterUpdated, this->mainWindow, &InsightWindow::onTargetProgramCounterUpdate);
this->connect(this->mainWindow, &InsightWindow::refreshTargetPinStates, this->insightWorker, &InsightWorker::requestPinStates);
QObject::connect(this->insightWorker, &InsightWorker::targetControllerSuspended, this->mainWindow, &InsightWindow::onTargetControllerSuspended);
QObject::connect(this->insightWorker, &InsightWorker::targetControllerResumed, this->mainWindow, &InsightWindow::onTargetControllerResumed);
QObject::connect(this->insightWorker, &InsightWorker::targetStateUpdated, this->mainWindow, &InsightWindow::onTargetStateUpdate);
QObject::connect(this->insightWorker, &InsightWorker::targetProgramCounterUpdated, this->mainWindow, &InsightWindow::onTargetProgramCounterUpdate);
QObject::connect(this->mainWindow, &InsightWindow::refreshTargetPinStates, this->insightWorker, &InsightWorker::requestPinStates);
this->mainWindow->setInsightConfig(this->insightConfig);
this->mainWindow->setEnvironmentConfig(this->environmentConfig);
@@ -132,11 +132,11 @@ void Insight::startup() {
this->workerThread = new QThread();
this->workerThread->setObjectName("IW");
this->insightWorker->moveToThread(this->workerThread);
this->connect(this->workerThread, &QThread::started, this->insightWorker, &InsightWorker::startup);
this->connect(this->workerThread, &QThread::finished, this->insightWorker, &QObject::deleteLater);
this->connect(this->workerThread, &QThread::finished, this->workerThread, &QThread::deleteLater);
QObject::connect(this->workerThread, &QThread::started, this->insightWorker, &InsightWorker::startup);
QObject::connect(this->workerThread, &QThread::finished, this->insightWorker, &QObject::deleteLater);
QObject::connect(this->workerThread, &QThread::finished, this->workerThread, &QThread::deleteLater);
this->connect(this->insightWorker, &InsightWorker::ready, this, [this] {
QObject::connect(this->insightWorker, &InsightWorker::ready, this, [this] {
this->checkBloomVersion();
});
@@ -167,7 +167,7 @@ void Insight::checkBloomVersion() {
currentVersionNumber
);
this->connect(
QObject::connect(
versionQueryTask,
&QueryLatestVersionNumber::latestVersionNumberRetrieved,
this,

View File

@@ -42,10 +42,10 @@ void InsightWorker::startup() {
);
this->eventDispatchTimer = new QTimer(this);
this->connect(this->eventDispatchTimer, &QTimer::timeout, this, &InsightWorker::dispatchEvents);
QObject::connect(this->eventDispatchTimer, &QTimer::timeout, this, &InsightWorker::dispatchEvents);
this->eventDispatchTimer->start(5);
this->connect(this, &InsightWorker::taskQueued, this, &InsightWorker::executeTasks);
QObject::connect(this, &InsightWorker::taskQueued, this, &InsightWorker::executeTasks);
this->eventManager.triggerEvent(
std::make_shared<Events::InsightThreadStateChanged>(ThreadState::READY)

View File

@@ -17,7 +17,7 @@ void QueryLatestVersionNumber::run(TargetControllerConsole& targetControllerCons
}));
auto response = networkAccessManager->get(QNetworkRequest(queryVersionEndpointUrl));
this->connect(response, &QNetworkReply::finished, this, [this, response] {
QObject::connect(response, &QNetworkReply::finished, this, [this, response] {
const auto jsonResponseObject = QJsonDocument::fromJson(response->readAll()).object();
if (jsonResponseObject.contains("latestVersionNumber")) {

View File

@@ -6,7 +6,7 @@
namespace Bloom::Widgets
{
class Q_WIDGETS_EXPORT ClickableWidget: public QFrame
class ClickableWidget: public QFrame
{
Q_OBJECT

View File

@@ -54,5 +54,5 @@ ErrorDialogue::ErrorDialogue(
this->errorMessageLabel->setText(errorMessage);
this->connect(this->okButton, &QPushButton::clicked, this, &QDialog::close);
QObject::connect(this->okButton, &QPushButton::clicked, this, &QDialog::close);
}

View File

@@ -6,7 +6,7 @@
namespace Bloom::Widgets
{
class Q_WIDGETS_EXPORT ErrorDialogue: public QDialog
class ErrorDialogue: public QDialog
{
Q_OBJECT

View File

@@ -6,7 +6,7 @@
namespace Bloom::Widgets
{
class Q_WIDGETS_EXPORT ExpandingHeightScrollAreaWidget: public QScrollArea
class ExpandingHeightScrollAreaWidget: public QScrollArea
{
Q_OBJECT

View File

@@ -17,7 +17,7 @@ namespace Bloom::Widgets
};
Q_ENUM_NS(PanelWidgetType)
class Q_WIDGETS_EXPORT PanelWidget: public QFrame
class PanelWidget: public QFrame
{
Q_OBJECT
Q_PROPERTY(int handleSize READ getHandleSize WRITE setHandleSize DESIGNABLE true)
@@ -40,15 +40,15 @@ namespace Bloom::Widgets
this->resizeCursor = this->panelType == PanelWidgetType::LEFT ? Qt::SplitHCursor : Qt::SplitVCursor;
}
int getHandleSize() {
[[nodiscard]] int getHandleSize() const {
return this->handleSize;
}
int getMinimumResize() {
[[nodiscard]] int getMinimumResize() const {
return this->minimumResize;
}
int getMaximumResize() {
[[nodiscard]] int getMaximumResize() const {
return this->maximumResize;
}
@@ -71,7 +71,7 @@ namespace Bloom::Widgets
void mouseReleaseEvent(QMouseEvent* event) override;
void mouseMoveEvent(QMouseEvent* event) override;
std::pair<QPoint, QPoint> getHandleArea() const;
bool isPositionWithinHandleArea(const QPoint& position) const;
[[nodiscard]] std::pair<QPoint, QPoint> getHandleArea() const;
[[nodiscard]] bool isPositionWithinHandleArea(const QPoint& position) const;
};
}

View File

@@ -19,8 +19,8 @@ ByteWidget::ByteWidget(
this->addressHex = "0x" + QString::number(this->address, 16).rightJustified(8, '0').toUpper();
this->relativeAddressHex = "0x" + QString::number(this->byteIndex, 16).rightJustified(8, '0').toUpper();
this->connect(this, &ClickableWidget::clicked, this, onClick);
this->connect(this, &ClickableWidget::rightClicked, this, onClick);
QObject::connect(this, &ClickableWidget::clicked, this, onClick);
QObject::connect(this, &ClickableWidget::rightClicked, this, onClick);
this->setSelected(false);
}

View File

@@ -41,9 +41,9 @@ namespace Bloom::Widgets
void setSelected(bool selected);
signals:
void selected(ByteWidget*);
void enter(ByteWidget*);
void leave(ByteWidget*);
void selected(Bloom::Widgets::ByteWidget*);
void enter(Bloom::Widgets::ByteWidget*);
void leave(Bloom::Widgets::ByteWidget*);
protected:
virtual void postSetSelected(bool selected) {};

View File

@@ -47,11 +47,11 @@ parent(parent) {
byteWidget
));
this->connect(byteWidget, &ByteWidget::enter, this, &ByteWidgetContainer::onByteWidgetEnter);
this->connect(byteWidget, &ByteWidget::leave, this, &ByteWidgetContainer::onByteWidgetLeave);
QObject::connect(byteWidget, &ByteWidget::enter, this, &ByteWidgetContainer::onByteWidgetEnter);
QObject::connect(byteWidget, &ByteWidget::leave, this, &ByteWidgetContainer::onByteWidgetLeave);
}
this->connect(
QObject::connect(
&insightWorker,
&InsightWorker::targetStateUpdated,
this,
@@ -117,8 +117,8 @@ void ByteWidgetContainer::adjustByteWidgets() {
this->setMinimumHeight(minHeight);
this->parent->setMinimumHeight(minHeight);
this->byteWidgetsByRowIndex.swap(byteWidgetsByRowIndex);
this->byteWidgetsByColumnIndex.swap(byteWidgetsByColumnIndex);
this->byteWidgetsByRowIndex = std::move(byteWidgetsByRowIndex);
this->byteWidgetsByColumnIndex = std::move(byteWidgetsByColumnIndex);
emit this->byteWidgetsAdjusted();
}

View File

@@ -58,7 +58,7 @@ namespace Bloom::Widgets
private slots:
void onTargetStateChanged(Targets::TargetState newState);
void onByteWidgetEnter(ByteWidget* widget);
void onByteWidgetLeave(ByteWidget* widget);
void onByteWidgetEnter(Bloom::Widgets::ByteWidget* widget);
void onByteWidgetLeave(Bloom::Widgets::ByteWidget* widget);
};
}

View File

@@ -76,13 +76,13 @@ HexViewerWidget::HexViewerWidget(
this->byteWidgetAddressLayout = this->byteWidgetAddressContainer->findChild<QVBoxLayout*>();
this->byteWidgetAddressLayout->setContentsMargins(5, 10, 0, 5);
this->connect(
QObject::connect(
this->byteWidgetContainer,
&ByteWidgetContainer::byteWidgetsAdjusted,
this,
&HexViewerWidget::onByteWidgetsAdjusted
);
this->connect(
QObject::connect(
&insightWorker,
&InsightWorker::targetStateUpdated,
this,

View File

@@ -52,14 +52,14 @@ TargetMemoryInspectionPane::TargetMemoryInspectionPane(
subContainerLayout->addWidget(this->hexViewerWidget);
this->connect(
QObject::connect(
&insightWorker,
&InsightWorker::targetStateUpdated,
this,
&TargetMemoryInspectionPane::onTargetStateChanged
);
this->connect(
QObject::connect(
this->hexViewerWidget->refreshButton,
&QToolButton::clicked,
this,
@@ -78,14 +78,14 @@ void TargetMemoryInspectionPane::refreshMemoryValues(std::optional<std::function
this->targetMemoryDescriptor.size()
);
this->connect(
QObject::connect(
readMemoryTask,
&ReadTargetMemory::targetMemoryRead,
this,
&TargetMemoryInspectionPane::onMemoryRead
);
this->connect(
QObject::connect(
readMemoryTask,
&InsightWorkerTask::completed,
this,
@@ -95,7 +95,7 @@ void TargetMemoryInspectionPane::refreshMemoryValues(std::optional<std::function
);
if (callback.has_value()) {
this->connect(
QObject::connect(
readMemoryTask,
&InsightWorkerTask::completed,
this,

View File

@@ -48,7 +48,7 @@ BitWidget::BitWidget(
layout->addStretch(1);
if (!this->readOnly) {
this->connect(this->body, &BitBodyWidget::clicked, this, [this] {
QObject::connect(this->body, &BitBodyWidget::clicked, this, [this] {
emit this->bitChanged();
});
}

View File

@@ -32,7 +32,7 @@ QWidget(parent), byteNumber(byteNumber), byte(byte), readOnly(readOnly) {
);
bitLayout->addWidget(bitWidget, 0, Qt::AlignmentFlag::AlignHCenter | Qt::AlignmentFlag::AlignTop);
this->connect(
QObject::connect(
bitWidget,
&BitWidget::bitChanged,
this,

View File

@@ -10,8 +10,8 @@ ClickableWidget(parent), registerValue(registerValue) {
this->setSelected(true);
};
this->connect(this, &ClickableWidget::clicked, this, onClick);
this->connect(this, &ClickableWidget::rightClicked, this, onClick);
QObject::connect(this, &ClickableWidget::clicked, this, onClick);
QObject::connect(this, &ClickableWidget::rightClicked, this, onClick);
this->setSelected(false);
}

View File

@@ -43,8 +43,8 @@ RegisterHistoryItem::RegisterHistoryItem(
this->setSelected(true);
};
this->connect(this, &ClickableWidget::clicked, this, onClick);
this->connect(this, &ClickableWidget::rightClicked, this, onClick);
QObject::connect(this, &ClickableWidget::clicked, this, onClick);
QObject::connect(this, &ClickableWidget::rightClicked, this, onClick);
this->setSelected(false);
}

View File

@@ -52,14 +52,14 @@ RegisterHistoryWidget::RegisterHistoryWidget(
titleBar->setContentsMargins(0, 0, 0, 0);
title->setFixedHeight(titleBar->height());
this->connect(
QObject::connect(
&insightWorker,
&InsightWorker::targetStateUpdated,
this,
&RegisterHistoryWidget::onTargetStateChanged
);
this->connect(
QObject::connect(
&insightWorker,
&InsightWorker::targetRegistersWritten,
this,
@@ -67,7 +67,7 @@ RegisterHistoryWidget::RegisterHistoryWidget(
);
this->currentItem = new CurrentItem(currentValue, this);
this->connect(this->currentItem, &Item::selected, this, &RegisterHistoryWidget::onItemSelectionChange);
QObject::connect(this->currentItem, &Item::selected, this, &RegisterHistoryWidget::onItemSelectionChange);
this->itemContainerLayout->addWidget(this->currentItem);
this->currentItem->setSelected(true);
@@ -98,7 +98,7 @@ void RegisterHistoryWidget::selectCurrentItem() {
void RegisterHistoryWidget::addItem(const Targets::TargetMemoryBuffer& registerValue, const QDateTime& changeDate) {
auto item = new RegisterHistoryItem(registerValue, changeDate, this->itemContainer);
this->connect(item, &Item::selected, this, &RegisterHistoryWidget::onItemSelectionChange);
QObject::connect(item, &Item::selected, this, &RegisterHistoryWidget::onItemSelectionChange);
this->itemContainerLayout->insertWidget(2, item);
}

View File

@@ -154,7 +154,7 @@ TargetRegisterInspectorWindow::TargetRegisterInspectorWindow(
);
bitsetSingleHorizontalLayout->addWidget(bitsetWidget, 0, Qt::AlignmentFlag::AlignLeft);
this->connect(
QObject::connect(
bitsetWidget,
&BitsetWidget::byteChanged,
this,
@@ -177,31 +177,31 @@ TargetRegisterInspectorWindow::TargetRegisterInspectorWindow(
this->registerHistoryWidget->setFixedHeight(this->contentContainer->sizeHint().height());
this->connect(this->helpButton, &QPushButton::clicked, this, &TargetRegisterInspectorWindow::openHelpPage);
this->connect(this->closeButton, &QPushButton::clicked, this, &QWidget::close);
this->connect(
QObject::connect(this->helpButton, &QPushButton::clicked, this, &TargetRegisterInspectorWindow::openHelpPage);
QObject::connect(this->closeButton, &QPushButton::clicked, this, &QWidget::close);
QObject::connect(
this->refreshValueButton,
&QPushButton::clicked,
this,
&TargetRegisterInspectorWindow::refreshRegisterValue
);
this->connect(this->applyButton, &QPushButton::clicked, this, &TargetRegisterInspectorWindow::applyChanges);
QObject::connect(this->applyButton, &QPushButton::clicked, this, &TargetRegisterInspectorWindow::applyChanges);
this->connect(
QObject::connect(
this->registerHistoryWidget,
&RegisterHistoryWidget::historyItemSelected,
this,
&TargetRegisterInspectorWindow::onHistoryItemSelected
);
this->connect(
QObject::connect(
this->registerValueTextInput,
&QLineEdit::textEdited,
this,
&TargetRegisterInspectorWindow::onValueTextInputChanged
);
this->connect(
QObject::connect(
&insightWorker,
&InsightWorker::targetStateUpdated,
this,
@@ -310,7 +310,7 @@ void TargetRegisterInspectorWindow::refreshRegisterValue() {
this->registerValueContainer->setDisabled(true);
auto readTargetRegisterTask = new ReadTargetRegisters({this->registerDescriptor});
this->connect(
QObject::connect(
readTargetRegisterTask,
&ReadTargetRegisters::targetRegistersRead,
this,
@@ -325,7 +325,7 @@ void TargetRegisterInspectorWindow::refreshRegisterValue() {
}
);
this->connect(
QObject::connect(
readTargetRegisterTask,
&InsightWorkerTask::failed,
this,
@@ -342,7 +342,7 @@ void TargetRegisterInspectorWindow::applyChanges() {
const auto targetRegister = Targets::TargetRegister(this->registerDescriptor, this->registerValue);
auto writeRegisterTask = new WriteTargetRegister(targetRegister);
this->connect(writeRegisterTask, &InsightWorkerTask::completed, this, [this, targetRegister] {
QObject::connect(writeRegisterTask, &InsightWorkerTask::completed, this, [this, targetRegister] {
this->registerValueContainer->setDisabled(false);
emit this->insightWorker.targetRegistersWritten(
{targetRegister},
@@ -352,7 +352,7 @@ void TargetRegisterInspectorWindow::applyChanges() {
this->registerHistoryWidget->selectCurrentItem();
});
this->connect(writeRegisterTask, &InsightWorkerTask::failed, this, [this] (QString errorMessage) {
QObject::connect(writeRegisterTask, &InsightWorkerTask::failed, this, [this] (QString errorMessage) {
this->registerValueContainer->setDisabled(false);
auto errorDialogue = new ErrorDialogue(
"Error",

View File

@@ -9,8 +9,8 @@ ItemWidget::ItemWidget(QWidget* parent): ClickableWidget(parent) {
this->setSelected(true);
};
this->connect(this, &ClickableWidget::clicked, this, onClick);
this->connect(this, &ClickableWidget::rightClicked, this, onClick);
QObject::connect(this, &ClickableWidget::clicked, this, onClick);
QObject::connect(this, &ClickableWidget::rightClicked, this, onClick);
this->setSelected(false);
}

View File

@@ -66,7 +66,7 @@ RegisterGroupWidget::RegisterGroupWidget(
auto registerWidget = new RegisterWidget(descriptor, insightWorker, this->bodyWidget);
bodyLayout->addWidget(registerWidget, 0, Qt::AlignmentFlag::AlignTop);
this->connect(
QObject::connect(
registerWidget,
&ItemWidget::selected,
parent,
@@ -87,7 +87,7 @@ RegisterGroupWidget::RegisterGroupWidget(
this->collapse();
this->connect(this->headerWidget, &ClickableWidget::doubleClicked, [this] {
QObject::connect(this->headerWidget, &ClickableWidget::doubleClicked, [this] {
if (this->collapsed) {
this->expand();
@@ -96,7 +96,7 @@ RegisterGroupWidget::RegisterGroupWidget(
}
});
this->connect(
QObject::connect(
this->headerWidget,
&ItemWidget::selected,
parent,

View File

@@ -43,15 +43,15 @@ RegisterWidget::RegisterWidget(
this->layout->addWidget(this->valueLabel);
this->layout->addStretch(1);
this->connect(this, &ClickableWidget::doubleClicked, this, &RegisterWidget::openInspectionWindow);
this->connect(this->openInspectionWindowAction, &QAction::triggered, this, &RegisterWidget::openInspectionWindow);
this->connect(this->refreshValueAction, &QAction::triggered, this, &RegisterWidget::refreshValue);
this->connect(this->copyValueNameAction, &QAction::triggered, this, &RegisterWidget::copyName);
this->connect(this->copyValueHexAction, &QAction::triggered, this, &RegisterWidget::copyValueHex);
this->connect(this->copyValueDecimalAction, &QAction::triggered, this, &RegisterWidget::copyValueDecimal);
this->connect(this->copyValueBinaryAction, &QAction::triggered, this, &RegisterWidget::copyValueBinary);
QObject::connect(this, &ClickableWidget::doubleClicked, this, &RegisterWidget::openInspectionWindow);
QObject::connect(this->openInspectionWindowAction, &QAction::triggered, this, &RegisterWidget::openInspectionWindow);
QObject::connect(this->refreshValueAction, &QAction::triggered, this, &RegisterWidget::refreshValue);
QObject::connect(this->copyValueNameAction, &QAction::triggered, this, &RegisterWidget::copyName);
QObject::connect(this->copyValueHexAction, &QAction::triggered, this, &RegisterWidget::copyValueHex);
QObject::connect(this->copyValueDecimalAction, &QAction::triggered, this, &RegisterWidget::copyValueDecimal);
QObject::connect(this->copyValueBinaryAction, &QAction::triggered, this, &RegisterWidget::copyValueBinary);
this->connect(
QObject::connect(
&(this->insightWorker),
&InsightWorker::targetStateUpdated,
this,
@@ -152,7 +152,7 @@ void RegisterWidget::openInspectionWindow() {
void RegisterWidget::refreshValue() {
auto readRegisterTask = new ReadTargetRegisters({this->descriptor});
this->connect(
QObject::connect(
readRegisterTask,
&ReadTargetRegisters::targetRegistersRead,
this,

View File

@@ -51,15 +51,15 @@ TargetRegistersPaneWidget::TargetRegistersPaneWidget(
this->toolBar->layout()->setContentsMargins(5, 0, 5, 0);
this->searchInput = this->container->findChild<QLineEdit*>("search-input");
this->connect(this->expandAllButton, &QToolButton::clicked, [this] {
QObject::connect(this->expandAllButton, &QToolButton::clicked, [this] {
this->expandAllRegisterGroups();
});
this->connect(this->collapseAllButton, &QToolButton::clicked, [this] {
QObject::connect(this->collapseAllButton, &QToolButton::clicked, [this] {
this->collapseAllRegisterGroups();
});
this->connect(this->searchInput, &QLineEdit::textChanged, [this] {
QObject::connect(this->searchInput, &QLineEdit::textChanged, [this] {
this->filterRegisters(this->searchInput->text());
});
@@ -108,14 +108,14 @@ TargetRegistersPaneWidget::TargetRegistersPaneWidget(
itemLayout->addStretch(1);
this->connect(
QObject::connect(
&insightWorker,
&InsightWorker::targetStateUpdated,
this,
&TargetRegistersPaneWidget::onTargetStateChanged
);
this->connect(
QObject::connect(
&insightWorker,
&InsightWorker::targetRegistersWritten,
this,
@@ -165,7 +165,7 @@ void TargetRegistersPaneWidget::refreshRegisterValues(std::optional<std::functio
}
auto readRegisterTask = new ReadTargetRegisters(descriptors);
this->connect(
QObject::connect(
readRegisterTask,
&ReadTargetRegisters::targetRegistersRead,
this,
@@ -173,7 +173,7 @@ void TargetRegistersPaneWidget::refreshRegisterValues(std::optional<std::functio
);
if (callback.has_value()) {
this->connect(
QObject::connect(
readRegisterTask,
&InsightWorkerTask::completed,
this,

View File

@@ -42,7 +42,7 @@ namespace Bloom::Widgets
void deactivate();
public slots:
void onItemSelectionChange(ItemWidget* newlySelectedWidget);
void onItemSelectionChange(Bloom::Widgets::ItemWidget* newlySelectedWidget);
protected:
void resizeEvent(QResizeEvent* event) override;

View File

@@ -14,14 +14,14 @@ TargetPackageWidget::TargetPackageWidget(
InsightWorker& insightWorker,
QWidget* parent
): QWidget(parent), targetVariant(std::move(targetVariant)), insightWorker(insightWorker) {
this->connect(
QObject::connect(
&(this->insightWorker),
&InsightWorker::targetStateUpdated,
this,
&TargetPackageWidget::onTargetStateChanged
);
this->connect(
QObject::connect(
&(this->insightWorker),
&InsightWorker::targetRegistersWritten,
this,
@@ -33,7 +33,7 @@ TargetPackageWidget::TargetPackageWidget(
void TargetPackageWidget::refreshPinStates(std::optional<std::function<void(void)>> callback) {
auto refreshTask = new RefreshTargetPinStates(this->targetVariant.id);
this->connect(
QObject::connect(
refreshTask,
&RefreshTargetPinStates::targetPinStatesRetrieved,
this,
@@ -41,7 +41,7 @@ void TargetPackageWidget::refreshPinStates(std::optional<std::function<void(void
);
if (callback.has_value()) {
this->connect(
QObject::connect(
refreshTask,
&InsightWorkerTask::completed,
this,

View File

@@ -36,12 +36,12 @@ void TargetPinWidget::onWidgetBodyClicked() {
TargetPinState::IoState::LOW : TargetPinState::IoState::HIGH;
auto setPinStateTask = new SetTargetPinState(this->pinDescriptor, pinState);
this->connect(setPinStateTask, &InsightWorkerTask::completed, this, [this, pinState] {
QObject::connect(setPinStateTask, &InsightWorkerTask::completed, this, [this, pinState] {
this->updatePinState(pinState);
this->setDisabled(false);
});
this->connect(setPinStateTask, &InsightWorkerTask::failed, this, [this] {
QObject::connect(setPinStateTask, &InsightWorkerTask::failed, this, [this] {
this->setDisabled(false);
});