Category Archives: QML

Qt Quick Controls 2 has TableView but without the header yet

QT 5.13 supports SplitView and TableView but without TableHeader yet. Probably TableHeader can be implemented with the overlays. And there is an interesting example of implementation of table header with the source code.

The information provided below is outdated.

Qt Quick Controls 2 does not support TableView and looks like they are not going to support it, some notable missing features from Qt Quick Controls 1 also are Action, SplitView and TreeView, so the following QML code would not work:

TableView {

    TableViewColumn {
        role: "time"
        title: qsTr("date/time:")
        width: parent.width - 30
    }

    TableViewColumn {
        role: "score"
        title: qsTr("result:")
        width: 30
    }

    model: boardModel.list

    ScrollIndicator.vertical: ScrollIndicator { }
}

But there is a solution with ListView, so there can be something like this:

(more…)

QML DropShadow is very slow

QML DropShadow is an interesting effect that acts in a very simple way. It works fine in my application and produces the following result:

QML DropShadow is very slow

The only disadvantage of DropShadow effect is that is slows down my application from 60 FPS to 30 FPS on Android Phone. The following code demonstrates how I use it with StackView:

(more…)