QWidget::createWindowContainer() ,how to put this widget createdby this API to stackunder another QWidget
Unsolved
General and Desktop
-
@jimfar
hi,
that really depends on how you manage your Widget position.
But, generally speaking, you can useQWidget::raise()
to move it on top of the stack,QWidget::lower()
to move it to the bottom, or useQWidget::stackUnder(QWidget *w)
to place it under the QWidget W -
QGridLayout *layout = new QGridLayout(this);
m_window->lower();
QWidget*pw=QWidget::createWindowContainer(m_window, pw, Qt::Widget);pw->setFocusPolicy(Qt::TabFocus); pw->setAcceptDrops(true); setAcceptDrops(true); layout->setMargin(0); layout->setSpacing(0); layout->setContentsMargins(0, 0, 0, 0); this->setContentsMargins(0, 0, 0, 0); layout->addWidget(pw); pProgressBar = NULL; pProgressBar = new QProgressBar(this); pProgressBar->setVisible(true); pProgressBar->setMinimum(0); pProgressBar->setMaximum(100); QPoint PT = this->geometry().center(); pProgressBar->setMinimumWidth(this->width() / 4); pProgressBar->move(PT.x() - pProgressBar->width() / 2, PT.y() - pProgressBar->height() / 2); pProgressBar->raise();
-
@jimfar In this line you pass pw as parent:
QWidget*pw=QWidget::createWindowContainer(m_window, pw, Qt::Widget);
Do you have another pw there? Because if not this code actually should not compile.
Can you show the whole code? -