Eneboo - Documentación para desarrolladores
Slots públicos | Señales | Métodos públicos | Métodos protegidos | Amigas
Referencia de la Clase PopupMenuEditor

#include <popupmenueditor.h>

Diagrama de herencias de PopupMenuEditor
QWidget QObject QPaintDevice QObject QPaintDevice Qt Qt Qt Qt

Lista de todos los miembros.

Slots públicos

void cut ()
void copy ()
void paste ()
void remove (int index)
void remove (QAction *a)
void resizeToContents ()
void showSubMenu ()
void hideSubMenu ()
void focusOnSubMenu ()

Señales

void inserted (QAction *)
void removed (QAction *)

Métodos públicos

 PopupMenuEditor (FormWindow *fw, QWidget *parent=0, const char *name=0)
 PopupMenuEditor (FormWindow *fw, PopupMenuEditor *menu, QWidget *parent, const char *name=0)
 ~PopupMenuEditor ()
void init ()
void insert (PopupMenuEditorItem *item, int index=-1)
void insert (QAction *action, int index=-1)
void insert (QActionGroup *actionGroup, int index=-1)
int find (const QAction *action)
int find (PopupMenuEditor *menu)
int count ()
PopupMenuEditorItemat (int index)
PopupMenuEditorItemat (QPoint pos)
void exchange (int a, int b)
void cut (int index)
void copy (int index)
void paste (int index)
void insertedActions (QPtrList< QAction > &list)
void show ()
void choosePixmap (int index=-1)
void showLineEdit (int index=-1)
void setAccelerator (int key, Qt::ButtonState state, int index=-1)
FormWindowformWindow ()
bool isCreatingAccelerator ()
QPtrList< PopupMenuEditorItem > * items ()
QWidgetparentEditor ()

Métodos protegidos

PopupMenuEditorItemcreateItem (QAction *a=0)
void removeItem (int index=-1)
PopupMenuEditorItemcurrentItem ()
PopupMenuEditorItemitemAt (int y)
void setFocusAt (const QPoint &pos)
bool eventFilter (QObject *o, QEvent *e)
void paintEvent (QPaintEvent *e)
void mousePressEvent (QMouseEvent *e)
void mouseDoubleClickEvent (QMouseEvent *e)
void mouseMoveEvent (QMouseEvent *e)
void dragEnterEvent (QDragEnterEvent *e)
void dragLeaveEvent (QDragLeaveEvent *e)
void dragMoveEvent (QDragMoveEvent *e)
void dropEvent (QDropEvent *e)
void keyPressEvent (QKeyEvent *e)
void focusInEvent (QFocusEvent *e)
void focusOutEvent (QFocusEvent *e)
void drawItems (QPainter *p)
void drawItem (QPainter *p, PopupMenuEditorItem *i, const QRect &r, int f) const
void drawWinFocusRect (QPainter *p, const QRect &r) const
QSize contentsSize ()
int itemHeight (const PopupMenuEditorItem *item) const
int itemPos (const PopupMenuEditorItem *item) const
int snapToItem (int y)
void dropInPlace (PopupMenuEditorItem *i, int y)
void dropInPlace (QActionGroup *g, int y)
void safeDec ()
void safeInc ()
void clearCurrentField ()
void navigateUp (bool ctrl)
void navigateDown (bool ctrl)
void navigateLeft ()
void navigateRight ()
void enterEditMode (QKeyEvent *e)
void leaveEditMode (QKeyEvent *e)
QString constructName (PopupMenuEditorItem *item)

Amigas

class PopupMenuEditorItem
class MenuBarEditor
class Resource

Documentación del constructor y destructor

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 ( )

Documentación de las funciones miembro

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.

Ver también:
QTextDrag, QImageDrag, QDragEnterEvent

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.

Ver también:
QTextDrag, QImageDrag, QDragLeaveEvent

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.

Ver también:
QTextDrag, QImageDrag, QDragMoveEvent

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::drawWinFocusRect ( QPainter p,
const QRect r 
) const [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.

Ver también:
QTextDrag, QImageDrag, QDropEvent

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]
bool PopupMenuEditor::eventFilter ( QObject ,
QEvent  
) [protected, 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.

Atención:
If you delete the receiver object in this function, be sure to return TRUE. Otherwise, Qt will forward the event to the deleted object and the program might crash.
Ver también:
installEventFilter()

Reimplementado de QObject.

void PopupMenuEditor::exchange ( int  a,
int  b 
)
int PopupMenuEditor::find ( const QAction action)
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.

Ver también:
focusOutEvent(), setFocusPolicy(), keyPressEvent(), keyReleaseEvent(), event(), QFocusEvent

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.

Ver también:
focusInEvent(), setFocusPolicy(), keyPressEvent(), keyReleaseEvent(), event(), QFocusEvent

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::insert ( QAction action,
int  index = -1 
)
void PopupMenuEditor::inserted ( QAction ) [signal]
void PopupMenuEditor::insertedActions ( QPtrList< QAction > &  list)
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.

Ver también:
keyReleaseEvent(), QKeyEvent::ignore(), setFocusPolicy(), focusInEvent(), focusOutEvent(), event(), QKeyEvent

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().

Ver también:
mousePressEvent(), mouseReleaseEvent() mouseMoveEvent(), event(), QMouseEvent

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.

Ver también:
setMouseTracking(), mousePressEvent(), mouseReleaseEvent(), mouseDoubleClickEvent(), event(), QMouseEvent

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.

Ver también:
mouseReleaseEvent(), mouseDoubleClickEvent(), mouseMoveEvent(), event(), QMouseEvent

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.

Ver también:
event(), repaint(), update(), QPainter, QPixmap, QPaintEvent

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().

Ver también:
showEvent(), hide(), showMinimized(), showMaximized(), showNormal(), isVisible(), polish()

Reimplementado de QWidget.

void PopupMenuEditor::showLineEdit ( int  index = -1)
void PopupMenuEditor::showSubMenu ( ) [slot]
int PopupMenuEditor::snapToItem ( int  y) [protected]

Documentación de las funciones relacionadas y clases amigas

friend class MenuBarEditor [friend]
friend class PopupMenuEditorItem [friend]
friend class Resource [friend]

La documentación para esta clase fue generada a partir de los siguientes ficheros:
 Todo Clases Namespaces Archivos Funciones Variables 'typedefs' Enumeraciones Valores de enumeraciones Propiedades Amigas 'defines'