|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.trolltech.qt.internal.QSignalEmitterInternal
com.trolltech.qt.QSignalEmitter
com.trolltech.qt.QtJambiObject
com.trolltech.qt.gui.QStyleOption
com.trolltech.qt.gui.QStyleOptionMenuItem
public class QStyleOptionMenuItem
The QStyleOptionMenuItem class is used to describe the parameter necessary for drawing a menu item. QStyleOptionMenuItem contains all the information that QStyle
functions need to draw the menu items from QMenu
. It is also used for drawing other menu-related widgets.
For performance reasons, the access to the member variables is direct (i.e., using the . or -> operator). This low-level feel makes the structures straightforward to use and emphasizes that these are simply parameters used by the style functions.
For an example demonstrating how style options can be used, see the Styles example.
QStyleOption
.
Nested Class Summary | |
---|---|
static class |
QStyleOptionMenuItem.CheckType
This enum is used to indicate whether or not a check mark should be drawn for the item, or even if it should be drawn at all. |
static class |
QStyleOptionMenuItem.MenuItemType
This enum indicates the type of menu item that the structure describes. |
static class |
QStyleOptionMenuItem.StyleOptionType
This enum is used to hold information about the type of the style option, and is defined for each QStyleOption subclass. |
static class |
QStyleOptionMenuItem.StyleOptionVersion
This enum is used to hold information about the version of the style option, and is defined for each QStyleOption subclass. |
Nested classes/interfaces inherited from class com.trolltech.qt.gui.QStyleOption |
---|
QStyleOption.OptionType |
Nested classes/interfaces inherited from class com.trolltech.qt.internal.QSignalEmitterInternal |
---|
com.trolltech.qt.internal.QSignalEmitterInternal.AbstractSignalInternal |
Field Summary |
---|
Fields inherited from class com.trolltech.qt.internal.QSignalEmitterInternal |
---|
currentSender |
Constructor Summary | |
---|---|
QStyleOptionMenuItem()
Constructs a QStyleOptionMenuItem, initializing the members variables to their default values. |
|
QStyleOptionMenuItem(QStyleOptionMenuItem other)
Constructs a copy of the other style option. |
Method Summary | |
---|---|
boolean |
checked()
This variable holds whether the menu item is checked or not. |
QStyleOptionMenuItem.CheckType |
checkType()
This variable holds the type of checkmark of the menu item. |
QStyleOptionMenuItem |
clone()
This method is reimplemented for internal reasons |
QFont |
font()
This variable holds the font used for the menu item text. |
QIcon |
icon()
This variable holds the icon for the menu item. |
int |
maxIconWidth()
This variable holds the maximum icon width for the icon in the menu item. |
boolean |
menuHasCheckableItems()
This variable holds whether the menu as a whole has checkable items or not. |
QStyleOptionMenuItem.MenuItemType |
menuItemType()
This variable holds the type of menu item. |
QRect |
menuRect()
This variable holds the rectangle for the entire menu. |
void |
setChecked(boolean checked)
This variable holds whether the menu item is checked or not. |
void |
setCheckType(QStyleOptionMenuItem.CheckType checkType)
This variable holds the type of checkmark of the menu item. |
void |
setFont(QFont font)
This variable holds the font used for the menu item text. |
void |
setIcon(QIcon icon)
This variable holds the icon for the menu item. |
void |
setMaxIconWidth(int maxIconWidth)
This variable holds the maximum icon width for the icon in the menu item. |
void |
setMenuHasCheckableItems(boolean menuHasCheckableItems)
This variable holds whether the menu as a whole has checkable items or not. |
void |
setMenuItemType(QStyleOptionMenuItem.MenuItemType menuItemType)
This variable holds the type of menu item. |
void |
setMenuRect(QRect menuRect)
This variable holds the rectangle for the entire menu. |
void |
setTabWidth(int tabWidth)
This variable holds the tab width for the menu item. |
void |
setText(java.lang.String text)
This variable holds the text for the menu item. |
int |
tabWidth()
This variable holds the tab width for the menu item. |
java.lang.String |
text()
This variable holds the text for the menu item. |
Methods inherited from class com.trolltech.qt.gui.QStyleOption |
---|
direction, fontMetrics, initFrom, palette, rect, setDirection, setFontMetrics, setPalette, setRect, setState, setState, setType, setVersion, state, type, version |
Methods inherited from class com.trolltech.qt.QtJambiObject |
---|
dispose, disposed, equals, finalize, reassignNativeResources, tr, tr, tr |
Methods inherited from class com.trolltech.qt.QSignalEmitter |
---|
blockSignals, disconnect, disconnect, signalsBlocked, signalSender, thread |
Methods inherited from class com.trolltech.qt.internal.QSignalEmitterInternal |
---|
__qt_signalInitialization |
Methods inherited from class java.lang.Object |
---|
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.trolltech.qt.QtJambiInterface |
---|
disableGarbageCollection, nativeId, nativePointer, reenableGarbageCollection, setJavaOwnership |
Constructor Detail |
---|
public QStyleOptionMenuItem()
public QStyleOptionMenuItem(QStyleOptionMenuItem other)
Method Detail |
---|
public final void setMenuHasCheckableItems(boolean menuHasCheckableItems)
If this option is set to false, then the menu has no checkable items. This makes it possible for GUI styles to save some horizontal space that would normally be used for the check column.
public final boolean menuHasCheckableItems()
If this option is set to false, then the menu has no checkable items. This makes it possible for GUI styles to save some horizontal space that would normally be used for the check column.
public final void setMenuRect(QRect menuRect)
public final QRect menuRect()
public final void setCheckType(QStyleOptionMenuItem.CheckType checkType)
NotCheckable
. CheckType
.
public final QStyleOptionMenuItem.CheckType checkType()
NotCheckable
. CheckType
.
public final void setIcon(QIcon icon)
public final QIcon icon()
public final void setChecked(boolean checked)
public final boolean checked()
public final void setMaxIconWidth(int maxIconWidth)
public final int maxIconWidth()
public final void setTabWidth(int tabWidth)
public final int tabWidth()
public final void setText(java.lang.String text)
If the menu item doesn't have a shortcut, it will just contain the menu item's text. The default value is an empty string.
public final java.lang.String text()
If the menu item doesn't have a shortcut, it will just contain the menu item's text. The default value is an empty string.
public final void setFont(QFont font)
public final QFont font()
public final void setMenuItemType(QStyleOptionMenuItem.MenuItemType menuItemType)
Normal
. MenuItemType
.
public final QStyleOptionMenuItem.MenuItemType menuItemType()
Normal
. MenuItemType
.
public QStyleOptionMenuItem clone()
clone
in class QStyleOption
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |