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

Q_GADGET forces following elements to be private

    XMLWordPrintable

Details

    • macOS
    • eb2db7906 (dev), 9fb14df81 (6.7), 8db678128 (6.6), 4f69c82ce (tqtc/lts-6.5)

    Description

      When Q_GADGET appears in a class or struct, it forces everything following it to be private.

      In the following C++ struct

      struct MyGadget
      {
        int publicInt;
        Q_INVOKABLE publicQInvokable();
      
        Q_GADGET
      
        int privateInt;
        Q_INVOKABLE privateQInvokable();
      

      Of course everything in a struct should be public unless explicitly changed, yet everything following Q_GADGET is private unless explicitly changed.

      Attachments

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

        Activity

          People

            cnn Qt Core & Network
            paulmasri Paul
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: