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

Updating the value of a Q_PROPERTY-ENUM using a stylesheet

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 6.5.0
    • Widgets: Style Sheets
    • None
    • Windows 10, Qt 6.5, Visual Studio 2022
    • Windows

    Description

      Given this code:

      class Gallery : public ScrollArea 
      {     
         Q_OBJECT     
         Q_PROPERTY(Alignment alignment MEMBER alignment) 
      public:     
         enum class Alignment { top, left, center };     
         Q_ENUM(Alignment)     
         Alignment alignment = Alignment::center;
      };

       When updating the value of alignment using a stylesheet:

      Gallery
      { 
         qproperty-alignment: abc;   /* any value !=  than left or "left" is ignored, alignment remains left */   
         qproperty-alignment: left;   /* alignment becomes 19, why? (?)*/   
         qproperty-alignment: "left"/* Inside quotes, as: "left", "right", both works correctly */
      }
      

      Why does alignment become 19 in the second case? Is it a bug?

      Attachments

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

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            joey Joey Nek
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes