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. QQuick.TableViewColumn is hidden.
Forum Updated to NodeBB v4.3 + New Features

QQuick.TableViewColumn is hidden.

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
3 Posts 2 Posters 629 Views
  • 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.
  • W Offline
    W Offline
    w.tkm
    wrote on last edited by
    #1

    Hellow.
    I use TableView and TableViewColumn.
    The display is done from QWidget, but when I do that, the column doesn't show up.
    To be more precise, only the first column will be displayed.
    However, if you change the size of the column by dragging it, it will be displayed thereafter.
    Is it not possible to display it in QWidget with QQuickItem?
    If I just can't, can I create a TableView like the following in a QWidget TableView?

            TableView {
                id: myTable
                model: myList
                height: 230
                width: 285
                TableViewColumn {
                    title: qsTr("Num")
                    role: "num"
                    horizontalAlignment: Text.AlignLeft
                    width: 40
                }
                TableViewColumn {
                    title: qsTr("Data1")
                    role: "D1"
                    width: 80
                }
                TableViewColumn {
                    title: qsTr("Data2")
                    role: "D2"
                    width: 80
                }
                style: TableViewStyle {
                    backgroundColor: "#444343"
                    alternateBackgroundColor: "gray"
                    textColor: "white"
                    headerDelegate: Rectangle {
                        height: 20
                        width: myTable.width
                        border.width: 1
                        border.color: "#d3d3d3"
                        color: "gray"
                        Text {
                            anchors.fill: parent
                            verticalAlignment: Text.AlignVCenter
                            horizontalAlignment: Text.AlignLeft
                            anchors.leftMargin: 4
                            text: styleData.value
                            color: textColor
                            renderType: Text.NativeRendering
                        }
                    }
                }
            }
    
    1 Reply Last reply
    0
    • 6thC6 Offline
      6thC6 Offline
      6thC
      wrote on last edited by
      #2

      @w-tkm said in QQuick.TableViewColumn is hidden.:

      TableViewColumn

      Can you use Quick2?
      Does this help: https://stackoverflow.com/questions/64403258/tableview-replacement-for-tableviewcolumn-in-qt-quick-2
      TableView QML Type
      DelegateChooser QML Type

      You might need to manually create the titles/headers from memory, but I've not done work that requires touching our Table stuff/code for about a year now...

      W 1 Reply Last reply
      0
      • 6thC6 6thC

        @w-tkm said in QQuick.TableViewColumn is hidden.:

        TableViewColumn

        Can you use Quick2?
        Does this help: https://stackoverflow.com/questions/64403258/tableview-replacement-for-tableviewcolumn-in-qt-quick-2
        TableView QML Type
        DelegateChooser QML Type

        You might need to manually create the titles/headers from memory, but I've not done work that requires touching our Table stuff/code for about a year now...

        W Offline
        W Offline
        w.tkm
        wrote on last edited by
        #3

        @6thC
        Thanks for your reply.
        It's not hidden on the Window in QML side.
        This is only the case when displayed via QWidget.
        I apologize for the confusing explanation.

        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