Am 18.05.2007, 18:49 Uhr, schrieb Johan Grahn <johan cgeek.net>:
> Hello guys, i'm new to the list so this is my first
post!
>
> I'm developing a KDE 3 application and is using
KMainWindow to store all
> my
> widgets and is using a QLayout to align the widgets.
The problem is that
> KMainWindow has already a layout.
>
> The error msg i get is:
> QLayout "unnamed" added to MainWindow
"mainwin", which already has a
> layout
>
> relevent code is:
> MainWindow::MainWindow ( const char *name )
> : KMainWindow ( 0, name )
> {
> m_text = new QTextEdit(this, "dd");
> QPushButton *m_button = new
QPushButton("Connect", this,
"badanka");
> connect(m_button, SIGNAL(clicked()), this,
SLOT(connectToMpd()));
>
> m_main_box = new QVBoxLayout(this);
> m_main_box->addWidget(m_text);
> m_main_box->addWidget(m_button);
>
> Any hints/tips?
>
> Thanks!
>
> // Johan
I think you have to create a QWidget, give it your Layout,
and set it as
centralWidget in the MainWindow.
>> Visit
http://mail.kde.org/mailman/listinfo/kde-devel#unsub to
unsubscribe <<
|