LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 12-09-2007, 09:40 PM   #1
binarybob0001
Member
 
Registered: Dec 2004
Distribution: Debian Wheezy
Posts: 444

Rep: Reputation: 30
qt complains about having multiple layout


The best way to get to the problem is through code. So here it goes.
Code:
PackageProperties::PackageProperties(QWidget *parent, const char *n) : QWidget(parent, n)
{
  QHBoxLayout* hbl = new QHBoxLayout(this);

  prompt[0] = new QLabel("Tar file name: ", this);
  filename = new QLineEdit(this);
  prompt[1] = new QLabel("Name: ", this);
  name = new QLineEdit(this);
  prompt[2] = new QLabel("Version: ", this);
  version = new QLineEdit(this);
  prompt[3] = new QLabel("Architecture: ", this);
  arch = new QComboBox(this);
  arch->insertItem("i386");
  arch->insertItem("i486");
  arch->insertItem("i586");
  arch->insertItem("i686");
  arch->insertItem("noarch");
  arch->setCurrentItem(3);
  prompt[4] = new QLabel("Build: ", this);
  build = new QLineEdit(this);

  QVBoxLayout* vbl = new QVBoxLayout(this);
  vbl->addWidget(prompt[0]);
  vbl->addWidget(prompt[1]);
  vbl->addWidget(prompt[2]);
  vbl->addWidget(prompt[3]);
  vbl->addWidget(prompt[4]);
  hbl->addLayout(vbl);

  vbl = new QVBoxLayout(this);
  vbl->addWidget(filename);
  vbl->addWidget(name);
  vbl->addWidget(version);
  vbl->addWidget(arch);
  vbl->addWidget(build);
  hbl->addLayout(vbl);
}
In the messages portion I get a message stating
QLayout "unnamed" added to QWidget "unnamed", which already has a layout
Is there any way to accomplish the same thing and not have this message?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Switching keyboard layout - Mandriva2006 - K.D.E. Windows Layout! itz2000 Mandriva 3 08-13-2006 06:43 PM
Limewire complains I don't have J2RE kahlil88 Linux - Software 8 01-20-2006 03:08 AM
g++ complains about global variables copolii Programming 3 09-18-2005 08:43 PM
firefox complains about my profile being in use renna Linux - Software 4 02-02-2005 12:53 PM
Help: complains that I can't post URLs, but I have none. mithrascruor LQ Suggestions & Feedback 3 11-14-2004 10:14 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:22 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration