PDA

View Full Version : How to use the Qt3 Support members in Qt4?



Cutey
7th August 2008, 10:31
Hi Folks,

In my project(Qt4) I'm using
void QGridLayout::addColSpacing ( int col, int minsize ) the above method but I'm getting the following error " 'addColSpacing' : is not a member of 'QGridLayout'. "

Can any one help me in this regard..!!!

spirit
7th August 2008, 10:39
try to use this


void QGridLayout::setColumnMinimumWidth ( int column, int minSize )

jpn
7th August 2008, 10:49
You shouldn't use Qt3 support members in new code. Anyway, if you insist, add this to your .pro file:


QT += qt3support

Cutey
8th August 2008, 14:53
Yup I got it. Thanks folks...
But still I'm not meeting my requirement. FYI, Please look into the attachment.

There you could find collections of "checkboxes" in one side and other side "spinboxes & checkboxes".
I wanted to reduce the width of the spinboxes. I kept everything in a grid layout and I have tried setColumnMinimumWidth, setRowMinimumHeight, setColSpacing & etc., but nothing works...

Can any one help in this regard..........?

spirit
8th August 2008, 16:52
you can set Size Policy of spinBox to Fixed.

Cutey
9th August 2008, 07:36
I tried the following method but I'm getting error( 'QSizePolicy::QSizePolicy' : cannot access private member declared in class 'QSizePolicy' ).

spnBx->setSizePolicy(QSizePolicy::Fixed)

How to get this property..???

spirit
9th August 2008, 07:58
use this use


void QWidget::setSizePolicy ( QSizePolicy::Policy horizontal, QSizePolicy::Policy vertical )

Cutey
9th August 2008, 08:31
If you done mine, could you please explain me little more with an example..?

spirit
10th August 2008, 09:31
read this
http://doc.trolltech.com/4.4/qwidget.html#sizePolicy-prop
in your case, your code should look like


spinBox->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);

Cutey
11th August 2008, 06:27
Yup I got it................................. :D

Thanks Spirit,