[Qt-interest] qspinbox

Guido Seifert Wargand at gmx.de
Tue Aug 3 12:34:48 CEST 2010


Hi Phil,
I don't think you can do this. If I had your problem, before I derive from QSpinBox, I'd try whether I can get an acceptable behaviour with 	QAbstractSpinBox::specialValueText. If valid range is 0-100 I'd allow -1-100 and making the specialValueText an empty string, which is displayed when the value is -1. However, never tried this, so it might not work. Especially not when the value is entered manually and not via the arrow buttons. 

Guido


> 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
> 
> Phil
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest

-- 
GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01



More information about the Qt-interest-old mailing list