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

missing Q_DECLARE_METATYPE for QHostAddress

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Do
    • P3: Somewhat important
    • None
    • 5.1.1
    • Network
    • None
    • vs2012/win7/x86 and gcc/centos6.4/x86

    Description

      most QT objects such as QString and QByteArray have their metatypes declared allowing emitting of them across threads, but not QHostAddress. This appears to be an oversight.

      simply adding the following to one of my cpp files fixes this

      Q_DECLARE_METATYPE(QHostAddress);
      class my_init { public: my_init()

      { qRegisterMetaType<QHostAddress>("QHostAddress"); }

      };
      static my_init _init;

      eg use a signal like the follow and connect and emit across threads
      signals:
      void test(const QHostAddress& a);

      Attachments

        For Gerrit Dashboard: QTBUG-34995
        # Subject Branch Project Status CR V

        Activity

          People

            richmoore Richard Moore (qtnetwork)
            steelbytes Louis Solomon
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes