Table Scroll Modes
Search
Table Scroll Modes
Hi,
Just wanting to know if it is possible to configure a table to be "ScrollPerItem" or "ScrollPerPixel"? As per what is available in the extended properties of the Tree View widget.
The table only seems to provide "ScrollBarAsNeeded", "ScrollBarAlwaysOff" and "ScrollBarAlwaysOn". The table looks to be implemented as "ScrollPerPixel" as rows can be half seen when scrolling.
The issue we have with this is that when a table is dynamically updated the updateLines function updates/inserts lines and seems to ensure the top visible row is not half visible. This causes the table to jump if you have scrolled to a 'half' row position when the updateLines function is run.
It seems as though qt does support this "ScrollPerItem" style scrolling in the native qt table widget. Would it be possible to add this feature to the next patch / version of OA? (see https://doc.qt.io/qt-5/qtablewidget.html#scrollToItem)
We are using OA v3.17 P014 on RHEL 8.2.
Cheers
Eric
Just wanting to know if it is possible to configure a table to be "ScrollPerItem" or "ScrollPerPixel"? As per what is available in the extended properties of the Tree View widget.
The table only seems to provide "ScrollBarAsNeeded", "ScrollBarAlwaysOff" and "ScrollBarAlwaysOn". The table looks to be implemented as "ScrollPerPixel" as rows can be half seen when scrolling.
The issue we have with this is that when a table is dynamically updated the updateLines function updates/inserts lines and seems to ensure the top visible row is not half visible. This causes the table to jump if you have scrolled to a 'half' row position when the updateLines function is run.
It seems as though qt does support this "ScrollPerItem" style scrolling in the native qt table widget. Would it be possible to add this feature to the next patch / version of OA? (see https://doc.qt.io/qt-5/qtablewidget.html#scrollToItem)
We are using OA v3.17 P014 on RHEL 8.2.
Cheers
Eric
-
- Posts: 330
- Joined: Tue Jan 15, 2019 3:12 pm
Re: Table Scroll Modes
I guess you could do this by setting the 'lineVisible' property.
Re: Table Scroll Modes
Yeah tried that on the scroll event but that just makes it jumpy every time you scroll the table not just when a new entry is added. It also makes the last row difficult/impossible to see if your table is say 10.1 rows in height. If this is the case then as the last row is shown the visible 10% of the top row forces the whole row to show and pushes the bottom row out of view.
-
- Posts: 330
- Joined: Tue Jan 15, 2019 3:12 pm
Re: Table Scroll Modes
In some project I did do something like first jumping to the last/first row before making the actual wanted row visible, so it would be completely visible. But it is not a pretty solution.
You could set the Qt property with a stylesheet (or by setting the stylesheet property of the table), like this:
You could set the Qt property with a stylesheet (or by setting the stylesheet property of the table), like this:
Code: Select all
QTableView { qproperty-verticalScrollMode: "ScrollPerItem"; }
Re: Table Scroll Modes
Thanks gschijndel! That's exactly what I was after. I always find it difficult to know how to add these Qt properties to the stylesheet. Do you know of a good web resource that defines what properties are available? The Qt website has them but nowhere can I find that the actual syntax needed to be 'QTableView { qproperty-verticalScrollMode: "ScrollPerItem"; }'.
-
- Posts: 330
- Joined: Tue Jan 15, 2019 3:12 pm
Re: Table Scroll Modes
The Qt properties can be set in a stylesheet with the syntax:
The name and value of the property can be found in the Qt documentation
The documentation is missing this information. I only found this wonderful feature out because of the (trend) examples in the documentation.
Code: Select all
qtproperty-<property name>: "<property value>";
The documentation is missing this information. I only found this wonderful feature out because of the (trend) examples in the documentation.
Re: Table Scroll Modes
Thanks for that gschijndel
Unfortunately going back to the 'qproperty-verticalScrollMode: "ScrollPerItem";' fix, this works from a scrolling point of view but now when adding to the table this property seems to ignore/override the '.lineVisible(iRow)' function when trying to retain the previously visible row. With the "ScrollPerItem" property the table shifts to the bottom when you run the '.updateLines()' function
Unfortunately going back to the 'qproperty-verticalScrollMode: "ScrollPerItem";' fix, this works from a scrolling point of view but now when adding to the table this property seems to ignore/override the '.lineVisible(iRow)' function when trying to retain the previously visible row. With the "ScrollPerItem" property the table shifts to the bottom when you run the '.updateLines()' function
Re: Table Scroll Modes
I did not test it. Maybe you can solve the issue by using the option "lineVisible" again after calling updateLines().
E.g. in the aes.ctl library in funktion aes_workCB lineVisible is called in the end of the function to show a specific line.
Best Regards
Leopold Knipp
Senior Support Specialist
E.g. in the aes.ctl library in funktion aes_workCB lineVisible is called in the end of the function to show a specific line.
Best Regards
Leopold Knipp
Senior Support Specialist