Added ghost image for gate placement
This commit is contained in:
parent
e81622f8f3
commit
edf6a0ad2b
11 changed files with 198 additions and 28 deletions
|
@ -10,6 +10,9 @@ class Component : public QFrame
|
|||
{
|
||||
public:
|
||||
explicit Component(QWidget* parent);
|
||||
explicit Component(QWidget* parent, const QString& resource);
|
||||
|
||||
void mouseMoveEvent(QMouseEvent* event) override;
|
||||
|
||||
private:
|
||||
Ui::Component* ui;
|
||||
|
|
19
include/GhostLabel.hpp
Normal file
19
include/GhostLabel.hpp
Normal file
|
@ -0,0 +1,19 @@
|
|||
#pragma once
|
||||
|
||||
#include <qlabel.h>
|
||||
|
||||
class GhostLabel : public QLabel
|
||||
{
|
||||
public:
|
||||
explicit GhostLabel(QWidget* parent) :
|
||||
QLabel(parent)
|
||||
{
|
||||
setMouseTracking(true);
|
||||
}
|
||||
|
||||
void mouseMoveEvent(QMouseEvent* event) override
|
||||
{
|
||||
// Ignore all mouse move events, who cares tbh
|
||||
event->ignore();
|
||||
}
|
||||
};
|
|
@ -7,6 +7,8 @@ namespace Ui {
|
|||
}
|
||||
|
||||
class Component;
|
||||
class QActionGroup;
|
||||
class GhostLabel;
|
||||
|
||||
class Window : public QMainWindow
|
||||
{
|
||||
|
@ -21,6 +23,8 @@ protected:
|
|||
|
||||
private:
|
||||
void ToggleSimulation();
|
||||
void ToggleComponentPlacer();
|
||||
void LoadGhostLabel(const QString& resource);
|
||||
|
||||
Ui::Window* ui;
|
||||
bool simulating;
|
||||
|
@ -29,4 +33,8 @@ private:
|
|||
Component* component;
|
||||
QPoint relativePos;
|
||||
} dragInfo;
|
||||
|
||||
GhostLabel* ghostImage;
|
||||
QString resourcePath;
|
||||
QActionGroup* componentGroup;
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue