Forum
Sign Up
× DataGrid for Qt.C++

trouble with filter

6 years 3 months ago #1 by alexey.basilio
Hello!

I set "view->options()->setFocusFollowMouse(true)"
and set filter on some column with empty "Find what".
And when I follow mouse over the grid - application crashes.

Is it only my trouble?

Please Log in or Create an account to join the conversation.

More
6 years 3 months ago #2 by corrado valeri
Replied by corrado valeri on topic trouble with filter
I have a similar problem, but maybe the bug should related to the datamodel.

please try this:
disable the FocusFollowMouse
open the grid, right mouse click and set up a filter, the click ok: it raises an assertion in qvector?
If yes, I have your same problem and it is probably a grid bug
If not, probably I have a problem of my datamodel.

Please Log in or Create an account to join the conversation.

More
6 years 3 months ago - 6 years 3 months ago #3 by corrado valeri
Replied by corrado valeri on topic trouble with filter
to verify, I tried to apply a filter created on the fly with three different model of my application, and seems that one of my model causes the assertion..
Last edit: 6 years 3 months ago by corrado valeri.

Please Log in or Create an account to join the conversation.

More
6 years 3 months ago #4 by alexey.basilio
Replied by alexey.basilio on topic trouble with filter
Hello!

If I disable "FocusFollowMouse" and then set filters, all works ok.

And what with other two your models? They works with filter on the fly?

Please Log in or Create an account to join the conversation.

More
6 years 3 months ago - 6 years 3 months ago #5 by corrado valeri
Replied by corrado valeri on topic trouble with filter
Yes, they works.
The model that doesn't work is specific for banded grid dataset.. but seems that the implementation lacks of any methods needed to work perfectly.
That model has two side effects: one, clicking on clomun header for apply the sort built-in function, it acts on the dataset like a filter. Only one row, the first, is shown.
Second, if apply any filter, it raise a QVector assection..

Any idea to implements a correct Model? I already look into the demos srcs of titangrid.
Last edit: 6 years 3 months ago by corrado valeri. Reason: fix

Please Log in or Create an account to join the conversation.

More
6 years 3 months ago #6 by corrado valeri
Replied by corrado valeri on topic trouble with filter
Finally I solved it.

The bug was an inconsinstency of internal dataset contained in the derived datamodel.
When you make a filter by the titangrid, it call rowcount method of the datamodel: in my case, it returns the size of internal dataset, a std::map.

Because the map was passed by reference in the constructor of the window, after a while the map was released by its parent, external to the scope.
In conclusion: when the filtering called rowcount, the internal std::map reference was yet deallocated and it raises the assertion..

I created a local, private copy of the std::map passed by reference, and all run correctly, filtering too.

Maybe this post can help you to check for the life scope of your dataset or datamodel.

Please Log in or Create an account to join the conversation.

More
  • Not Allowed: to create new topic.
  • Not Allowed: to reply.
  • Not Allowed: to edit your message.
Moderators: Developer MachinesEduard
Time to create page: 0.141 seconds

Developer Newsletter

Join our Developer Machines newsletter to get informed on all the latest releases of the commercial components for Qt.C++, Delphi FireMonkey, updates and general knowledges.

Quick Support

Should you need any additional information about our products or licensing, please contact us at the following email addresses:

  • This email address is being protected from spambots. You need JavaScript enabled to view it.

  • This email address is being protected from spambots. You need JavaScript enabled to view it.

Get in Touch

If you would like to purchase our products or services, but don’t know how to do it the right way, please feel free to contact us:

  • This email address is being protected from spambots. You need JavaScript enabled to view it.( any questions related to our products or services )
  • This email address is being protected from spambots. You need JavaScript enabled to view it.( questions related to licensing )