PDA

View Full Version : QGridLayout XY position



paule22
9th August 2008, 17:20
Hi,

i using Qt 4.3.4.
how can I compile http://doc.trolltech.com/3.3/t8-main-cpp.html

QGridLayout *grid = new QGridLayout( this, 2, 2, 10 ); // 2x2, 10 pixel border

I get some errors like

qt_mainwindow.cc:33: error: no matching function for call to `QGridLayout::QGrid
Layout(QWidget*&, int, int, int)'
i:/Qt/4.3.4/include/QtGui/../../src/gui/kernel/qgridlayout.h:146: note: candidat
es are: QGridLayout::QGridLayout(const QGridLayout&)
i:/Qt/4.3.4/include/QtGui/../../src/gui/kernel/qgridlayout.h:69: note:
QGridLayout::QGridLayout()
i:/Qt/4.3.4/include/QtGui/../../src/gui/kernel/qgridlayout.h:68: note:
QGridLayout::QGridLayout(QWidget*)
make: *** [qt_mainwindow.o] Error 1


How can I emulate 640x480 pixel mode in GridLayout?
I confused with the layout from Qt ...
give it a XY Layout?

thanks for helping
Jens

jpn
9th August 2008, 17:24
Qt 3 and Qt 4 are incompatible. You're using Qt 4 but trying to compile an example from Qt 3. Use the ones provided with Qt 4 instead.

paule22
9th August 2008, 18:42
Thanks for your Reply,

but, is there a QXYLayout class like BORLAND Java-Builder?
So I can use the testfunc(int x, int y, int w, int h) function
to resize a QPushButton?
button->setGeometry(x,y,w,h); does not effect.
But the QDesigner understand XY Layout, if there a way to do this
per hand?
I don't will/need *.ui files.

thanks
Jens