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. How to use deprecated functions in Qt5

How to use deprecated functions in Qt5

Scheduled Pinned Locked Moved General and Desktop
4 Posts 3 Posters 2.7k 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.
  • C Offline
    C Offline
    chris17
    wrote on last edited by
    #1

    Hi,

    I am trying to build my application with Qt5, while keeping the source compatible to Qt4. I already have an idea how to do this in the project file and how to deal with the includes.

    Now I would like to use deprecated functions like QHeaderView::setResizeMode().

    I have tried the "QT_DISABLE_DEPRECATED_BEFORE":http://qt-project.org/doc/qt-5.0/qtcore/qtglobal.html#QT_DISABLE_DEPRECATED_BEFORE macro but I still cannot use the deprecated functions.

    .pro file:
    @QT_DISABLE_DEPRECATED_BEFORE=0x04000000@

    Is it possible to call deprecated functions, or would I have to make a custom build to do this?

    1 Reply Last reply
    0
    • K Offline
      K Offline
      koahnig
      wrote on last edited by
      #2

      Did you try

      @
      QT_DISABLE_DEPRECATED_BEFORE=0x000000
      @

      Vote the answer(s) that helped you to solve your issue(s)

      1 Reply Last reply
      0
      • D Offline
        D Offline
        dbzhang800
        wrote on last edited by
        #3

        @
        QT_DISABLE_DEPRECATED_BEFORE=0x04000000 ##Don't work, it's larger than 0x050000
        QT_DISABLE_DEPRECATED_BEFORE=0x040000 ##Use this!!
        @

        1 Reply Last reply
        0
        • C Offline
          C Offline
          chris17
          wrote on last edited by
          #4

          thanks for the answers, I now tried
          @
          QT_DISABLE_DEPRECATED_BEFORE=0x040000
          @

          and
          @
          QT_DISABLE_DEPRECATED_BEFORE=0x000000@

          but none of it works.

          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