Qyoto  4.0.5
Qyoto is a C# language binding for Qt
 All Classes Namespaces Functions Variables Typedefs Enumerations Properties
QtGui.QWidgetAction Class Reference

The QWidgetAction class extends QAction by an interface for inserting custom widgets into action based containers, such as toolbars. More...

Inheritance diagram for QtGui.QWidgetAction:
Collaboration diagram for QtGui.QWidgetAction:

Public Member Functions

 QWidgetAction (QObject parent)
 
 
override void CreateProxy ()
 
override bool OnEvent (QEvent arg1)
 
 
override bool EventFilter (QObject arg1, QEvent arg2)
 
 
new void ReleaseWidget (QWidget widget)
 
 
new QWidget RequestWidget (QWidget parent)
 
 
new void Dispose ()
 
- Public Member Functions inherited from QtGui.QAction
 QAction (QObject parent)
 
 
 QAction (QIcon icon, string text, QObject parent)
 
 
 QAction (string text, QObject parent)
 
 
new void Activate (QAction.ActionEvent @event)
 
 
new
System.Collections.Generic.List
< QGraphicsWidget
AssociatedGraphicsWidgets ()
 
 
new
System.Collections.Generic.List
< QWidget
AssociatedWidgets ()
 
 
new void Hover ()
 
 
new bool IsSeparator ()
 
 
new QWidget ParentWidget ()
 
 
new void SetDisabled (bool b)
 
 
new void SetSeparator (bool b)
 
 
new void SetShortcuts (QKeySequence.StandardKey arg1)
 
 
new bool ShowStatusText (QWidget widget=null)
 
 
new void Toggle ()
 
 
new void Trigger ()
 
 
new void Dispose ()
 
- Public Member Functions inherited from QtCore.QObject
 QObject (QObject parent=null)
 
 
new bool BlockSignals (bool b)
 
 
new
System.Collections.Generic.List
< QObject
Children ()
 
 
new bool Connect (QObject sender, string signal, string member, Qt.ConnectionType type=Qt.ConnectionType.AutoConnection)
 
 
new void DeleteLater ()
 
 
new bool Disconnect (QObject receiver, string member=null)
 
 
new bool Disconnect (string signal=null, QObject receiver=null, string member=null)
 
 
new void DumpObjectInfo ()
 
 
new void DumpObjectTree ()
 
 
new
System.Collections.Generic.List
< QByteArray
DynamicPropertyNames ()
 
 
new bool Inherits (string classname)
 
 
new void InstallEventFilter (QObject arg1)
 
 
new bool IsWidgetType ()
 
 
new void KillTimer (int id)
 
 
new object Property (string name)
 
 
new void RemoveEventFilter (QObject arg1)
 
 
new bool SetProperty (string name, object value)
 
 
new void SetUserData (uint id, QObjectUserData data)
 
new bool SignalsBlocked ()
 
 
new int StartTimer (int interval)
 
 
new QObjectUserData UserData (uint id)
 
new void Dispose ()
 
- Public Member Functions inherited from QtCore.Qt
delegate QTextStream FuncQTextStreamQTextStream (QTextStream qTextStream)
 
delegate string FuncStringQByteArray (QByteArray qByteArray)
 
delegate QByteArray FuncQByteArrayString (string @string)
 
delegate void ActionQtMsgTypeString (QtMsgType qtMsgType, string @string)
 
delegate QObject FuncQObject ()
 

Static Public Member Functions

static string Tr (string s, string c=null)
 
static string Tr (string s, string c, int n)
 
static string TrUtf8 (string s, string c=null)
 
static string TrUtf8 (string s, string c, int n)
 
- Static Public Member Functions inherited from QtGui.QAction
static string Tr (string s, string c=null)
 
static string Tr (string s, string c, int n)
 
static string TrUtf8 (string s, string c=null)
 
static string TrUtf8 (string s, string c, int n)
 
- Static Public Member Functions inherited from QtCore.QObject
static bool Connect (QObject sender, QMetaMethod signal, QObject receiver, QMetaMethod method, Qt.ConnectionType type=Qt.ConnectionType.AutoConnection)
 
 
static bool Connect (QObject sender, string signal, QObject receiver, string member, Qt.ConnectionType arg5=Qt.ConnectionType.AutoConnection)
 
 
static bool Disconnect (QObject sender, QMetaMethod signal, QObject receiver, QMetaMethod member)
 
 
static bool Disconnect (QObject sender, string signal, QObject receiver, string member)
 
 
static uint RegisterUserData ()
 
static string Tr (string s, string c=null)
 
 
static string Tr (string s, string c, int n)
 
 
static string TrUtf8 (string s, string c=null)
 
 
static string TrUtf8 (string s, string c, int n)
 
 
- Static Public Member Functions inherited from QtCore.Qt
static QDataStream Write (QDataStream s, object p)
 
static QDataStream Write (QDataStream arg1, QSizeF arg2)
 
static QTextStream Write (QTextStream s, Qt.FuncQTextStreamQTextStream f)
 
static QDataStream Write (QDataStream arg1, QPoint arg2)
 
static QDataStream Write (QDataStream arg1, QLineF arg2)
 
static QDataStream Write (QDataStream arg1, QPointF arg2)
 
static QDataStream Write (QDataStream arg1, QChar arg2)
 
static QDataStream Write (QDataStream arg1, QByteArray arg2)
 
static QDataStream Write (QDataStream arg1, QEasingCurve arg2)
 
static QDataStream Write (QDataStream arg1, QRectF arg2)
 
static QDataStream Write (QDataStream arg1, QDateTime arg2)
 
static QDataStream Write (QDataStream arg1, QUrl arg2)
 
static QDataStream Write (QDataStream arg1, QTime arg2)
 
static QDataStream Write (QDataStream arg1, QLocale arg2)
 
static QDataStream Write (QDataStream arg1, QBitArray arg2)
 
static QDataStream Write (QDataStream arg1, QUuid arg2)
 
static QDataStream Write (QDataStream arg1, QLine arg2)
 
static QDataStream Write (QDataStream arg1, QDate arg2)
 
static QDataStream Write (QDataStream @out, QRegExp regExp)
 
static QDataStream Write (QDataStream arg1, QRect arg2)
 
static QDataStream Write (QDataStream arg1, QSize arg2)
 
static QDataStream Write (QDataStream s, QVariant.Type p)
 
static QDataStream Write (QDataStream arg1, string arg2)
 
static QDataStream Write (QDataStream @out, System.Collections.Generic.List< string > list)
 
static QDataStream Read (QDataStream arg1, QChar arg2)
 
static QDataStream Read (QDataStream arg1, QLocale arg2)
 
static QDataStream Read (QDataStream arg1, QRect arg2)
 
static QDataStream Read (QDataStream arg1, QEasingCurve arg2)
 
static QDataStream Read (QDataStream arg1, QDate arg2)
 
static QDataStream Read (QDataStream arg1, QUrl arg2)
 
static QDataStream Read (QDataStream arg1, QUuid arg2)
 
static QTextStream Read (QTextStream s, Qt.FuncQTextStreamQTextStream f)
 
static QDataStream Read (QDataStream arg1, QLineF arg2)
 
static QDataStream Read (QDataStream arg1, QRectF arg2)
 
static QDataStream Read (QDataStream arg1, QPointF arg2)
 
static QDataStream Read (QDataStream arg1, QLine arg2)
 
static QDataStream Read (QDataStream arg1, QBitArray arg2)
 
static QDataStream Read (QDataStream arg1, QSize arg2)
 
static QDataStream Read (QDataStream arg1, QDateTime arg2)
 
static QDataStream Read (QDataStream arg1, QTime arg2)
 
static QDataStream Read (QDataStream arg1, QPoint arg2)
 
static QDataStream Read (QDataStream @in, QRegExp regExp)
 
static QDataStream Read (QDataStream s, object p)
 
static QDataStream Read (QDataStream arg1, QByteArray arg2)
 
static QDataStream Read (QDataStream arg1, QSizeF arg2)
 
static QDataStream Read (QDataStream arg1, string arg2)
 
static QDataStream Read (QDataStream s, QVariant.Type p)
 
static QDataStream Read (QDataStream @in, System.Collections.Generic.List< string > list)
 
static double qAcos (double v)
 
static void qAddPostRoutine (System.Action arg1)
 
static string qAppName ()
 
static double qAsin (double v)
 
static double qAtan (double v)
 
static double qAtan2 (double x, double y)
 
static void qBadAlloc ()
 
static int qCeil (double v)
 
static ushort qChecksum (string s, uint len)
 
static QByteArray qCompress (QByteArray data)
 
static QByteArray qCompress (QByteArray data, int compressionLevel=-1)
 
