Set two control in same column in Gridlayout

  • Hi,
    How to set the two widget in same column in gridlayout.

  • Lifetime Qt Champion


    What do you mean by same column ? Two widget at the same place or two widget in the same column on different rows ?

  • You can nest layouts, so you can put a RowLayout as an item inside a GridLayout. The other solution is to use columnSpan>1 on the other rows in the layout.

  • Hi
    let me explain the problem

    My requirement is i need to place two widgets on the same position for that i made use of grid widget has a transparent portion and the second one need to be placed exactly at the transparent area here the widget is list(need to be placed at transparent area).the placement is fine but the selection of index starting from above the list.

    thanks in advance

  • I think it might be easier to follow if you show a code example of what you have tried to do and explain what is wrong with that or show a crude drawing of what you are trying to achieve.

    I don't really get from the description that anything is wrong with your grid layout at all. Wrapping an item inside another is simply done by parenting and anchors on the same item.

  • Hi,
    For your reference i pasted a image file.In that image file the white area is a transparent i want to fit the listview in that transparent i used gridlayout to insert the widget like


    But i face the index problem in listview.if i click the outside of listview also the list selected.


Log in to reply

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