Eneboo - Documentación para desarrolladores
|
#include <popupmenueditor.h>
PopupMenuEditor::PopupMenuEditor | ( | FormWindow * | fw, |
QWidget * | parent = 0 , |
||
const char * | name = 0 |
||
) |
PopupMenuEditor::PopupMenuEditor | ( | FormWindow * | fw, |
PopupMenuEditor * | menu, | ||
QWidget * | parent, | ||
const char * | name = 0 |
||
) |
PopupMenuEditor::~PopupMenuEditor | ( | ) |
PopupMenuEditorItem * PopupMenuEditor::at | ( | int | index | ) |
PopupMenuEditorItem* PopupMenuEditor::at | ( | QPoint | pos | ) | [inline] |
void PopupMenuEditor::choosePixmap | ( | int | index = -1 | ) |
void PopupMenuEditor::clearCurrentField | ( | ) | [protected] |
QString PopupMenuEditor::constructName | ( | PopupMenuEditorItem * | item | ) | [protected] |
QSize PopupMenuEditor::contentsSize | ( | ) | [protected] |
void PopupMenuEditor::copy | ( | int | index | ) |
void PopupMenuEditor::copy | ( | ) | [inline, slot] |
int PopupMenuEditor::count | ( | ) |
PopupMenuEditorItem * PopupMenuEditor::createItem | ( | QAction * | a = 0 | ) | [protected] |
PopupMenuEditorItem * PopupMenuEditor::currentItem | ( | ) | [protected] |
void PopupMenuEditor::cut | ( | int | index | ) |
void PopupMenuEditor::cut | ( | ) | [inline, slot] |
void PopupMenuEditor::dragEnterEvent | ( | QDragEnterEvent * | ) | [protected, virtual] |
This event handler is called when a drag is in progress and the mouse enters this widget.
See the Drag-and-drop documentation for an overview of how to provide drag-and-drop in your application.
Reimplementado de QWidget.
void PopupMenuEditor::dragLeaveEvent | ( | QDragLeaveEvent * | ) | [protected, virtual] |
This event handler is called when a drag is in progress and the mouse leaves this widget.
See the Drag-and-drop documentation for an overview of how to provide drag-and-drop in your application.
Reimplementado de QWidget.
void PopupMenuEditor::dragMoveEvent | ( | QDragMoveEvent * | ) | [protected, virtual] |
This event handler is called when a drag is in progress and the mouse enters this widget, and whenever it moves within the widget.
See the Drag-and-drop documentation for an overview of how to provide drag-and-drop in your application.
Reimplementado de QWidget.
void PopupMenuEditor::drawItem | ( | QPainter * | p, |
PopupMenuEditorItem * | i, | ||
const QRect & | r, | ||
int | f | ||
) | const [protected] |
void PopupMenuEditor::drawItems | ( | QPainter * | p | ) | [protected] |
void PopupMenuEditor::dropEvent | ( | QDropEvent * | ) | [protected, virtual] |
This event handler is called when the drag is dropped on this widget.
See the Drag-and-drop documentation for an overview of how to provide drag-and-drop in your application.
Reimplementado de QWidget.
void PopupMenuEditor::dropInPlace | ( | QActionGroup * | g, |
int | y | ||
) | [protected] |
void PopupMenuEditor::dropInPlace | ( | PopupMenuEditorItem * | i, |
int | y | ||
) | [protected] |
void PopupMenuEditor::enterEditMode | ( | QKeyEvent * | e | ) | [protected] |
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.
int PopupMenuEditor::find | ( | PopupMenuEditor * | menu | ) |
void PopupMenuEditor::focusInEvent | ( | QFocusEvent * | ) | [protected, virtual] |
This event handler can be reimplemented in a subclass to receive keyboard focus events (focus received) for the widget.
A widget normally must setFocusPolicy() to something other than NoFocus
in order to receive focus events. (Note that the application programmer can call setFocus() on any widget, even those that do not normally accept focus.)
The default implementation updates the widget (except for toplevel widgets that do not specify a focusPolicy() ). It also calls setMicroFocusHint(), hinting any system-specific input tools about the focus of the user's attention.
Reimplementado de QWidget.
void PopupMenuEditor::focusOnSubMenu | ( | ) | [slot] |
void PopupMenuEditor::focusOutEvent | ( | QFocusEvent * | ) | [protected, virtual] |
This event handler can be reimplemented in a subclass to receive keyboard focus events (focus lost) for the widget.
A widget normally must setFocusPolicy() to something other than NoFocus
in order to receive focus events. (Note that the application programmer can call setFocus() on any widget, even those that do not normally accept focus.)
The default implementation updates the widget (except for toplevel widgets that do not specify a focusPolicy() ). It also calls setMicroFocusHint(), hinting any system-specific input tools about the focus of the user's attention.
Reimplementado de QWidget.
FormWindow* PopupMenuEditor::formWindow | ( | ) | [inline] |
void PopupMenuEditor::hideSubMenu | ( | ) | [slot] |
void PopupMenuEditor::init | ( | ) |
void PopupMenuEditor::insert | ( | QActionGroup * | actionGroup, |
int | index = -1 |
||
) |
void PopupMenuEditor::insert | ( | PopupMenuEditorItem * | item, |
int | index = -1 |
||
) |
void PopupMenuEditor::inserted | ( | QAction * | ) | [signal] |
bool PopupMenuEditor::isCreatingAccelerator | ( | ) | [inline] |
PopupMenuEditorItem * PopupMenuEditor::itemAt | ( | int | y | ) | [protected] |
int PopupMenuEditor::itemHeight | ( | const PopupMenuEditorItem * | item | ) | const [protected] |
int PopupMenuEditor::itemPos | ( | const PopupMenuEditorItem * | item | ) | const [protected] |
QPtrList<PopupMenuEditorItem>* PopupMenuEditor::items | ( | ) | [inline] |
void PopupMenuEditor::keyPressEvent | ( | QKeyEvent * | e | ) | [protected, virtual] |
This event handler, for event e, can be reimplemented in a subclass to receive key press events for the widget.
A widget must call setFocusPolicy() to accept focus initially and have focus in order to receive a key press event.
If you reimplement this handler, it is very important that you explicitly ignore the event if you do not understand it, so that the widget's parent can interpret it; otherwise, the event will be implicitly accepted. Although top-level widgets are able to choose whether to accept or ignore unknown events because they have no parent widgets that could otherwise handle them, it is good practice to explicitly ignore events to make widgets as reusable as possible.
The default implementation closes popup widgets if the user presses Esc. Otherwise the event is ignored.
Reimplementado de QWidget.
void PopupMenuEditor::leaveEditMode | ( | QKeyEvent * | e | ) | [protected] |
void PopupMenuEditor::mouseDoubleClickEvent | ( | QMouseEvent * | e | ) | [protected, virtual] |
This event handler, for event e, can be reimplemented in a subclass to receive mouse double click events for the widget.
The default implementation generates a normal mouse press event.
Note that the widgets gets a mousePressEvent() and a mouseReleaseEvent() before the mouseDoubleClickEvent().
Reimplementado de QWidget.
void PopupMenuEditor::mouseMoveEvent | ( | QMouseEvent * | e | ) | [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 PopupMenuEditor::mousePressEvent | ( | QMouseEvent * | e | ) | [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 PopupMenuEditor::navigateDown | ( | bool | ctrl | ) | [protected] |
void PopupMenuEditor::navigateLeft | ( | ) | [protected] |
void PopupMenuEditor::navigateRight | ( | ) | [protected] |
void PopupMenuEditor::navigateUp | ( | bool | ctrl | ) | [protected] |
void PopupMenuEditor::paintEvent | ( | QPaintEvent * | ) | [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.
QWidget* PopupMenuEditor::parentEditor | ( | ) | [inline] |
void PopupMenuEditor::paste | ( | int | index | ) |
void PopupMenuEditor::paste | ( | ) | [inline, slot] |
void PopupMenuEditor::remove | ( | QAction * | a | ) | [inline, slot] |
void PopupMenuEditor::remove | ( | int | index | ) | [slot] |
void PopupMenuEditor::removed | ( | QAction * | ) | [signal] |
void PopupMenuEditor::removeItem | ( | int | index = -1 | ) | [protected] |
void PopupMenuEditor::resizeToContents | ( | ) | [slot] |
void PopupMenuEditor::safeDec | ( | ) | [protected] |
void PopupMenuEditor::safeInc | ( | ) | [protected] |
void PopupMenuEditor::setAccelerator | ( | int | key, |
Qt::ButtonState | state, | ||
int | index = -1 |
||
) |
void PopupMenuEditor::setFocusAt | ( | const QPoint & | pos | ) | [protected] |
void PopupMenuEditor::show | ( | ) | [virtual] |
Shows the widget and its child widgets.
If its size or position has changed, Qt guarantees that a widget gets move and resize events just before it is shown.
You almost never have to reimplement this function. If you need to change some settings before a widget is shown, use showEvent() instead. If you need to do some delayed initialization use polish().
Reimplementado de QWidget.
void PopupMenuEditor::showLineEdit | ( | int | index = -1 | ) |
void PopupMenuEditor::showSubMenu | ( | ) | [slot] |
friend class MenuBarEditor [friend] |
friend class PopupMenuEditorItem [friend] |
friend class Resource [friend] |