Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gantt item is not vertically centered on zoom fit with a large row height #63

Open
arabine opened this issue Aug 12, 2024 · 0 comments
Open

Comments

@arabine
Copy link

arabine commented Aug 12, 2024

How to reproduce the bug:

  • starting with the Gantt Project example, add a "zoom fit" entry in the menu, add the zoomFit() algorithm from the Gant Legend example
  • Change the model of the project to change the row size:
    if (idx.column() == 0) {
        switch (role) {
        case Qt::SizeHintRole:
            return QSize(100, 60);

Fix:

There are two paths to update the Gantt items (which is bad). The faulty path (GraphicsScene::updateItems()) does not take in account the row size:

Replace:

item->updateItem(Span(item->pos().y(), item->rect().height()), idx);

With:

const QModelIndex sidx = summaryHandlingModel()->mapToSource(idx);
Span rg = rowController()->rowGeometry(sidx);
item->updateItem(rg, idx);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant