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

QMetaType API inconsistency

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Out of scope
    • P3: Somewhat important
    • 5.0.0
    • 4.3.1
    • Core: Object Model
    • None

    Description

      QMetaType::type returns 0 for unregistered types, whereas 0 is considered a default-type by QMetaType::isRegistered. A -1 return value from QMetaType::type would be more in line with the rest of Qt.

      #include <QtGui>

      int main(int argc, char *argv[])
      {
      QApplication a(argc, argv);

      if (!QMetaType::isRegistered(QMetaType::type("QList<double>")))

      { qRegisterMetaType< QList<double> >("QList<double>"); }

      Q_ASSERT("queued connection with QList<double> parameter");
      }

      Update:
      Such a change cannot be done until Qt 5 due to compabitility reasons.

      Attachments

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

        Activity

          People

            bhughes Bradley T. Hughes (closed Nokia Identity) (Inactive)
            vhilshei Volker Hilsheimer
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes