Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QScript add a specific == operator

QScript add a specific == operator

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 540 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.
  • mistralegnaM Offline
    mistralegnaM Offline
    mistralegna
    wrote on last edited by
    #1

    Hello !

    I am currently playing with the functionalities provided by the QScript module. I would like to evaluate a simple expression like 'val 1' == 'val 2'. Is it possible to indicate to QScript what it should use to perform the equality comparison ? In C++, I should have reimplemented the operator== for the specified types.

    Thanks a lot for your answers !

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SysTech
      wrote on last edited by SysTech
      #2

      I honestly can't answer your question directly as I have not tried to do any operator overloading in QScript. I can say however while it is not the same thing you can extend QScript providing and registering your own functions. So you can have something in your code like:

      if( compareValue( A, B ) )
         then do something
      

      You'd write and register compareValue to do whatever you need. Yes yes... not operator overloading but it would world to get your comparison to work the way you want. I'm doing something like this now in my scripts.

      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