diff --git a/src/Component.cpp b/src/Component.cpp index e70a95a..575b555 100644 --- a/src/Component.cpp +++ b/src/Component.cpp @@ -16,9 +16,7 @@ Component::Component(QWidget* parent, const QString& resource) : ui = new Ui::Component(); ui->setupUi(this); - ui->label->setPixmap(QPixmap(":/components/and.png")); - - std::cout << "Created Component --" << ui->label->pos().x() << ", " << ui->label->pos().y() << std::endl; + ui->label->setPixmap(QPixmap(resource)); } void Component::mouseMoveEvent(QMouseEvent* event) diff --git a/src/Window.cpp b/src/Window.cpp index 5fe28eb..29f6cba 100644 --- a/src/Window.cpp +++ b/src/Window.cpp @@ -62,17 +62,13 @@ void Window::mousePressEvent(QMouseEvent* event) if (child != nullptr) return; - // So Qt can't add widgets outside of the constructor apparently - // So component cannot be a QFrame, it will have to become just a normal object - // And I need one of these open gl gsjdööööööööööööööl< // TODO: I'll just let this leak for now, I just wanna eat dinner... Component* leak = new Component(this, resourcePath); QPoint pos = event->pos() - QPoint {50, 25}; - leak->setGeometry(QRect(280, 160, 100, 50)); - leak->setFrameShape(QFrame::StyledPanel); - leak->setFrameShadow(QFrame::Raised); - - std::cout << leak->pos().x() << ", " << leak->pos().y() << std::endl; + leak->setGeometry(QRect(pos.x(), pos.y(), 100, 50)); + leak->setFrameShape(QFrame::NoFrame); + leak->setFrameShadow(QFrame::Plain); + leak->setVisible(true); } } @@ -118,6 +114,7 @@ void Window::LoadGhostLabel(const QString& resource) ghostImage = new GhostLabel(this); ghostImage->setGeometry({ 0, 0, 100, 50 }); ghostImage->setScaledContents(true); + ghostImage->setVisible(true); } QPainter p; diff --git a/ui/Window.ui b/ui/Window.ui index 25b9628..46d567b 100644 --- a/ui/Window.ui +++ b/ui/Window.ui @@ -16,24 +16,7 @@ QMainWindow::AnimatedDocks - - - - - 360 - 180 - 120 - 80 - - - - QFrame::StyledPanel - - - QFrame::Raised - - - + @@ -106,14 +89,6 @@ - - - Component - QFrame -
Component.hpp
- 1 -
-