Eneboo - Documentación para desarrolladores
|
#include <browser.h>
Métodos públicos | |
EditorBrowser (Editor *e) | |
~EditorBrowser () | |
bool | eventFilter (QObject *o, QEvent *e) |
virtual void | setCurrentEdior (Editor *e) |
virtual void | addEditor (Editor *e) |
virtual bool | findCursor (const QTextCursor &c, QTextCursor &from, QTextCursor &to) |
virtual void | showHelp (const QString &) |
EditorBrowser (Editor *e) | |
~EditorBrowser () | |
bool | eventFilter (QObject *o, QEvent *e) |
virtual void | setCurrentEdior (Editor *e) |
virtual void | addEditor (Editor *e) |
virtual bool | findCursor (const QTextCursor &c, QTextCursor &from, QTextCursor &to) |
virtual void | showHelp (const QString &) |
Atributos protegidos | |
Editor * | curEditor |
QTextParagraph * | oldHighlightedParag |
QString | lastWord |
QTextFormat * | highlightedFormat |
EditorBrowser::EditorBrowser | ( | Editor * | e | ) |
EditorBrowser::~EditorBrowser | ( | ) |
EditorBrowser::EditorBrowser | ( | Editor * | e | ) |
EditorBrowser::~EditorBrowser | ( | ) |
void EditorBrowser::addEditor | ( | Editor * | e | ) | [virtual] |
virtual void EditorBrowser::addEditor | ( | Editor * | e | ) | [virtual] |
Filters events if this object has been installed as an event filter for the watched object.
In your reimplementation of this function, if you want to filter the event e, out, i.e. stop it being handled further, return TRUE; otherwise return FALSE.
Example:
class MyMainWindow : public QMainWindow { public: MyMainWindow( QWidget *parent = 0, const char *name = 0 ); protected: bool eventFilter( QObject *obj, QEvent *ev ); private: QTextEdit *textEdit; }; MyMainWindow::MyMainWindow( QWidget *parent, const char *name ) : QMainWindow( parent, name ) { textEdit = new QTextEdit( this ); setCentralWidget( textEdit ); textEdit->installEventFilter( this ); } bool MyMainWindow::eventFilter( QObject *obj, QEvent *ev ) { if ( obj == textEdit ) { if ( e->type() == QEvent::KeyPress ) { QKeyEvent *k = (QKeyEvent*)ev; qDebug( "Ate key press %d", k->key() ); return TRUE; } else { return FALSE; } } else { // pass the event on to the parent class return QMainWindow::eventFilter( obj, ev ); } }
Notice in the example above that unhandled events are passed to the base class's eventFilter() function, since the base class might have reimplemented eventFilter() for its own internal purposes.
Reimplementado de QObject.
Reimplementado en QSAEditorBrowser.
Filters events if this object has been installed as an event filter for the watched object.
In your reimplementation of this function, if you want to filter the event e, out, i.e. stop it being handled further, return TRUE; otherwise return FALSE.
Example:
class MyMainWindow : public QMainWindow { public: MyMainWindow( QWidget *parent = 0, const char *name = 0 ); protected: bool eventFilter( QObject *obj, QEvent *ev ); private: QTextEdit *textEdit; }; MyMainWindow::MyMainWindow( QWidget *parent, const char *name ) : QMainWindow( parent, name ) { textEdit = new QTextEdit( this ); setCentralWidget( textEdit ); textEdit->installEventFilter( this ); } bool MyMainWindow::eventFilter( QObject *obj, QEvent *ev ) { if ( obj == textEdit ) { if ( e->type() == QEvent::KeyPress ) { QKeyEvent *k = (QKeyEvent*)ev; qDebug( "Ate key press %d", k->key() ); return TRUE; } else { return FALSE; } } else { // pass the event on to the parent class return QMainWindow::eventFilter( obj, ev ); } }
Notice in the example above that unhandled events are passed to the base class's eventFilter() function, since the base class might have reimplemented eventFilter() for its own internal purposes.
Reimplementado de QObject.
Reimplementado en QSAEditorBrowser.
bool EditorBrowser::findCursor | ( | const QTextCursor & | c, |
QTextCursor & | from, | ||
QTextCursor & | to | ||
) | [virtual] |
virtual bool EditorBrowser::findCursor | ( | const QTextCursor & | c, |
QTextCursor & | from, | ||
QTextCursor & | to | ||
) | [virtual] |
virtual void EditorBrowser::setCurrentEdior | ( | Editor * | e | ) | [virtual] |
void EditorBrowser::setCurrentEdior | ( | Editor * | e | ) | [virtual] |
virtual void EditorBrowser::showHelp | ( | const QString & | ) | [inline, virtual] |
Reimplementado en QSAEditorBrowser y CppEditorBrowser.
virtual void EditorBrowser::showHelp | ( | const QString & | ) | [inline, virtual] |
Reimplementado en QSAEditorBrowser y CppEditorBrowser.
Editor * EditorBrowser::curEditor [protected] |
QTextFormat * EditorBrowser::highlightedFormat [protected] |
QString EditorBrowser::lastWord [protected] |
QTextParagraph * EditorBrowser::oldHighlightedParag [protected] |