[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    QGridLayout question
From:       Mirko Sucker <mirko.sucker () unibw-hamburg ! de>
Date:       2000-04-16 21:23:13
[Download RAW message or body]

Hallo all,
I am experiencing trouble with using QGridLayout.
I create one using the following code:
----
  const int NoOfCols=3;
  layout=new QGridLayout(this, 100 /* 7 */, NoOfCols, 3, 2);
  if(layout==0)
    {
      KMessageBox::sorry
	(this, i18n("Out of memory."),
	 i18n("General failure."));
      ::exit(-1);
    }
  for(count=0; count<NoOfCols; ++count)
    { // make sure all columns get the same width:
      layout->setColStretch(count, 1);
    }
----
It is quiet simple - create a grid of 100 rows and 3 columns. Each column
should get the same width (exactly). QGridLayout is used as there are some
multi-call-widgets in it.

The problem is that column 0 (the first one) is layouted much wider than the
others. 

And now the completely weird thing: when changing the loop to 
  for(count=0; count<NoOfCols+1; ++count)
all columns get the same with, but now an empty column appears. 

Does anybody know an answer? I simply want 3 columns of the same width...
--Mirko.
-- 
Denn der  Mensch  liebt und ehrt den  Menschen,  solange er ihn
nicht zu beurteilen vermag, und die Sehnsucht ist ein Erzeugnis
mangelhafter Erkenntnis. (Thomas Mann)

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic