added more cpp files for faster compile speeds

removed many obsolte elements
many improvements and fixes
This commit is contained in:
2018-07-20 15:00:43 +02:00
parent 7ee4e122e8
commit 5d002c3f2b
43 changed files with 1257 additions and 1361 deletions

View File

@@ -42,36 +42,29 @@ public:
return;
}
static const QPixmap& pixmapUnfocused = UIHelper::getPixmapColored("gtp", CFG::UNFOCUS_COLOR, 16);
static const QPixmap& pixmapFocused = UIHelper::getPixmapColored("gtp", CFG::FOCUS_COLOR, 16);
static const QPixmap& pixmapSel = UIHelper::getPixmapColored("gtp", CFG::SEL_COLOR, 16);
static const QPixmap& pixmapUnfocused = UIHelper::getPixmapColored("gtp", CFG::UNFOCUS_COLOR, 16);
static const QPixmap& pixmapFocused = UIHelper::getPixmapColored("gtp", CFG::FOCUS_COLOR, 16);
static const QPixmap& pixmapSel = UIHelper::getPixmapColored("gtp", CFG::SEL_COLOR, 16);
if (selectedUserIdx == 0) {
p.drawPixmap(gtp->pos.xy(), pixmapSel);
} else if (hasFocus()) {
p.drawPixmap(gtp->pos.xy(), pixmapFocused);
} else {
p.drawPixmap(gtp->pos.xy(), pixmapUnfocused);
}
if (selectedUserIdx == 0) {
// p.setPenBrush(Qt::black, CFG::SEL_COLOR);
// p.drawCircle(gtp->pos);
p.drawPixmap(gtp->pos.xy(), pixmapSel);
} else if (hasFocus()) {
// p.setPenBrush(Qt::black, Qt::NoBrush);
// p.drawCircle(gtp->pos);
p.drawPixmap(gtp->pos.xy(), pixmapFocused);
} else {
// p.setPenBrush(Qt::gray, Qt::NoBrush);
// p.drawCircle(gtp->pos);
p.drawPixmap(gtp->pos.xy(), pixmapUnfocused);
}
// label
p.setPenBrush(Qt::black, Qt::NoBrush);
p.drawDot(gtp->pos.xy());
if (p.getScaler().getScale() >= 10) {
const std::string str = std::to_string(gtp->id);
p.p->drawText(p.getScaler().xms(gtp->pos.x) + 10, p.getScaler().yms(gtp->pos.y) + 5, str.c_str());
}
// label
//p.setPenBrush(Qt::black, Qt::NoBrush);
//p.drawDot(gtp->pos.xy());
if (p.getScaler().getScale() >= 12) {
p.setPenBrush(Qt::black, Qt::NoBrush);
const std::string str = std::to_string(gtp->id);
p.p->drawText(p.getScaler().xms(gtp->pos.x) + 10, p.getScaler().yms(gtp->pos.y) + 5, str.c_str());
}
}
virtual std::vector<MoveableNode> getMoveableNodes() const override {
return { MoveableNode(0, gtp->pos.xy()) };
}
@@ -87,30 +80,6 @@ public:
emit v->onElementChange(this);
}
/** mouse pressed at the given point */
virtual void mousePressed(MapView2D* v, const Point2 p) override {
(void) v;
(void) p;
}
/** mouse moved to the given point */
virtual void mouseMove(MapView2D* v, const Point2 p) override {
(void) v;
(void) p;
}
/** mouse released */
virtual void mouseReleased(MapView2D* v, const Point2 p) override {
(void) v;
(void) p;
}
virtual bool keyPressEvent(MapView2D* v, QKeyEvent *e) override {
(void) v;
(void) e;
return false;
}
virtual void onFocus() override {
;
}