K
K
Kirixo2019-11-30 20:05:16
Qt
Kirixo, 2019-11-30 20:05:16

How to refer to an element created programmatically in qt in c++?

I'm creating a layer and want to access it from another function. how to do it?

QVBoxLayout *l = new QVBoxLayout(this);
  l->setObjectName("sel_part");

Through ui, I understand it will not work.
ui->sel_part->hide();

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Ananiev, 2019-11-30
@Kirixo

Create a local class variable and access it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question