Removed all using declarations and directives from header files
This commit is contained in:
@@ -1,16 +1,14 @@
|
||||
#include <QPainter>
|
||||
#include <QLayout>
|
||||
#include <cmath>
|
||||
#include <QEvent>
|
||||
#include <QMenu>
|
||||
#include <QContextMenuEvent>
|
||||
|
||||
#include "PinBodyWidget.hpp"
|
||||
#include "src/Logger/Logger.hpp"
|
||||
#include "src/Exceptions/Exception.hpp"
|
||||
|
||||
using namespace Bloom::InsightTargetWidgets::Qfp;
|
||||
using namespace Bloom::Exceptions;
|
||||
using namespace Bloom::Targets;
|
||||
|
||||
void PinBodyWidget::paintEvent(QPaintEvent* event) {
|
||||
auto painter = QPainter(this);
|
||||
|
||||
@@ -7,10 +7,6 @@
|
||||
|
||||
namespace Bloom::InsightTargetWidgets::Qfp
|
||||
{
|
||||
using Targets::TargetPinDescriptor;
|
||||
using Targets::TargetPinType;
|
||||
using Targets::TargetPinState;
|
||||
|
||||
class PinBodyWidget: public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
@@ -18,8 +14,8 @@ namespace Bloom::InsightTargetWidgets::Qfp
|
||||
Q_PROPERTY(int disableAlphaLevel READ getDisableAlphaLevel WRITE setDisableAlphaLevel DESIGNABLE true)
|
||||
|
||||
private:
|
||||
TargetPinDescriptor pinDescriptor;
|
||||
std::optional<TargetPinState> pinState;
|
||||
Targets::TargetPinDescriptor pinDescriptor;
|
||||
std::optional<Targets::TargetPinState> pinState;
|
||||
QColor bodyColor = QColor("#AFB1B3");
|
||||
int disableAlphaLevel = 100;
|
||||
bool isVertical = false;
|
||||
@@ -42,7 +38,7 @@ namespace Bloom::InsightTargetWidgets::Qfp
|
||||
static const int WIDTH = 30;
|
||||
static const int HEIGHT = 40;
|
||||
|
||||
PinBodyWidget(QWidget* parent, const TargetPinDescriptor& pinDescriptor, bool isVertical):
|
||||
PinBodyWidget(QWidget* parent, const Targets::TargetPinDescriptor& pinDescriptor, bool isVertical):
|
||||
QWidget(parent), pinDescriptor(pinDescriptor), isVertical(isVertical) {
|
||||
this->setObjectName("target-pin-body");
|
||||
|
||||
@@ -54,7 +50,7 @@ namespace Bloom::InsightTargetWidgets::Qfp
|
||||
}
|
||||
}
|
||||
|
||||
void setPinState(const TargetPinState& pinState) {
|
||||
void setPinState(const Targets::TargetPinState& pinState) {
|
||||
this->pinState = pinState;
|
||||
}
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
#include "src/Logger/Logger.hpp"
|
||||
|
||||
using namespace Bloom::InsightTargetWidgets::Qfp;
|
||||
using namespace Bloom::Targets;
|
||||
|
||||
PinWidget::PinWidget(QWidget* parent, const TargetPinDescriptor& pinDescriptor, const TargetVariant& targetVariant):
|
||||
TargetPinWidget(parent, pinDescriptor, targetVariant) {
|
||||
|
||||
@@ -41,19 +41,26 @@ namespace Bloom::InsightTargetWidgets::Qfp
|
||||
static const int LABEL_HEIGHT = 20;
|
||||
static const int MAXIMUM_LABEL_WIDTH = PinBodyWidget::WIDTH;
|
||||
static const int MAXIMUM_LABEL_HEIGHT = 20;
|
||||
static const int MAXIMUM_HORIZONTAL_WIDTH = PinBodyWidget::HEIGHT + (PinWidget::MAXIMUM_LABEL_WIDTH * PinWidget::MAXIMUM_LABEL_COUNT);
|
||||
static const int MAXIMUM_HORIZONTAL_WIDTH = PinBodyWidget::HEIGHT
|
||||
+ (PinWidget::MAXIMUM_LABEL_WIDTH * PinWidget::MAXIMUM_LABEL_COUNT);
|
||||
static const int MAXIMUM_HORIZONTAL_HEIGHT = PinBodyWidget::WIDTH;
|
||||
static const int MAXIMUM_VERTICAL_HEIGHT = PinBodyWidget::HEIGHT + (PinWidget::MAXIMUM_LABEL_HEIGHT * PinWidget::MAXIMUM_LABEL_COUNT);
|
||||
static const int MAXIMUM_VERTICAL_HEIGHT = PinBodyWidget::HEIGHT
|
||||
+ (PinWidget::MAXIMUM_LABEL_HEIGHT * PinWidget::MAXIMUM_LABEL_COUNT);
|
||||
static const int MAXIMUM_VERTICAL_WIDTH = PinBodyWidget::WIDTH;
|
||||
|
||||
PinWidget(QWidget* parent, const TargetPinDescriptor& pinDescriptor, const TargetVariant& targetVariant);
|
||||
PinWidget(
|
||||
QWidget* parent,
|
||||
const Targets::TargetPinDescriptor& pinDescriptor,
|
||||
const Targets::TargetVariant& targetVariant
|
||||
);
|
||||
|
||||
virtual void updatePinState(const TargetPinState& pinState) override {
|
||||
virtual void updatePinState(const Targets::TargetPinState& pinState) override {
|
||||
TargetPinWidget::updatePinState(pinState);
|
||||
|
||||
if (pinState.ioDirection.has_value()) {
|
||||
this->pinDirectionLabel->setText(pinState.ioDirection.value() == TargetPinState::IoDirection::INPUT ?
|
||||
"IN" : "OUT");
|
||||
this->pinDirectionLabel->setText(
|
||||
pinState.ioDirection.value() == Targets::TargetPinState::IoDirection::INPUT ? "IN" : "OUT"
|
||||
);
|
||||
|
||||
} else {
|
||||
this->pinDirectionLabel->setText("");
|
||||
|
||||
@@ -7,16 +7,17 @@
|
||||
|
||||
#include "../../InsightWindow.hpp"
|
||||
#include "QuadFlatPackageWidget.hpp"
|
||||
#include "src/Logger/Logger.hpp"
|
||||
#include "src/Exceptions/Exception.hpp"
|
||||
#include "PinWidget.hpp"
|
||||
#include "BodyWidget.hpp"
|
||||
|
||||
using namespace Bloom::InsightTargetWidgets::Qfp;
|
||||
using namespace Bloom::Exceptions;
|
||||
using namespace Bloom::Targets;
|
||||
|
||||
QuadFlatPackageWidget::QuadFlatPackageWidget(const TargetVariant& targetVariant, QObject* insightWindowObj, QWidget* parent):
|
||||
TargetPackageWidget(targetVariant, insightWindowObj, parent) {
|
||||
QuadFlatPackageWidget::QuadFlatPackageWidget(
|
||||
const TargetVariant& targetVariant,
|
||||
QObject* insightWindowObj,
|
||||
QWidget* parent
|
||||
): TargetPackageWidget(targetVariant, insightWindowObj, parent) {
|
||||
assert((targetVariant.pinDescriptorsByNumber.size() % 4) == 0);
|
||||
|
||||
auto stylesheetFile = QFile(":/compiled/Insight/UserInterfaces/InsightWindow/TargetWidgets/QFP/Stylesheets/QuadFlatPackage.qss");
|
||||
@@ -212,4 +213,3 @@ void QuadFlatPackageWidget::drawWidget(QPainter& painter) {
|
||||
containerHeight
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -12,8 +12,6 @@
|
||||
|
||||
namespace Bloom::InsightTargetWidgets::Qfp
|
||||
{
|
||||
using Targets::TargetVariant;
|
||||
|
||||
/**
|
||||
* QuadFlatPackageWidget implements a custom Qt widget for Quad-flat package variants.
|
||||
*/
|
||||
@@ -36,6 +34,6 @@ namespace Bloom::InsightTargetWidgets::Qfp
|
||||
public:
|
||||
static const int PIN_WIDGET_LAYOUT_PADDING = 46;
|
||||
static const int PIN_WIDGET_SPACING = 8;
|
||||
QuadFlatPackageWidget(const TargetVariant& targetVariant, QObject* insightWindowObj, QWidget* parent);
|
||||
QuadFlatPackageWidget(const Targets::TargetVariant& targetVariant, QObject* insightWindowObj, QWidget* parent);
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user