From 6b11956c9095d78373061ed8673c6e82425dadad Mon Sep 17 00:00:00 2001 From: Nav Date: Thu, 21 Oct 2021 19:24:48 +0100 Subject: [PATCH] Tidying --- src/Insight/Insight.cpp | 22 ++++++++--------- src/Insight/InsightWorker/InsightWorker.cpp | 4 ++-- .../Tasks/QueryLatestVersionNumber.cpp | 2 +- .../InsightWindow/Widgets/ClickableWidget.hpp | 2 +- .../Widgets/ErrorDialogue/ErrorDialogue.cpp | 2 +- .../Widgets/ErrorDialogue/ErrorDialogue.hpp | 2 +- .../ExpandingHeightScrollAreaWidget.hpp | 2 +- .../InsightWindow/Widgets/PanelWidget.hpp | 12 +++++----- .../HexViewerWidget/ByteWidget.cpp | 4 ++-- .../HexViewerWidget/ByteWidget.hpp | 6 ++--- .../HexViewerWidget/ByteWidgetContainer.cpp | 10 ++++---- .../HexViewerWidget/ByteWidgetContainer.hpp | 4 ++-- .../HexViewerWidget/HexViewerWidget.cpp | 4 ++-- .../TargetMemoryInspectionPane.cpp | 10 ++++---- .../BitsetWidget/BitWidget.cpp | 2 +- .../BitsetWidget/BitsetWidget.cpp | 2 +- .../RegisterHistoryWidget/Item.cpp | 4 ++-- .../RegisterHistoryItem.cpp | 4 ++-- .../RegisterHistoryWidget.cpp | 8 +++---- .../TargetRegisterInspectorWindow.cpp | 24 +++++++++---------- .../TargetRegistersPane/ItemWidget.cpp | 4 ++-- .../RegisterGroupWidget.cpp | 6 ++--- .../TargetRegistersPane/RegisterWidget.cpp | 18 +++++++------- .../TargetRegistersPaneWidget.cpp | 14 +++++------ .../TargetRegistersPaneWidget.hpp | 2 +- .../TargetWidgets/TargetPackageWidget.cpp | 8 +++---- .../Widgets/TargetWidgets/TargetPinWidget.cpp | 4 ++-- 27 files changed, 93 insertions(+), 93 deletions(-) diff --git a/src/Insight/Insight.cpp b/src/Insight/Insight.cpp index df6dbde5..42a50630 100644 --- a/src/Insight/Insight.cpp +++ b/src/Insight/Insight.cpp @@ -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, diff --git a/src/Insight/InsightWorker/InsightWorker.cpp b/src/Insight/InsightWorker/InsightWorker.cpp index 0cb275d8..23ffa8cb 100644 --- a/src/Insight/InsightWorker/InsightWorker.cpp +++ b/src/Insight/InsightWorker/InsightWorker.cpp @@ -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(ThreadState::READY) diff --git a/src/Insight/InsightWorker/Tasks/QueryLatestVersionNumber.cpp b/src/Insight/InsightWorker/Tasks/QueryLatestVersionNumber.cpp index 7701deb6..80dc96bd 100644 --- a/src/Insight/InsightWorker/Tasks/QueryLatestVersionNumber.cpp +++ b/src/Insight/InsightWorker/Tasks/QueryLatestVersionNumber.cpp @@ -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")) { diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/ClickableWidget.hpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/ClickableWidget.hpp index 18ea8f4e..00fa7e85 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/ClickableWidget.hpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/ClickableWidget.hpp @@ -6,7 +6,7 @@ namespace Bloom::Widgets { - class Q_WIDGETS_EXPORT ClickableWidget: public QFrame + class ClickableWidget: public QFrame { Q_OBJECT diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/ErrorDialogue/ErrorDialogue.cpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/ErrorDialogue/ErrorDialogue.cpp index fb74559d..1bf665d8 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/ErrorDialogue/ErrorDialogue.cpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/ErrorDialogue/ErrorDialogue.cpp @@ -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); } diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/ErrorDialogue/ErrorDialogue.hpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/ErrorDialogue/ErrorDialogue.hpp index 1593437a..5681b213 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/ErrorDialogue/ErrorDialogue.hpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/ErrorDialogue/ErrorDialogue.hpp @@ -6,7 +6,7 @@ namespace Bloom::Widgets { - class Q_WIDGETS_EXPORT ErrorDialogue: public QDialog + class ErrorDialogue: public QDialog { Q_OBJECT diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/ExpandingHeightScrollAreaWidget.hpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/ExpandingHeightScrollAreaWidget.hpp index d0014664..ba70ad3f 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/ExpandingHeightScrollAreaWidget.hpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/ExpandingHeightScrollAreaWidget.hpp @@ -6,7 +6,7 @@ namespace Bloom::Widgets { - class Q_WIDGETS_EXPORT ExpandingHeightScrollAreaWidget: public QScrollArea + class ExpandingHeightScrollAreaWidget: public QScrollArea { Q_OBJECT diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/PanelWidget.hpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/PanelWidget.hpp index c64a3d41..eb7cd41a 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/PanelWidget.hpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/PanelWidget.hpp @@ -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 getHandleArea() const; - bool isPositionWithinHandleArea(const QPoint& position) const; + [[nodiscard]] std::pair getHandleArea() const; + [[nodiscard]] bool isPositionWithinHandleArea(const QPoint& position) const; }; } diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/ByteWidget.cpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/ByteWidget.cpp index 5bc94338..a5b60773 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/ByteWidget.cpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/ByteWidget.cpp @@ -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); } diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/ByteWidget.hpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/ByteWidget.hpp index 93ac63ca..586dc7de 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/ByteWidget.hpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/ByteWidget.hpp @@ -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) {}; diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/ByteWidgetContainer.cpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/ByteWidgetContainer.cpp index 7ad9f268..850b2305 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/ByteWidgetContainer.cpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/ByteWidgetContainer.cpp @@ -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(); } diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/ByteWidgetContainer.hpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/ByteWidgetContainer.hpp index d96964d9..8a005b8b 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/ByteWidgetContainer.hpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/ByteWidgetContainer.hpp @@ -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); }; } diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/HexViewerWidget.cpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/HexViewerWidget.cpp index 852aa30d..3c76fd12 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/HexViewerWidget.cpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/HexViewerWidget.cpp @@ -76,13 +76,13 @@ HexViewerWidget::HexViewerWidget( this->byteWidgetAddressLayout = this->byteWidgetAddressContainer->findChild(); 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, diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/TargetMemoryInspectionPane.cpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/TargetMemoryInspectionPane.cpp index d95b23de..2fc94c6d 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/TargetMemoryInspectionPane.cpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/TargetMemoryInspectionPane.cpp @@ -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::optionaltargetMemoryDescriptor.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::optionalconnect( + QObject::connect( readMemoryTask, &InsightWorkerTask::completed, this, diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetRegisterInspector/BitsetWidget/BitWidget.cpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetRegisterInspector/BitsetWidget/BitWidget.cpp index 8c8de52b..c38e8895 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetRegisterInspector/BitsetWidget/BitWidget.cpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetRegisterInspector/BitsetWidget/BitWidget.cpp @@ -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(); }); } diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetRegisterInspector/BitsetWidget/BitsetWidget.cpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetRegisterInspector/BitsetWidget/BitsetWidget.cpp index f77ca001..48f9a070 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetRegisterInspector/BitsetWidget/BitsetWidget.cpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetRegisterInspector/BitsetWidget/BitsetWidget.cpp @@ -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, diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetRegisterInspector/RegisterHistoryWidget/Item.cpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetRegisterInspector/RegisterHistoryWidget/Item.cpp index 34de0f28..56732ae2 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetRegisterInspector/RegisterHistoryWidget/Item.cpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetRegisterInspector/RegisterHistoryWidget/Item.cpp @@ -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); } diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetRegisterInspector/RegisterHistoryWidget/RegisterHistoryItem.cpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetRegisterInspector/RegisterHistoryWidget/RegisterHistoryItem.cpp index 79de3515..89aee5be 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetRegisterInspector/RegisterHistoryWidget/RegisterHistoryItem.cpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetRegisterInspector/RegisterHistoryWidget/RegisterHistoryItem.cpp @@ -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); } diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetRegisterInspector/RegisterHistoryWidget/RegisterHistoryWidget.cpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetRegisterInspector/RegisterHistoryWidget/RegisterHistoryWidget.cpp index fd471f5b..a2ea6465 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetRegisterInspector/RegisterHistoryWidget/RegisterHistoryWidget.cpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetRegisterInspector/RegisterHistoryWidget/RegisterHistoryWidget.cpp @@ -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); } diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetRegisterInspector/TargetRegisterInspectorWindow.cpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetRegisterInspector/TargetRegisterInspectorWindow.cpp index 8c2d47d7..e3662e31 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetRegisterInspector/TargetRegisterInspectorWindow.cpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetRegisterInspector/TargetRegisterInspectorWindow.cpp @@ -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", diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetRegistersPane/ItemWidget.cpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetRegistersPane/ItemWidget.cpp index 8a8483ea..b6e6e4aa 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetRegistersPane/ItemWidget.cpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetRegistersPane/ItemWidget.cpp @@ -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); } diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetRegistersPane/RegisterGroupWidget.cpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetRegistersPane/RegisterGroupWidget.cpp index ceb0f777..a9162d3c 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetRegistersPane/RegisterGroupWidget.cpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetRegistersPane/RegisterGroupWidget.cpp @@ -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, diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetRegistersPane/RegisterWidget.cpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetRegistersPane/RegisterWidget.cpp index 2319b020..cbcb1543 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetRegistersPane/RegisterWidget.cpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetRegistersPane/RegisterWidget.cpp @@ -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, diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetRegistersPane/TargetRegistersPaneWidget.cpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetRegistersPane/TargetRegistersPaneWidget.cpp index faa2123d..2e2bacf3 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetRegistersPane/TargetRegistersPaneWidget.cpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetRegistersPane/TargetRegistersPaneWidget.cpp @@ -51,15 +51,15 @@ TargetRegistersPaneWidget::TargetRegistersPaneWidget( this->toolBar->layout()->setContentsMargins(5, 0, 5, 0); this->searchInput = this->container->findChild("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::optionalconnect( + QObject::connect( readRegisterTask, &ReadTargetRegisters::targetRegistersRead, this, @@ -173,7 +173,7 @@ void TargetRegistersPaneWidget::refreshRegisterValues(std::optionalconnect( + QObject::connect( readRegisterTask, &InsightWorkerTask::completed, this, diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetRegistersPane/TargetRegistersPaneWidget.hpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetRegistersPane/TargetRegistersPaneWidget.hpp index aaca08cf..2df2d306 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetRegistersPane/TargetRegistersPaneWidget.hpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetRegistersPane/TargetRegistersPaneWidget.hpp @@ -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; diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetWidgets/TargetPackageWidget.cpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetWidgets/TargetPackageWidget.cpp index 1d7aea2d..b56104a6 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetWidgets/TargetPackageWidget.cpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetWidgets/TargetPackageWidget.cpp @@ -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> callback) { auto refreshTask = new RefreshTargetPinStates(this->targetVariant.id); - this->connect( + QObject::connect( refreshTask, &RefreshTargetPinStates::targetPinStatesRetrieved, this, @@ -41,7 +41,7 @@ void TargetPackageWidget::refreshPinStates(std::optionalconnect( + QObject::connect( refreshTask, &InsightWorkerTask::completed, this, diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetWidgets/TargetPinWidget.cpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetWidgets/TargetPinWidget.cpp index ac909dda..691ddcc5 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetWidgets/TargetPinWidget.cpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetWidgets/TargetPinWidget.cpp @@ -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); });