QSpinBox: fix cursor jumping around when pressing up/down keys

Backport of:
  Make QLineEdit unit test pass again

  Widget failed to update cursor position if selection remained the same, but
  changed direction, and did not emit selectionChanged if change resulted
  from input method event.

Bisected to fix
Task-number: QTBUG-15116
a regression introduced in fb7d86cf.

Change-Id: I6a4ae48d41efa5e126980749f89982f92e3ec499
Reviewed-by: Joona Petrell <joona.t.petrell@nokia.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
(cherry picked from qtbase/1189ebff320b8dd03637947c92df6e3ef84a3c06)
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>