Results 1 to 10 of 10

Thread: Big Qt Project planning...

  1. #1
    Join Date
    Jan 2006
    Location
    Saint-Petersburg (Russia)
    Posts
    41
    Thanks
    1
    Thanked 2 Times in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Big Qt Project planning...

    Hi all.
    I wish to create big project in Qt 4.1.0.
    Well, some futures as plugins and Designer UI formes will be used.
    There is very interesting examples about plugins in "pluginpaint" demo.
    But some limitation (of example):
    1. "Adding new menu" functions started at Main window.
    2. Project don't use ui formes.
    3. Don't shown using SIGNAL & SLOT

    To create something big with upper futures we need (I think generally):
    1. Plugins can add menu themselfes, can using statusbar
    2. Plugins can use UI formes
    3. Plugins can use SIGNAL & SLOTS behind Main Window or _other_plugins_

    So, my way:
    Plugins need to know about Main Class to use it Menu, Statusbar e.t.c. To do this we need to include header of Main Class in plugin implementation & then give pointer to real object of Main Class in plugin initialization (something like "init" function in interface)

    Using of UI forms is not problem: we just need to implement object of ui-class in interface realization.

    To realize signals and slots in plugin we need to know classes that we will used.
    Example:
    "news" plugin need to use "user" form to show form for editing user, thats create this news.

    so.. some problems (questions):
    1. When we use in plugins including of main class, the DLL (or .so) will be include code of Main Class in all plugins... Correct me if I wrong.
    2. When we use some classes in plugins, how other plugins can acces them? In example, we want use formes. We need to declare class extends QWidget & declare is as "plugins part" or we can include class in plugin & then use it simple.
    3. Signal and slots.... Oh,

    Can somebody help me to do this and show to my mistakes..
    Succes is 5% of talent and 95% of work!

  2. #2
    Join Date
    Jan 2006
    Location
    Moscow, Russia
    Posts
    23
    Thanks
    1
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Big Qt Project planning...

    In my opinion:
    1. Your plugins shouldn't include any MainClass.h, they must provide some function. As the arguments of this function you can send QStatusBar and so on...

    2. Your plugins must be inherited from one poor abstract class

  3. #3
    Join Date
    Jan 2006
    Location
    Saint-Petersburg (Russia)
    Posts
    41
    Thanks
    1
    Thanked 2 Times in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Big Qt Project planning...

    If I understand you:
    I need inherit all of plugins from base class and then use it as pointer to subclasses.
    What about plugin to plugin connections ?
    and signal and slots ?
    Succes is 5% of talent and 95% of work!

  4. #4
    Join Date
    Jan 2006
    Location
    Moscow, Russia
    Posts
    23
    Thanks
    1
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Big Qt Project planning...

    I need inherit all of plugins from base class and then use it as pointer to subclasses.
    Right! In this case - interface of your plugins is common.

    What about plugin to plugin connections ?
    If your plugins will be inherited from one base class, then you can manage one plugin from another.

    and signal and slots ?
    Your base-plugin class may consist any slot. You can reciev PluginClass from libraries and connect it with any signal.

    I can send you plugin-example if you want. It uses Qt3, but you'll see general principles of design plugins.

  5. #5
    Join Date
    Jan 2006
    Location
    Saint-Petersburg (Russia)
    Posts
    41
    Thanks
    1
    Thanked 2 Times in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Big Qt Project planning...

    I'll be very pleased If you will!
    And a little question: when we load plugin (PluginLoader::instance) we get pointer to _realized_object_ ? We cannot get class from plugin ? Tell me, please.
    Maybe I don't understand plugin theory at all.
    Succes is 5% of talent and 95% of work!

  6. #6
    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: Big Qt Project planning...

    Quote Originally Posted by blackliteon
    I'll be very pleased If you will!
    And a little question: when we load plugin (PluginLoader::instance) we get pointer to _realized_object_ ? We cannot get class from plugin ? Tell me, please.
    Maybe I don't understand plugin theory at all.
    You get a pointer to a class which knows how to create objects (called object factory), at least that's one of potential designs. The other is to get the object directly.

    Factory:
    Qt Code:
    1. struct IFactory {
    2. virtual QObject *createObject() = 0;
    3. }; // pure abstract class
    4.  
    5. class MyFactory : public IFactory {
    6. public:
    7. QObject *createObject(){ return new MyObject(); }
    8. };
    To copy to clipboard, switch view to plain text mode 

    In the second case (without factories), "MyFactory" is already a class which you use in your app and it is created by the plugin loader.

  7. #7
    Join Date
    Jan 2006
    Location
    Saint-Petersburg (Russia)
    Posts
    41
    Thanks
    1
    Thanked 2 Times in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Big Qt Project planning...

    I think philosofy of plugins in common to use realized objects, not clases...
    Succes is 5% of talent and 95% of work!

  8. #8
    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: Big Qt Project planning...

    Could you explain what you mean? Objects are instances of classes, so I don't see your point.

  9. #9
    Join Date
    Jan 2006
    Location
    travelling
    Posts
    1,116
    Thanks
    8
    Thanked 127 Times in 121 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Big Qt Project planning...

    Quote Originally Posted by blackliteon
    Hi all.
    I wish to create big project in Qt 4.1.0.
    Well, some futures as plugins and Designer UI formes will be used.
    There is very interesting examples about plugins in "pluginpaint" demo.
    But some limitation (of example):
    1. "Adding new menu" functions started at Main window.
    2. Project don't use ui formes.
    3. Don't shown using SIGNAL & SLOT

    To create something big with upper futures we need (I think generally):
    1. Plugins can add menu themselfes, can using statusbar
    2. Plugins can use UI formes
    3. Plugins can use SIGNAL & SLOTS behind Main Window or _other_plugins_

    So, my way:
    Plugins need to know about Main Class to use it Menu, Statusbar e.t.c. To do this we need to include header of Main Class in plugin implementation & then give pointer to real object of Main Class in plugin initialization (something like "init" function in interface)

    Using of UI forms is not problem: we just need to implement object of ui-class in interface realization.

    To realize signals and slots in plugin we need to know classes that we will used.
    Example:
    "news" plugin need to use "user" form to show form for editing user, thats create this news.

    so.. some problems (questions):
    1. When we use in plugins including of main class, the DLL (or .so) will be include code of Main Class in all plugins... Correct me if I wrong.
    2. When we use some classes in plugins, how other plugins can acces them? In example, we want use formes. We need to declare class extends QWidget & declare is as "plugins part" or we can include class in plugin & then use it simple.
    3. Signal and slots.... Oh,

    Can somebody help me to do this and show to my mistakes..
    Impressive description!!! But what is the point of your project ?
    Current Qt projects : QCodeEdit, RotiDeCode

  10. #10
    Join Date
    Jan 2006
    Location
    Saint-Petersburg (Russia)
    Posts
    41
    Thanks
    1
    Thanked 2 Times in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Big Qt Project planning...

    Working with different tables in sql-database
    For simplity every plugin word with different tables, and tables are linked, so plugins can call each other
    Succes is 5% of talent and 95% of work!

Similar Threads

  1. How to Compile VTKDesigner2 with Qt?
    By alfredoaal in forum Newbie
    Replies: 0
    Last Post: 5th September 2008, 05:34
  2. Set up the Qt4.3.2 with Visual Studio 2005
    By lamoda in forum Installation and Deployment
    Replies: 6
    Last Post: 30th January 2008, 06:51
  3. Importing qt project to an eclipse workspace
    By isahin in forum Installation and Deployment
    Replies: 2
    Last Post: 28th January 2008, 18:00
  4. I need a project opinion.
    By hgedek in forum General Discussion
    Replies: 6
    Last Post: 25th September 2007, 18:54
  5. Qt4 open src mingw from a PC to another
    By nvictor in forum Installation and Deployment
    Replies: 11
    Last Post: 1st May 2007, 17:41

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.