[Qt-interest] qspinbox

phil prentice philp.cheer at talktalk.net
Tue Aug 3 14:12:00 CEST 2010


Hi Andre
  I did try that, but for some reason it also came back with the last valid 
string i.e.

I tried 

qDebug("Text=%s",        
qPrintable(m_routing[0].chanSpinBox->QAbstractSpinBox::text()));

and 

QAbstractSpinBox *ptr = m_routing[0].chanSpinBox;
qDebug("Text=%s", qPrintable(ptr->QAbstractSpinBox::text()));

Both of these gave me the last valid integer text string that had been 
entered.

Am I doing something wrong?

Hi Guido
  If the above can not be made to work then I will try your suggestion. 

I just would of thought that this could be achieved easily using QSpinBox.  It 
seems over-kill to have to derive my own object???

Thanks
  Phil

On Tuesday 03 August 2010 11:37, Andre Somers wrote:
> Op Di, 3 augustus, 2010 12:25 pm, schreef phil prentice:
> > Hi
> >   I am using some QSpinBoxes in a dialog.  These spinboxes have valid
> > ranges.
> > Ideally I would like to disable the Ok box if the user has completely
> > deleted
> > all the characters in the spinbox.  Although I would be happy to check
> > for this case on the Ok slot itself if I cant disable Ok.
> >
> >   I've tryed all the obvious things like the valueChanged signals etc,
> > but at
> > the moment it seems to end up with the last correct value i.e.
> > QAbstractSpinBox::CorrectToPreviousValue.
> > I cant seem to detect that the curent text in the spinbox is null.
> >
> > Is there any nice way to do this (without deriving from QSpinBox)?
> >
> > Thanks for your help
>
> Doesn't QAbstractSpinBox::text() provide you with the current text?
>
> André
>
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest




More information about the Qt-interest-old mailing list