static QByteArray qCompress (Pointer< byte > data, int nbytes)
 
static QByteArray qCompress (Pointer< byte > data, int nbytes, int compressionLevel=-1)
 
static double qCos (double v)
 
static double qExp (double v)
 
static double qFabs (double v)
 
static double qFastCos (double x)
 
static double qFastSin (double x)
 
static string qFlagLocation (string method)
 
static int qFloor (double v)
 
static bool qFuzzyCompare (double p1, double p2)
 
static bool qFuzzyCompare (float p1, float p2)
 
static bool qFuzzyIsNull (double d)
 
static bool qFuzzyIsNull (float f)
 
static uint qHash (QBitArray key)
 
static uint qHash (QChar key)
 
static uint qHash (QStringRef key)
 
static uint qHash (QUrl url)
 
static uint qHash (QPersistentModelIndex index)
 
static uint qHash (QByteArray key)
 
static uint qHash (QModelIndex index)
 
static uint qHash (uint key)
 
static uint qHash (sbyte key)
 
static uint qHash (byte key)
 
static uint qHash (short key)
 
static uint qHash (NativeLong key)
 
static uint qHash (ushort key)
 
static uint qHash (long key)
 
static uint qHash (ulong key)
 
static uint qHash (int key)
 
static uint qHash (string key)
 
static uint qHash (NativeULong key)
 
static double qInf ()
 
static Qt.ActionQtMsgTypeString qInstallMsgHandler (Qt.ActionQtMsgTypeString arg1)
 
static int qIntCast (float f)
 
static int qIntCast (double f)
 
static bool qIsFinite (double d)
 
static bool qIsFinite (float f)
 
static bool qIsInf (float f)
 
static bool qIsInf (double d)
 
static bool qIsNaN (float f)
 
static bool qIsNaN (double d)
 
static bool qIsNull (float f)
 
static bool qIsNull (double d)
 
static double qLn (double v)
 
static double qPow (double x, double y)
 
static double qQNaN ()
 
static void qRegisterStaticPluginInstanceFunction (Qt.FuncQObject function)
 
static void qRemovePostRoutine (System.Action arg1)
 
static int qRound (double d)
 
static long qRound64 (double d)
 
static double qSNaN ()
 
static bool qSharedBuild ()
 
static double qSin (double v)
 
static double qSqrt (double v)
 
static bool qStringComparisonHelper (QStringRef s1, string s2)
 
static double qTan (double v)
 
static QByteArray qUncompress (QByteArray data)
 
static QByteArray qUncompress (Pointer< byte > data, int nbytes)
 
static string qVersion ()
 
static void Qbswap_helper (Pointer< byte > src, Pointer< byte > dest, int size)
 
static QByteArray Qgetenv (string varName)
 
static bool Qputenv (string varName, QByteArray value)
 
static int Qrand ()
 
static void Qsrand (uint seed)
 
static int Qstrcmp (QByteArray str1, QByteArray str2)
 
static int Qstrcmp (QByteArray str1, string str2)
 
static int Qstrcmp (string str1, QByteArray str2)
 
static int Qstrcmp (string str1, string str2)
 
static Pointer< sbyte > Qstrcpy (Pointer< sbyte > dst, string src)
 
static Pointer< sbyte > Qstrdup (string arg1)
 
static int Qstricmp (string arg1, string arg2)
 
static uint Qstrlen (string str)
 
static int Qstrncmp (string str1, string str2, uint len)
 
static Pointer< sbyte > Qstrncpy (Pointer< sbyte > dst, string src, uint len)
 
static int Qstrnicmp (string arg1, string arg2, uint len)
 
static uint Qstrnlen (string str, uint maxlen)
 
static string QtTrId (string id, int n=-1)
 

Protected Member Functions

 QWidgetAction (System.Type dummy)
 
virtual QWidget CreateWidget (QWidget parent)
 
 
new
System.Collections.Generic.List
< QWidget
CreatedWidgets ()
 
 
virtual void DeleteWidget (QWidget widget)
 
 
- Protected Member Functions inherited from QtGui.QAction
 QAction (System.Type dummy)
 
new void OnChanged ()
 
 
new void OnHovered ()
 
 
new void OnToggled (bool arg1)
 
 
new void OnTriggered (bool @checked=false)
 
 
- Protected Member Functions inherited from QtCore.QObject
 QObject (System.Type dummy)
 
