TableView
в QML действительно странно, на мой взгляд, по крайней мере, на QtQuick.Controls 1.4
В Windows происходит следующее:

на mac:

Почему они такие разные? Я не понимаю Как я могу сделать их такими же.
Как мы видим в окнах, scrollBar начинается в верхней части таблицы, а в Mac - под заголовком.
Ниже приведен код таблицы:
import QtQuick 2.9
import QtQuick.Controls 2.2
import QtQuick.Controls 1.4
import QtQuick.Layouts 1.3
import QtQuick.Controls.Styles 1.1
ApplicationWindow {
id: window
title: "Stack"
visible: true
width: 300
ListModel {
id: libraryModel
ListElement {
title: "A Masterpiece"
author: "Gabriel"
}
ListElement {
title: "Brilliance"
author: "Jens"
}
ListElement {
title: "Outstanding"
author: "Frederik"
}
ListElement {
title: "Outstanding"
author: "Frederik"
}
ListElement {
title: "Outstanding"
author: "Frederik"
}
ListElement {
title: "Outstanding"
author: "Frederik"
}
ListElement {
title: "Outstanding"
author: "Frederik"
}
ListElement {
title: "Outstanding"
author: "Frederik"
}
ListElement {
title: "Outstanding"
author: "Frederik"
}
ListElement {
title: "Outstanding"
author: "Frederik"
}
ListElement {
title: "Outstanding"
author: "Frederik"
}
ListElement {
title: "Outstanding"
author: "Frederik"
}
ListElement {
title: "Outstanding"
author: "Frederik"
}
}
Page {
id: page
anchors.fill: parent
TableView{
id:table
anchors{
//top:chooseColum.bottom
topMargin:10
left:parent.left
right:parent.right
bottom:parent.bottom
}
model: libraryModel
headerDelegate: Rectangle{
id:recHeader
width:styleData.width+20
height:30
color:"blue"
border.color: "black"
border.width: 1
Text {
anchors.fill:parent
//color:globals.text.textColor
text:styleData.value
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
}
}
itemDelegate: Rectangle {
border.color:"black"
border.width: 1
Text
{
text: styleData.value
elide: Text.ElideRight
}
}
TableViewColumn {
id: col1
role: "title"
title: "Title"
}
TableViewColumn {
role: "author"
title: "Authors of this tutorial"
}
}
}
}
на данный момент не возможно обновить QT до 5.12.