Strange problem with layout

  • Hi guys,
    i have two strange problems with my layout.

    My layout is like this:

    this->mainLayout = new QHBoxLayout();
    this->itemView = new QTableView();
    menuLayout = new QVBoxLayout();
    mapsLayout = new QHBoxLayout();
    view=new QWebView(ythis)

    Now i would to remove the mapsLayout from the mainLayout. I tried all method of the documentation but noone seems works fine.

    An other problem is that the mapsLayout is displayed vertically. Why? It 's a QHBoxLayout. I would to display it horizontally, under my QTableView.

    This is th screenshot:


  • Regarding your second question:

    I think your understanding of the layout terminology is backwards: a horizontal layout lays out items in a horizontal row, whereas a vertical layout lays out items in a vertical column. It sounds to me like you want a QVBoxLayout, if you want the widgets to be added beneath the QTableView.

  • Yes Chris i'm sorry, you're right.
    I thought the problem was that originally i would only the menuLayout displayed vertically, then i changed my mind and i am going to display all with vertical layout.

    I'm sorry.

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.