QCodeEdit  2.2
Public Types | Public Member Functions | Static Public Member Functions | Friends | List of all members
QCodeEdit Class Reference

A thin layer over QEditor. More...

Public Types

enum  Position { West, North, South, East }
 

Public Member Functions

 QCodeEdit (QWidget *p=0)
 ctor More...
 
 QCodeEdit (bool actions, QWidget *p=0)
 ctor More...
 
 QCodeEdit (const QString &layout, QWidget *p=0)
 ctor More...
 
 QCodeEdit (const QString &layout, bool actions, QWidget *p=0)
 ctor More...
 
virtual ~QCodeEdit ()
 dtor More...
 
QEditoreditor () const
 
QPanelLayoutpanelLayout () const
 
QAction * addPanel (QPanel *panel, Position pos, bool _add=false)
 Add a panel. More...
 
QAction * addPanel (const QString &name, Position pos, bool _add=false)
 
bool hasPanel (const QString &type) const
 
QList< QPanel * > panels (const QString &type=QString()) const
 
QAction * toggleViewAction (QPanel *p) const
 
void sendPanelCommand (const QString &type, const char *signature, const QList< QGenericArgument > &args=Q_COMMAND)
 Send a command to every panel of a given type. More...
 
 QCodeEdit (QEditor *e, QPanelLayout *p)
 ctor More...
 
 QCodeEdit (QEditor *e, const QString &l)
 ctor More...
 

Static Public Member Functions

static QCodeEditmanager (QEditor *e)
 
static QEditormanaged (const QString &f)
 The (first) managed editor editing a given file or a null pointer if none found.
 

Friends

class QPanelWatcher
 

Detailed Description

A thin layer over QEditor.

The QCodeEdit class provides simple means to associate panels with editors and manage them.

Constructor & Destructor Documentation

◆ QCodeEdit() [1/6]

QCodeEdit::QCodeEdit ( QWidget p = 0)

ctor

The created editor object comes with builtin actions.

◆ QCodeEdit() [2/6]

QCodeEdit::QCodeEdit ( bool  actions,
QWidget p = 0 
)

ctor

Parameters
actionswhether the QEditor object should create builtin actions

◆ QCodeEdit() [3/6]

QCodeEdit::QCodeEdit ( const QString &  layout,
QWidget p = 0 
)

ctor

Parameters
layoutstructure of the panel layout

The created editor object comes with builtin actions.

◆ QCodeEdit() [4/6]

QCodeEdit::QCodeEdit ( const QString &  layout,
bool  actions,
QWidget p = 0 
)

ctor

Parameters
layoutstructure of the panel layout
actionswhether the QEditor object should create builtin actions

◆ ~QCodeEdit()

QCodeEdit::~QCodeEdit ( )
virtual

dtor

Warning
Destroyes the editor and the panel layout it manages

◆ QCodeEdit() [5/6]

QCodeEdit::QCodeEdit ( QEditor e,
QPanelLayout p 
)

ctor

Parameters
eeditor to manage
ppanel layout to associate with the editor

◆ QCodeEdit() [6/6]

QCodeEdit::QCodeEdit ( QEditor e,
const QString &  l 
)

ctor

Parameters
eeditor to manage
lstructure of the panel layout

Member Function Documentation

◆ addPanel() [1/2]

QAction * QCodeEdit::addPanel ( QPanel panel,
Position  pos,
bool  _add = false 
)

Add a panel.

Returns
Toggle view action for the added panel
Parameters
panelpanel to add
posposition of the panel in the layout
_addwhether to add the show action of the panel to the menu of the editor

References QPanel::attach().

Referenced by addPanel().

◆ addPanel() [2/2]

QAction * QCodeEdit::addPanel ( const QString &  name,
Position  pos,
bool  _add = false 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Returns
Toggle view action for the added panel
Parameters
namename of panel to add
posposition of the panel in the layout
_addwhether to add the show action of the panel to the menu of the editor

References addPanel().

◆ editor()

QEditor * QCodeEdit::editor ( ) const
Returns
the managed editor

◆ hasPanel()

bool QCodeEdit::hasPanel ( const QString &  type) const
Returns
whether the editor has a panel of the given type

Referenced by QEditor::gotoLine().

◆ manager()

QCodeEdit * QCodeEdit::manager ( QEditor e)
static
Returns
The QCodeEdit object managing a given editor or a null point if the given editor is unmanaged

Referenced by QEditor::find(), QEditor::findNext(), QEditor::gotoLine(), and QEditor::replace().

◆ panelLayout()

QPanelLayout * QCodeEdit::panelLayout ( ) const
Returns
the panel layout associated with the managed editor

◆ panels()

QList< QPanel * > QCodeEdit::panels ( const QString &  type = QString()) const
Returns
a list of panels added to the editor
Parameters
typeType of panel to look for (no filtering is performed if empty)

Referenced by sendPanelCommand(), and toggleViewAction().

◆ sendPanelCommand()

void QCodeEdit::sendPanelCommand ( const QString &  type,
const char *  signature,
const QList< QGenericArgument > &  args = Q_COMMAND 
)

Send a command to every panel of a given type.

Parameters
signaturemethod name suitable for QMetaObject::invokeMethod()
argslist of arguments suitable for QMetaObject::invokeMethod()

Example use :

sendPanelCommand("Status", "setVisible" Q_COMMAND << Q_ARG(bool, false));

References panels().

Referenced by QEditor::find(), QEditor::findNext(), QEditor::gotoLine(), and QEditor::replace().

◆ toggleViewAction()

QAction * QCodeEdit::toggleViewAction ( QPanel p) const
Returns
the toggle view action of a given panel

References panels().


The documentation for this class was generated from the following files: