For some implementation ideas, take a look at the code in
desktop-widget.cpp that controls the zoom_status spinbutton. This
implements logarithmic scaling by setting the spinbutton's value to
the *log* of the requested zoom. Linear increments/decrements in this
value then result in multiplicative scaling of the zoom factor. There
is some code in zoom_output and zoom_input that takes care of
converting from the log value to the true zoom value (which is
displayed).
For some implementation ideas, take a look at the code in decrements in this
desktop-widget.cpp that controls the zoom_status spinbutton. This
implements logarithmic scaling by setting the spinbutton's value to
the *log* of the requested zoom. Linear increments/
value then result in multiplicative scaling of the zoom factor. There
is some code in zoom_output and zoom_input that takes care of
converting from the log value to the true zoom value (which is
displayed).