QSlider problem in Android 6.0



  • Year ago I have made decorated slider deriving from QSlider. I did not have problems with it until now. Now I created app with it for newer versions of Android. And found strangle problem - if I build app for target platform Android 6 (API 23) then on Android 6 smartphone my slider doesn't move. All my functions work properly but I see value() does not change when trying move slider. Knob stalls hard.

    I must tell, I use unusual technique for this app - I create QGraphicsScene, then place controls on it using proxy items, then I scale scene to Android screen size. Little weird but all worked fine before this slider problem. I have created set of decorated controls - buttons, rotating knobs, moving SVG graphics and so on. All worked fine. Even my slider worked fine in previous versions of Android. Here is compatibility table for my slider with different APIs build and different Android OS versions:

    Build for min and max API 15, run on Android 4.1 - works fine
    Build for min and max API 15, run on Android 6.0 - works fine
    Build for min API 16, max API 23, run on Android 4.1 - works fine
    Build for min API 16, max API 23, run on Android 6.0 - doesn't work

    Even I tried add native QSLider to my app - and found another problem. The QSlider works in Android 6 and 4.1 but with artefacts. They look little different on different screen resolutions. Only part of knob moves. This part has size equal to original knob size before scaling. Probably this is an error in proxy item scale algorithm.

    May be somebody knows some workarounds for QSlider in Android... May be this is already known issue... I did not find yet anything about this in Internet.


  • Lifetime Qt Champion

    Hi,

    What version of Qt are you using ?
    Does it also happen on desktop ?
    Is it possible to share your custom slider code ?



  • @SGaist

    • 5.6.1
    • No, even in QtCreator I made plugin with same code - it works fine (Linux Kubuntu)
    • No. I do not think C++ code contains something wrong - it works in most environments. Probably I have change something in AndroidMainfest.xml. I am not a keen in it's content. It already containes lines for permissions:

    <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS"/>
    <uses-permission android:name="android.permission.RECORD_AUDIO"/>
    <uses-permission android:name="android.permission.WAKE_LOCK"/>
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>

    Line for different screen resolutions:

    <supports-screens android:largeScreens="true" android:xlargeScreens="true" android:normalScreens="true" android:anyDensity="true" android:smallScreens="true"/>

    May be this is about styles?


  • Lifetime Qt Champion

    Can you test with a more recent version of Qt ? The current LTS is 5.9.2 with 5.10 around the corner.



  • @SGaist now I cannot. I have finish main job first. In application I replaced decorated sliders by my own decorated buttons and dialers. This works for current release. It will be done then I will be able test more.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.