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. QML and C++ overloaded operators
Qt 6.11 is out! See what's new in the release blog

QML and C++ overloaded operators

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
4 Posts 2 Posters 2.2k 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.
  • Raistlin MajereR Offline
    Raistlin MajereR Offline
    Raistlin Majere
    wrote on last edited by
    #1

    Good time of day :)
    Is it possible to call QObject overloaded operators (for example operator+) in QML javascript instead of built-in JS operator "+"?

    1 Reply Last reply
    0
    • dheerendraD Offline
      dheerendraD Offline
      dheerendra
      Moderators Qt Champions 2024 Qt Champions 2022 Qt Champions 2017
      wrote on last edited by
      #2

      This is not possible as the operator is interpreted in QML as script.

      Dheerendra
      @Community Service
      Certified Qt Specialist
      https://www.pthinks.com

      Raistlin MajereR 1 Reply Last reply
      4
      • dheerendraD dheerendra

        This is not possible as the operator is interpreted in QML as script.

        Raistlin MajereR Offline
        Raistlin MajereR Offline
        Raistlin Majere
        wrote on last edited by Raistlin Majere
        #3

        @dheerendra
        what a pity :(
        So, if i use "+" in JS, corresponding "+" operator in C++ is not called?

        1 Reply Last reply
        0
        • dheerendraD Offline
          dheerendraD Offline
          dheerendra
          Moderators Qt Champions 2024 Qt Champions 2022 Qt Champions 2017
          wrote on last edited by
          #4

          It is fact. Do you have complete sample ?

          Dheerendra
          @Community Service
          Certified Qt Specialist
          https://www.pthinks.com

          1 Reply Last reply
          3

          • Login

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