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
Forum Update on Monday, May 27th 2025

QScript add a specific == operator

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 542 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.
  • M Offline
    M Offline
    mistralegna
    wrote on 27 Apr 2015, 08:52 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 28 Apr 2015, 23:43 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

      1/2

      27 Apr 2015, 08:52

      • Login

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