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. Mac OSX Read all file not defined... Is this a bug? in qt5.9
QtWS25 Last Chance

Mac OSX Read all file not defined... Is this a bug? in qt5.9

Scheduled Pinned Locked Moved Solved General and Desktop
macosx
3 Posts 2 Posters 1.1k 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.
  • P Offline
    P Offline
    patrik08
    wrote on 5 Aug 2017, 11:39 last edited by
    #1

    This produce some error..

    QTextStream out(stdout,QIODevice::WriteOnly);
    /* inside qmake file pro
    macx:DEFINES += MACOSX_ROOT
    win32:DEFINES += WINOSX_ROOT
    unix:DEFINES += LINUXOSX_ROOT
    QMake version 3.1
    Using Qt version 5.9.1 in /Users/dev/Applications/qt5.9.1/lib
     */
    
    #ifdef MACOSX_ROOT
    out << "Hi MAC OSX User: " << __DATE__ << endl; /// mac play this
    #endif
    
    #ifdef WINOSX_ROOT
    out << "Hi Window User: " << __DATE__ << endl;
    #endif
    
    #ifndef Q_WS_MAC
    #ifdef LINUXOSX_ROOT
       out << "Hi Linux User: " << __DATE__ << endl; /// mac play this??
    #endif
    #endif
    

    Out play:

    Hi MAC OSX User: Aug 5 2017
    Hi Linux User: Aug 5 2017

    Is this my error?
    ps: 2cm place to write new post in chrome.

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 5 Aug 2017, 11:46 last edited by
      #2

      Hi,

      Because Q_WS_MAC is a Qt 4 era define that is not anymore in Qt 5 and the unix scope you use in your .pro file includes also macOS.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • P Offline
        P Offline
        patrik08
        wrote on 5 Aug 2017, 14:29 last edited by
        #3

        @SGaist said in Mac OSX Read all file not defined... Is this a bug? in qt5.9:

        Q_WS_MAC
        Ok... tanks.... so many different variable in the last 10 years... uauu... other DEV-T to all QT oldtimer guy...
        I set now new my pro file...

        DEFINES += DEF-T
        message( "DEV-T - Developed Unnecessary Traffic you find all new inside QT5" )
        
        
        
        1 Reply Last reply
        0

        2/3

        5 Aug 2017, 11:46

        • Login

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