QSqlqueryModel with Mouse Move
-
Hello, I have a QSqlQueryModel where I override the data function to give the columns different colors.
When I move the mouse over the connected QTableView
(target outside the tableview)
without pressing a mouse button, the data function is always called with the model index of the position where I started the movement. Is there any way to disable this?
Thanks -
Hello, I have a QSqlQueryModel where I override the data function to give the columns different colors.
When I move the mouse over the connected QTableView
(target outside the tableview)
without pressing a mouse button, the data function is always called with the model index of the position where I started the movement. Is there any way to disable this?
Thanks@Fuxi said in QSqlqueryModel with Mouse Move:
Is there any way to disable this?
Since the data() function is called whenever the cell needs to be redrawn - no.
And what's the problem with someone calling data()? -
Thanks. The problem is a bit difficult to describe. But the fact that only one column is called when the mouse is moved isn't good for my application. Can I simply redraw all columns instead of just redrawing the source column?
For example, if the mouse moved end , everything will be redrawn. Thanks. -
A redraw can happen every time on every cell / region inside your widget when e.g. the os or Qt decides that there is a redraw needed - so no you can't control this.