- setCursor(QCursor(Qt::OpenHandCursor));
- QGraphicsItem::mouseReleaseEvent(event);
-}
-
-void ColumnHandleItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) {
- Q_UNUSED(option);
- Q_UNUSED(widget);
-
- QLinearGradient gradient(0, 0, width(), 0);
- gradient.setColorAt(0.25, Qt::transparent);
- gradient.setColorAt(0.5, QColor(0, 0, 0, _hover * 200));
- gradient.setColorAt(0.75, Qt::transparent);
- painter->fillRect(boundingRect(), gradient);
+ if(_moving) {
+ _moving = false;
+ setCursor(QCursor(Qt::OpenHandCursor));
+ QRectF sceneBRect = _boundingRect.translated(x(), 0);
+ _sceneLeft = sceneBRect.left();
+ _sceneRight = sceneBRect.right();
+ emit positionChanged(x());
+ event->accept();
+ } else {
+ event->ignore();
+ }