Hi
I have a Problem with any type of Layout Control in a "subView"
If i load following qml into a Loader Object which is present in the main.qml
The app stucks and doesnt react any more. I dont know what i am doing wrong
If i remove the ColumnLayou from the view.qml it works.
If use the columnLayout in the main.qml it works without any Problem.
viewQml
import QtQuick 2.5
import QtQuick.Layouts 1.2
Rectangle {
color: guiTheme.view.backgroundColor
anchors.fill: parent
ColumnLayout
{
anchors.fill: parent
spacing : 0
Text {
anchors.top: parent.top
anchors.topMargin: 20
anchors.left: parent.left
anchors.leftMargin: 20
anchors.right: parent.right
anchors.rightMargin: 20
horizontalAlignment: Text.AlignJustify
wrapMode: Text.Wrap
text: qsTr("Test")
color: guiTheme.view.standardTextColor
font.pixelSize: guiTheme.app.standardTextSize
font.family: guiTheme.app.fontFamily
}
}
}
import QtQuick 2.5
import QtQuick.Layouts 1.2
Rectangle {
color: guiTheme.view.backgroundColor
anchors.fill: parent
ColumnLayout
{
anchors.fill: parent
spacing : 0
Text {
anchors.top: parent.top
anchors.topMargin: 20
anchors.left: parent.left
anchors.leftMargin: 20
anchors.right: parent.right
anchors.rightMargin: 20
horizontalAlignment: Text.AlignJustify
wrapMode: Text.Wrap
text: qsTr("Test")
color: guiTheme.view.standardTextColor
font.pixelSize: guiTheme.app.standardTextSize
font.family: guiTheme.app.fontFamily
}
}
}
To copy to clipboard, switch view to plain text mode
Main.qml
import QtQuick 2.5
import QtQuick.Controls 1.4
import QtQuick.Window 2.0
ApplicationWindow {
Loader {
id: loaderViewContainer
anchors.fill: parent
focus: true
source: viewControllerObject.currentQmlViewPath / contains above qml
}
}
import QtQuick 2.5
import QtQuick.Controls 1.4
import QtQuick.Window 2.0
ApplicationWindow {
Loader {
id: loaderViewContainer
anchors.fill: parent
focus: true
source: viewControllerObject.currentQmlViewPath / contains above qml
}
}
To copy to clipboard, switch view to plain text mode
The main qml is loaded with the QQmlApplicationEngine.load(...)
Any suggestions?
THANKS!
Added after 21 minutes:
Okay....
The Problem is this code
anchors.right: parent.right
anchors.rightMargin: 20
wrapMode: Text.Wrap
anchors.right: parent.right
anchors.rightMargin: 20
wrapMode: Text.Wrap
To copy to clipboard, switch view to plain text mode
Wehn i am removing the wrapMode it works....?!?!
Of course this will lokk bad if i have Long text...
Bookmarks