Всем привет.
Имеется дочерние обьекты в SplitView, в моем случаи это TreeView и PdfScrollablePageView.
Проблема в том что почему то не получается позиционирование открытой страницы по центру парента для PdfScrollablePageView.
Почему то левый верхний угол страницы это центр парента. Может кто подскажет как для дочернего обьекта SplitView надо правильно позицию выставлять?
Код прилогается ниже.
import QtQuick
import QtQuick.Controls.Basic
import QtQuick.Pdf
import QtQuick.Layouts
import Qt5Compat.GraphicalEffects
Rectangle
{
id: root
property int defaultWidthBookmark : root.width * 0.1
PdfDocument
{
id: docPdf
source: Qt.resolvedUrl("file:///pathtofile")
}
SplitView
{
id: splitView
anchors.fill: parent
orientation: Qt.Horizontal
handle: Rectangle
{
id: handleDelegate
implicitWidth: 4
color: ""black
}
Rectangle
{
id: rectTreeView
SplitView.preferredWidth: root.defaultWidthBookmark
TreeView
{
id: treeViewBookmark
anchors.fill: parent
delegate: Item
{
id: treeDelegate
Rectangle
{
id: labelRect
width: text.width
height: text.height
Text
{
id: text
clip: true
antialiasing: true
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
}
}
}
}
}
Rectangle
{
id: rectPdfPageView
SplitView.fillWidth: true
// SplitView.fillHeight: true
SplitView.minimumWidth: 500
color: "blue"
clip: true
PdfScrollablePageView
{
id: pdfView
// anchors.centerIn: parent
anchors.top: parent.top
anchors.bottom: parent.bottom
document: docPdf
contentWidth: 100
}
}
}
}