List Info

Thread: KMainWindow layout




KMainWindow layout
country flaguser name
Sweden
2007-05-18 11:49:20
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
 
>> Visit 
http://mail.kde.org/mailman/listinfo/kde-devel#unsub to
unsubscribe <<

Re: KMainWindow layout
country flaguser name
Germany
2007-05-18 11:53:55
Am 18.05.2007, 18:49 Uhr, schrieb Johan Grahn <johancgeek.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 <<

Re: KMainWindow layout
country flaguser name
Sweden
2007-05-18 13:45:01
On Friday 18 May 2007 18.53.55 BtbN wrote:
> Am 18.05.2007, 18:49 Uhr, schrieb Johan Grahn
<johancgeek.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 <<

[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )