» Scrollbar logarithmic behavior
Scrollbar logarithmic behavior
|September 13, 2014
Posted by forumadmin
I’m creating a scrollbar control in Qt from scratch and I managed to calculate the slider center position into a vertical scrollbar. The scrollbar is attached to an edit box and adding lines make the slider go down. The slider is just a small red circle.
The problem now is that while adding lots of lines (by keeping Enter pressed) the slider eventually reaches the end of the bar and goes beyond it where it cannot be seen anymore.
If you try to insert a huge number of newlines on any notepad the slider will eventually become slower and slower (aside from getting smaller and smaller).
How can I accomplish the same with my slider’s position?
To make it clear: how can I accomplish a “logarithmic-like behavior” with my custom scrollbar? i.e. how to make the slider slower and slower (in such a way that it will never reach the bottom) when inserting lots of newlines
More Related Questions
- Qt C++: How to change layout after new project opening? I would like to create two layouts for my program. The first one would be showed to user after startup of program and would contains two push buttons - new/open project and the right side […]
- QTreeWidget vertical scrollbar jumps too far I have a QTreeWidget in my application that is populated by a user selection elsewhere. The contents of the first column of treewidget is other custom qt widgets based on the users […]
- Qt 4.7 visual touch/click feedback I have a complex application in Qt and I want to add visual feedback of touch or mouse press/release. What is the best approach to do this? I have some ideas how it can be implemented, but […]
- QT5 How access HTML5 canvas values in C++? In QT Creator I have a GUI with a 'border layout' and the centre panel is a canvas. To keep things simplified (for my question), the user can press a button and an html5 file is created […]
- Qt: Running designer app with main in different directory I've written a Qt application initially in one directory, meaning that all the necessary files, and the like were included. So, the directory structure would look something like […]
- Compile Qt from source cannot use OpenSSL along with OpenGL I'm in confuse right now.
I've just tried compiling Qt 5.3.1 libs with MinGW 4.8.2
Previously, I managed to build OpenSSL. And I want to use it for compiling Qt with -openssl.
But, I've […]
- Qt QML Start external application VLC Lost focus Hi I run VLC as a process and everything ok only my application loses focus and I can not kill it by pressing the button, because first I have to click back to the application window. […]
- How to use in-place QComboBox with a QTableView I'm working with a QTableView and I want add a QComboBox in the 3rd column of every cell. There will be thousands of cells so I have opted for an in place editor solution. I want the combo […]
- How to implement a video widget in Qt that builds upon GStreamer? I want to use Qt to create a simple GUI application that can play a local video file. I could use Phonon which does all the work behind the scenes, but I need to have a little more […]
- Qt application fails to load custom plugin debug library My question:
Why does my test application, when running in Release, not load the Debug (-d) version of my plugin DLL and instead only load the Release version?