Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Labs and Controls conflict
Forum Updated to NodeBB v4.3 + New Features

Labs and Controls conflict

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
4 Posts 2 Posters 1.2k Views 2 Watching
  • 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.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by A Former User
    #1

    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
    0
    • jpnurmiJ Offline
      jpnurmiJ Offline
      jpnurmi
      wrote on last edited by
      #2

      Could you show the code?

      1 Reply Last reply
      0
      • jpnurmiJ Offline
        jpnurmiJ Offline
        jpnurmi
        wrote on last edited by jpnurmi
        #3

        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.

        ? 1 Reply Last reply
        0
        • jpnurmiJ 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.

          ? Offline
          ? Offline
          A Former User
          wrote on last edited by
          #4

          @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
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved