Results 1 to 16 of 16

Thread: Problem of including Widgets into DLL

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Nov 2008
    Posts
    12
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Problem of including Widgets into DLL

    I always make the dll's with one interface class.

    e.g.

    dll_mywidget.hpp
    dll_mywidget.cpp

    the class dll_mywidget are just call to another class dll_mywidget_impl

    The dll_mywidget_impl class is the one that include the ui file...basically you make dll_mywidget_impl as you would make a normal widget....

    and in dll_mywidget.cpp you decide which parts to make public in the dll...dont forget the class you want to make public in the dll, needs special DLL declaration (DLL_EXPORT) in order to work.

    jan

  2. #2
    Join Date
    Nov 2008
    Posts
    8
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Problem of including Widgets into DLL

    LOL I still don't get it. I think the way I understand it is that I have a dummy class which gets included into the main application and it exports other class with UI. But how do I include the base class into main application without ui header?

    So far I have this:

    Here the dummy class which includes the interface class (test.h) :
    Qt Code:
    1. #ifndef FBL_GUI_H
    2. #define FBL_GUI_H
    3.  
    4. #include "fbl_gui_global.h"
    5. #include "test.h"
    6. class FBL_GUI_EXPORT fbl_gui
    7. {
    8. public:
    9. fbl_gui();
    10. ~fbl_gui();
    11.  
    12. private:
    13.  
    14. };
    15.  
    16. #endif // FBL_GUI_H
    To copy to clipboard, switch view to plain text mode 

    Then I have an interface class in the same dll project:

    Qt Code:
    1. #ifndef TEST_H
    2. #define TEST_H
    3.  
    4. #include <QWidget>
    5. #include "ui_test.h"
    6.  
    7. class test : public QWidget
    8. {
    9. Q_OBJECT
    10.  
    11. public:
    12. test(QWidget *parent = 0);
    13. ~test();
    14.  
    15. private:
    16. Ui::testClass ui;
    17. };
    18.  
    19. #endif // TEST_H
    To copy to clipboard, switch view to plain text mode 

    Now the problem is that if I include the base dll class it also includes the widget class. How can I skip this part but be able to access the widget and be able to create it in the main app?

Similar Threads

  1. Replies: 0
    Last Post: 16th July 2008, 13:15
  2. Replies: 3
    Last Post: 10th May 2008, 17:36
  3. Algorithms problem of brackets including.
    By luffy27 in forum General Programming
    Replies: 2
    Last Post: 12th April 2007, 01:10
  4. Docking widgets setFixedSize and setBaseSize Problem
    By forrestfsu in forum Qt Programming
    Replies: 2
    Last Post: 16th October 2006, 18:20
  5. Replies: 11
    Last Post: 7th July 2006, 13:09

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.