starcontrol
9th April 2008, 12:09
Hi,
I use a nested layout widget instance in my subclass of QMainWindow. At runtime I get the following message on console:
QLayout: Attempting to add QLayout "" to SchulungsplanParentWidget "", which already has a layout
Do you know why ? The gui seems to be correct...
This is my constuctor of the Widget class which is the center in my QMainWindow:
SchulungsplanParentWidget::SchulungsplanParentWidg et(QDate& p_startViewDate, QDate& p_endViewDate, QWidget *p_parent)
: QWidget(p_parent)
{
QVBoxLayout *vBoxLayout = new QVBoxLayout(this);
QHBoxLayout *hBoxLayout = new QHBoxLayout(this);
m_startViewDateLabel= new QLabel("Schulungsplan VON:");
m_startViewDateEdit = new QDateEdit(p_startViewDate);
m_endViewDateLabel = new QLabel("Schulungsplan BIS:");
m_endViewDateEdit = new QDateEdit(p_endViewDate);
m_uebernehmenButton = new QPushButton("Uebernehmen");
m_spTableView = new SchulungsplanView(this);
hBoxLayout->addWidget(m_startViewDateLabel, 1, Qt::AlignLeft);
hBoxLayout->addWidget(m_startViewDateEdit, 2, Qt::AlignLeft);
hBoxLayout->addWidget(m_endViewDateLabel, 1, Qt::AlignLeft);
hBoxLayout->addWidget(m_endViewDateEdit, 2, Qt::AlignLeft);
hBoxLayout->addWidget(m_uebernehmenButton, 1, Qt::AlignLeft);
vBoxLayout->addLayout(hBoxLayout);
vBoxLayout->addWidget(m_spTableView);
connect( m_uebernehmenButton, SIGNAL(clicked() ),
this, SLOT(uebernehmenButtonPressed() ) );
}
I use a nested layout widget instance in my subclass of QMainWindow. At runtime I get the following message on console:
QLayout: Attempting to add QLayout "" to SchulungsplanParentWidget "", which already has a layout
Do you know why ? The gui seems to be correct...
This is my constuctor of the Widget class which is the center in my QMainWindow:
SchulungsplanParentWidget::SchulungsplanParentWidg et(QDate& p_startViewDate, QDate& p_endViewDate, QWidget *p_parent)
: QWidget(p_parent)
{
QVBoxLayout *vBoxLayout = new QVBoxLayout(this);
QHBoxLayout *hBoxLayout = new QHBoxLayout(this);
m_startViewDateLabel= new QLabel("Schulungsplan VON:");
m_startViewDateEdit = new QDateEdit(p_startViewDate);
m_endViewDateLabel = new QLabel("Schulungsplan BIS:");
m_endViewDateEdit = new QDateEdit(p_endViewDate);
m_uebernehmenButton = new QPushButton("Uebernehmen");
m_spTableView = new SchulungsplanView(this);
hBoxLayout->addWidget(m_startViewDateLabel, 1, Qt::AlignLeft);
hBoxLayout->addWidget(m_startViewDateEdit, 2, Qt::AlignLeft);
hBoxLayout->addWidget(m_endViewDateLabel, 1, Qt::AlignLeft);
hBoxLayout->addWidget(m_endViewDateEdit, 2, Qt::AlignLeft);
hBoxLayout->addWidget(m_uebernehmenButton, 1, Qt::AlignLeft);
vBoxLayout->addLayout(hBoxLayout);
vBoxLayout->addWidget(m_spTableView);
connect( m_uebernehmenButton, SIGNAL(clicked() ),
this, SLOT(uebernehmenButtonPressed() ) );
}