Project

General

Profile

Actions

Feature #973

open

WSpinBox + WValidator

Added by Rob Van Dyck over 12 years ago. Updated over 12 years ago.

Status:
Feedback
Priority:
Normal
Assignee:
Target version:
-
Start date:
09/01/2011
Due date:
% Done:

0%

Estimated time:

Description

It appears Validators don't work on Spinboxes.

code example:

// does not work

WSpinBox *b2 = new WSpinBox(root());

WIntValidator *val2 = new WIntValidator(0, 1);

b2->setValidator(val2);

// works

WLineEdit *tst = new WLineEdit(root());

WIntValidator *val3 = new WIntValidator(0, 1);

tst->setValidator(val3);

I have tried this with the git version, and the latest release.

Actions #1

Updated by Koen Deforche over 12 years ago

  • Status changed from New to Feedback
  • Assignee set to Koen Deforche

Hey Rob,

This may indeed be unexpected. The reason is that the spinbox already uses a validator to accept only valid input according to the defined range and prefix and suffix definitions.

Are you trying to accomplish anything beyond that ?

Regards,

koen

Actions #2

Updated by Rob Van Dyck over 12 years ago

Hi Koen,

I would like to make a spinbox that accepts only odd positive numbers. Is there a way to do this?

Either way, it might be usefull to add some info on this to the documentation.

Thanx!

Rob.

Actions #3

Updated by Koen Deforche over 12 years ago

Hey Rob,

I've updated the documentation. No, currently, this is not possible indeed. I guess it should be doable to compose the two validators (the built-in one, and the user-set one).

Regards,

koen

Actions #4

Updated by Koen Deforche over 12 years ago

  • Tracker changed from Bug to Feature
Actions

Also available in: Atom PDF