PDA

View Full Version : Why?



qintm
29th March 2006, 21:39
Error Hint :"Attempting to add QLayout "" to QFrame "WelcomePage", which already has a layout."
int
main (int argc, char *argv[])
{
QApplication app (argc, argv);
Q_INIT_RESOURCE (InstallerForQt4);

QDialog dlg;
UiInstallerDlg uidlg;
uidlg.setupUi (&dlg);
WelcomePage wp;
wp.setupUi (uidlg.m_PageFrame);
uidlg.m_PageFrame->adjustSize();


dlg.show ();
return app.exec ();
}
//WelcomePage.h
.................
{
public:
.........

void setupUi(QWidget *WelcomePage)
{
WelcomePage->setObjectName(QString::fromUtf8("WelcomePage"));
WelcomePage->resize(QSize(755, 454).expandedTo(WelcomePage->minimumSizeHint()));//??Why useless
WelcomePage->setMinimumSize(QSize(755, 454));//??Why useless
WelcomePage->setMaximumSize(QSize(755, 454));//??Why useless

hboxLayout = new QHBoxLayout(WelcomePage);
hboxLayout->setSpacing(0);
hboxLayout->setMargin(0);
hboxLayout->setObjectName(QString::fromUtf8("hboxLayout"));
hboxLayout1 = new QHBoxLayout();
hboxLayout1->setSpacing(0);
hboxLayout1->setMargin(0);
hboxLayout1->setObjectName(QString::fromUtf8("hboxLayout1"));
frame_2 = new QFrame(WelcomePage);
frame_2->setObjectName(QString::fromUtf8("frame_2"));
frame_2->setMaximumSize(QSize(260, 16777215));
frame_2->setFrameShape(QFrame::StyledPanel);
frame_2->setFrameShadow(QFrame::Raised);
label = new QLabel(frame_2);
label->setObjectName(QString::fromUtf8("label"));
label->setGeometry(QRect(20, 30, 201, 41));

hboxLayout1->addWidget(frame_2);

line = new QFrame(WelcomePage);
line->setObjectName(QString::fromUtf8("line"));
line->setFrameShape(QFrame::VLine);

hboxLayout1->addWidget(line);

frame = new QFrame(WelcomePage);
frame->setObjectName(QString::fromUtf8("frame"));
frame->setFrameShape(QFrame::StyledPanel);
frame->setFrameShadow(QFrame::Raised);

hboxLayout1->addWidget(frame);

hboxLayout->addLayout(hboxLayout1);

retranslateUi(WelcomePage);

QMetaObject::connectSlotsByName(WelcomePage);
} // setupUi

void retranslateUi(QWidget *WelcomePage)
{
...
...
...
} // retranslateUi

};

namespace Ui {
class WelcomePage: public Ui_WelcomePage {};
} // namespace Ui

#endif // WELCOMEPAGE_H

//UiInstallerDlg.h
#ifndef UIINSTALLERDLG_H
#define UIINSTALLERDLG_H
#include <...>

class Ui_UiInstallerDlg
{
...................

void setupUi(QDialog *UiInstallerDlg)
{
UiInstallerDlg->setObjectName(QString::fromUtf8("UiInstallerDlg"));
UiInstallerDlg->resize(QSize(755, 580).expandedTo(UiInstallerDlg->minimumSizeHint()));
UiInstallerDlg->setMinimumSize(QSize(755, 580));
UiInstallerDlg->setMaximumSize(QSize(755, 580));
UiInstallerDlg->setBaseSize(QSize(755, 580));
label = new QLabel(UiInstallerDlg);
label->setObjectName(QString::fromUtf8("label"));

line_2 = new QFrame(UiInstallerDlg);
line_2->setObjectName(QString::fromUtf8("line_2"));
line_2->setGeometry(QRect(1, 518, 753, 16));
line_2->setFrameShape(QFrame::HLine);
m_PageFrame = new QFrame(UiInstallerDlg);
m_PageFrame->setObjectName(QString::fromUtf8("m_PageFrame"));
m_PageFrame->setGeometry(QRect(1, 64, 755, 454));

m_PageFrame->setFrameShadow(QFrame::Raised);
gridLayout = new QGridLayout(m_PageFrame);
gridLayout->setSpacing(0);
gridLayout->setMargin(0);
gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
frame = new QFrame(UiInstallerDlg);
frame->setObjectName(QString::fromUtf8("frame"));
frame->setGeometry(QRect(1, 521, 755, 58));
frame->setFrameShape(QFrame::NoFrame);
frame->setFrameShadow(QFrame::Raised);
hboxLayout = new QHBoxLayout(frame);
hboxLayout->setSpacing(0);
hboxLayout->setMargin(2);
hboxLayout->setObjectName(QString::fromUtf8("hboxLayout"));
hboxLayout1 = new QHBoxLayout();
hboxLayout1->setSpacing(0);
hboxLayout1->setMargin(4);
hboxLayout1->setObjectName(QString::fromUtf8("hboxLayout1"));
progressBar = new QProgressBar(frame);
progressBar->setObjectName(QString::fromUtf8("progressBar"));
progressBar->setMaximumSize(QSize(16777215, 18));

progressBar->setValue(24);


hboxLayout1->addWidget(progressBar);

spacerItem = new QSpacerItem(20, 20, QSizePolicy::Fixed, QSizePolicy::Minimum);

hboxLayout1->addItem(spacerItem);

backBtn = new QPushButton(frame);
backBtn->setObjectName(QString::fromUtf8("backBtn"));
backBtn->setEnabled(false);

hboxLayout1->addWidget(backBtn);

nextBtn = new QPushButton(frame);
nextBtn->setObjectName(QString::fromUtf8("nextBtn"));
nextBtn->setEnabled(true);
nextBtn->setAutoFillBackground(true);

hboxLayout1->addWidget(nextBtn);

cancelBtn = new QPushButton(frame);
cancelBtn->setObjectName(QString::fromUtf8("cancelBtn"));

hboxLayout1->addWidget(cancelBtn);

spacerItem1 = new QSpacerItem(4, 2, QSizePolicy::Fixed, QSizePolicy::Minimum);

hboxLayout1->addItem(spacerItem1);


hboxLayout->addLayout(hboxLayout1);

retranslateUi(UiInstallerDlg);
QObject::connect(cancelBtn, SIGNAL(clicked()), UiInstallerDlg, SLOT(close()));

QMetaObject::connectSlotsByName(UiInstallerDlg);
} // setupUi

void retranslateUi(QDialog *UiInstallerDlg)
{
...
...
...
} // retranslateUi

};

namespace Ui {
class UiInstallerDlg: public Ui_UiInstallerDlg {};
} // namespace Ui

#endif // UIINSTALLERDLG_H

wysota
29th March 2006, 21:45
And the question is...?