Skip to content
This repository has been archived by the owner on Oct 6, 2020. It is now read-only.

Smooth scrolling in TableView with image columns #37

Closed
joshirio opened this issue Oct 22, 2017 · 1 comment
Closed

Smooth scrolling in TableView with image columns #37

joshirio opened this issue Oct 22, 2017 · 1 comment
Assignees
Milestone

Comments

@joshirio
Copy link
Collaborator

joshirio commented Oct 22, 2017

Scrolling in table view mode is really choppy and slow in presence of image fields (columns).
Especially when the image files are big and there are more than one image columns.

Implementing caching of images in memory works and the result is a smooth scrolling experience.
I tested this by using QPixmapCache with a larger database with 2 image columns.
The big disadvantage is that this increases memory usage dramatically: symphytum uses around 30-50 MiB now, with this patch it uses at least 900 MiB to 1.3 GiB memory (only if needed).

On modern computers with large amounts of RAM this is not a problem, but many still use notebooks with 2GiB RAM.

I think, it would be possible to check RAM availability and enable this optimization only on high end (RAM at least 4 GiB) machines. And of course, providing an option in the setting to disable this.

EDIT: it makes sense to clear the cache before printing as printing requires all free resources in case the database file is really big...

EDIT2: Qt5 doesn't offer a way to check for system RAM, so either a new utility needs to beimplemented for each platform or the default state for this should be disabled and an option provided in the settings to enable it.

@joshirio joshirio added this to the 2.2 milestone Oct 22, 2017
@joshirio joshirio self-assigned this Oct 22, 2017
@joshirio
Copy link
Collaborator Author

joshirio commented Nov 7, 2017

Implemented as option disabled by default.
Can be enabled in settings, RAM usage can take up to 2GB.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant