Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Qt transition 5.9 to 5.13 issues



  • Problem 1) Virtually every control on any QML form in all my projects gets the following error:

    QML Button: Detected anchors on an item that is managed by a layout. This is undefined behavior; use Layout.alignment instead.

    The "errors" did not exist in 5.9 versions and before.
    The "errors" don't appear to affect app operation.

    I've tried the simple solution of commenting out the "anchors.??: something" lines and do not get the errors.

    The "anchors." statements are used to enforce control placement on forms. Not unexpectedly, when the "anchors." statements are not used, the forms look like shit.

    Please do not suggest I learn to use "Layouts". Layouts do not work for me. At least I've never been able to get them to work as I wanted.

    While I don't know if the messages will cause problems on released apps, I'd prefer not to find that out after uploading to the app stores.

    How do I disable the error message?

    Problem 2) The TableView QML Type no longer works the same as in 5.9 and before.

    When running the app with no code changes, the TableView loads as expected, but when you "flick" to scroll, the new improved 5.13 version does not scroll in the same fashion. It's like there were changes made to the "flick" speed or animation or IDK.

    With 5.9 and prior, you'd flick the TableView and the list would scroll nicely and gradually come to a stop. Now you flick and the list scrolls 3 or 4 rows and then jerks to a halt.

    Actually I just fixed this. 5.9 and prior didn't care if the verticalScrollBarPolicy was set. Apparently 5.13 does. I noticed this because when NOT defined on 5.13 Android there would actually be a scroll grab handle..but is was sooooo tiny as to be almost be invisible. If not defined, 5.9 and prior left the vertical scroll handle off if the platform was iOS or Android and added it as required on the desktop versions..go figure.

        verticalScrollBarPolicy: (gd.isDeviceDesktop()===true) ? Qt.ScrollBarAlwaysOn : Qt.ScrollBarAlwaysOff
    

    The above line setting verticalScrollBarPolicy fixes Problem 2

    Problem 3) The model loaded in the TableView thinks it has a negative list count. The app displays the following output after loading the model. This doesn't appear to hurt anything, but it would be nice to disable the output

    W/TheAppName( 8025): Model size of -617 is less than 0

    Any suggestions would be appreciated.


Log in to reply