Tidied structure of all classes within the entire code base

Also some other small bits of tidying
This commit is contained in:
Nav
2021-10-06 21:12:31 +01:00
parent 1aef5bba79
commit 6edfb7376a
179 changed files with 3446 additions and 3493 deletions

View File

@@ -1,7 +1,6 @@
#include <QPainter>
#include "BodyWidget.hpp"
#include "src/Logger/Logger.hpp"
#include <QPainter>
using namespace Bloom::Widgets::InsightTargetWidgets::Qfp;

View File

@@ -6,18 +6,9 @@ namespace Bloom::Widgets::InsightTargetWidgets::Qfp
{
class BodyWidget: public QWidget
{
Q_OBJECT
Q_PROPERTY(QColor bodyColor READ getBodyColor WRITE setBodyColor DESIGNABLE true)
Q_PROPERTY(int disableAlphaLevel READ getDisableAlphaLevel WRITE setDisableAlphaLevel DESIGNABLE true)
private:
// These properties can be modified via Qt style sheets (see Stylesheets/QuadFlatPackage.qss)
QColor bodyColor = QColor("#8E8B83");
int disableAlphaLevel = 100;
protected:
void paintEvent(QPaintEvent* event) override;
void drawWidget(QPainter& painter);
Q_OBJECT
Q_PROPERTY(QColor bodyColor READ getBodyColor WRITE setBodyColor DESIGNABLE true)
Q_PROPERTY(int disableAlphaLevel READ getDisableAlphaLevel WRITE setDisableAlphaLevel DESIGNABLE true)
public:
explicit BodyWidget(QWidget* parent): QWidget(parent) {
@@ -39,5 +30,14 @@ namespace Bloom::Widgets::InsightTargetWidgets::Qfp
void setDisableAlphaLevel(int level) {
this->disableAlphaLevel = level;
}
protected:
void paintEvent(QPaintEvent* event) override;
void drawWidget(QPainter& painter);
private:
// These properties can be modified via Qt style sheets (see Stylesheets/QuadFlatPackage.qss)
QColor bodyColor = QColor("#8E8B83");
int disableAlphaLevel = 100;
};
}

View File

@@ -1,8 +1,8 @@
#include "PinBodyWidget.hpp"
#include <QPainter>
#include <QEvent>
#include "PinBodyWidget.hpp"
using namespace Bloom::Widgets::InsightTargetWidgets::Qfp;
using namespace Bloom::Targets;

View File

@@ -5,18 +5,14 @@
#include <utility>
#include "../TargetPinBodyWidget.hpp"
#include "src/Targets/TargetPinDescriptor.hpp"
namespace Bloom::Widgets::InsightTargetWidgets::Qfp
{
class PinBodyWidget: public TargetPinBodyWidget
{
private:
bool isVertical = false;
protected:
void paintEvent(QPaintEvent* event) override;
void drawWidget(QPainter& painter);
Q_OBJECT
public:
static const int WIDTH = 30;
@@ -33,5 +29,12 @@ namespace Bloom::Widgets::InsightTargetWidgets::Qfp
this->setFixedSize(PinBodyWidget::HEIGHT, PinBodyWidget::WIDTH);
}
}
protected:
void paintEvent(QPaintEvent* event) override;
void drawWidget(QPainter& painter);
private:
bool isVertical = false;
};
}

View File

@@ -6,7 +6,6 @@
#include "PinWidget.hpp"
#include "PinBodyWidget.hpp"
#include "src/Logger/Logger.hpp"
using namespace Bloom::Widgets::InsightTargetWidgets::Qfp;
using namespace Bloom::Targets;

View File

@@ -12,20 +12,7 @@ namespace Bloom::Widgets::InsightTargetWidgets::Qfp
{
class PinWidget: public TargetPinWidget
{
Q_OBJECT
private:
QBoxLayout* layout = nullptr;
QLabel* pinNumberLabel = nullptr;
QLabel* pinNameLabel = nullptr;
QLabel* pinDirectionLabel = nullptr;
PinBodyWidget* bodyWidget = nullptr;
bool isLeftLayout = false;
bool isBottomLayout = false;
bool isRightLayout = false;
bool isTopLayout = false;
void setLabelColor(const QString& hexColor);
Q_OBJECT
public:
static const int PIN_WIDGET_LAYOUT_PADDING = 46;
@@ -49,5 +36,19 @@ namespace Bloom::Widgets::InsightTargetWidgets::Qfp
);
void updatePinState(const Targets::TargetPinState& pinState) override;
private:
QBoxLayout* layout = nullptr;
QLabel* pinNumberLabel = nullptr;
QLabel* pinNameLabel = nullptr;
QLabel* pinDirectionLabel = nullptr;
PinBodyWidget* bodyWidget = nullptr;
bool isLeftLayout = false;
bool isBottomLayout = false;
bool isRightLayout = false;
bool isTopLayout = false;
void setLabelColor(const QString& hexColor);
};
}

View File

@@ -7,7 +7,6 @@
#include <QEvent>
#include <QFile>
#include "../../../InsightWindow.hpp"
#include "src/Helpers/Paths.hpp"
#include "PinWidget.hpp"
#include "BodyWidget.hpp"

View File

@@ -17,7 +17,15 @@ namespace Bloom::Widgets::InsightTargetWidgets::Qfp
*/
class QuadFlatPackageWidget: public TargetPackageWidget
{
Q_OBJECT
Q_OBJECT
public:
QuadFlatPackageWidget(
const Targets::TargetVariant& targetVariant,
InsightWorker& insightWorker,
QWidget* parent
);
private:
QVBoxLayout* layout = nullptr;
QHBoxLayout* horizontalLayout = nullptr;
@@ -26,12 +34,5 @@ namespace Bloom::Widgets::InsightTargetWidgets::Qfp
QHBoxLayout* bottomPinLayout = nullptr;
QVBoxLayout* leftPinLayout = nullptr;
BodyWidget* bodyWidget = nullptr;
public:
QuadFlatPackageWidget(
const Targets::TargetVariant& targetVariant,
InsightWorker& insightWorker,
QWidget* parent
);
};
}