slotZoom(qMin(300, newzoom));
}
-void MonitorScene::addItem(QGraphicsItem* item)
-{
- QGraphicsScene::addItem(item);
-
- /*OnMonitorRectItem *rect = qgraphicsitem_cast<OnMonitorRectItem*>(item);
- if (rect) {
- connect(this, SIGNAL(mousePressed(QGraphicsSceneMouseEvent*)), rect, SLOT(slotMousePressed(QGraphicsSceneMouseEvent*)));
- connect(this, SIGNAL(mouseReleased(QGraphicsSceneMouseEvent*)), rect, SLOT(slotMouseReleased(QGraphicsSceneMouseEvent*)));
- connect(this, SIGNAL(mouseMoved(QGraphicsSceneMouseEvent*)), rect, SLOT(slotMouseMoved(QGraphicsSceneMouseEvent*)));
- connect(rect, SIGNAL(actionFinished()), this, SIGNAL(actionFinished()));
- connect(rect, SIGNAL(setCursor(const QCursor &)), this, SLOT(slotSetCursor(const QCursor &)));
- }*/
-}
-
void MonitorScene::slotSetCursor(const QCursor &cursor)
{
if (m_view)
{
emit mousePressed(event);
- if (!event->isAccepted() && m_enabled)
+ if (!event->isAccepted())
QGraphicsScene::mousePressEvent(event);
}
{
emit mouseMoved(event);
- if (!event->isAccepted() && m_enabled)
+ if (!event->isAccepted())
QGraphicsScene::mouseMoveEvent(event);
}
{
emit mouseReleased(event);
- if (!event->isAccepted() && m_enabled)
+ if (!event->isAccepted())
QGraphicsScene::mouseReleaseEvent(event);
}
/** @brief Makes the background frame fit again after the profile changed (and therefore the resolution might have changed). */
void resetProfile();
- /** @brief Adds an item to the scene and connects mouse events + change signals if it is a onmonitor item. */
- void addItem(QGraphicsItem *item);
-
protected:
/** @brief Emits signal mousePressed to be used in onmonitor items. */
virtual void mousePressEvent(QGraphicsSceneMouseEvent *event);