diff --git a/cropeditor/cropscene.cpp b/cropeditor/cropscene.cpp index fc5a526..3e69c56 100644 --- a/cropeditor/cropscene.cpp +++ b/cropeditor/cropscene.cpp @@ -21,7 +21,7 @@ #include CropScene::CropScene(QObject *parent, QPixmap pixmap) -: QGraphicsScene(parent), drawingSelectionMaker([] { return nullptr; }), prevButtons(Qt::NoButton), +: QGraphicsScene(parent), cursorPos(0, 0), drawingSelectionMaker([] { return nullptr; }), prevButtons(Qt::NoButton), _brush(Qt::SolidPattern), _font(settings::settings().value("font", QFont()).value()) { _pixmap = pixmap; pen().setColor(settings::settings().value("penColor", pen().color()).value()); @@ -64,13 +64,23 @@ CropScene::CropScene(QObject *parent, QPixmap pixmap) show(); }); menu.addAction(settings); + QPolygonF cursorPoly; + cursorPoly << QPoint(-10, 0) // + << QPoint(10, 0) // + << QPoint(0, 0) // + << QPoint(0, 10) // + << QPoint(0, -10) // + << QPoint(0, 0); - magnifier = addPixmap(pixmap.copy(0, 0, 11, 11).scaled(110, 110)); + cursorItem = addPolygon(cursorPoly, QPen(Qt::white)); + cursorItem->setZValue(3); + + magnifier = addPixmap(QPixmap(110, 110)); magnifierBox = addRect(magnifier->boundingRect(), QPen(Qt::cyan)); - magnifier->setZValue(1); + magnifier->setZValue(3); magnifierBox->setZValue(1.1); magnifierBox->setParentItem(magnifier); - magnifierHint = addText("ptr: (0, 0)\nsel: (0, 0, 0, 0)"); + magnifierHint = addText("ptr: (0, 0)\nsel: (-1, -1, 0, 0)"); magnifierHint->setParentItem(magnifier); magnifierHint->setY(magnifier->boundingRect().height()); QColor c(Qt::cyan); @@ -80,20 +90,25 @@ CropScene::CropScene(QObject *parent, QPixmap pixmap) magnifierHintBox->setZValue(1); magnifierHint->setZValue(1.1); initMagnifierGrid(); - updateMag(QPointF(0, 0)); + updateMag(); connect(menu.addAction("Set Font"), &QAction::triggered, this, &CropScene::fontAsk); + QPolygonF poly; + QRect prect = pixmap.rect(); + poly.append(prect.topLeft()); + poly.append(prect.topRight()); + poly.append(prect.bottomRight()); + poly.append(prect.bottomLeft()); + polyItem = new QGraphicsPolygonItem(poly); + polyItem->setBrush(QBrush(QColor(0, 0, 0, 191))); + polyItem->setPen(QPen(Qt::NoPen)); + addItem(polyItem); QTimer::singleShot(0, [&] { - QPolygonF poly; - poly.append(sceneRect().topLeft()); - poly.append(sceneRect().topRight()); - poly.append(sceneRect().bottomRight()); - poly.append(sceneRect().bottomLeft()); - polyItem = new QGraphicsPolygonItem(poly); - polyItem->setBrush(QBrush(QColor(0, 0, 0, 191))); - polyItem->setPen(QPen(Qt::NoPen)); - addItem(polyItem); + auto pf = views()[0]->mapFromGlobal(QCursor::pos()); + cursorPos = QPoint(pf.x(), pf.y()); + cursorItem->setPos(cursorPos); + updateMag(); }); } @@ -147,14 +162,20 @@ void CropScene::fontAsk() { } void CropScene::mouseMoveEvent(QGraphicsSceneMouseEvent *e) { - updateMag(e->scenePos()); + QPointF delta = e->scenePos() - cursorPos; + if (e->modifiers() & Qt::ShiftModifier) { + cursorPos += delta / 2; + QCursor::setPos(views()[0]->mapToGlobal(cursorPos.toPoint())); + } else + cursorPos = e->scenePos(); + cursorItem->setPos(cursorPos); + updateMag(); auto buttons = e->buttons(); if (e->modifiers() & Qt::ControlModifier && buttons == Qt::LeftButton) { QTransform stupidThing = views()[0]->transform(); - auto item = itemAt(e->scenePos(), stupidThing); + auto item = itemAt(cursorPos, stupidThing); if (item && item != polyItem && item != rect && item->zValue() != -1) { - QPointF delta = e->scenePos() - e->lastScenePos(); item->moveBy(delta.x(), delta.y()); } return; @@ -163,14 +184,14 @@ void CropScene::mouseMoveEvent(QGraphicsSceneMouseEvent *e) { if (drawingSelection) { drawingSelection->mouseDragEvent(e, this); } else { - QPointF p = e->scenePos(); + QPointF p = cursorPos; if (rect == nullptr) { rect = new QGraphicsRectItem(p.x(), p.y(), 1, 1); initPos = p; QPen pen(Qt::NoBrush, 1); pen.setColor(Qt::cyan); rect->setPen(pen); - rect->setZValue(-0.1); + rect->setZValue(1); addItem(rect); } else { if (prevButtons == Qt::NoButton) { @@ -218,7 +239,7 @@ void CropScene::mouseReleaseEvent(QGraphicsSceneMouseEvent *e) { void CropScene::mousePressEvent(QGraphicsSceneMouseEvent *e) { if (e->modifiers() & Qt::AltModifier) { QTransform stupidThing = views()[0]->transform(); - auto item = itemAt(e->scenePos(), stupidThing); + auto item = itemAt(cursorPos, stupidThing); if (item && item != polyItem && item != rect && item->zValue() != -1) { removeItem(item); } @@ -240,7 +261,7 @@ void CropScene::wheelEvent(QGraphicsSceneWheelEvent *event) { gridRectsY.clear(); initMagnifierGrid(); - updateMag(event->scenePos()); + updateMag(); } void CropScene::addDrawingAction(QMenu &menu, QString name, std::function item) { @@ -250,30 +271,32 @@ void CropScene::addDrawingAction(QMenu &menu, QString name, std::functionsetText(drawingName); - menu.exec(e->screenPos()); + menu.exec((cursorPos + contextOffset).toPoint()); e->accept(); } void CropScene::keyReleaseEvent(QKeyEvent *event) { - if (event->key() == Qt::Key_Return || event->key() == Qt::Key_Enter || event->key() == Qt::Key_Escape) + if (((event->key() == Qt::Key_Return || event->key() == Qt::Key_Enter) && !drawingSelection) || event->key() == Qt::Key_Escape) done(event->key() != Qt::Key_Escape); } -void CropScene::updateMag(QPointF scenePos) { - QString rectStr("(0, 0, 0, 0)"); +void CropScene::updateMag() { + QString rectStr("(-1, -1, 0, 0)"); if (rect) { rectStr = "(%0, %1, %2, %3)"; rectStr = rectStr.arg(rect->rect().x()).arg(rect->rect().y()).arg(rect->rect().width()).arg(rect->rect().height()); } - magnifierHint->setPlainText(QString("ptr: (%0, %1)\nsel: %2").arg(scenePos.x()).arg(scenePos.y()).arg(rectStr)); + magnifierHint->setPlainText(QString("ptr: (%0, %1)\nsel: %2").arg(qRound(cursorPos.x())).arg(qRound(cursorPos.y())).arg(rectStr)); magnifierHintBox->setRect(magnifierHint->boundingRect()); int pixCnt = settings::settings().value("magnifierPixelCount", 11).toInt(); if (pixCnt % 2 == 0) pixCnt++; - QPointF magnifierTopLeft = scenePos - QPointF(pixCnt / 2., pixCnt / 2.); - QPointF magnifierPos = scenePos + QPointF(5, 5); + QPointF magnifierTopLeft = cursorPos - QPointF(pixCnt / 2., pixCnt / 2.); + QPointF magnifierPos = cursorPos + QPointF(5, 5); magnifier->setPos(magnifierPos); magnifier->setPixmap(_pixmap.copy(magnifierTopLeft.x(), magnifierTopLeft.y(), pixCnt, pixCnt).scaled(110, 110)); @@ -316,6 +339,7 @@ void CropScene::done(bool notEsc) { if (notEsc && rect) { rect->setPen(QPen(Qt::NoPen)); magnifier->setVisible(false); + cursorItem->setVisible(false); magnifierBox->setVisible(false); magnifierHint->setVisible(false); magnifierHintBox->setVisible(false); diff --git a/cropeditor/cropscene.hpp b/cropeditor/cropscene.hpp index 0f93daa..d2dcfd4 100644 --- a/cropeditor/cropscene.hpp +++ b/cropeditor/cropscene.hpp @@ -34,6 +34,9 @@ public: void hide(); void show(); void setVisible(bool visible); + QPointF cursorPosition() { + return cursorPos; + } public slots: void fontAsk(); @@ -47,15 +50,15 @@ protected: void mousePressEvent(QGraphicsSceneMouseEvent *e) override; void wheelEvent(QGraphicsSceneWheelEvent *event) override; // WHEEEEEEL void contextMenuEvent(QGraphicsSceneContextMenuEvent *e) override; - void keyReleaseEvent(QKeyEvent *e) override; private: - void updateMag(QPointF scenePos); + void updateMag(); void initMagnifierGrid(); void addDrawingAction(QMenu &menu, QString name, std::function item); void done(bool notEsc); bool fullscreen; + QPointF cursorPos; std::function drawingSelectionMaker; QFlags prevButtons; QPixmap _pixmap; @@ -75,6 +78,7 @@ private: QAction *display; QList gridRectsX; QList gridRectsY; + QGraphicsPolygonItem *cursorItem = nullptr; }; #endif // CROPSCENE_HPP diff --git a/cropeditor/cropview.cpp b/cropeditor/cropview.cpp index c4599c3..03e34f2 100644 --- a/cropeditor/cropview.cpp +++ b/cropeditor/cropview.cpp @@ -9,4 +9,5 @@ CropView::CropView(QGraphicsScene *scene) : QGraphicsView(scene) { setCursor(QCursor(Qt::CrossCursor)); setMouseTracking(true); setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed)); + setCursor(Qt::BlankCursor); } diff --git a/cropeditor/drawing/arrowitem.cpp b/cropeditor/drawing/arrowitem.cpp index e1558e4..c7b31f6 100644 --- a/cropeditor/drawing/arrowitem.cpp +++ b/cropeditor/drawing/arrowitem.cpp @@ -2,9 +2,9 @@ #include #include -void ArrowItem::mouseDragEvent(QGraphicsSceneMouseEvent *e, CropScene *scene) { +void ArrowItem::mouseDragEvent(QGraphicsSceneMouseEvent *, CropScene *scene) { if (init.isNull()) { - init = e->scenePos(); + init = scene->cursorPosition(); line = scene->addLine(QLineF(init, init), scene->pen()); QPainterPath poly; qreal w = settings::settings().value("arrow/width", 20).toDouble() / 2; @@ -14,8 +14,9 @@ void ArrowItem::mouseDragEvent(QGraphicsSceneMouseEvent *e, CropScene *scene) { poly.lineTo(QPoint(w, h)); head = scene->addPath(poly, scene->pen(), scene->brush()); } else { - line->setLine(QLineF(init, e->scenePos())); - head->setRotation(270 + qRadiansToDegrees(qAtan2((init.y() - e->scenePos().y()), (init.x() - e->scenePos().x())))); + line->setLine(QLineF(init, scene->cursorPosition())); + head->setRotation( + 270 + qRadiansToDegrees(qAtan2((init.y() - scene->cursorPosition().y()), (init.x() - scene->cursorPosition().x())))); } - head->setPos(e->scenePos()); + head->setPos(scene->cursorPosition()); } diff --git a/cropeditor/drawing/arrowitem.hpp b/cropeditor/drawing/arrowitem.hpp index 13050f1..c43be3f 100644 --- a/cropeditor/drawing/arrowitem.hpp +++ b/cropeditor/drawing/arrowitem.hpp @@ -11,7 +11,7 @@ public: QString name() override { return "Arrow"; } - void mouseDragEvent(QGraphicsSceneMouseEvent *e, CropScene *scene) override; + void mouseDragEvent(QGraphicsSceneMouseEvent *, CropScene *scene) override; void mouseDragEndEvent(QGraphicsSceneMouseEvent *, CropScene *) override { } diff --git a/cropeditor/drawing/bluritem.cpp b/cropeditor/drawing/bluritem.cpp index aa2b2a8..23005f1 100644 --- a/cropeditor/drawing/bluritem.cpp +++ b/cropeditor/drawing/bluritem.cpp @@ -13,16 +13,16 @@ bool BlurItem::init(CropScene *) { return true; } -void BlurItem::mouseDragEvent(QGraphicsSceneMouseEvent *e, CropScene *scene) { +void BlurItem::mouseDragEvent(QGraphicsSceneMouseEvent *, CropScene *scene) { if (pos.isNull()) { - pos = e->scenePos(); - rect = scene->addRect(QRect(e->scenePos().toPoint(), QSize(1, 1)), QPen(Qt::cyan), Qt::NoBrush); + pos = scene->cursorPosition(); + rect = scene->addRect(QRect(scene->cursorPosition().toPoint(), QSize(1, 1)), QPen(Qt::cyan), Qt::NoBrush); pixmap = scene->addPixmap(scene->pixmap().copy(rect->rect().toRect())); - pixmap->setPos(e->scenePos()); + pixmap->setPos(scene->cursorPosition()); pixmap->setZValue(rect->zValue() - 0.1); pixmap->setGraphicsEffect(effect); } else { - QPointF p = e->scenePos(); + QPointF p = scene->cursorPosition(); rect->setRect(QRect(qMin(pos.x(), p.x()), qMin(pos.y(), p.y()), qAbs(pos.x() - p.x()), qAbs(pos.y() - p.y()))); pixmap->setPixmap(scene->pixmap().copy(rect->rect().toRect())); pixmap->setPos(rect->rect().topLeft()); diff --git a/cropeditor/drawing/bluritem.hpp b/cropeditor/drawing/bluritem.hpp index c95229a..bfff86f 100644 --- a/cropeditor/drawing/bluritem.hpp +++ b/cropeditor/drawing/bluritem.hpp @@ -14,7 +14,7 @@ public: } bool init(CropScene *) override; - void mouseDragEvent(QGraphicsSceneMouseEvent *e, CropScene *scene) override; + void mouseDragEvent(QGraphicsSceneMouseEvent *, CropScene *scene) override; void mouseDragEndEvent(QGraphicsSceneMouseEvent *, CropScene *) override; private: diff --git a/cropeditor/drawing/dotitem.cpp b/cropeditor/drawing/dotitem.cpp index e6af596..8eaea94 100644 --- a/cropeditor/drawing/dotitem.cpp +++ b/cropeditor/drawing/dotitem.cpp @@ -7,7 +7,7 @@ DotItem::~DotItem() { } void DotItem::mouseDragEvent(QGraphicsSceneMouseEvent *e, CropScene *scene) { - scene->addEllipse(e->pos().x() - 1.5, e->pos().y() - 1.5, 3, 3, scene->pen(), scene->brush())->setPos(e->scenePos()); + scene->addEllipse(e->pos().x() - 1.5, e->pos().y() - 1.5, 3, 3, scene->pen(), scene->brush())->setPos(scene->cursorPosition()); } void DotItem::mouseDragEndEvent(QGraphicsSceneMouseEvent *, CropScene *) { diff --git a/cropeditor/drawing/ellipseitem.cpp b/cropeditor/drawing/ellipseitem.cpp index ff1cfce..e21257c 100644 --- a/cropeditor/drawing/ellipseitem.cpp +++ b/cropeditor/drawing/ellipseitem.cpp @@ -1,11 +1,11 @@ #include "ellipseitem.hpp" -void EllipseItem::mouseDragEvent(QGraphicsSceneMouseEvent *e, CropScene *scene) { +void EllipseItem::mouseDragEvent(QGraphicsSceneMouseEvent *, CropScene *scene) { if (!ellie) { - ellie = scene->addEllipse(e->scenePos().x(), e->scenePos().y(), 0, 0, scene->pen(), scene->brush()); - initPos = e->scenePos(); + ellie = scene->addEllipse(scene->cursorPosition().x(), scene->cursorPosition().y(), 0, 0, scene->pen(), scene->brush()); + initPos = scene->cursorPosition(); } else { - auto p = e->scenePos(); + auto p = scene->cursorPosition(); ellie->setRect(QRectF(qMin(initPos.x(), p.x()), qMin(initPos.y(), p.y()), qAbs(initPos.x() - p.x()), qAbs(initPos.y() - p.y()))); } diff --git a/cropeditor/drawing/ellipseitem.hpp b/cropeditor/drawing/ellipseitem.hpp index 116da7c..0169d74 100644 --- a/cropeditor/drawing/ellipseitem.hpp +++ b/cropeditor/drawing/ellipseitem.hpp @@ -12,7 +12,7 @@ public: } ~EllipseItem() { } - void mouseDragEvent(QGraphicsSceneMouseEvent *e, CropScene *scene) override; + void mouseDragEvent(QGraphicsSceneMouseEvent *, CropScene *scene) override; void mouseDragEndEvent(QGraphicsSceneMouseEvent *, CropScene *) override { } diff --git a/cropeditor/drawing/eraseritem.cpp b/cropeditor/drawing/eraseritem.cpp index 0d3a53c..89c8c56 100644 --- a/cropeditor/drawing/eraseritem.cpp +++ b/cropeditor/drawing/eraseritem.cpp @@ -6,9 +6,9 @@ EraserItem::EraserItem() { EraserItem::~EraserItem() { } -void EraserItem::mouseDragEvent(QGraphicsSceneMouseEvent *e, CropScene *scene) { +void EraserItem::mouseDragEvent(QGraphicsSceneMouseEvent *, CropScene *scene) { for (auto i : scene->items()) { - if (i->contains(e->scenePos()) && i->zValue() != -1 && i != scene->polyItm() && i != scene->selRect()) { + if (i->contains(scene->cursorPosition()) && i->zValue() != -1 && i != scene->polyItm() && i != scene->selRect()) { scene->removeItem(i); break; } diff --git a/cropeditor/drawing/eraseritem.hpp b/cropeditor/drawing/eraseritem.hpp index 078cd2d..9184629 100644 --- a/cropeditor/drawing/eraseritem.hpp +++ b/cropeditor/drawing/eraseritem.hpp @@ -10,7 +10,7 @@ public: QString name() override { return "Eraser"; } - void mouseDragEvent(QGraphicsSceneMouseEvent *e, CropScene *scene) override; + void mouseDragEvent(QGraphicsSceneMouseEvent *, CropScene *scene) override; void mouseDragEndEvent(QGraphicsSceneMouseEvent *, CropScene *) override { } }; diff --git a/cropeditor/drawing/lineitem.cpp b/cropeditor/drawing/lineitem.cpp index 563ce3f..a8efb58 100644 --- a/cropeditor/drawing/lineitem.cpp +++ b/cropeditor/drawing/lineitem.cpp @@ -3,12 +3,12 @@ LineItem::LineItem() { } -void LineItem::mouseDragEvent(QGraphicsSceneMouseEvent *e, CropScene *scene) { +void LineItem::mouseDragEvent(QGraphicsSceneMouseEvent *, CropScene *scene) { if (init.isNull()) { - init = e->scenePos(); + init = scene->cursorPosition(); line = scene->addLine(QLineF(init, init), scene->pen()); } else { - line->setLine(QLineF(init, e->scenePos())); + line->setLine(QLineF(init, scene->cursorPosition())); } } diff --git a/cropeditor/drawing/lineitem.hpp b/cropeditor/drawing/lineitem.hpp index c72edd8..a6f59fe 100644 --- a/cropeditor/drawing/lineitem.hpp +++ b/cropeditor/drawing/lineitem.hpp @@ -9,7 +9,7 @@ public: QString name() override { return "Straight line"; } - void mouseDragEvent(QGraphicsSceneMouseEvent *e, CropScene *scene) override; + void mouseDragEvent(QGraphicsSceneMouseEvent *, CropScene *scene) override; void mouseDragEndEvent(QGraphicsSceneMouseEvent *, CropScene *) override; private: diff --git a/cropeditor/drawing/pathitem.cpp b/cropeditor/drawing/pathitem.cpp index 9bc15b7..b4d8b7c 100644 --- a/cropeditor/drawing/pathitem.cpp +++ b/cropeditor/drawing/pathitem.cpp @@ -9,13 +9,13 @@ PathItem::~PathItem() { delete path; } -void PathItem::mouseDragEvent(QGraphicsSceneMouseEvent *e, CropScene *scene) { +void PathItem::mouseDragEvent(QGraphicsSceneMouseEvent *, CropScene *scene) { if (path == nullptr) { - path = new QPainterPath(e->scenePos()); + path = new QPainterPath(scene->cursorPosition()); pathItem = scene->addPath(*path, scene->pen(), settings::settings().value("brushPath", false).toBool() ? scene->brush() : QBrush()); } else { - path->quadTo(path->currentPosition(), e->scenePos()); + path->quadTo(path->currentPosition(), scene->cursorPosition()); pathItem->setPath(*path); } } diff --git a/cropeditor/drawing/pathitem.hpp b/cropeditor/drawing/pathitem.hpp index e2dfba9..6eb347a 100644 --- a/cropeditor/drawing/pathitem.hpp +++ b/cropeditor/drawing/pathitem.hpp @@ -11,7 +11,7 @@ public: QString name() { return "Path"; } - void mouseDragEvent(QGraphicsSceneMouseEvent *e, CropScene *scene); + void mouseDragEvent(QGraphicsSceneMouseEvent *, CropScene *scene); void mouseDragEndEvent(QGraphicsSceneMouseEvent *e, CropScene *scene); private: diff --git a/cropeditor/drawing/rectitem.cpp b/cropeditor/drawing/rectitem.cpp index 5524661..aebf123 100644 --- a/cropeditor/drawing/rectitem.cpp +++ b/cropeditor/drawing/rectitem.cpp @@ -6,14 +6,14 @@ RectItem::RectItem() { RectItem::~RectItem() { } -void RectItem::mouseDragEvent(QGraphicsSceneMouseEvent *e, CropScene *scene) { +void RectItem::mouseDragEvent(QGraphicsSceneMouseEvent *, CropScene *scene) { if (!rect) { - rect = scene->addRect(e->scenePos().x(), e->scenePos().y(), 0, 0); + rect = scene->addRect(scene->cursorPosition().x(), scene->cursorPosition().y(), 0, 0); rect->setBrush(scene->brush()); rect->setPen(scene->pen()); - initPos = e->scenePos(); + initPos = scene->cursorPosition(); } else { - auto p = e->scenePos(); + auto p = scene->cursorPosition(); rect->setRect( QRect(qMin(initPos.x(), p.x()), qMin(initPos.y(), p.y()), qAbs(initPos.x() - p.x()), qAbs(initPos.y() - p.y()))); } diff --git a/cropeditor/drawing/rectitem.hpp b/cropeditor/drawing/rectitem.hpp index 8e09d80..a0e32bf 100644 --- a/cropeditor/drawing/rectitem.hpp +++ b/cropeditor/drawing/rectitem.hpp @@ -10,7 +10,7 @@ public: QString name() override { return "Rectangle"; } - void mouseDragEvent(QGraphicsSceneMouseEvent *e, CropScene *scene) override; + void mouseDragEvent(QGraphicsSceneMouseEvent *, CropScene *scene) override; void mouseDragEndEvent(QGraphicsSceneMouseEvent *, CropScene *) override; private: diff --git a/cropeditor/drawing/textitem.cpp b/cropeditor/drawing/textitem.cpp index bf67849..8ed86f5 100644 --- a/cropeditor/drawing/textitem.cpp +++ b/cropeditor/drawing/textitem.cpp @@ -10,15 +10,15 @@ bool TextItem::init(CropScene *s) { return ok; } -void TextItem::mouseDragEvent(QGraphicsSceneMouseEvent *e, CropScene *scene) { +void TextItem::mouseDragEvent(QGraphicsSceneMouseEvent *, CropScene *scene) { if (!textItem) { textItem = scene->addSimpleText(text, scene->font()); - textItem->setPos(e->scenePos()); + textItem->setPos(scene->cursorPosition()); textItem->setPen(scene->pen().color()); textItem->setBrush(scene->pen().color()); } else { - auto ee - = 180 + qRadiansToDegrees(qAtan2((textItem->pos().y() - e->scenePos().y()), (textItem->pos().x() - e->scenePos().x()))); + auto ee = 180 + qRadiansToDegrees(qAtan2((textItem->pos().y() - scene->cursorPosition().y()), + (textItem->pos().x() - scene->cursorPosition().x()))); textItem->setRotation(ee); } } diff --git a/cropeditor/drawing/textitem.hpp b/cropeditor/drawing/textitem.hpp index b2660ef..d60fb54 100644 --- a/cropeditor/drawing/textitem.hpp +++ b/cropeditor/drawing/textitem.hpp @@ -8,7 +8,7 @@ class TextItem : public DrawItem { public: QString name() override; bool init(CropScene *s) override; - void mouseDragEvent(QGraphicsSceneMouseEvent *e, CropScene *scene) override; + void mouseDragEvent(QGraphicsSceneMouseEvent *, CropScene *scene) override; void mouseDragEndEvent(QGraphicsSceneMouseEvent *, CropScene *) override; private: diff --git a/main.cpp b/main.cpp index 6a98de1..a16c765 100644 --- a/main.cpp +++ b/main.cpp @@ -32,6 +32,7 @@ bool stillAlive = true; } void handler(QtMsgType type, const QMessageLogContext &, const QString &msg) { + if (!verbose && msg.startsWith("QPixmap::fromWinHBITMAP")) return; std::string stdMsg = msg.toStdString(); switch (type) { case QtDebugMsg: