Inheritance diagram for qmdiServer:
Public Member Functions | |
qmdiServer () | |
Empty constructor. Creates the object. | |
virtual | ~qmdiServer () |
Empty destructor. Destroys the object. | |
virtual void | addClient (qmdiClient *client)=0 |
insert a new client to the server | |
virtual void | deleteClient (qmdiClient *) |
callback to get alarm of deleted object | |
virtual int | getClientsCount ()=0 |
return the number of sub clients in this server | |
virtual qmdiClient * | getClient (int i)=0 |
return a pointer to an MDI client | |
void | tryCloseClient (int i) |
request an MDI client to be closed | |
void | tryCloseAllButClient (int i) |
request to close all other clients | |
void | tryCloseAllCliens () |
try to close all MDI clients | |
void | showClientMenu (int i, QPoint p) |
display the menu of a specific MDI client | |
Public Attributes | |
qmdiHost * | mdiHost |
a pointer to the MDI host |
This class is used only to get messages from the qmdiClient that it asks to be removed from the list.
Classes which derive this class, MUST implement the clientDeleted() function. This a rather abstract class, you are probably looking for qmdiTabWidget.
Other classes which implement this interface are planned for next versions.
qmdiServer::qmdiServer | ( | ) |
Empty constructor. Creates the object.
Constructs the mdi Server. By default does nothing
qmdiServer::~qmdiServer | ( | ) | [virtual] |
Empty destructor. Destroys the object.
Since this class needs to be dynamic_casted by the derived classes, to assign the correct qmdiServer, this class needs to have a virtual table. If the class has a virtual function, it's only smart to have a virtual destructor.
qmdiServer::addClient | ( | qmdiClient * | client | ) | [pure virtual] |
insert a new client to the server
client | the new client to be added |
Users of this class should be able to add new clients, and set the properties needed using this function, but you should also supply more advanced functions provided by your new widget, like add the widget into another location, setting an icon for this client, etc.
Since it's defined as pure virtual, you must implement this on derived classes.
Implemented in qmdiTabWidget, and qmdiWorkspace.
void qmdiServer::deleteClient | ( | qmdiClient * | ) | [virtual] |
callback to get alarm of deleted object
This function gets called on the destructor of qmdiClient, to announce that the object is about to be deleted. This function should be used to remove the menus and toolbars and other cleanup actions needed.
Why not using QTabWidget::tabRemoved ( int index ) ?
Why not using the signal QObject::destroyed( QObject * obj = 0 ) ?
This means that the qmdiClient needs to know the MDI server (usually a qmdiTabWidget) and ask to be removed before it gets destructed.
Why this function is not pure virtual?
Even tough this is not a pure virtual, you must implement this on derived classes.
Reimplemented in qmdiTabWidget.
qmdiServer::getClientsCount | ( | ) | [pure virtual] |
return the number of sub clients in this server
Return the number of sub-widgets in this server. Please note that this function can return also non-mdi clients.
Since it's defined as pure virtual, you must implement this on derived classes.
Implemented in qmdiTabWidget, and qmdiWorkspace.
qmdiClient * qmdiServer::getClient | ( | int | i | ) | [pure virtual] |
return a pointer to an MDI client
i | the number of sub widget to return |
Since it's defined as pure virtual, you must implement this on derived classes.
Implemented in qmdiTabWidget, and qmdiWorkspace.
void qmdiServer::tryCloseClient | ( | int | i | ) |
request an MDI client to be closed
i | the number of the client (tab) to be closed |
This function used to be part of qmdiTabWidget, but it was ported down to this abstract interface at version 0.0.4.
void qmdiServer::tryCloseAllButClient | ( | int | i | ) |
request to close all other clients
i | the number of the client to keep open |
If some widget on the MDI server does not derive (implements) the qmdiClient interface, the widget will not be closed.
This function used to be part of qmdiTabWidget, but it was ported down to this abstract interface at version 0.0.4.
void qmdiServer::tryCloseAllCliens | ( | ) |
try to close all MDI clients
Call this slot when you want to close all the MDI clients.
This function used to be part of qmdiTabWidget, but it was ported down to this abstract interface at version 0.0.4.
void qmdiServer::showClientMenu | ( | int | i, | |
QPoint | p | |||
) |
display the menu of a specific MDI client
i | the mouse button that has been pressed | |
p | the location of the mouse click |
This function used to be part of qmdiTabWidget, but it was ported down to this abstract interface at version 0.0.4.
a pointer to the MDI host
This is a pointer to the MDI host in which the server is registered. It should not be assigned any value, and should be threated as read only.