C++ Reflection and Qt MOC

(wiki.qt.io)

44 points | by coffeeaddict1 3 days ago

7 comments

  • pjmlp 3 hours ago
    Even if C++26 covers all scenarios needed for MOC, it is going to take ages until Qt can rely on it being available across all their customer platforms, unfortunely after a spike in the last decades regarding ISO C++ support, the compilers velocity has slowed down, while proprietary compilers have decided to freeze their support somewhere between C++14 and C++17.

    Most likely the raise of AOT compiled alternatives, for scenarios where C and C++ were only being used due to being compiled languages, big names in C++ compiler world rather put money on their own alternatives, are the two main reasons of the slow down.

    - https://en.cppreference.com/w/cpp/compiler_support.html

    - https://en.cppreference.com/w/cpp/compiler_support/17.html

    - https://en.cppreference.com/w/cpp/compiler_support/14.html

    • HarHarVeryFunny 1 hour ago
      What are all the use cases for MOC?

      I used to use Qt quite extensively years ago, and it seemed that all MOC was really bringing to the table was signa-slot connections which can certainly be done in much nicer ways (e.g. just use std::function to represent signals).

      • badsectoracula 1 hour ago
        That is what the linked article is about: what moc provides and what the pure C++ equivalent (if any) could be.
  • waynecochran 1 minute ago
    Moc?
  • rixed 29 minutes ago
    Meanwhile, copperspice got rid of the MOC more than 10 years ago.

    I'm no longer familiar with Qt nor C++, but I guess the real blocker here is that the Qt foundation is only looking for ways that are 100% backward-compatible to inccur no change in its commercial userbase? Or am I missing something more subtle?

  • 5- 45 minutes ago
  • bluGill 2 hours ago
    Moc is complex. reflection is complex. round one was trying to be as simple as possible while still allowing some real world use and allow room for the future.
  • Kelteseth 3 hours ago
    • buovjaga 3 hours ago
      Comment in the issue referring to the wiki page: "note: it needs updates for stuff merged in Sofia".