diff options
Diffstat (limited to 'examples/sql/books/bookdelegate.cpp')
-rw-r--r-- | examples/sql/books/bookdelegate.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/examples/sql/books/bookdelegate.cpp b/examples/sql/books/bookdelegate.cpp index 4115f80cf3..00bdd1708a 100644 --- a/examples/sql/books/bookdelegate.cpp +++ b/examples/sql/books/bookdelegate.cpp @@ -116,7 +116,7 @@ bool BookDelegate::editorEvent(QEvent *event, QAbstractItemModel *model, if (event->type() == QEvent::MouseButtonPress) { QMouseEvent *mouseEvent = static_cast<QMouseEvent*>(event); - int stars = qBound(0, int(0.7 + qreal(mouseEvent->pos().x() + int stars = qBound(0, int(0.7 + qreal(mouseEvent->position().toPoint().x() - option.rect.x()) / star.width()), 5); model->setData(index, QVariant(stars)); // So that the selection can change: |