Hi all,

I have a problem in updating a validator range in the body
of a callback, as the result of a button click.

Wt version in use: 3.1.9

In order to see the very same behaviour, I modified the widgetgallery
example in the following way:

Validators.h
- Added a class method with the following signature

void updateRange();

Validators.C
- Made WDoubleValidator global.
- Implemented the method updateRange() by doing:

std::cout << "myValidator range: ["
          << myValidator->bottom() << ", "
          << myValidator->top() << "]" << std::endl;
myValidator->setRange(-4, 14);

- In the constructor this is the code of the validator part:

  new WText("<tt>WDoubleValidator</tt>: range [-5.0 to 15.0]",
    table->elementAt(1, 0));
  le = new WLineEdit(table->elementAt(1, 1));
  myValidator = new WDoubleValidator(-5, 15);
  le->setValidator(myValidator);
  fields_.push_back(std::pair<WFormWidget *, WText *>
                    (le, new WText("", table->elementAt(1, 2))));
  WPushButton* myButton = new WPushButton("UpdateRanges",
     table->elementAt(1, 1));
  myButton->clicked().connect(this, &Validators::updateRange);

First click output:

    myValidator range: [-5, 15]
    (then the range gets updated)

Second click output:

    myValidator range: [-4, 14]
    (same range setup)

But both at tooltip level and at validation level (the red
highlighting of the lineedit) I'm seeing the old validator range
behaviour (-5, 15). What am I doing wrong here?

Thanks in advance,
-- 
Antonio

------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
witty-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/witty-interest

Reply via email to