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. Qt 4.8 QT_VERSION_CHECK and moc [WORKAROUND]
Forum Updated to NodeBB v4.3 + New Features

Qt 4.8 QT_VERSION_CHECK and moc [WORKAROUND]

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 1.8k Views 1 Watching
  • 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
    mcallegari79
    wrote on last edited by
    #1

    Hi all, sorry if this might have been already asked. I searched the forums but got nowhere.
    I'm now adding new features to my software using Qt 5.2.1.
    I've added several checks in the code like this:

    @
    #if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
    void slotVideoChecked(bool state);
    #endif
    @

    However, when moc creates the moc_*.cpp files, it seems to ignore the #if check, thus giving me build errors on Qt4.

    Any clue/workaround ?
    Thanks in advance

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mcallegari79
      wrote on last edited by
      #2

      OK, found what it is, as stated here:
      http://qt-project.org/forums/viewthread/31641

      On signals and slots in my header files, I need to change the check from
      @#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)@
      to
      @#if QT_VERSION >= 0x050000@

      It's a dirty workaround and it seems like a never fixed thing in Qt 4 (I'm on 4.8.4)

      1 Reply Last reply
      0
      • G Offline
        G Offline
        gkochar
        wrote on last edited by
        #3

        I've been stuck on the same issue from last two days now, and just came across your workaround...thank you so much for posting this.

        [quote author="mcallegari79" date="1392554855"]OK, found what it is, as stated here:
        http://qt-project.org/forums/viewthread/31641

        On signals and slots in my header files, I need to change the check from
        @#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)@
        to
        @#if QT_VERSION >= 0x050000@

        It's a dirty workaround and it seems like a never fixed thing in Qt 4 (I'm on 4.8.4)[/quote]

        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