Eneboo - Documentación para desarrolladores
|
Métodos públicos | |
QHideDock (QMainWindow *parent) | |
~QHideDock () | |
Métodos protegidos | |
void | paintEvent (QPaintEvent *e) |
void | mousePressEvent (QMouseEvent *e) |
void | mouseMoveEvent (QMouseEvent *e) |
void | mouseReleaseEvent (QMouseEvent *e) |
bool | eventFilter (QObject *o, QEvent *e) |
void | updateState () |
void | childEvent (QChildEvent *e) |
Amigas | |
class | QHideToolTip |
QHideDock::QHideDock | ( | QMainWindow * | parent | ) | [inline] |
QHideDock::~QHideDock | ( | ) | [inline] |
void QHideDock::childEvent | ( | QChildEvent * | ) | [inline, protected, virtual] |
This event handler can be reimplemented in a subclass to receive child events.
Child events are sent to objects when children are inserted or removed.
Note that events with QEvent::type() QEvent::ChildInserted
are posted (with {QApplication::postEvent()}) to make sure that the child's construction is completed before this function is called.
If a child is removed immediately after it is inserted, the ChildInserted
event may be suppressed, but the ChildRemoved
event will always be sent. In such cases it is possible that there will be a ChildRemoved
event without a corresponding ChildInserted
event.
If you change state based on ChildInserted
events, call QWidget::constPolish(), or do
in functions that depend on the state. One notable example is QWidget::sizeHint().
Reimplementado de QObject.
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.
void QHideDock::mouseMoveEvent | ( | QMouseEvent * | e | ) | [inline, protected, virtual] |
This event handler, for event e, can be reimplemented in a subclass to receive mouse move events for the widget.
If mouse tracking is switched off, mouse move events only occur if a mouse button is pressed while the mouse is being moved. If mouse tracking is switched on, mouse move events occur even if no mouse button is pressed.
QMouseEvent::pos() reports the position of the mouse cursor, relative to this widget. For press and release events, the position is usually the same as the position of the last mouse move event, but it might be different if the user's hand shakes. This is a feature of the underlying window system, not Qt.
Reimplementado de QWidget.
void QHideDock::mousePressEvent | ( | QMouseEvent * | e | ) | [inline, protected, virtual] |
This event handler, for event e, can be reimplemented in a subclass to receive mouse press events for the widget.
If you create new widgets in the mousePressEvent() the mouseReleaseEvent() may not end up where you expect, depending on the underlying window system (or X11 window manager), the widgets' location and maybe more.
The default implementation implements the closing of popup widgets when you click outside the window. For other widget types it does nothing.
Reimplementado de QWidget.
void QHideDock::mouseReleaseEvent | ( | QMouseEvent * | e | ) | [inline, protected, virtual] |
This event handler, for event e, can be reimplemented in a subclass to receive mouse release events for the widget.
Reimplementado de QWidget.
void QHideDock::paintEvent | ( | QPaintEvent * | ) | [inline, protected, virtual] |
This event handler can be reimplemented in a subclass to receive paint events.
A paint event is a request to repaint all or part of the widget. It can happen as a result of repaint() or update(), or because the widget was obscured and has now been uncovered, or for many other reasons.
Many widgets can simply repaint their entire surface when asked to, but some slow widgets need to optimize by painting only the requested region: QPaintEvent::region(). This speed optimization does not change the result, as painting is clipped to that region during event processing. QListView and QCanvas do this, for example.
Qt also tries to speed up painting by merging multiple paint events into one. When update() is called several times or the window system sends several paint events, Qt merges these events into one event with a larger region (see QRegion::unite()). repaint() does not permit this optimization, so we suggest using update() when possible.
When the paint event occurs, the update region has normally been erased, so that you're painting on the widget's background. There are a couple of exceptions and QPaintEvent::erased() tells you whether the widget has been erased or not.
The background can be set using setBackgroundMode(), setPaletteBackgroundColor() or setBackgroundPixmap(). The documentation for setBackgroundMode() elaborates on the background; we recommend reading it.
Reimplementado de QWidget.
void QHideDock::updateState | ( | ) | [inline, protected] |
friend class QHideToolTip [friend] |