[Interest] QML bug?

Alexander Dyagilev alervdvcw at gmail.com
Fri Apr 16 13:24:47 CEST 2021


Hello,

Is this QML bug or am I misunderstanding something?

It says:
qrc:/qml_ui/desktop/BottomPanel/ConnectionsTab.qml:75: ReferenceError: 
hostItem is not defined
qrc:/qml_ui/desktop/BottomPanel/ConnectionsTab.qml:84: ReferenceError: 
portItem is not defined

Why are not they defined? These are ids of items defined in the same qml 
file.

Code:

importQtQuick2.10

importQtQuick.Controls2.4

importQtQuick.Layouts1.3

import"../BaseElements"

importorg.freedownloadmanager.fdm1.0

Item{

anchors.fill:parent

BaseLabel{

text:qsTr("Therearenoconnections")+App.loc.emptyString

anchors.centerIn:parent

visible:!connectionsList.visible

font.pixelSize:13

}

ListView{

id:connectionsList

anchors.fill:parent

anchors.bottomMargin:1

ScrollBar.vertical:ScrollBar{}

flickableDirection:Flickable.AutoFlickIfNeeded

boundsBehavior:Flickable.StopAtBounds

clip:true

headerPositioning:ListView.OverlayHeader

visible:downloadsItemTools.running&&count

model:downloadsItemTools.connectionsModel

header:RowLayout{

id:columns

width:parent.width

spacing:0

z:2

TablesHeaderItem{

id:hostItem

text:qsTr("Host")+width+App.loc.emptyString

Layout.preferredWidth:Math.max(300,headerMinimumWidth)

color:appWindow.theme.background

}

TablesHeaderItem{

id:portItem

text:qsTr("Port")+App.loc.emptyString

Layout.preferredWidth:headerMinimumWidth

color:appWindow.theme.background

}

TablesHeaderItem{

id:countItem

text:qsTr("Connectioncount")+App.loc.emptyString

Layout.fillWidth:true

color:appWindow.theme.background

Rectangle{

height:parent.height

width:1

anchors.right:parent.right

color:appWindow.theme.border

}

}

}

delegate:RowLayout{

width:parent.width

height:22

spacing:0

BaseLabel{

text:model.host

Layout.preferredWidth:hostItem.width

Layout.minimumWidth:Layout.preferredWidth

Layout.fillHeight:true

leftPadding:6

Rectangle{anchors.fill:parent;color:"yellow";z:-1}

}

BaseLabel{

text:model.port

Layout.preferredWidth:portItem.width

Layout.minimumWidth:Layout.preferredWidth

Layout.fillHeight:true

Rectangle{anchors.fill:parent;color:"red";z:-1}

leftPadding:6

}

BaseLabel{

text:model.connectionCount

Layout.fillWidth:true

Layout.fillHeight:true

leftPadding:6

Rectangle{anchors.fill:parent;color:"blue";z:-1}

}

}

}

}



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20210416/7eb08d3a/attachment.html>


More information about the Interest mailing list