Results 1 to 6 of 6

Thread: macros in QT

  1. #1
    Join Date
    Feb 2009
    Posts
    53
    Thanks
    5

    Default macros in QT

    how can I find out if operation system has some font? how i can use this construction?

    Can I use this construction for finding font?

    #ifndef SOMETHING
    #define SOMETHING
    /*some code*/
    #endif

    Is somewhere some example with qt how can I use it?
    thanks

    edit: existing some this macros for recognising operating system? thanks
    Last edited by Noxxik; 19th March 2009 at 21:48.

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: macros in QT

    Quote Originally Posted by noxxik View Post
    edit: Existing some this macros for recognising operating system? Thanks
    q_ws_mac, q_ws_qws, q_ws_win, q_ws_x11

    For finding a font you can use QFontDatabase, but this is no macro. I would wonder if there were one to check for fonts. By the way, why do you need that (in a macro)?

  3. #3
    Join Date
    Jan 2006
    Posts
    22
    Thanks
    5
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: macros in QT

    You're right about the macros, Lykurg, but they do need to be in all-caps:

    Qt Code:
    1. #ifdef Q_WS_WIN
    2. #endif
    To copy to clipboard, switch view to plain text mode 

    See here for a list of the defined constants.
    Last edited by init2null; 19th March 2009 at 22:20.
    ImageRocket - My Qt4-based image editing program
    Project Page / Screenshots / Source

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: macros in QT

    Quote Originally Posted by Lykurg View Post
    I would wonder if there were one to check for fonts.
    It wouldn't make sense because you can move the font away (or install it) after you build the application. Things that vary between installations should be checked at run time, not compile time which obviously can't be done through a preprocessor macro.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. #5
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: macros in QT

    Quote Originally Posted by init2null View Post
    you're right about the macros, lykurg, but they do need to be in all-caps
    Jepp, but the board doesn't like me. It converted all caps to lower. Like "AAAAHHHHH" (<- was written in capitals). And I'm not willing to get forced to use the CODE-Tag (also was written in capitals). (The real reason was, I was yesterday too tired to change, and I thought Noxxik could figure it out )

    EDIT: Hä? don't understand it..
    ASDFJKLAJG GIAUJ ASL ILJ IGAUIDGH KIU HDSKLSDG
    now it works...

  6. #6
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: macros in QT

    This sample text was written in capitals!

Similar Threads

  1. why MACROS are used between class name and class keyword
    By babu198649 in forum General Programming
    Replies: 6
    Last Post: 4th February 2009, 13:30
  2. win32 platform macros?
    By gfunk in forum Qt Programming
    Replies: 1
    Last Post: 5th September 2007, 20:02
  3. Debug macros in 64bit systems
    By mcostalba in forum Qt Programming
    Replies: 8
    Last Post: 2nd December 2006, 20:16
  4. Qt Source Macros
    By cwalsh in forum Qt Programming
    Replies: 1
    Last Post: 8th January 2006, 18:27

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.