Results 1 to 3 of 3

Thread: tab does not appear

  1. #1
    Join Date
    Apr 2014
    Posts
    53
    Thanks
    9

    Default tab does not appear

    Hi,
    I get this error when I try to show a tab (app is done with QT 5.2, with QT Quick 2):
    Qt Code:
    1. 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.
    To copy to clipboard, switch view to plain text mode 

    the column is declared like this in my main qml file:
    Qt Code:
    1. Column {
    2. Row {
    3. Label {
    4. text: "Search:"
    5. }
    6.  
    7. TextField {
    8. width: 160
    9. placeholderText: "search..."
    10. }
    11. Button {
    12. text: " Ok ";
    13. }
    14. Button {
    15. text: "...";
    16. menu: menu_options
    17. }
    18. }
    19. TabView {
    20. id: companies_tab
    21. anchors.fill: parent
    22. }
    23. }
    To copy to clipboard, switch view to plain text mode 

    this is how I create the tab:
    Qt Code:
    1. Component.onCompleted: {
    2. loginWindow.show();
    3.  
    4. companies_tab.addTab("Company",Qt.createComponent("Tabc.qml"));
    5. }
    To copy to clipboard, switch view to plain text mode 

    The Tabc.qml component has this code:
    Qt Code:
    1. import QtQuick 2.0
    2. import QtQuick.Layouts 1.1
    3. import QtQuick.Dialogs 1.1
    4. import QtQuick.Window 2.1
    5. import QtQuick.Controls 1.1
    6.  
    7. Rectangle {
    8. ListModel {
    9. id: libraryModel
    10. ListElement{ title: "Buy a car" ; type: "Task" ; sender: "boss@domain.com"}
    11. ListElement{ title: "Install Linux" ; type: "Task"; sender: "cto@domain.com" }
    12. ListElement{ title: "What are the sales for this month?" ; type: "Question"; sender: "secretary@domain.com" }
    13. }
    14.  
    15. TableView {
    16. width: parent.width
    17. TableViewColumn{ role: "title" ; title: "Title" }
    18. TableViewColumn{ role: "type" ; title: "Type" }
    19. TableViewColumn{ role: "sender" ; title: "From" }
    20. model: libraryModel
    21. }
    22. }
    To copy to clipboard, switch view to plain text mode 

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

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: tab does not appear

    Quote Originally Posted by nuliknol View Post
    Hi,
    I get this error when I try to show a tab (app is done with QT 5.2, with QT Quick 2):
    Qt Code:
    1. 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.
    To copy to clipboard, switch view to plain text mode 

    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,
    _

  3. #3
    Join Date
    Apr 2014
    Posts
    53
    Thanks
    9

    Default Re: tab does not appear

    ohh, thanks!
    Qt Code:
    1. anchors.fill: parent
    To copy to clipboard, switch view to plain text mode 

    was what i was missing

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.