Results 1 to 2 of 2

Thread: Q_DECLARE_PUBLIC and other things I dont understand ?

  1. #1
    Join Date
    Sep 2010
    Posts
    654
    Thanks
    56
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Q_DECLARE_PUBLIC and other things I dont understand ?

    I have found at QT files then next 'way' of declare a class :
    Anybody can help me to understand it ? Any doc ?

    At file.h :
    class QLCDNumberPrivate;

    At file cpp :
    class QLCDNumberPrivate : public QFramePrivate
    {
    Q_DECLARE_PUBLIC(QLCDNumber)

    ////////////////////////////////////////// at global.h
    #define Q_DECLARE_PRIVATE(Class) \
    inline Class##Private* d_func() { return reinterpret_cast<Class##Private *>(qGetPtrHelper(d_ptr)); } \
    inline const Class##Private* d_func() const { return reinterpret_cast<const Class##Private *>(qGetPtrHelper(d_ptr)); } \
    friend class Class##Private;

    #define Q_DECLARE_PRIVATE_D(Dptr, Class) \
    inline Class##Private* d_func() { return reinterpret_cast<Class##Private *>(Dptr); } \
    inline const Class##Private* d_func() const { return reinterpret_cast<const Class##Private *>(Dptr); } \
    friend class Class##Private;

    #define Q_DECLARE_PUBLIC(Class) \
    inline Class* q_func() { return static_cast<Class *>(q_ptr); } \
    inline const Class* q_func() const { return static_cast<const Class *>(q_ptr); } \
    friend class Class;

  2. #2
    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: Q_DECLARE_PUBLIC and other things I dont understand ?

    These are all things private to Qt implementation. You don't need to worry about it. And there are no docs about it outside Qt development team.
    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.


Similar Threads

  1. Replies: 4
    Last Post: 13th June 2010, 13:31
  2. recompiling Qt install with -ffast-math to speed things up ...
    By qt_gotcha in forum Installation and Deployment
    Replies: 1
    Last Post: 23rd February 2010, 20:27
  3. Replies: 1
    Last Post: 18th March 2009, 22:26
  4. Replies: 4
    Last Post: 10th March 2007, 05:28
  5. Replies: 2
    Last Post: 14th February 2006, 16:28

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.