Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Forum Updated on Feb 6th

    Unsolved Labs and Controls conflict

    QML and Qt Quick
    2
    4
    951
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Tugdual
      Tugdual last edited by Tugdual

      I was trying to use Qt.labs.calendar and QtQuick.Controls together and ran into some conflicts since Calendar is declared in both imports. I then used a qualifier to remove ambiguity "import Qt.labs.calendar 1.0 as LC" but the control Calendar was still not initializing correctly and returning errors ("Type Calendar is unavailable" - "Cannot assign object to property").
      Should we avoid to mix the two controls libs?

      1 Reply Last reply Reply Quote 0
      • jpnurmi
        jpnurmi last edited by

        Could you show the code?

        1 Reply Last reply Reply Quote 0
        • jpnurmi
          jpnurmi last edited by jpnurmi

          Oh, I can see what you mean now. There was indeed an internal conflict in Qt 5.6 (https://bugreports.qt.io/browse/QTBUG-53552). It was reproducible with something as simple as:

          import QtQuick 2.6
          import QtQuick.Controls 1.2
          import Qt.labs.calendar 1.0 as LC
          
          ApplicationWindow {
              visible: true
              Calendar { }
          }
          

          ==>

          qrc:/main.qml:7 Type Calendar unavailable
          file:///Users/jpnurmi/Qt/5.6/clang_64/qml/QtQuick/Controls/Calendar.qml:216 Cannot assign object to property
          

          The conflict has been fixed in Qt 5.7.

          Tugdual 1 Reply Last reply Reply Quote 0
          • Tugdual
            Tugdual @jpnurmi last edited by

            @jpnurmi thanks for your followup.
            Another issue with the Controls calendar is that binding (from external variable to control) is lost whenever the user selects a date. I have found this confirmed in the bug reports. Wonder if it will also be fixed in v5.7.

            In the meantime i have implemented my own calendar, less generic than the lib one though.

            1 Reply Last reply Reply Quote 0
            • First post
              Last post