virtual void OnChildEvent (QChildEvent arg1)
 
 
virtual void ConnectNotify (string signal)
 
 
virtual void OnCustomEvent (QEvent arg1)
 
 
new void OnDestroyed (QObject arg1=null)
 
 
virtual void DisconnectNotify (string signal)
 
 
new int Receivers (string signal)
 
 
new QObject Sender ()
 
 
new int SenderSignalIndex ()
 
 
virtual void OnTimerEvent (QTimerEvent arg1)
 
 

Properties

new QWidget DefaultWidget [get, set]
 
 
static new QMetaObject StaticMetaObject [get]
 
new IQWidgetActionSignals Emit [get]
 
- Properties inherited from QtGui.QAction
Slot Changed
 
 
Slot< System.Boolean > TriggeredChecked
 
Slot Triggered
 
 
Slot Hovered
 
 
Slot< System.Boolean > Toggled
 
 
Slot< System.Int32 > ActivatedInt32
 
Slot Activated
 
new QActionGroup ActionGroup [get, set]
 
 
new object Data [get, set]
 
 
new QMenu Menu [get, set]
 
 
new
System.Collections.Generic.List
< QKeySequence
Shortcuts [get, set]
 
 
new bool Checkable [get, set]
 
 
new bool Checked [get, set]
 
 
new bool Enabled [get, set]
 
 
new QIcon Icon [get, set]
 
 
new string Text [get, set]
 
 
new string IconText [get, set]
 
 
new string ToolTip [get, set]
 
 
new string StatusTip [get, set]
 
 
new string WhatsThis [get, set]
 
 
new QFont Font [get, set]
 
 
new QKeySequence Shortcut [get, set]
 
 
new Qt.ShortcutContext ShortcutContext [get, set]
 
 
new bool AutoRepeat [get, set]
 
 
new bool Visible [get, set]
 
 
new MenuRole menuRole [get, set]
 
 
new SoftKeyRole softKeyRole [get, set]
 
 
new bool IconVisibleInMenu [get, set]
 
 
new Priority priority [get, set]
 
 
static new QMetaObject StaticMetaObject [get]
 
new IQActionSignals Emit [get]
 
- Properties inherited from QtCore.QObject
virtual EventHandler
< QEventArgs< QChildEvent > > 
ChildEvent
 
 
virtual EventHandler
< QEventArgs< QEvent > > 
CustomEvent
 
 
virtual EventHandler
< QEventArgs< QEvent > > 
Event
 
 
virtual EventHandler
< QEventArgs< QTimerEvent > > 
TimerEvent
 
 
Slot< QObjectDestroyedQObject
 
Slot Destroyed
 
 
new QObject Parent [get, set]
 
 
virtual System.IntPtr SmokeObject [get, set]
 
new string ObjectName [get, set]
 
 
static new QMetaObject StaticMetaObject [get]
 
 
static new QMetaObject StaticQtMetaObject [get]
 
new IQObjectSignals Emit [get]
 

Additional Inherited Members

- Public Types inherited from QtGui.QAction
enum  ActionEvent { Hover = 1, Trigger = 0 }
  More...
 
enum  MenuRole {
  AboutQtRole = 3, AboutRole = 4, ApplicationSpecificRole = 2, NoRole = 0,
  PreferencesRole = 5, QuitRole = 6, TextHeuristicRole = 1
}
  More...
 
enum  Priority { HighPriority = 256, LowPriority = 0, NormalPriority = 128 }
  More...
 
enum  SoftKeyRole { NegativeSoftKey = 2, NoSoftKey = 0, PositiveSoftKey = 1, SelectSoftKey = 3 }
  More...
 
- Protected Attributes inherited from QtCore.QObject
object Q_EMIT = null
 
SmokeInvocation interceptor
 
readonly List< QEventHandler > eventFilters = new List<QEventHandler>()
 

Detailed Description

The QWidgetAction class extends QAction by an interface for inserting custom widgets into action based containers, such as toolbars.

Most actions in an application are represented as items in menus or buttons in toolbars. However sometimes more complex widgets are necessary. For example a zoom action in a word processor may be realized using a QComboBox in a QToolBar, presenting a range of different zoom levels. QToolBar provides QToolBar::insertWidget() as convenience function for inserting a single widget. However if you want to implement an action that uses custom widgets for visualization in multiple containers then you have to subclass QWidgetAction.

