Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-20489

QValidator inheritance

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Unresolved
    • Not Evaluated
    • None
    • 4.7.3
    • None

    Description

      The specialized validators QDoubleValidator, QIntValidator QRegExpValidator derived from the QValidator shall be defined as:

      class QXXXValidator : public virtual QValidator

      This would allow to extend the validator interface:

      class MyValidatorInterface : public virtual QValidator
      {
      MyValidatorInterface( char *inp = 0 );
      virtual someType myInterfaceMethod = 0; // e.g. QString getError();
      };

      class MyIntValidator : public MyValidatorInterface, public QIntValidator
      {
      QIntValidatorVerb( char *inp = 0 );
      virtual int validate();
      virtual someType myInterfaceMethod;
      };

      Currently such an attempt causes the ambiguity warning:

      warning: virtual base 'QValidator' inaccessible in 'MyIntValidator' due to ambiguity

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            Unassigned Unassigned
            lotek Bogdan Lotko
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes