Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Qt Quick Test and enums- Compare actual enums instead of enum values
Forum Updated to NodeBB v4.3 + New Features

Qt Quick Test and enums- Compare actual enums instead of enum values

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 117 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Offline
    E Offline
    Edbob
    wrote on last edited by Edbob
    #1

    Hi,

    Let's say I have in MyText.qml:

    Text {
        enum TextType {
            Normal,
            Heading
        }
    
        property int textType: MyText.TextType.Normal
    }
    

    And in my tst_MyText.qml:

    TestCase
    {
      function test_test()
      {
      ...
      compare(myText.textType, 0);
      ...
      }
    }
    

    This works fine. However I would like to do something like this:

    compare(myText.textType, myText.textType.Normal);
    

    But I can't get it working despite trying many different way of writing the expected part.

    Any way to make it work?
    Cheers

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved