Qt Forum

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

    Unsolved TableViewColumn/TableView is not a type

    QML and Qt Quick
    4
    4
    3894
    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.
    • N
      nnicou last edited by

      Greetings,

      I have been struggling with a TableView issue the few last days. When i define a TableView in my application i get this error: TableViewColumn is not a type and the same applies for TableView. It worked when i change import QtQuick.Controls 2.0 to import QtQuick.Controls 1.4 but i got so much other problems in my application when changed it. My question is if there is any other way around to fix this?

      I did update Qt Creator from 5.7 to 5.8 and now i have imported QtQuick.Controls 2.1.

      1 Reply Last reply Reply Quote 0
      • G
        Gianfranco Facchini last edited by

        I have the same problem. If i upgrade QtQuick.Controls 1.4 when i run the program i have the same error. Why ?

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

          There is currently no TableView in QtQuick.Controls 2.X
          Supposedly TV is planned for Qt 5.12 release.
          In QtQuick.Controls 2.X I roll my own implementation; using ListView and Repeater in delegates as columns.

          1 Reply Last reply Reply Quote 0
          • sierdzio
            sierdzio Moderators last edited by

            You can mix Controls 1 and 2 in apps. So, keep your UI in Controls2, but take TableView from Controls1 only - should work. To make sure QML engine does not get confused about the imports, you can do something like this:

            import QtQuick.Controls 1.4 as OldControls
            import QtQuick.Controls 2.2
            
            Button {
              // controls 2, yay!
            }
            
            OldControls.TableView {
             // controls 1 :-)
            }
            

            (Z(:^

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