Results 1 to 12 of 12

Thread: Item in a DLL not getting events

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #4
    Join Date
    Apr 2006
    Location
    Denmark / Norway
    Posts
    67
    Thanks
    3
    Thanked 12 Times in 8 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: Item in a DLL not getting events

    Sorry... my bad!
    should be like this:

    mylibrary.h
    Qt Code:
    1. #ifdef COMPILING_LIBRARY
    2. #define MYLIBRARYEXPORT Q_DECL_EXPORT
    3. #else
    4. #define MYLIBRARYEXPORT Q_DECL_IMPORT
    5. #endif
    6.  
    7. class MYLIBRARYEXPORT MyLibraryInDLL: public QWidget
    8. {
    9. Q_OBJECT
    10.  
    11. public:
    12. MyLibraryInDLL(QWidget *parent);
    13. }
    To copy to clipboard, switch view to plain text mode 

    The only reason to load it is if you want to make sure it's loaded before calling a function. As that makes you able to handle a loading-library-error... If not, your app will just crash if there is a problem loading the library. (e.g. the user moved it).

    As you say, you don't have to move the files. It was just a suggestion to keep projects like:
    Application
    --- library1
    --- library2
    --- library3
    --- library3a
    --- library3b

    Just to make it easier for your self if the projects grows and gets big...

    As for the LIBS += mylibrary.lib in the pro file, it's to make the linker find any links to the library. Nothing else...

    cheers,
    Leif

  2. The following user says thank you to luf for this useful post:

    Benne Gesserit (7th August 2008)

Similar Threads

  1. Replies: 2
    Last Post: 1st August 2008, 16:58
  2. QGraphicsView Mouse Events
    By tomf in forum Qt Programming
    Replies: 5
    Last Post: 29th July 2008, 15:03
  3. Item Delegate Painting
    By stevey in forum Qt Programming
    Replies: 3
    Last Post: 9th May 2008, 07:37
  4. Replies: 1
    Last Post: 21st August 2007, 16:25
  5. Replies: 1
    Last Post: 19th April 2007, 22:23

Tags for this Thread

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
  •  
Qt is a trademark of The Qt Company.