PDA

View Full Version : Big Qt Project planning...



blackliteon
7th February 2006, 08:49
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..

Opilki_Inside
7th February 2006, 10:16
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

blackliteon
7th February 2006, 10:37
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 ?

Opilki_Inside
7th February 2006, 11:00
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.

blackliteon
7th February 2006, 11:37
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.

wysota
7th February 2006, 11:46
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:


struct IFactory {
virtual QObject *createObject() = 0;
}; // pure abstract class

class MyFactory : public IFactory {
public:
QObject *createObject(){ return new MyObject(); }
};

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.

blackliteon
7th February 2006, 15:05
I think philosofy of plugins in common to use realized objects, not clases...

wysota
7th February 2006, 19:56
Could you explain what you mean? Objects are instances of classes, so I don't see your point.

fullmetalcoder
8th February 2006, 09:16
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 ? :confused: :p

blackliteon
8th February 2006, 09:40
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