If a QWidgetAction is added for example to a QToolBar then QWidgetAction::createWidget() is called. Reimplementations of that function should create a new custom widget with the specified parent.

If the action is removed from a container widget then QWidgetAction::deleteWidget() is called with the previously created custom widget as argument. The default implementation hides the widget and deletes it using QObject::deleteLater().

If you have only one single custom widget then you can set it as default widget using setDefaultWidget(). That widget will then be used if the action is added to a QToolBar, or in general to an action container that supports QWidgetAction. If a QWidgetAction with only a default widget is added to two toolbars at the same time then the default widget is shown only in the first toolbar the action was added to. QWidgetAction takes over ownership of the default widget.

Note that it is up to the widget to activate the action, for example by reimplementing mouse event handlers and calling QAction::trigger().

Mac OS X: If you add a widget to a menu in the application's menu bar on Mac OS X, the widget will be added and it will function but with some limitations:

The widget is reparented away from the QMenu to the native menu view. If you show the menu in some other place (e.g. as a popup menu), the widget will not be there.

Focus/Keyboard handling of the widget is not possible.

Due to Apple's design, mouse tracking on the widget currently does not work.

Connecting the triggered() signal to a slot that opens a modal dialog will cause a crash in Mac OS X 10.4 (known bug acknowledged by Apple), a workaround is to use a QueuedConnection instead of a DirectConnection.

See also QAction, QActionGroup, and QWidget.

Constructor & Destructor Documentation

QtGui.QWidgetAction.QWidgetAction ( System.Type  dummy)
protected
QtGui.QWidgetAction.QWidgetAction ( QObject  parent)

Constructs an action with parent.

Member Function Documentation

new System.Collections.Generic.List<QWidget> QtGui.QWidgetAction.CreatedWidgets ( )
protected

Returns the list of widgets that have been using createWidget() and are currently in use by widgets the action has been added to.

override void QtGui.QWidgetAction.CreateProxy ( )
virtual

Reimplemented from QtGui.QAction.

virtual QWidget QtGui.QWidgetAction.CreateWidget ( QWidget  parent)
protectedvirtual

This function is called whenever the action is added to a container widget that supports custom widgets. If you don't want a custom widget to be used as representation of the action in the specified parent widget then 0 should be returned.

See also deleteWidget().

virtual void QtGui.QWidgetAction.DeleteWidget ( QWidget  widget)
protectedvirtual

This function is called whenever the action is removed from a container widget that displays the action using a custom widget previously created using createWidget(). The default implementation hides the widget and schedules it for deletion using QObject::deleteLater().

See also createWidget().

new void QtGui.QWidgetAction.Dispose ( )
override bool QtGui.QWidgetAction.EventFilter ( QObject  arg1,
QEvent  arg2 
)
virtual

Reimplemented from QObject::eventFilter().

Reimplemented from QtCore.QObject.

override bool QtGui.QWidgetAction.OnEvent ( QEvent  arg1)
virtual

Reimplemented from QObject::event().

Reimplemented from QtGui.QAction.

new void QtGui.QWidgetAction.ReleaseWidget ( QWidget  widget)

Releases the specified widget.

Container widgets that support actions call this function when a widget action is removed.

See also requestWidget(), deleteWidget(), and defaultWidget().

new QWidget QtGui.QWidgetAction.RequestWidget ( QWidget  parent)

Returns a widget that represents the action, with the given parent.

Container widgets that support actions can call this function to request a widget as visual representation of the action.

See also releaseWidget(), createWidget(), and defaultWidget().

static string QtGui.QWidgetAction.Tr ( string  s,
string  c = null 
)
static
static string QtGui.QWidgetAction.Tr ( string  s,
string  c,
int  n 
)
static
static string QtGui.QWidgetAction.TrUtf8 ( string  s,
string  c = null 
)
static
static string QtGui.QWidgetAction.TrUtf8 ( string  s,
string  c,
int  n 
)
static

Property Documentation

new QWidget QtGui.QWidgetAction.DefaultWidget
getset

Returns the default widget.

Sets widget to be the default widget. The ownership is transferred to QWidgetAction. Unless createWidget() is reimplemented by a subclass to return a new widget the default widget is used when a container widget requests a widget through requestWidget().

new IQWidgetActionSignals QtGui.QWidgetAction.Emit
getprotected
new QMetaObject QtGui.QWidgetAction.StaticMetaObject
staticget