I
I
igorianru2016-11-20 21:34:24
Qt
igorianru, 2016-11-20 21:34:24

How to replace (update) widget in centralWidget in qt?

-------------------------------------

Answer the question

In order to leave comments, you need to log in

5 answer(s)
R
Rou1997, 2016-11-20
@Rou1997

So you add the layer already to the child widget, but you need to change it again in the same central one:

QGridLayout *layout = new QGridLayout;
QWidget *widget = new QWidget();
            
layout->addWidget(treeWidgetRight, 1, 5, 1, 8);
widget->setLayout(layout);

widget->setLayout(layout);
setCentralWidget(widget);

M
monochromer, 2017-03-09
@monochromer

Variant on float.
Assumption that sidebars are fixed width (200px in demo). The central column comes first in the markup (SEO-shniks in ecstasy).
An example from 10 years ago.

A
Alexander Reshetnyak, 2017-03-09
@Vampireos

Try to simplify the task to a minimum, and the solution will pop up by itself ^ ^
..if it doesn’t work out, then you need to get rid of the excess)

A
AnjeyTsibylskij, 2017-03-09
@AnjeyTsibylskij

I got something similar on floats https://jsfiddle.net/v1ga73uq/

K
krontill, 2017-03-12
@krontill

Alternatively, the green block can be duplicated, and then we show the necessary block with a media query and hide the unnecessary one.
Here is an example of how to do this codepen.io/krontill/pen/Npjmgr

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question