[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-devel
Subject: Re: KMainWindow layout
From: Johan Grahn <johan () cgeek ! net>
Date: 2007-05-18 18:45:01
Message-ID: 200705182045.01801.johan () cgeek ! net
[Download RAW message or body]
On Friday 18 May 2007 18.53.55 BtbN wrote:
> 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.
Thanks alot, worked like a charm.
>
> >> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to
> >> unsubscribe <<
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic