Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Strange problem with layout
Forum Updated to NodeBB v4.3 + New Features

Strange problem with layout

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 1.6k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Sinapse
    wrote on last edited by
    #1

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

    My layout is like this:

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

    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:

    !http://imageshack.us/photo/my-images/825/screenshotkz.png/()!

    1 Reply Last reply
    0
    • C Offline
      C Offline
      Chris H
      wrote on last edited by
      #2

      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.

      1 Reply Last reply
      0
      • S Offline
        S Offline
        Sinapse
        wrote on last edited by
        #3

        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.
        Thanks
        Luca

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved