Bug 389306 - QxtSpanSlider w/ mouse does not work with KF5
Summary: QxtSpanSlider w/ mouse does not work with KF5
Status: RESOLVED FIXED
Alias: None
Product: KBibTeX
Classification: Applications
Component: User interface (show other bugs)
Version: git (master)
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Thomas Fischer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-01-22 08:51 UTC by Juergen Spitzmueller
Modified: 2018-02-11 20:18 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Juergen Spitzmueller 2018-01-22 08:51:02 UTC
With recent master/KF5 on OpenSuse Tumbleweed, the QxtSpanSlider used in the ID Suggestion Editor does not work anymore with the mouse. Whenever I touch the upper handle, it snaps to position 0 and cannot be moved anymore (the slider initially shows the correct settings, though; it just seems impossible to use it to change range settings). The lower handle cannot be moved at all with the mouse.

Note that I can successfully move both handles with the keyboard (left/right arrows for lower handle, up/down arrows for upper handle).
Comment 1 Thomas Fischer 2018-01-27 21:17:17 UTC
I can confirm this behaviour. The Qxt project is long dead, but I kept the code in place as it continued to work and no good replacement was available. Now that it is reproducible broken, a fix needs to be found.
Comment 2 Thomas Fischer 2018-01-28 19:52:38 UTC
Please check commit a223b461d6ced8ab7c1a962 from repository clones/kbibtex/thomasfischer/kbibtex.git (not main repo kbibtex.git) to see if it fixes your problem.

https://commits.kde.org/clones/kbibtex/thomasfischer/kbibtex/a223b461d6ced8ab7c1a962268939d7cf48cd53a
Comment 3 Juergen Spitzmueller 2018-01-29 08:50:09 UTC
Yes, the problem is fixed. I find the combo solution a bit awkward, though. I'd rather go for two spin boxes.
Comment 4 Thomas Fischer 2018-01-29 17:30:17 UTC
(In reply to Juergen Spitzmueller from comment #3)
> Yes, the problem is fixed. I find the combo solution a bit awkward, though.
> I'd rather go for two spin boxes.
I actually tried that first, but spin boxes won't work, at least the variant Qt offers. It allows only to select from a numbered range with the addition that for the minimum value a special text can be used (e.g. "Unused" or "No limit"). For the maximum, as would be required in our case to cover "all authors" or "all words", no such special text can be set. Thus, combo boxes were chosen as the next best alternative.

Of course, you can try to convince the trolls(*) at Qt to either have special value for the maximum in spin boxes (will only happen for Qt6, I assume) or include something like QxtSpanSlider (even less likely).

(*) not derogative, but a pun at Trolltech
Comment 5 Juergen Spitzmueller 2018-01-29 17:41:50 UTC
You could setWrapping(true), then the special ValueText would be at the edge of minimum/maximum.
Comment 6 Thomas Fischer 2018-02-10 21:28:47 UTC
(In reply to Juergen Spitzmueller from comment #5)
> You could setWrapping(true), then the special ValueText would be at the edge
> of minimum/maximum.
I see only potential confusion if one can wrap from "last author" to "author 1". However, I suggest to Qt to support special value texts both for minimum and maximum:
https://bugreports.qt.io/browse/QTBUG-66072

So, for now I will stay at the two-combobox solution until a clearly better solution becomes viable.

I tweaked the previous commit a little bit to support a tenth author|word for the upper end of the range. Please check and confirm that nothing got broken.
https://cgit.kde.org/clones/kbibtex/thomasfischer/kbibtex.git/commit/?id=cd59dea0a94621246654c49268699680e7f22fe7
Comment 7 Juergen Spitzmueller 2018-02-11 10:41:00 UTC
Seems to work.
Comment 8 Thomas Fischer 2018-02-11 20:18:44 UTC
Git commit 2af177ee2037a0c02cfff284a85acbf456183057 by Thomas Fischer.
Committed on 11/02/2018 at 20:15.
Pushed by thomasfischer into branch 'master'.

Replacing deprecated QxtSpanSlider with home-made widget

Removing deprecated LibQxt extension library for Qt. As it turns out,
the previously QxtSpanSlides does no longer properly react on mouse
events.

This required the introduction of a new widget, RangeWidget, which
mimics the same functionality by providing two QComboBoxes to allow
the user to select minimum and maximum values.

D  +0    -89   src/3rdparty/libqxt/LICENSE
D  +0    -208  src/3rdparty/libqxt/core/qxtglobal.h
D  +0    -107  src/3rdparty/libqxt/core/qxtnamespace.h
D  +0    -747  src/3rdparty/libqxt/gui/qxtspanslider.cpp
D  +0    -91   src/3rdparty/libqxt/gui/qxtspanslider.h
D  +0    -83   src/3rdparty/libqxt/gui/qxtspanslider_p.h
M  +1    -24   src/gui/CMakeLists.txt
M  +38   -42   src/gui/preferences/settingsidsuggestionseditor.cpp
M  +3    -4    src/gui/preferences/settingsidsuggestionseditor.h
A  +166  -0    src/gui/widgets/rangewidget.cpp     [License: GPL (v2+)]
A  +113  -0    src/gui/widgets/rangewidget.h     [License: GPL (v2+)]

https://commits.kde.org/kbibtex/2af177ee2037a0c02cfff284a85acbf456183057