You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tqt3/doc/man/man3/tqcontextmenuevent.3qt

188 lines
7.4 KiB

'\" t
.TH QContextMenuEvent 3qt "2 February 2007" "Trolltech AS" \" -*- nroff -*-
.\" Copyright 1992-2007 Trolltech ASA. All rights reserved. See the
.\" license file included in the distribution for a complete license
.\" statement.
.\"
.ad l
.nh
.SH NAME
QContextMenuEvent \- Parameters that describe a context menu event
.SH SYNOPSIS
\fC#include <ntqevent.h>\fR
.PP
Inherits QEvent.
.PP
.SS "Public Members"
.in +1c
.ti -1c
.BI "enum \fBReason\fR { Mouse, Keyboard, Other }"
.br
.ti -1c
.BI "\fBQContextMenuEvent\fR ( Reason reason, const QPoint & pos, const QPoint & globalPos, int state )"
.br
.ti -1c
.BI "\fBQContextMenuEvent\fR ( Reason reason, const QPoint & pos, int state )"
.br
.ti -1c
.BI "int \fBx\fR () const"
.br
.ti -1c
.BI "int \fBy\fR () const"
.br
.ti -1c
.BI "int \fBglobalX\fR () const"
.br
.ti -1c
.BI "int \fBglobalY\fR () const"
.br
.ti -1c
.BI "const QPoint & \fBpos\fR () const"
.br
.ti -1c
.BI "const QPoint & \fBglobalPos\fR () const"
.br
.ti -1c
.BI "ButtonState \fBstate\fR () const"
.br
.ti -1c
.BI "bool \fBisAccepted\fR () const"
.br
.ti -1c
.BI "bool \fBisConsumed\fR () const"
.br
.ti -1c
.BI "void \fBconsume\fR ()"
.br
.ti -1c
.BI "void \fBaccept\fR ()"
.br
.ti -1c
.BI "void \fBignore\fR ()"
.br
.ti -1c
.BI "Reason \fBreason\fR () const"
.br
.in -1c
.SH DESCRIPTION
The QContextMenuEvent class contains parameters that describe a context menu event.
.PP
Context menu events are sent to widgets when a user triggers a context menu. What triggers this is platform dependent. For example, on Windows, pressing the menu button or releasing the right mouse button will cause this event to be sent.
.PP
When this event occurs it is customary to show a QPopupMenu with a context menu, if this is relevant to the context.
.PP
Context menu events contain a special accept flag that indicates whether the receiver accepted the event. If the event handler does not accept the event, then whatever triggered the event will be handled as a regular input event if possible.
.PP
See also QPopupMenu and Event Classes.
.SS "Member Type Documentation"
.SH "QContextMenuEvent::Reason"
This enum describes the reason the ContextMenuEvent was sent. The values are:
.TP
\fCQContextMenuEvent::Mouse\fR - The mouse caused the event to be sent. Normally this means the right mouse button was clicked, but this is platform specific.
.TP
\fCQContextMenuEvent::Keyboard\fR - The keyboard caused this event to be sent. On Windows this means the menu button was pressed.
.TP
\fCQContextMenuEvent::Other\fR - The event was sent by some other means (i.e. not by the mouse or keyboard).
.SH MEMBER FUNCTION DOCUMENTATION
.SH "QContextMenuEvent::QContextMenuEvent ( Reason reason, const QPoint & pos, const QPoint & globalPos, int state )"
Constructs a context menu event object with the accept parameter flag set to FALSE.
.PP
The \fIreason\fR parameter must be QContextMenuEvent::Mouse or QContextMenuEvent::Keyboard.
.PP
The \fIpos\fR parameter specifies the mouse position relative to the receiving widget. \fIglobalPos\fR is the mouse position in absolute coordinates. \fIstate\fR is the ButtonState at the time of the event.
.SH "QContextMenuEvent::QContextMenuEvent ( Reason reason, const QPoint & pos, int state )"
Constructs a context menu event object with the accept parameter flag set to FALSE.
.PP
The \fIreason\fR parameter must be QContextMenuEvent::Mouse or QContextMenuEvent::Keyboard.
.PP
The \fIpos\fR parameter specifies the mouse position relative to the receiving widget. \fIstate\fR is the ButtonState at the time of the event.
.PP
The globalPos() is initialized to QCursor::pos(), which may not be appropriate. Use the other constructor to specify the global position explicitly.
.SH "void QContextMenuEvent::accept ()"
Sets the accept flag of the context event object.
.PP
Setting the accept flag indicates that the receiver of this event has processed the event. Processing the event means you did something with it and it will be implicitly consumed.
.PP
The accept flag is not set by default.
.PP
See also ignore() and consume().
.SH "void QContextMenuEvent::consume ()"
Sets the consume flag of the context event object.
.PP
Setting the consume flag indicates that the receiver of this event does not want the event to be propagated further (i.e. not sent to parent classes.)
.PP
The consumed flag is not set by default.
.PP
See also ignore() and accept().
.SH "const QPoint & QContextMenuEvent::globalPos () const"
Returns the global position of the mouse pointer at the time of the event.
.PP
See also x(), y(), and pos().
.SH "int QContextMenuEvent::globalX () const"
Returns the global x-position of the mouse pointer at the time of the event.
.PP
See also globalY() and globalPos().
.SH "int QContextMenuEvent::globalY () const"
Returns the global y-position of the mouse pointer at the time of the event.
.PP
See also globalX() and globalPos().
.SH "void QContextMenuEvent::ignore ()"
Clears the accept flag of the context event object.
.PP
Clearing the accept flag indicates that the receiver of this event does not need to show a context menu. This will implicitly remove the consumed flag as well.
.PP
The accept flag is not set by default.
.PP
See also accept() and consume().
.SH "bool QContextMenuEvent::isAccepted () const"
Returns TRUE if the receiver has processed the event; otherwise returns FALSE.
.PP
See also accept(), ignore(), and consume().
.SH "bool QContextMenuEvent::isConsumed () const"
Returns TRUE (which stops propagation of the event) if the receiver has blocked the event; otherwise returns FALSE.
.PP
See also accept(), ignore(), and consume().
.SH "const QPoint & QContextMenuEvent::pos () const"
Returns the position of the mouse pointer relative to the widget that received the event.
.PP
See also x(), y(), and globalPos().
.SH "Reason QContextMenuEvent::reason () const"
Returns the reason for this context event.
.SH "ButtonState QContextMenuEvent::state () const"
Returns the button state (a combination of mouse buttons and keyboard modifiers), i.e. what buttons and keys were being pressed immediately before the event was generated.
.PP
The returned value is LeftButton, RightButton, MidButton, ShiftButton, ControlButton and AltButton OR'ed together.
.SH "int QContextMenuEvent::x () const"
Returns the x-position of the mouse pointer, relative to the widget that received the event.
.PP
See also y() and pos().
.SH "int QContextMenuEvent::y () const"
Returns the y-position of the mouse pointer, relative to the widget that received the event.
.PP
See also x() and pos().
.SH "SEE ALSO"
.BR http://doc.trolltech.com/qcontextmenuevent.html
.BR http://www.trolltech.com/faq/tech.html
.SH COPYRIGHT
Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com. See the
license file included in the distribution for a complete license
statement.
.SH AUTHOR
Generated automatically from the source code.
.SH BUGS
If you find a bug in Qt, please report it as described in
.BR http://doc.trolltech.com/bughowto.html .
Good bug reports help us to help you. Thank you.
.P
The definitive TQt documentation is provided in HTML format; it is
located at $TQTDIR/doc/html and can be read using TQt Assistant or with
a web browser. This man page is provided as a convenience for those
users who prefer man pages, although this format is not officially
supported by Trolltech.
.P
If you find errors in this manual page, please report them to
.BR qt-bugs@trolltech.com .
Please include the name of the manual page (tqcontextmenuevent.3qt) and the Qt
version (3.3.8).