PDA

View Full Version : tab does not appear



nuliknol
1st May 2014, 11:54
Hi,
I get this error when I try to show a tab (app is done with QT 5.2, with QT Quick 2):


file:///home/niko/qtdev/build-forms-Desktop_Qt_5_2_1_GCC_64bit-Debug/qml/forms/main.qml:207:5: QML Column: Cannot specify top, bottom, verticalCenter, fill or centerIn anchors for items inside Column. Column will not function.

the column is declared like this in my main qml file:

Column {
Row {
Label {
text: "Search:"
}

TextField {
width: 160
placeholderText: "search..."
}
Button {
text: " Ok ";
}
Button {
text: "...";
menu: menu_options
}
}
TabView {
id: companies_tab
anchors.fill: parent
}
}

this is how I create the tab:

Component.onCompleted: {
loginWindow.show();

companies_tab.addTab("Company",Qt.createComponent("Tabc.qml"));
}

The Tabc.qml component has this code:

import QtQuick 2.0
import QtQuick.Layouts 1.1
import QtQuick.Dialogs 1.1
import QtQuick.Window 2.1
import QtQuick.Controls 1.1

Rectangle {
ListModel {
id: libraryModel
ListElement{ title: "Buy a car" ; type: "Task" ; sender: "boss@domain.com"}
ListElement{ title: "Install Linux" ; type: "Task"; sender: "cto@domain.com" }
ListElement{ title: "What are the sales for this month?" ; type: "Question"; sender: "secretary@domain.com" }
}

TableView {
width: parent.width
TableViewColumn{ role: "title" ; title: "Title" }
TableViewColumn{ role: "type" ; title: "Type" }
TableViewColumn{ role: "sender" ; title: "From" }
model: libraryModel
}
}


How do I fix this and make the tab appear ?
TIA

anda_skoa
1st May 2014, 13:19
Hi,
I get this error when I try to show a tab (app is done with QT 5.2, with QT Quick 2):


file:///home/niko/qtdev/build-forms-Desktop_Qt_5_2_1_GCC_64bit-Debug/qml/forms/main.qml:207:5: QML Column: Cannot specify top, bottom, verticalCenter, fill or centerIn anchors for items inside Column. Column will not function.

How do I fix this and make the tab appear ?


What is unclear about the error?
Open your main.qml, go to line 207, identify the element you add to the column, check that it does not use any of the anchors listed in the error message.
Hint: "fill"

Cheers,
_

nuliknol
1st May 2014, 15:40
ohh, thanks!

anchors.fill: parent

was what i was missing