Results 1 to 6 of 6

Thread: Q_EXPORT - The Journey

  1. #1
    Join Date
    Dec 2010
    Location
    UK
    Posts
    9
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Q_EXPORT - The Journey

    Hi all
    This is file is for emulation functionality for old QFocusData class witch i need
    Macro Q_EXPORT is making me errors but i need it in my prog.

    Qt Code:
    1. 1#ifndef QFOCUSDATA_H
    2. 2#define QFOCUSDATA_H
    3.  
    4. 3#ifndef QT_H
    5. 4#include <qwidgetlist.h>
    6. 5#endif // QT_H
    7. 6#include <qevent.h>
    8.  
    9. class Q_EXPORT QFocusData {
    10. public:
    11. QWidget* focusWidget() const { return it.current(); }
    12. QWidget* home();
    13. QWidget* next();
    14. QWidget* prev();
    15. QWidget* first() const;
    16. QWidget* last() const;
    17. int count() const { return focusWidgets.count(); }
    18.  
    19. private:
    20. friend class QWidget;
    21.  
    22. QFocusData() : it(focusWidgets) {}
    23. QWidgetList focusWidgets;
    24. //QWidgetListIt it;
    25. };
    26.  
    27. #endif // QFOCUSDATA_H
    To copy to clipboard, switch view to plain text mode 

    So if some has any suggestions please for help

  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_EXPORT - The Journey

    What is Q_EXPORT?
    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.


  3. #3
    Join Date
    Dec 2010
    Location
    UK
    Posts
    9
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Q_EXPORT - The Journey

    Qt <3 tools part for expanding internal transfer or usability- i am not sure about this

  4. #4
    Join Date
    Dec 2010
    Location
    UK
    Posts
    9
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Q_EXPORT - The Journey

    error: variable ‘Q_EXPORT QFocusData’ has initializer but incomplete type

  5. #5
    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_EXPORT - The Journey

    That's because in Qt4 there is no such thing as Q_EXPORT.
    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.


  6. #6
    Join Date
    Dec 2010
    Location
    UK
    Posts
    9
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Q_EXPORT - The Journey

    Hi all
    If anyone is interested this is my solution of Q_EXPORT macro problem
    Qt Code:
    1. qfocusdata.h
    2.  
    3. #ifndef QFOCUSDATA_H
    4. #define QFOCUSDATA_H
    5.  
    6. #ifdef Q_WIN
    7. #include <qwindowsystem_qws.h>
    8. #ifdef LIBAPP_EXPORTS
    9. #define LIBAPP_API __declspec(dllexport)
    10. #else // !LIBAPP_EXPORTS
    11. #define LIBAPP_API __declspec(dllimport)
    12. #endif // LIBAPP_EXPORTS
    13. #else
    14. #define LIBAPP_API // Q_EXPORT = LIBAPP_API
    15. #endif
    16. // all You see hire is copy from Qt help pages;
    17. http://web.mit.edu/qt/www/qfocusdata-h.html
    18. and
    19. http://lists.trolltech.com/qt-interest/2004-12/thread00790-0.html
    20.  
    21. #ifndef QT_H
    22. #include <QWidgetList> // "qwidgetlist.h"
    23. #endif // QT_H
    24.  
    25.  
    26. class LIBAPP_API QFocusData {
    27. public:
    28. //QWidget* focusWidget() const { return it.current(); }
    29. // current is not supported by QWidget but it is up to You- i do not need it.
    30. QWidget* home();
    31. QWidget* next();
    32. QWidget* prev();
    33. QWidget* first() const;
    34. QWidget* last() const;
    35. int count() const { return focusWidgets.count(); }
    36.  
    37. private:
    38. friend class QWidget;
    39. QFocusData() : it(focusWidgets) {}
    40. QWidgetList focusWidgets;
    41. QWidgetList it;
    42. };
    43.  
    44. #endif // QFOCUSDATA_H
    To copy to clipboard, switch view to plain text mode 

Similar Threads

  1. qt3to4 - The Journey
    By mkts in forum Qt Programming
    Replies: 2
    Last Post: 11th December 2010, 17:32
  2. Replies: 1
    Last Post: 9th December 2010, 19:37

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.