qdesigner_internal::TabOrderEditorPlugin Class Reference

#include <tabordereditor_plugin.h>

Inheritance diagram for qdesigner_internal::TabOrderEditorPlugin:

Inheritance graph
[legend]
Collaboration diagram for qdesigner_internal::TabOrderEditorPlugin:

Collaboration graph
[legend]
List of all members.

Detailed Description

Definition at line 41 of file tabordereditor_plugin.h.

Public Slots

void activeFormWindowChanged (QDesignerFormWindowInterface *formWindow)

Public Member Functions

 TabOrderEditorPlugin ()
virtual ~TabOrderEditorPlugin ()
virtual bool isInitialized () const
virtual void initialize (QDesignerFormEditorInterface *core)
QActionaction () const
virtual QDesignerFormEditorInterfacecore () const

Private Slots

void addFormWindow (QDesignerFormWindowInterface *formWindow)
void removeFormWindow (QDesignerFormWindowInterface *formWindow)

Private Attributes

QPointer< QDesignerFormEditorInterfacem_core
QHash< QDesignerFormWindowInterface *,
TabOrderEditorTool * > 
m_tools
bool m_initialized
QActionm_action


Constructor & Destructor Documentation

TabOrderEditorPlugin::TabOrderEditorPlugin (  ) 

Definition at line 37 of file tabordereditor_plugin.cpp.

00038     : m_initialized(false)
00039 {
00040 }

TabOrderEditorPlugin::~TabOrderEditorPlugin (  )  [virtual]

Definition at line 42 of file tabordereditor_plugin.cpp.

00043 {
00044 }


Member Function Documentation

bool TabOrderEditorPlugin::isInitialized (  )  const [virtual]

Returns true if the plugin interface is initialized; otherwise returns false.

Implements QDesignerFormEditorPluginInterface.

Definition at line 46 of file tabordereditor_plugin.cpp.

References m_initialized.

Referenced by initialize().

00047 {
00048     return m_initialized;
00049 }

void TabOrderEditorPlugin::initialize ( QDesignerFormEditorInterface core  )  [virtual]

Initializes the plugin interface for the specified core interface.

Implements QDesignerFormEditorPluginInterface.

Definition at line 51 of file tabordereditor_plugin.cpp.

References activeFormWindowChanged(), addFormWindow(), QObject::connect(), core(), QDesignerFormEditorInterface::formWindowManager(), isInitialized(), m_action, m_core, m_initialized, removeFormWindow(), QDesignerFormEditorInterface::resourceLocation(), QAction::setEnabled(), QAction::setIcon(), QObject::setParent(), SIGNAL, and SLOT.

00052 {
00053     Q_ASSERT(!isInitialized());
00054 
00055     m_action = new QAction(tr("Edit Tab Order"), this);
00056     m_action->setIcon(QIcon(core->resourceLocation() + QLatin1String("/tabordertool.png")));
00057     m_action->setEnabled(false);
00058 
00059     setParent(core);
00060     m_core = core;
00061     m_initialized = true;
00062 
00063     connect(core->formWindowManager(), SIGNAL(formWindowAdded(QDesignerFormWindowInterface*)),
00064             this, SLOT(addFormWindow(QDesignerFormWindowInterface*)));
00065 
00066     connect(core->formWindowManager(), SIGNAL(formWindowRemoved(QDesignerFormWindowInterface*)),
00067             this, SLOT(removeFormWindow(QDesignerFormWindowInterface*)));
00068 
00069     connect(core->formWindowManager(), SIGNAL(activeFormWindowChanged(QDesignerFormWindowInterface*)),
00070                 this, SLOT(activeFormWindowChanged(QDesignerFormWindowInterface*)));
00071 }

Here is the call graph for this function:

QAction * TabOrderEditorPlugin::action (  )  const [virtual]

Returns the action associated with this interface.

Implements QDesignerFormEditorPluginInterface.

Definition at line 107 of file tabordereditor_plugin.cpp.

References m_action.

00108 {
00109     return m_action;
00110 }

QDesignerFormEditorInterface * TabOrderEditorPlugin::core (  )  const [virtual]

Returns the core form editor interface associated with this component.

Implements QDesignerFormEditorPluginInterface.

Definition at line 78 of file tabordereditor_plugin.cpp.

References m_core.

Referenced by initialize().

00079 {
00080     return m_core;
00081 }

void TabOrderEditorPlugin::activeFormWindowChanged ( QDesignerFormWindowInterface formWindow  )  [slot]

Definition at line 73 of file tabordereditor_plugin.cpp.

References m_action, and QAction::setEnabled().

Referenced by initialize().

00074 {
00075     m_action->setEnabled(formWindow != 0);
00076 }

void TabOrderEditorPlugin::addFormWindow ( QDesignerFormWindowInterface formWindow  )  [private, slot]

Definition at line 83 of file tabordereditor_plugin.cpp.

References QObject::connect(), m_action, m_tools, QDesignerFormWindowInterface::registerTool(), SIGNAL, and SLOT.

Referenced by initialize().

00084 {
00085     Q_ASSERT(formWindow != 0);
00086     Q_ASSERT(m_tools.contains(formWindow) == false);
00087 
00088     TabOrderEditorTool *tool = new TabOrderEditorTool(formWindow, this);
00089     m_tools[formWindow] = tool;
00090     connect(m_action, SIGNAL(triggered()), tool->action(), SLOT(trigger()));
00091     formWindow->registerTool(tool);
00092 }

void TabOrderEditorPlugin::removeFormWindow ( QDesignerFormWindowInterface formWindow  )  [private, slot]

Definition at line 94 of file tabordereditor_plugin.cpp.

References QObject::disconnect(), m_action, m_tools, SIGNAL, and SLOT.

Referenced by initialize().

00095 {
00096     Q_ASSERT(formWindow != 0);
00097     Q_ASSERT(m_tools.contains(formWindow) == true);
00098 
00099     TabOrderEditorTool *tool = m_tools.value(formWindow);
00100     m_tools.remove(formWindow);
00101     disconnect(m_action, SIGNAL(triggered()), tool->action(), SLOT(trigger()));
00102     // ### FIXME disable the tool
00103 
00104     delete tool;
00105 }


Member Data Documentation

QPointer<QDesignerFormEditorInterface> qdesigner_internal::TabOrderEditorPlugin::m_core [private]

Definition at line 63 of file tabordereditor_plugin.h.

Referenced by core(), and initialize().

QHash<QDesignerFormWindowInterface*, TabOrderEditorTool*> qdesigner_internal::TabOrderEditorPlugin::m_tools [private]

Definition at line 64 of file tabordereditor_plugin.h.

Referenced by addFormWindow(), and removeFormWindow().

bool qdesigner_internal::TabOrderEditorPlugin::m_initialized [private]

Definition at line 65 of file tabordereditor_plugin.h.

Referenced by initialize(), and isInitialized().

QAction* qdesigner_internal::TabOrderEditorPlugin::m_action [private]

Definition at line 66 of file tabordereditor_plugin.h.

Referenced by action(), activeFormWindowChanged(), addFormWindow(), initialize(), and removeFormWindow().


The documentation for this class was generated from the following files:
Generated on Thu Mar 15 20:38:32 2007 for Qt 4.2 User's Guide by  doxygen 1.5.1