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

The QGraphicsView class provides a widget for displaying the contents of a QGraphicsScene. More...

Inheritance diagram for QtGui.QGraphicsView:
Collaboration diagram for QtGui.QGraphicsView:

Public Types

enum  CacheModeFlag { CacheBackground = 1, CacheNone = 0 }
  More...
 
enum  DragMode { NoDrag = 0, RubberBandDrag = 2, ScrollHandDrag = 1 }
  More...
 
enum  OptimizationFlag { DontAdjustForAntialiasing = 4, DontClipPainter = 1, DontSavePainterState = 2, IndirectPainting = 8 }
  More...
 
enum  ViewportAnchor { AnchorUnderMouse = 2, AnchorViewCenter = 1, NoAnchor = 0 }
  More...
 
enum  ViewportUpdateMode {
  BoundingRectViewportUpdate = 4, FullViewportUpdate = 0, MinimalViewportUpdate = 1, NoViewportUpdate = 3,
  SmartViewportUpdate = 2
}
  More...
 

Public Member Functions

 QGraphicsView (QWidget parent=null)
 
 
 QGraphicsView (QGraphicsScene scene, QWidget parent=null)
 
 
override void CreateProxy ()
 
new Qt.AlignmentFlag alignment ()
 
new QGraphicsView.CacheModeFlag cacheMode ()
 
new void CenterOn (QPointF pos)
 
 
new void CenterOn (IQGraphicsItem item)
 
 
new void CenterOn (double x, double y)
 
 
new void EnsureVisible (QRectF rect, int xmargin=50, int ymargin=50)
 
 
new void EnsureVisible (IQGraphicsItem item, int xmargin=50, int ymargin=50)
 
 
new void EnsureVisible (double x, double y, double w, double h, int xmargin=50, int ymargin=50)
 
 
override bool OnEvent (QEvent @event)
 
 
new void FitInView (QRectF rect, Qt.AspectRatioMode aspectRadioMode=Qt.AspectRatioMode.IgnoreAspectRatio)
 
 
new void FitInView (IQGraphicsItem item, Qt.AspectRatioMode aspectRadioMode=Qt.AspectRatioMode.IgnoreAspectRatio)
 
 
new void FitInView (double x, double y, double w, double h, Qt.AspectRatioMode aspectRadioMode=Qt.AspectRatioMode.IgnoreAspectRatio)
 
 
override object InputMethodQuery (Qt.InputMethodQuery query)
 
 
new void InvalidateScene ()
 
 
new void InvalidateScene (QRectF rect, QGraphicsScene.SceneLayer layers=QGraphicsScene.SceneLayer.AllLayers)
 
 
new bool IsTransformed ()
 
 
new IQGraphicsItem ItemAt (QPoint pos)
 
 
new IQGraphicsItem ItemAt (int x, int y)
 
 
new
System.Collections.Generic.List
< IQGraphicsItem
Items ()
 
 
new
System.Collections.Generic.List
< IQGraphicsItem
Items (QPoint pos)
 
 
new
System.Collections.Generic.List
< IQGraphicsItem
Items (QRect rect, Qt.ItemSelectionMode mode=Qt.ItemSelectionMode.IntersectsItemShape)
 
 
new
System.Collections.Generic.List
< IQGraphicsItem
Items (QPolygon polygon, Qt.ItemSelectionMode mode=Qt.ItemSelectionMode.IntersectsItemShape)
 
 
new
System.Collections.Generic.List
< IQGraphicsItem
Items (QPainterPath path, Qt.ItemSelectionMode mode=Qt.ItemSelectionMode.IntersectsItemShape)
 
 
new
System.Collections.Generic.List
< IQGraphicsItem
Items (int x, int y)
 
 
new
System.Collections.Generic.List
< IQGraphicsItem
Items (int x, int y, int w, int h, Qt.ItemSelectionMode mode=Qt.ItemSelectionMode.IntersectsItemShape)
 
 
new QPoint MapFromScene (QPointF point)
 
 
new QPolygon MapFromScene (QRectF rect)
 
 
new QPolygon MapFromScene (QPolygonF polygon)
 
 
new QPainterPath MapFromScene (QPainterPath path)
 
 
new QPoint MapFromScene (double x, double y)
 
 
new QPolygon MapFromScene (double x, double y, double w, double h)
 
 
new QPointF MapToScene (QPoint point)
 
 
new QPolygonF MapToScene (QRect rect)
 
 
new QPolygonF MapToScene (QPolygon polygon)
 
 
new QPainterPath MapToScene (QPainterPath path)
 
 
new QPointF MapToScene (int x, int y)
 
 
new QPolygonF MapToScene (int x, int y, int w, int h)
 
 
new QGraphicsView.OptimizationFlag optimizationFlags ()
 
new void Render (QPainter painter)
 
 
new void Render (QPainter painter, QRectF target)
 
 
new void Render (QPainter painter, QRectF target, QRect source, Qt.AspectRatioMode aspectRatioMode=Qt.AspectRatioMode.KeepAspectRatio)
 
 
new QPainter.RenderHint renderHints ()
 
new void ResetCachedContent ()
 
 
new void ResetMatrix ()
 
 
new void ResetTransform ()
 
 
new void Rotate (double angle)
 
 
new void Scale (double sx, double sy)
 
 
new void SetAlignment (Qt.AlignmentFlag alignment)
 
new void SetCacheMode (QGraphicsView.CacheModeFlag mode)
 
new void SetMatrix (QMatrix matrix, bool combine=false)
 
 
new void SetOptimizationFlag (QGraphicsView.OptimizationFlag flag, bool enabled=true)
 
 
new void SetOptimizationFlags (QGraphicsView.OptimizationFlag flags)
 
new void SetRenderHint (QPainter.RenderHint hint, bool enabled=true)
 
 
new void SetRenderHints (QPainter.RenderHint hints)
 
new void SetSceneRect (double x, double y, double w, double h)
 
new void SetTransform (QTransform matrix, bool combine=false)
 
 
new void Shear (double sh, double sv)
 
 
override QSize SizeHint ()
 
 
new void Translate (double dx, double dy)
 
 
new void UpdateScene (System.Collections.Generic.List< QRectF > rects)
 
 
new void UpdateSceneRect (QRectF rect)
 
 
new QTransform ViewportTransform ()
 
 
new void Dispose ()
 
- Public Member Functions inherited from QtGui.QAbstractScrollArea
 QAbstractScrollArea (QWidget parent=null)
 
 
new void AddScrollBarWidget (QWidget widget, Qt.AlignmentFlag alignment)
 
 
override bool OnEvent (QEvent arg1)
 
 
new QSize MaximumViewportSize ()
 
 
override QSize MinimumSizeHint ()
 
 
new
System.Collections.Generic.List
< QWidget
ScrollBarWidgets (Qt.AlignmentFlag alignment)
 
 
new void Dispose ()
 
- Public Member Functions inherited from QtGui.QFrame
 QFrame (QWidget parent=null, Qt.WindowType f=0)
 
 
override bool OnEvent (QEvent e)
 
 
new void Dispose ()
 
- Public Member Functions inherited from QtGui.QWidget
 QWidget (QWidget parent=null, Qt.WindowType f=0)
 
 
override void CreateProxy ()
 
new
System.Collections.Generic.List
< QAction
Actions ()
 
 
new void ActivateWindow ()
 
 
new void AddAction (QAction action)
 
 
new void AddActions (System.Collections.Generic.List< QAction > actions)
 
 
new void AdjustSize ()
 
 
new QWidget ChildAt (QPoint p)
 
 
new QWidget ChildAt (int x, int y)
 
 
new void ClearFocus ()
 
 
new void ClearMask ()
 
 
new bool Close ()
 
 
new QRect ContentsRect ()
 
 
new void CreateWinId ()
 
virtual int DevType ()
 
new NativeULong EffectiveWinId ()
 
 
new void EnsurePolished ()
 
 
override bool OnEvent (QEvent arg1)
 
 
new QWidget FocusWidget ()
 
 
new QFont font ()
 
new QFontInfo FontInfo ()
 
 
new QFontMetrics FontMetrics ()
 
 
new QRect geometry ()
 
new void GetContentsMargins (ref int left, ref int top, ref int right, ref int bottom)
 
 
virtual System.IntPtr GetDC ()
 
 
new void GrabGesture (Qt.GestureType type, Qt.GestureFlag flags=0)
 
 
new void GrabKeyboard ()
 
 
new void GrabMouse ()
 
 
new void GrabMouse (QCursor arg1)
 
 
new int GrabShortcut (QKeySequence key, Qt.ShortcutContext context=Qt.ShortcutContext.WindowShortcut)
 
 
new QGraphicsProxyWidget GraphicsProxyWidget ()
 
 
virtual int HeightForWidth (int arg1)
 
 
new void Hide ()
 
 
new Qt.InputMethodHint inputMethodHints ()
 
new void InsertAction (QAction before, QAction action)
 
 
new void InsertActions (QAction before, System.Collections.Generic.List< QAction > actions)
 
 
new NativeULong InternalWinId ()
 
new bool IsAncestorOf (QWidget child)
 
 
new bool IsEnabledTo (QWidget arg1)
 
 
new bool IsEnabledToTLW ()
 
 
new bool IsHidden ()
 
 
new bool IsLeftToRight ()
 
new bool IsRightToLeft ()
 
new bool IsTopLevel ()
 
 
new bool IsVisibleTo (QWidget arg1)
 
 
new bool IsWindow ()
 
 
new void Lower ()
 
 
new QPoint MapFrom (QWidget arg1, QPoint arg2)
 
 
new QPoint MapFromGlobal (QPoint arg1)
 
 
new QPoint MapFromParent (QPoint arg1)
 
 
new QPoint MapTo (QWidget arg1, QPoint arg2)
 
 
new QPoint MapToGlobal (QPoint arg1)
 
 
new QPoint MapToParent (QPoint arg1)
 
 
new void Move (int x, int y)
 
new QWidget NativeParentWidget ()
 
 
new QWidget NextInFocusChain ()
 
 
new void OverrideWindowFlags (Qt.WindowType type)
 
 
new void OverrideWindowState (Qt.WindowState state)
 
virtual QPaintEngine PaintEngine ()
 
 
new QPalette palette ()
 
new QWidget ParentWidget ()
 
 
new QWidget PreviousInFocusChain ()
 
 
new void Raise ()
 
 
virtual void ReleaseDC (System.IntPtr arg1)
 
 
new void ReleaseKeyboard ()
 
 
new void ReleaseMouse ()
 
 
new void ReleaseShortcut (int id)
 
 
new void RemoveAction (QAction action)
 
 
new void Render (IQPaintDevice target)
 
 
new void Render (QPainter painter)
 
 
new void Render (IQPaintDevice target, QPoint targetOffset)
 
 
new void Render (QPainter painter, QPoint targetOffset)
 
 
new void Render (IQPaintDevice target, QPoint targetOffset, QRegion sourceRegion, QWidget.RenderFlag renderFlags=QWidget.RenderFlag.DrawWindowBackground|QWidget.RenderFlag.DrawChildren)
 
 
new void Render (QPainter painter, QPoint targetOffset, QRegion sourceRegion, QWidget.RenderFlag renderFlags=QWidget.RenderFlag.DrawWindowBackground|QWidget.RenderFlag.DrawChildren)
 
 
new void Repaint ()
 
 
new void Repaint (QRect arg1)
 
 
new void Repaint (QRegion arg1)
 
 
new void Repaint (int x, int y, int w, int h)
 
 
new void Resize (int w, int h)
 
new bool RestoreGeometry (QByteArray geometry)
 
 
new QByteArray SaveGeometry ()
 
 
new void Scroll (int dx, int dy)
 
 
new void Scroll (int dx, int dy, QRect arg3)
 
 
new void SetAttribute (Qt.WidgetAttribute arg1, bool on=true)
 
 
new void SetBaseSize (int basew, int baseh)
 
new void SetContentsMargins (int left, int top, int right, int bottom)
 
 
new void SetDisabled (bool arg1)
 
 
new void SetFixedHeight (int h)
 
 
new void SetFixedSize (QSize arg1)
 
 
new void SetFixedSize (int w, int h)
 
 
new void SetFixedWidth (int w)
 
 
new void SetFocus ()
 
 
new void SetFocus (Qt.FocusReason reason)
 
 
new void SetGeometry (int x, int y, int w, int h)
 
new void SetHidden (bool hidden)
 
 
new void SetInputMethodHints (Qt.InputMethodHint hints)
 
new void SetMask (QBitmap arg1)
 
 
new void SetMaximumSize (int maxw, int maxh)
 
new void SetMinimumSize (int minw, int minh)
 
new void SetParent (QWidget parent)
 
 
new void SetParent (QWidget parent, Qt.WindowType f)
 
 
new void SetShortcutAutoRepeat (int id, bool enable=true)
 
 
new void SetShortcutEnabled (int id, bool enable=true)
 
 
new void SetShown (bool shown)
 
new void SetSizeIncrement (int w, int h)
 
new void SetSizePolicy (QSizePolicy.Policy horizontal, QSizePolicy.Policy vertical)
 
virtual void SetVisible (bool visible)
 
new void Show ()
 
 
new void ShowFullScreen ()
 
 
new void ShowMaximized ()
 
 
new void ShowMinimized ()
 
 
new void ShowNormal ()
 
 
new void StackUnder (QWidget arg1)
 
 
new bool TestAttribute (Qt.WidgetAttribute arg1)
 
 
new QWidget TopLevelWidget ()
 
 
new bool UnderMouse ()
 
 
new void UngrabGesture (Qt.GestureType type)
 
 
new void UnsetCursor ()
 
new void UnsetLayoutDirection ()
 
new void UnsetLocale ()
 
new void Update ()
 
 
new void Update (QRect arg1)
 
 
new void Update (QRegion arg1)
 
 
new void Update (int x, int y, int w, int h)
 
 
new void UpdateGeometry ()
 
 
new QRegion VisibleRegion ()
 
 
new NativeULong WinId ()
 
 
new QWidget Window ()
 
 
new Qt.WindowType WindowType ()
 
 
new void Dispose ()
 
new int ColorCount ()
 
new int Depth ()
 
new int HeightMM ()
 
new int LogicalDpiX ()
 
new int LogicalDpiY ()
 
new int NumColors ()
 
new bool PaintingActive ()
 
new int PhysicalDpiX ()
 
new int PhysicalDpiY ()
 
new int WidthMM ()
 
- 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 ()
 
 
virtual bool EventFilter (QObject arg1, QEvent arg2)
 
 
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 ()
 
- Public Member Functions inherited from QtGui.IQPaintDevice
new int ColorCount ()
 
new int Depth ()
 
int DevType ()
 
System.IntPtr GetDC ()
 
new int Height ()
 
new int HeightMM ()
 
new int LogicalDpiX ()
 
new int LogicalDpiY ()
 
new int NumColors ()
 
QPaintEngine PaintEngine ()
 
new bool PaintingActive ()
 
new int PhysicalDpiX ()
 
new int PhysicalDpiY ()
 
void ReleaseDC (System.IntPtr hdc)
 
new int Width ()
 
new int WidthMM ()
 

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.QAbstractScrollArea
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.QFrame
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.QWidget
static QWidget Find (NativeULong arg1)
 
 
static QWidget KeyboardGrabber ()
 
 
static QWidget MouseGrabber ()
 
 
static void SetTabOrder (QWidget arg1, QWidget arg2)
 
 
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

 QGraphicsView (System.Type dummy)
 
override void OnContextMenuEvent (QContextMenuEvent @event)
 
 
override void OnDragEnterEvent (QDragEnterEvent @event)
 
 
override void OnDragLeaveEvent (QDragLeaveEvent @event)
 
 
override void OnDragMoveEvent (QDragMoveEvent @event)
 
 
virtual void DrawBackground (QPainter painter, QRectF rect)
 
 
virtual void DrawForeground (QPainter painter, QRectF rect)
 
 
virtual void DrawItems (QPainter painter, int numItems, IQGraphicsItem items, QStyleOptionGraphicsItem options)
 
 
override void OnDropEvent (QDropEvent @event)
 
 
override void OnFocusInEvent (QFocusEvent @event)
 
 
override bool FocusNextPrevChild (bool next)
 
 
override void OnFocusOutEvent (QFocusEvent @event)
 
 
override void OnInputMethodEvent (QInputMethodEvent @event)
 
 
override void OnKeyPressEvent (QKeyEvent @event)
 
 
override void OnKeyReleaseEvent (QKeyEvent @event)
 
 
override void OnMouseDoubleClickEvent (QMouseEvent @event)
 
 
override void OnMouseMoveEvent (QMouseEvent @event)
 
 
override void OnMousePressEvent (QMouseEvent @event)
 
 
override void OnMouseReleaseEvent (QMouseEvent @event)
 
 
override void OnPaintEvent (QPaintEvent @event)
 
 
override void OnResizeEvent (QResizeEvent @event)
 
 
override void ScrollContentsBy (int dx, int dy)
 
 
new void SetupViewport (QWidget widget)
 
 
override void OnShowEvent (QShowEvent @event)
 
 
override bool OnViewportEvent (QEvent @event)
 
 
override void OnWheelEvent (QWheelEvent @event)
 
 
- Protected Member Functions inherited from QtGui.QAbstractScrollArea
 QAbstractScrollArea (System.Type dummy)
 
override void OnContextMenuEvent (QContextMenuEvent arg1)
 
 
override void OnDragEnterEvent (QDragEnterEvent arg1)
 
 
override void OnDragLeaveEvent (QDragLeaveEvent arg1)
 
 
override void OnDragMoveEvent (QDragMoveEvent arg1)
 
 
override void OnDropEvent (QDropEvent arg1)
 
 
override void OnKeyPressEvent (QKeyEvent arg1)
 
 
override void OnMouseDoubleClickEvent (QMouseEvent arg1)
 
 
override void OnMouseMoveEvent (QMouseEvent arg1)
 
 
override void OnMousePressEvent (QMouseEvent arg1)
 
 
override void OnMouseReleaseEvent (QMouseEvent arg1)
 
 
override void OnPaintEvent (QPaintEvent arg1)
 
 
override void OnResizeEvent (QResizeEvent arg1)
 
 
new void SetViewportMargins (QMargins margins)
 
 
new void SetViewportMargins (int left, int top, int right, int bottom)
 
 
new void SetupViewport (QWidget viewport)
 
 
virtual bool OnViewportEvent (QEvent arg1)
 
 
override void OnWheelEvent (QWheelEvent arg1)
 
 
- Protected Member Functions inherited from QtGui.QFrame
 QFrame (System.Type dummy)
 
override void OnChangeEvent (QEvent arg1)
 
 
new void DrawFrame (QPainter arg1)
 
override void OnPaintEvent (QPaintEvent arg1)
 
 
- Protected Member Functions inherited from QtGui.QWidget
 QWidget (System.Type dummy)
 
virtual void OnActionEvent (QActionEvent arg1)
 
 
virtual void OnCloseEvent (QCloseEvent arg1)
 
 
new void Create ()
 
 
new void Create (NativeULong arg1, bool initializeWindow=true, bool destroyOldWindow=true)
 
 
new void OnCustomContextMenuRequested (QPoint pos)
 
 
new void Destroy (bool destroyWindow=true, bool destroySubWindows=true)
 
 
virtual void EnabledChange (bool arg1)
 
virtual void OnEnterEvent (QEvent arg1)
 
 
virtual void OnFocusInEvent (QFocusEvent arg1)
 
 
new bool FocusNextChild ()
 
 
virtual void OnFocusOutEvent (QFocusEvent arg1)
 
 
new bool FocusPreviousChild ()
 
 
virtual void FontChange (QFont arg1)
 
virtual void OnHideEvent (QHideEvent arg1)
 
 
virtual void OnInputMethodEvent (QInputMethodEvent arg1)
 
 
virtual void OnKeyReleaseEvent (QKeyEvent arg1)
 
 
virtual void LanguageChange ()
 
 
virtual void OnLeaveEvent (QEvent arg1)
 
 
virtual int Metric (QPaintDevice.PaintDeviceMetric arg1)
 
 
virtual void OnMoveEvent (QMoveEvent arg1)
 
 
virtual void PaletteChange (QPalette arg1)
 
new void ResetInputContext ()
 
 
virtual void OnShowEvent (QShowEvent arg1)
 
 
virtual void StyleChange (QStyle arg1)
 
virtual void OnTabletEvent (QTabletEvent arg1)
 
 
new void UpdateMicroFocus ()
 
 
virtual void WindowActivationChange (bool arg1)
 
- 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 QGraphicsScene Scene [get, set]
 
 
new QMatrix Matrix [get]
 
 
new QTransform Transform [get]
 
 
new QBrush BackgroundBrush [get, set]
 
 
new QBrush ForegroundBrush [get, set]
 
 
new bool Interactive [get, set]
 
 
new QRectF SceneRect [get, set]
 
 
new Qt.AlignmentFlag Alignment [get, set]
 
 
new QPainter.RenderHint RenderHints [get, set]
 
 
new DragMode dragMode [get, set]
 
 
new CacheModeFlag CacheMode [get, set]
 
 
new ViewportAnchor TransformationAnchor [get, set]
 
 
new ViewportAnchor ResizeAnchor [get, set]
 
 
new ViewportUpdateMode viewportUpdateMode [get, set]
 
 
new Qt.ItemSelectionMode RubberBandSelectionMode [get, set]
 
 
new OptimizationFlag OptimizationFlags [get, set]
 
 
static new QMetaObject StaticMetaObject [get]
 
new IQGraphicsViewSignals Emit [get]
 
- Properties inherited from QtGui.QAbstractScrollArea
virtual EventHandler
< QEventArgs< QEvent > > 
ViewportEvent
 
 
new QWidget CornerWidget [get, set]
 
 
new QScrollBar HorizontalScrollBar [get, set]
 
 
new QScrollBar VerticalScrollBar [get, set]
 
 
new QWidget Viewport [get, set]
 
 
override EventHandler
< QEventArgs< QPaintEvent > > 
PaintEvent
 
 
override EventHandler
< QEventArgs< QActionEvent > > 
ActionEvent
 
 
override EventHandler
< QEventArgs< QEvent > > 
ChangeEvent
 
 
override EventHandler
< QEventArgs< QCloseEvent > > 
CloseEvent
 
 
override EventHandler
< QEventArgs
< QContextMenuEvent > > 
ContextMenuEvent
 
 
override EventHandler
< QEventArgs< QDragEnterEvent > > 
DragEnterEvent
 
 
override EventHandler
< QEventArgs< QDragLeaveEvent > > 
DragLeaveEvent
 
 
override EventHandler
< QEventArgs< QDragMoveEvent > > 
DragMoveEvent
 
 
override EventHandler
< QEventArgs< QDropEvent > > 
DropEvent
 
 
override EventHandler
< QEventArgs< QEvent > > 
EnterEvent
 
 
override EventHandler
< QEventArgs< QFocusEvent > > 
FocusInEvent
 
 
override EventHandler
< QEventArgs< QFocusEvent > > 
FocusOutEvent
 
 
override EventHandler
< QEventArgs< QHideEvent > > 
HideEvent
 
 
override EventHandler
< QEventArgs
< QInputMethodEvent > > 
InputMethodEvent
 
 
override EventHandler
< QEventArgs< QKeyEvent > > 
KeyPressEvent
 
 
override EventHandler
< QEventArgs< QKeyEvent > > 
KeyReleaseEvent
 
 
override EventHandler
< QEventArgs< QEvent > > 
LeaveEvent
 
 
override EventHandler
< QEventArgs< QMouseEvent > > 
MouseDoubleClickEvent
 
 
override EventHandler
< QEventArgs< QMouseEvent > > 
MouseMoveEvent
 
 
override EventHandler
< QEventArgs< QMouseEvent > > 
MousePressEvent
 
 
override EventHandler
< QEventArgs< QMouseEvent > > 
MouseReleaseEvent
 
 
override EventHandler
< QEventArgs< QMoveEvent > > 
MoveEvent
 
 
override EventHandler
< QEventArgs< QResizeEvent > > 
ResizeEvent
 
 
override EventHandler
< QEventArgs< QShowEvent > > 
ShowEvent
 
 
override EventHandler
< QEventArgs< QTabletEvent > > 
TabletEvent
 
 
override EventHandler
< QEventArgs< QWheelEvent > > 
WheelEvent
 
 
new Qt.ScrollBarPolicy VerticalScrollBarPolicy [get, set]
 
 
new Qt.ScrollBarPolicy HorizontalScrollBarPolicy [get, set]
 
 
static new QMetaObject StaticMetaObject [get]
 
new IQAbstractScrollAreaSignals Emit [get]
 
- Properties inherited from QtGui.QFrame
new int FrameStyle [get, set]
 
 
new Shape FrameShape [get, set]
 
 
new Shadow FrameShadow [get, set]
 
 
new int LineWidth [get, set]
 
 
new int MidLineWidth [get, set]
 
 
new int FrameWidth [get]
 
 
new QRect FrameRect [get, set]
 
 
static new QMetaObject StaticMetaObject [get]
 
new IQFrameSignals Emit [get]
 
- Properties inherited from QtGui.QWidget
virtual EventHandler
< QEventArgs< QActionEvent > > 
ActionEvent
 
 
virtual EventHandler
< QEventArgs< QEvent > > 
ChangeEvent
 
 
virtual EventHandler
< QEventArgs< QCloseEvent > > 
CloseEvent
 
 
virtual EventHandler
< QEventArgs
< QContextMenuEvent > > 
ContextMenuEvent
 
 
virtual EventHandler
< QEventArgs< QDragEnterEvent > > 
DragEnterEvent
 
 
virtual EventHandler
< QEventArgs< QDragLeaveEvent > > 
DragLeaveEvent
 
 
virtual EventHandler
< QEventArgs< QDragMoveEvent > > 
DragMoveEvent
 
 
virtual EventHandler
< QEventArgs< QDropEvent > > 
DropEvent
 
 
virtual EventHandler
< QEventArgs< QEvent > > 
EnterEvent
 
 
virtual EventHandler
< QEventArgs< QFocusEvent > > 
FocusInEvent
 
 
virtual EventHandler
< QEventArgs< QFocusEvent > > 
FocusOutEvent
 
 
virtual EventHandler
< QEventArgs< QHideEvent > > 
HideEvent
 
 
virtual EventHandler
< QEventArgs
< QInputMethodEvent > > 
InputMethodEvent
 
 
virtual EventHandler
< QEventArgs< QKeyEvent > > 
KeyPressEvent
 
 
virtual EventHandler
< QEventArgs< QKeyEvent > > 
KeyReleaseEvent
 
 
virtual EventHandler
< QEventArgs< QEvent > > 
LeaveEvent
 
 
virtual EventHandler
< QEventArgs< QMouseEvent > > 
MouseDoubleClickEvent
 
 
virtual EventHandler
< QEventArgs< QMouseEvent > > 
MouseMoveEvent
 
 
virtual EventHandler
< QEventArgs< QMouseEvent > > 
MousePressEvent
 
 
virtual EventHandler
< QEventArgs< QMouseEvent > > 
MouseReleaseEvent
 
 
virtual EventHandler
< QEventArgs< QMoveEvent > > 
MoveEvent
 
 
virtual EventHandler
< QEventArgs< QPaintEvent > > 
PaintEvent
 
 
virtual EventHandler
< QEventArgs< QResizeEvent > > 
ResizeEvent
 
 
virtual EventHandler
< QEventArgs< QShowEvent > > 
ShowEvent
 
 
virtual EventHandler
< QEventArgs< QTabletEvent > > 
TabletEvent
 
 
virtual EventHandler
< QEventArgs< QWheelEvent > > 
WheelEvent
 
 
Slot< QPointCustomContextMenuRequested
 
 
new QPalette.ColorRole BackgroundRole [get, set]
 
 
new QMargins ContentsMargins [get, set]
 
 
new QWidget FocusProxy [get, set]
 
 
new QPalette.ColorRole ForegroundRole [get, set]
 
 
new QGraphicsEffect GraphicsEffect [get, set]
 
 
new QInputContext InputContext [get, set]
 
 
new QLayout Layout [get, set]
 
 
new QRegion Mask [get, set]
 
 
new QStyle Style [get, set]
 
 
new Qt.WindowType WindowFlags [get, set]
 
new string WindowRole [get, set]
 
 
new Qt.WindowState WindowState [get, set]
 
 
new bool Modal [get]
 
 
new Qt.WindowModality WindowModality [get, set]
 
 
new bool Enabled [get, set]
 
 
new QRect Geometry [get, set]
 
 
new QRect FrameGeometry [get]
 
 
new QRect NormalGeometry [get]
 
 
new int X [get]
 
 
new int Y [get]
 
 
new QPoint Pos [get, set]
 
 
new QSize FrameSize [get]
 
 
new QSize Size [get, set]
 
 
new int Width [get]
 
 
new int Height [get]
 
 
new QRect Rect [get]
 
 
new QRect ChildrenRect [get]
 
 
new QRegion ChildrenRegion [get]
 
 
new QSizePolicy SizePolicy [get, set]
 
 
new QSize MinimumSize [get, set]
 
 
new QSize MaximumSize [get, set]
 
 
new int MinimumWidth [get, set]
 
 
new int MinimumHeight [get, set]
 
 
new int MaximumWidth [get, set]
 
 
new int MaximumHeight [get, set]
 
 
new QSize SizeIncrement [get, set]
 
 
new QSize BaseSize [get, set]
 
 
new QPalette Palette [get, set]
 
 
new QFont Font [get, set]
 
 
new QCursor Cursor [get, set]
 
 
new bool MouseTracking [get, set]
 
 
new bool IsActiveWindow [get]
 
 
new Qt.FocusPolicy FocusPolicy [get, set]
 
 
new bool Focus [get]
 
 
new Qt.ContextMenuPolicy ContextMenuPolicy [get, set]
 
 
new bool UpdatesEnabled [get, set]
 
 
new bool Visible [get, set]
 
 
new bool Minimized [get]
 
 
new bool Maximized [get]
 
 
new bool FullScreen [get]
 
 
new bool AcceptDrops [get, set]
 
 
new string WindowTitle [get, set]
 
 
new QIcon WindowIcon [get, set]
 
 
new string WindowIconText [get, set]
 
 
new double WindowOpacity [get, set]
 
 
new bool WindowModified [get, set]
 
 
new string ToolTip [get, set]
 
 
new string StatusTip [get, set]
 
 
new string WhatsThis [get, set]
 
 
new string AccessibleName [get, set]
 
 
new string AccessibleDescription [get, set]
 
 
new Qt.LayoutDirection LayoutDirection [get, set]
 
 
new bool AutoFillBackground [get, set]
 
 
new string StyleSheet [get, set]
 
 
new QLocale Locale [get, set]
 
 
new string WindowFilePath [get, set]
 
 
new Qt.InputMethodHint InputMethodHints [get, set]
 
 
static new QMetaObject StaticMetaObject [get]
 
new ushort Painters [get, set]
 
new IQWidgetSignals 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

- Protected Attributes inherited from QtCore.QObject
object Q_EMIT = null
 
SmokeInvocation interceptor
 
readonly List< QEventHandler > eventFilters = new List<QEventHandler>()
 

Detailed Description

The QGraphicsView class provides a widget for displaying the contents of a QGraphicsScene.

QGraphicsView visualizes the contents of a QGraphicsScene in a scrollable viewport. To create a scene with geometrical items, see QGraphicsScene's documentation. QGraphicsView is part of the Graphics View Framework.

To visualize a scene, you start by constructing a QGraphicsView object, passing the address of the scene you want to visualize to QGraphicsView's constructor. Alternatively, you can call setScene() to set the scene at a later point. After you call show(), the view will by default scroll to the center of the scene and display any items that are visible at this point. For example:

QGraphicsScene scene;

scene.addText("Hello, world!");

QGraphicsView view(&scene);

view.show();

You can explicitly scroll to any position on the scene by using the scroll bars, or by calling centerOn(). By passing a point to centerOn(), QGraphicsView will scroll its viewport to ensure that the point is centered in the view. An overload is provided for scrolling to a QGraphicsItem, in which case QGraphicsView will see to that the center of the item is centered in the view. If all you want is to ensure that a certain area is visible, (but not necessarily centered,) you can call ensureVisible() instead.

QGraphicsView can be used to visualize a whole scene, or only parts of it. The visualized area is by default detected automatically when the view is displayed for the first time (by calling QGraphicsScene::itemsBoundingRect()). To set the visualized area rectangle yourself, you can call setSceneRect(). This will adjust the scroll bars' ranges appropriately. Note that although the scene supports a virtually unlimited size, the range of the scroll bars will never exceed the range of an integer (INT_MIN, INT_MAX).

QGraphicsView visualizes the scene by calling render(). By default, the items are drawn onto the viewport by using a regular QPainter, and using default render hints. To change the default render hints that QGraphicsView passes to QPainter when painting items, you can call setRenderHints().

By default, QGraphicsView provides a regular QWidget for the viewport widget. You can access this widget by calling viewport(), or you can replace it by calling setViewport(). To render using OpenGL, simply call setViewport(new QGLWidget). QGraphicsView takes ownership of the viewport widget.

QGraphicsView supports affine transformations, using QTransform. You can either pass a matrix to setTransform(), or you can call one of the convenience functions rotate(), scale(), translate() or shear(). The most two common transformations are scaling, which is used to implement zooming, and rotation. QGraphicsView keeps the center of the view fixed during a transformation. Because of the scene alignment (setAligment()), translating the view will have no visual impact.

You can interact with the items on the scene by using the mouse and keyboard. QGraphicsView translates the mouse and key events into scene events, (events that inherit QGraphicsSceneEvent,), and forward them to the visualized scene. In the end, it's the individual item that handles the events and reacts to them. For example, if you click on a selectable item, the item will typically let the scene know that it has been selected, and it will also redraw itself to display a selection rectangle. Similiary, if you click and drag the mouse to move a movable item, it's the item that handles the mouse moves and moves itself. Item interaction is enabled by default, and you can toggle it by calling setInteractive().

You can also provide your own custom scene interaction, by creating a subclass of QGraphicsView, and reimplementing the mouse and key event handlers. To simplify how you programmatically interact with items in the view, QGraphicsView provides the mapping functions mapToScene() and mapFromScene(), and the item accessors items() and itemAt(). These functions allow you to map points, rectangles, polygons and paths between view coordinates and scene coordinates, and to find items on the scene using view coordinates.

See also QGraphicsScene, QGraphicsItem, and QGraphicsSceneEvent.

Member Enumeration Documentation

This enum describes the flags that you can set for a QGraphicsView's cache mode.

See also cacheMode.

Enumerator:
CacheBackground 

The background is cached. This affects both custom backgrounds, and backgrounds based on the backgroundBrush property. When this flag is enabled, QGraphicsView will allocate one pixmap with the full size of the viewport.

CacheNone 

All painting is done directly onto the viewport.

This enum describes the default action for the view when pressing and dragging the mouse over the viewport.

See also dragMode and QGraphicsScene::setSelectionArea().

Enumerator:
NoDrag 

Nothing happens; the mouse event is ignored.

RubberBandDrag 

A rubber band will appear. Dragging the mouse will set the rubber band geometry, and all items covered by the rubber band are selected. This mode is disabled for non-interactive views.

ScrollHandDrag 

The cursor changes into a pointing hand, and dragging the mouse around will scroll the scrolbars. This mode works both in interactive and non-interactive mode.

This enum describes flags that you can enable to improve rendering performance in QGraphicsView. By default, none of these flags are set. Note that setting a flag usually imposes a side effect, and this effect can vary between paint devices and platforms.

This enum was introduced or modified in Qt 4.3.

Enumerator:
DontAdjustForAntialiasing 

Disables QGraphicsView's antialiasing auto-adjustment of exposed areas. Items that render antialiased lines on the boundaries of their QGraphicsItem::boundingRect() can end up rendering parts of the line outside. To prevent rendering artifacts, QGraphicsView expands all exposed regions by 2 pixels in all directions. If you enable this flag, QGraphicsView will no longer perform these adjustments, minimizing the areas that require redrawing, which improves performance. A common side effect is that items that do draw with antialiasing can leave painting traces behind on the scene as they are moved.

DontClipPainter 

This value is obsolete and has no effect.

DontSavePainterState 

When rendering, QGraphicsView protects the painter state (see QPainter::save()) when rendering the background or foreground, and when rendering each item. This allows you to leave the painter in an altered state (i.e., you can call QPainter::setPen() or QPainter::setBrush() without restoring the state after painting). However, if the items consistently do restore the state, you should enable this flag to prevent QGraphicsView from doing the same.

IndirectPainting 

Since Qt 4.6, restore the old painting algorithm that calls QGraphicsView::drawItems() and QGraphicsScene::drawItems(). To be used only for compatibility with old code.

This enums describe the possible anchors that QGraphicsView can use when the user resizes the view or when the view is transformed.

See also resizeAnchor and transformationAnchor.

Enumerator:
AnchorUnderMouse 

The point under the mouse is used as the anchor.

AnchorViewCenter 

The scene point at the center of the view is used as the anchor.

NoAnchor 

No anchor, i.e. the view leaves the scene's position unchanged.

This enum describes how QGraphicsView updates its viewport when the scene contents change or are exposed.

This enum was introduced or modified in Qt 4.3.

See also viewportUpdateMode.

Enumerator:
BoundingRectViewportUpdate 

The bounding rectangle of all changes in the viewport will be redrawn. This mode has the advantage that QGraphicsView searches only one region for changes, minimizing time spent determining what needs redrawing. The disadvantage is that areas that have not changed also need to be redrawn.

FullViewportUpdate 

When any visible part of the scene changes or is reexposed, QGraphicsView will update the entire viewport. This approach is fastest when QGraphicsView spends more time figuring out what to draw than it would spend drawing (e.g., when very many small items are repeatedly updated). This is the preferred update mode for viewports that do not support partial updates, such as QGLWidget, and for viewports that need to disable scroll optimization.

MinimalViewportUpdate 

QGraphicsView will determine the minimal viewport region that requires a redraw, minimizing the time spent drawing by avoiding a redraw of areas that have not changed. This is QGraphicsView's default mode. Although this approach provides the best performance in general, if there are many small visible changes on the scene, QGraphicsView might end up spending more time finding the minimal approach than it will spend drawing.

NoViewportUpdate 

QGraphicsView will never update its viewport when the scene changes; the user is expected to control all updates. This mode disables all (potentially slow) item visibility testing in QGraphicsView, and is suitable for scenes that either require a fixed frame rate, or where the viewport is otherwise updated externally.

SmartViewportUpdate 

QGraphicsView will attempt to find an optimal update mode by analyzing the areas that require a redraw.

Constructor & Destructor Documentation

QtGui.QGraphicsView.QGraphicsView ( System.Type  dummy)
protected
QtGui.QGraphicsView.QGraphicsView ( QWidget  parent = null)

Constructs a QGraphicsView. parent is passed to QWidget's constructor.

QtGui.QGraphicsView.QGraphicsView ( QGraphicsScene  scene,
QWidget  parent = null 
)

Constructs a QGraphicsView and sets the visualized scene to scene. parent is passed to QWidget's constructor.

Member Function Documentation

new Qt.AlignmentFlag QtGui.QGraphicsView.alignment ( )
new QGraphicsView.CacheModeFlag QtGui.QGraphicsView.cacheMode ( )
new void QtGui.QGraphicsView.CenterOn ( QPointF  pos)

Scrolls the contents of the viewport to ensure that the scene coordinate pos, is centered in the view.

Because pos is a floating point coordinate, and the scroll bars operate on integer coordinates, the centering is only an approximation.

Note: If the item is close to or outside the border, it will be visible in the view, but not centered.

See also ensureVisible().

new void QtGui.QGraphicsView.CenterOn ( IQGraphicsItem  item)

This is an overloaded function.

Scrolls the contents of the viewport to ensure that item is centered in the view.

See also ensureVisible().

new void QtGui.QGraphicsView.CenterOn ( double  x,
double  y 
)

Scrolls the contents of the viewport to ensure that the scene coordinate pos, is centered in the view.

Because pos is a floating point coordinate, and the scroll bars operate on integer coordinates, the centering is only an approximation.

Note: If the item is close to or outside the border, it will be visible in the view, but not centered.

See also ensureVisible().

override void QtGui.QGraphicsView.CreateProxy ( )
virtual

Reimplemented from QtGui.QAbstractScrollArea.

new void QtGui.QGraphicsView.Dispose ( )
virtual void QtGui.QGraphicsView.DrawBackground ( QPainter  painter,
QRectF  rect 
)
protectedvirtual

Draws the background of the scene using painter, before any items and the foreground are drawn. Reimplement this function to provide a custom background for this view.

If all you want is to define a color, texture or gradient for the background, you can call setBackgroundBrush() instead.

All painting is done in scene coordinates. rect is the exposed rectangle.

The default implementation fills rect using the view's backgroundBrush. If no such brush is defined (the default), the scene's drawBackground() function is called instead.

See also drawForeground() and QGraphicsScene::drawBackground().

virtual void QtGui.QGraphicsView.DrawForeground ( QPainter  painter,
QRectF  rect 
)
protectedvirtual

Draws the foreground of the scene using painter, after the background and all items are drawn. Reimplement this function to provide a custom foreground for this view.

If all you want is to define a color, texture or gradient for the foreground, you can call setForegroundBrush() instead.

All painting is done in scene coordinates. rect is the exposed rectangle.

The default implementation fills rect using the view's foregroundBrush. If no such brush is defined (the default), the scene's drawForeground() function is called instead.

See also drawBackground() and QGraphicsScene::drawForeground().

virtual void QtGui.QGraphicsView.DrawItems ( QPainter  painter,
int  numItems,
IQGraphicsItem  items,
QStyleOptionGraphicsItem  options 
)
protectedvirtual

Draws the items items in the scene using painter, after the background and before the foreground are drawn. numItems is the number of items in items and options in options. options is a list of styleoptions; one for each item. Reimplement this function to provide custom item drawing for this view.

The default implementation calls the scene's drawItems() function.

Since Qt 4.6, this function is not called anymore unless the QGraphicsView::IndirectPainting flag is given as an Optimization flag.

See also drawForeground(), drawBackground(), and QGraphicsScene::drawItems().

new void QtGui.QGraphicsView.EnsureVisible ( QRectF  rect,
int  xmargin = 50,
int  ymargin = 50 
)

Scrolls the contents of the viewport so that the scene rectangle rect is visible, with margins specified in pixels by xmargin and ymargin. If the specified rect cannot be reached, the contents are scrolled to the nearest valid position. The default value for both margins is 50 pixels.

See also centerOn().

new void QtGui.QGraphicsView.EnsureVisible ( IQGraphicsItem  item,
int  xmargin = 50,
int  ymargin = 50 
)

This is an overloaded function.

Scrolls the contents of the viewport so that the center of item item is visible, with margins specified in pixels by xmargin and ymargin. If the specified point cannot be reached, the contents are scrolled to the nearest valid position. The default value for both margins is 50 pixels.

See also centerOn().

new void QtGui.QGraphicsView.EnsureVisible ( double  x,
double  y,
double  w,
double  h,
int  xmargin = 50,
int  ymargin = 50 
)

Scrolls the contents of the viewport so that the scene rectangle rect is visible, with margins specified in pixels by xmargin and ymargin. If the specified rect cannot be reached, the contents are scrolled to the nearest valid position. The default value for both margins is 50 pixels.

See also centerOn().

new void QtGui.QGraphicsView.FitInView ( QRectF  rect,
Qt.AspectRatioMode  aspectRadioMode = Qt.AspectRatioMode.IgnoreAspectRatio 
)

Scales the view matrix and scrolls the scroll bars to ensure that the scene rectangle rect fits inside the viewport. rect must be inside the scene rect; otherwise, fitInView() cannot guarantee that the whole rect is visible.

This function keeps the view's rotation, translation, or shear. The view is scaled according to aspectRatioMode. rect will be centered in the view if it does not fit tightly.

It's common to call fitInView() from inside a reimplementation of resizeEvent(), to ensure that the whole scene, or parts of the scene, scales automatically to fit the new size of the viewport as the view is resized. Note though, that calling fitInView() from inside resizeEvent() can lead to unwanted resize recursion, if the new transformation toggles the automatic state of the scrollbars. You can toggle the scrollbar policies to always on or always off to prevent this (see horizontalScrollBarPolicy() and verticalScrollBarPolicy()).

If rect is empty, or if the viewport is too small, this function will do nothing.

See also setTransform(), ensureVisible(), and centerOn().

new void QtGui.QGraphicsView.FitInView ( IQGraphicsItem  item,
Qt.AspectRatioMode  aspectRadioMode = Qt.AspectRatioMode.IgnoreAspectRatio 
)

Scales the view matrix and scrolls the scroll bars to ensure that the scene rectangle rect fits inside the viewport. rect must be inside the scene rect; otherwise, fitInView() cannot guarantee that the whole rect is visible.

This function keeps the view's rotation, translation, or shear. The view is scaled according to aspectRatioMode. rect will be centered in the view if it does not fit tightly.

It's common to call fitInView() from inside a reimplementation of resizeEvent(), to ensure that the whole scene, or parts of the scene, scales automatically to fit the new size of the viewport as the view is resized. Note though, that calling fitInView() from inside resizeEvent() can lead to unwanted resize recursion, if the new transformation toggles the automatic state of the scrollbars. You can toggle the scrollbar policies to always on or always off to prevent this (see horizontalScrollBarPolicy() and verticalScrollBarPolicy()).

If rect is empty, or if the viewport is too small, this function will do nothing.

See also setTransform(), ensureVisible(), and centerOn().

new void QtGui.QGraphicsView.FitInView ( double  x,
double  y,
double  w,
double  h,
Qt.AspectRatioMode  aspectRadioMode = Qt.AspectRatioMode.IgnoreAspectRatio 
)

Scales the view matrix and scrolls the scroll bars to ensure that the scene rectangle rect fits inside the viewport. rect must be inside the scene rect; otherwise, fitInView() cannot guarantee that the whole rect is visible.

This function keeps the view's rotation, translation, or shear. The view is scaled according to aspectRatioMode. rect will be centered in the view if it does not fit tightly.

It's common to call fitInView() from inside a reimplementation of resizeEvent(), to ensure that the whole scene, or parts of the scene, scales automatically to fit the new size of the viewport as the view is resized. Note though, that calling fitInView() from inside resizeEvent() can lead to unwanted resize recursion, if the new transformation toggles the automatic state of the scrollbars. You can toggle the scrollbar policies to always on or always off to prevent this (see horizontalScrollBarPolicy() and verticalScrollBarPolicy()).

If rect is empty, or if the viewport is too small, this function will do nothing.

See also setTransform(), ensureVisible(), and centerOn().

override bool QtGui.QGraphicsView.FocusNextPrevChild ( bool  next)
protectedvirtual

Reimplemented from QWidget::focusNextPrevChild().

Reimplemented from QtGui.QWidget.

override object QtGui.QGraphicsView.InputMethodQuery ( Qt.InputMethodQuery  query)
virtual

Reimplemented from QWidget::inputMethodQuery().

Reimplemented from QtGui.QWidget.

new void QtGui.QGraphicsView.InvalidateScene ( )

Invalidates and schedules a redraw of layers inside rect. rect is in scene coordinates. Any cached content for layers inside rect is unconditionally invalidated and redrawn.

You can call this function to notify QGraphicsView of changes to the background or the foreground of the scene. It is commonly used for scenes with tile-based backgrounds to notify changes when QGraphicsView has enabled background caching.

Note that QGraphicsView currently supports background caching only (see QGraphicsView::CacheBackground). This function is equivalent to calling update() if any layer but QGraphicsScene::BackgroundLayer is passed.

See also QGraphicsScene::invalidate() and update().

new void QtGui.QGraphicsView.InvalidateScene ( QRectF  rect,
QGraphicsScene.SceneLayer  layers = QGraphicsScene.SceneLayer.AllLayers 
)

Invalidates and schedules a redraw of layers inside rect. rect is in scene coordinates. Any cached content for layers inside rect is unconditionally invalidated and redrawn.

You can call this function to notify QGraphicsView of changes to the background or the foreground of the scene. It is commonly used for scenes with tile-based backgrounds to notify changes when QGraphicsView has enabled background caching.

Note that QGraphicsView currently supports background caching only (see QGraphicsView::CacheBackground). This function is equivalent to calling update() if any layer but QGraphicsScene::BackgroundLayer is passed.

See also QGraphicsScene::invalidate() and update().

new bool QtGui.QGraphicsView.IsTransformed ( )

Returns true if the view is transformed (i.e., a non-identity transform has been assigned, or the scrollbars are adjusted).

This function was introduced in Qt 4.6.

See also setTransform(), horizontalScrollBar(), and verticalScrollBar().

new IQGraphicsItem QtGui.QGraphicsView.ItemAt ( QPoint  pos)

Returns the item at position pos, which is in viewport coordinates. If there are several items at this position, this function returns the topmost item.

Example:

void CustomView::mousePressEvent(QMouseEvent *event)

{

if (QGraphicsItem *item = itemAt(event->pos())) {

qDebug() << "You clicked on item" << item;

} else {

qDebug() << "You didn't click on an item.";

}

}

See also items() and Sorting.

new IQGraphicsItem QtGui.QGraphicsView.ItemAt ( int  x,
int  y 
)

This is an overloaded function.

This function is provided for convenience. It's equivalent to calling itemAt(QPoint(x, y)).

new System.Collections.Generic.List<IQGraphicsItem> QtGui.QGraphicsView.Items ( )

Returns a list of all the items in the associated scene, in descending stacking order (i.e., the first item in the returned list is the uppermost item).

See also QGraphicsScene::items() and Sorting.

new System.Collections.Generic.List<IQGraphicsItem> QtGui.QGraphicsView.Items ( QPoint  pos)

Returns a list of all the items at the position pos in the view. The items are listed in descending stacking order (i.e., the first item in the list is the uppermost item, and the last item is the lowermost item). pos is in viewport coordinates.

This function is most commonly called from within mouse event handlers in a subclass in QGraphicsView. pos is in untransformed viewport coordinates, just like QMouseEvent::pos().

void CustomView::mousePressEvent(QMouseEvent *event)

{

qDebug() << "There are" << items(event->pos()).size()

<< "items at position" << mapToScene(event->pos());

}

See also QGraphicsScene::items() and Sorting.

new System.Collections.Generic.List<IQGraphicsItem> QtGui.QGraphicsView.Items ( QRect  rect,
Qt.ItemSelectionMode  mode = Qt.ItemSelectionMode.IntersectsItemShape 
)

Returns a list of all the items in the associated scene, in descending stacking order (i.e., the first item in the returned list is the uppermost item).

See also QGraphicsScene::items() and Sorting.

new System.Collections.Generic.List<IQGraphicsItem> QtGui.QGraphicsView.Items ( QPolygon  polygon,
Qt.ItemSelectionMode  mode = Qt.ItemSelectionMode.IntersectsItemShape 
)

Returns a list of all the items in the associated scene, in descending stacking order (i.e., the first item in the returned list is the uppermost item).

See also QGraphicsScene::items() and Sorting.

new System.Collections.Generic.List<IQGraphicsItem> QtGui.QGraphicsView.Items ( QPainterPath  path,
Qt.ItemSelectionMode  mode = Qt.ItemSelectionMode.IntersectsItemShape 
)

Returns a list of all the items in the associated scene, in descending stacking order (i.e., the first item in the returned list is the uppermost item).

See also QGraphicsScene::items() and Sorting.

new System.Collections.Generic.List<IQGraphicsItem> QtGui.QGraphicsView.Items ( int  x,
int  y 
)

This function is provided for convenience. It's equivalent to calling items(QPoint(x, y)).

new System.Collections.Generic.List<IQGraphicsItem> QtGui.QGraphicsView.Items ( int  x,
int  y,
int  w,
int  h,
Qt.ItemSelectionMode  mode = Qt.ItemSelectionMode.IntersectsItemShape 
)

Returns a list of all the items in the associated scene, in descending stacking order (i.e., the first item in the returned list is the uppermost item).

See also QGraphicsScene::items() and Sorting.

new QPoint QtGui.QGraphicsView.MapFromScene ( QPointF  point)

Returns the scene coordinate point to viewport coordinates.

See also mapToScene().

new QPolygon QtGui.QGraphicsView.MapFromScene ( QRectF  rect)

Returns the scene rectangle rect to a viewport coordinate polygon.

See also mapToScene().

new QPolygon QtGui.QGraphicsView.MapFromScene ( QPolygonF  polygon)

Returns the scene coordinate polygon polygon to a viewport coordinate polygon.

See also mapToScene().

new QPainterPath QtGui.QGraphicsView.MapFromScene ( QPainterPath  path)

Returns the scene coordinate painter path path to a viewport coordinate painter path.

See also mapToScene().

new QPoint QtGui.QGraphicsView.MapFromScene ( double  x,
double  y 
)

Returns the scene coordinate point to viewport coordinates.

See also mapToScene().

new QPolygon QtGui.QGraphicsView.MapFromScene ( double  x,
double  y,
double  w,
double  h 
)

Returns the scene coordinate point to viewport coordinates.

See also mapToScene().

new QPointF QtGui.QGraphicsView.MapToScene ( QPoint  point)

Returns the viewport coordinate point mapped to scene coordinates.

Note: It can be useful to map the whole rectangle covered by the pixel at point instead of the point itself. To do this, you can call mapToScene(QRect(point, QSize(2, 2))).

See also mapFromScene().

new QPolygonF QtGui.QGraphicsView.MapToScene ( QRect  rect)

Returns the viewport rectangle rect mapped to a scene coordinate polygon.

See also mapFromScene().

new QPolygonF QtGui.QGraphicsView.MapToScene ( QPolygon  polygon)

Returns the viewport polygon polygon mapped to a scene coordinate polygon.

See also mapFromScene().

new QPainterPath QtGui.QGraphicsView.MapToScene ( QPainterPath  path)

Returns the viewport painter path path mapped to a scene coordinate painter path.

See also mapFromScene().

new QPointF QtGui.QGraphicsView.MapToScene ( int  x,
int  y 
)

This function is provided for convenience. It's equivalent to calling mapToScene(QPoint(x, y)).

new QPolygonF QtGui.QGraphicsView.MapToScene ( int  x,
int  y,
int  w,
int  h 
)

This function is provided for convenience. It's equivalent to calling mapToScene(QRect(x, y, w, h)).

override void QtGui.QGraphicsView.OnContextMenuEvent ( QContextMenuEvent event)
protected

Reimplemented from QWidget::contextMenuEvent().

override void QtGui.QGraphicsView.OnDragEnterEvent ( QDragEnterEvent event)
protected

Reimplemented from QWidget::dragEnterEvent().

override void QtGui.QGraphicsView.OnDragLeaveEvent ( QDragLeaveEvent event)
protected

Reimplemented from QWidget::dragLeaveEvent().

override void QtGui.QGraphicsView.OnDragMoveEvent ( QDragMoveEvent event)
protected

Reimplemented from QWidget::dragMoveEvent().

override void QtGui.QGraphicsView.OnDropEvent ( QDropEvent event)
protected

Reimplemented from QWidget::dropEvent().

override bool QtGui.QGraphicsView.OnEvent ( QEvent event)

Reimplemented from QObject::event().

override void QtGui.QGraphicsView.OnFocusInEvent ( QFocusEvent event)
protected

Reimplemented from QWidget::focusInEvent().

override void QtGui.QGraphicsView.OnFocusOutEvent ( QFocusEvent event)
protected

Reimplemented from QWidget::focusOutEvent().

override void QtGui.QGraphicsView.OnInputMethodEvent ( QInputMethodEvent event)
protected

Reimplemented from QWidget::inputMethodEvent().

override void QtGui.QGraphicsView.OnKeyPressEvent ( QKeyEvent event)
protected

Reimplemented from QWidget::keyPressEvent().

override void QtGui.QGraphicsView.OnKeyReleaseEvent ( QKeyEvent event)
protected

Reimplemented from QWidget::keyReleaseEvent().

override void QtGui.QGraphicsView.OnMouseDoubleClickEvent ( QMouseEvent event)
protected

Reimplemented from QWidget::mouseDoubleClickEvent().

override void QtGui.QGraphicsView.OnMouseMoveEvent ( QMouseEvent event)
protected

Reimplemented from QWidget::mouseMoveEvent().

override void QtGui.QGraphicsView.OnMousePressEvent ( QMouseEvent event)
protected

Reimplemented from QWidget::mousePressEvent().

override void QtGui.QGraphicsView.OnMouseReleaseEvent ( QMouseEvent event)
protected

Reimplemented from QWidget::mouseReleaseEvent().

override void QtGui.QGraphicsView.OnPaintEvent ( QPaintEvent event)
protected

Reimplemented from QWidget::paintEvent().

override void QtGui.QGraphicsView.OnResizeEvent ( QResizeEvent event)
protected

Reimplemented from QWidget::resizeEvent().

override void QtGui.QGraphicsView.OnShowEvent ( QShowEvent event)
protected

Reimplemented from QWidget::showEvent().

override bool QtGui.QGraphicsView.OnViewportEvent ( QEvent event)
protected

Reimplemented from QAbstractScrollArea::viewportEvent().

override void QtGui.QGraphicsView.OnWheelEvent ( QWheelEvent event)
protected

Reimplemented from QWidget::wheelEvent().

new QGraphicsView.OptimizationFlag QtGui.QGraphicsView.optimizationFlags ( )
new void QtGui.QGraphicsView.Render ( QPainter  painter)

Renders the source rect, which is in view coordinates, from the scene into target, which is in paint device coordinates, using painter. This function is useful for capturing the contents of the view onto a paint device, such as a QImage (e.g., to take a screenshot), or for printing to QPrinter. For example:

QGraphicsScene scene;

scene.addItem(...

...

QGraphicsView view(&scene);

view.show();

...

QPrinter printer(QPrinter::HighResolution);

printer.setPageSize(QPrinter::A4);

QPainter painter(&printer);

// print, fitting the viewport contents into a full page

view.render(&painter);

// print the upper half of the viewport into the lower.

// half of the page.

QRect viewport = view.viewport()->rect();

view.render(&painter,

QRectF(0, printer.height() / 2,

printer.width(), printer.height() / 2),

viewport.adjusted(0, 0, 0, -viewport.height() / 2));

If source is a null rect, this function will use viewport()->rect() to determine what to draw. If target is a null rect, the full dimensions of painter's paint device (e.g., for a QPrinter, the page size) will be used.

The source rect contents will be transformed according to aspectRatioMode to fit into the target rect. By default, the aspect ratio is kept, and source is scaled to fit in target.

See also QGraphicsScene::render().

new void QtGui.QGraphicsView.Render ( QPainter  painter,
QRectF  target 
)

Renders the source rect, which is in view coordinates, from the scene into target, which is in paint device coordinates, using painter. This function is useful for capturing the contents of the view onto a paint device, such as a QImage (e.g., to take a screenshot), or for printing to QPrinter. For example:

QGraphicsScene scene;

scene.addItem(...

...

QGraphicsView view(&scene);

view.show();

...

QPrinter printer(QPrinter::HighResolution);

printer.setPageSize(QPrinter::A4);

QPainter painter(&printer);

// print, fitting the viewport contents into a full page

view.render(&painter);

// print the upper half of the viewport into the lower.

// half of the page.

QRect viewport = view.viewport()->rect();

view.render(&painter,

QRectF(0, printer.height() / 2,

printer.width(), printer.height() / 2),

viewport.adjusted(0, 0, 0, -viewport.height() / 2));

If source is a null rect, this function will use viewport()->rect() to determine what to draw. If target is a null rect, the full dimensions of painter's paint device (e.g., for a QPrinter, the page size) will be used.

The source rect contents will be transformed according to aspectRatioMode to fit into the target rect. By default, the aspect ratio is kept, and source is scaled to fit in target.

See also QGraphicsScene::render().

new void QtGui.QGraphicsView.Render ( QPainter  painter,
QRectF  target,
QRect  source,
Qt.AspectRatioMode  aspectRatioMode = Qt.AspectRatioMode.KeepAspectRatio 
)

Renders the source rect, which is in view coordinates, from the scene into target, which is in paint device coordinates, using painter. This function is useful for capturing the contents of the view onto a paint device, such as a QImage (e.g., to take a screenshot), or for printing to QPrinter. For example:

QGraphicsScene scene;

scene.addItem(...

...

QGraphicsView view(&scene);

view.show();

...

QPrinter printer(QPrinter::HighResolution);

printer.setPageSize(QPrinter::A4);

QPainter painter(&printer);

// print, fitting the viewport contents into a full page

view.render(&painter);

// print the upper half of the viewport into the lower.

// half of the page.

QRect viewport = view.viewport()->rect();

view.render(&painter,

QRectF(0, printer.height() / 2,

printer.width(), printer.height() / 2),

viewport.adjusted(0, 0, 0, -viewport.height() / 2));

If source is a null rect, this function will use viewport()->rect() to determine what to draw. If target is a null rect, the full dimensions of painter's paint device (e.g., for a QPrinter, the page size) will be used.

The source rect contents will be transformed according to aspectRatioMode to fit into the target rect. By default, the aspect ratio is kept, and source is scaled to fit in target.

See also QGraphicsScene::render().

new QPainter.RenderHint QtGui.QGraphicsView.renderHints ( )
new void QtGui.QGraphicsView.ResetCachedContent ( )

Resets any cached content. Calling this function will clear QGraphicsView's cache. If the current cache mode is CacheNone, this function does nothing.

This function is called automatically for you when the backgroundBrush or QGraphicsScene::backgroundBrush properties change; you only need to call this function if you have reimplemented QGraphicsScene::drawBackground() or QGraphicsView::drawBackground() to draw a custom background, and need to trigger a full redraw.

See also cacheMode().

new void QtGui.QGraphicsView.ResetMatrix ( )

Resets the view transformation matrix to the identity matrix.

See also resetTransform().

new void QtGui.QGraphicsView.ResetTransform ( )

Resets the view transformation to the identity matrix.

See also transform() and setTransform().

new void QtGui.QGraphicsView.Rotate ( double  angle)

Rotates the current view transformation angle degrees clockwise.

See also setTransform(), transform(), scale(), shear(), and translate().

new void QtGui.QGraphicsView.Scale ( double  sx,
double  sy 
)

Scales the current view transformation by (sx, sy).

See also setTransform(), transform(), rotate(), shear(), and translate().

override void QtGui.QGraphicsView.ScrollContentsBy ( int  dx,
int  dy 
)
protectedvirtual

Reimplemented from QAbstractScrollArea::scrollContentsBy().

Reimplemented from QtGui.QAbstractScrollArea.

new void QtGui.QGraphicsView.SetAlignment ( Qt.AlignmentFlag  alignment)
new void QtGui.QGraphicsView.SetCacheMode ( QGraphicsView.CacheModeFlag  mode)
new void QtGui.QGraphicsView.SetMatrix ( QMatrix  matrix,
bool  combine = false 
)

Sets the view's current transformation matrix to matrix.

If combine is true, then matrix is combined with the current matrix; otherwise, matrix replaces the current matrix. combine is false by default.

The transformation matrix tranforms the scene into view coordinates. Using the default transformation, provided by the identity matrix, one pixel in the view represents one unit in the scene (e.g., a 10x10 rectangular item is drawn using 10x10 pixels in the view). If a 2x2 scaling matrix is applied, the scene will be drawn in 1:2 (e.g., a 10x10 rectangular item is then drawn using 20x20 pixels in the view).

Example:

QGraphicsScene scene;

scene.addText("GraphicsView rotated clockwise");

QGraphicsView view(&scene);

view.rotate(90); // the text is rendered with a 90 degree clockwise rotation

view.show();

To simplify interation with items using a transformed view, QGraphicsView provides mapTo... and mapFrom... functions that can translate between scene and view coordinates. For example, you can call mapToScene() to map a view coordinate to a floating point scene coordinate, or mapFromScene() to map from floating point scene coordinates to view coordinates.

See also matrix(), setTransform(), rotate(), scale(), shear(), and translate().

new void QtGui.QGraphicsView.SetOptimizationFlag ( QGraphicsView.OptimizationFlag  flag,
bool  enabled = true 
)

Enables flag if enabled is true; otherwise disables flag.

See also optimizationFlags.

new void QtGui.QGraphicsView.SetOptimizationFlags ( QGraphicsView.OptimizationFlag  flags)
new void QtGui.QGraphicsView.SetRenderHint ( QPainter.RenderHint  hint,
bool  enabled = true 
)

If enabled is true, the render hint hint is enabled; otherwise it is disabled.

See also renderHints.

new void QtGui.QGraphicsView.SetRenderHints ( QPainter.RenderHint  hints)
new void QtGui.QGraphicsView.SetSceneRect ( double  x,
double  y,
double  w,
double  h 
)
new void QtGui.QGraphicsView.SetTransform ( QTransform  matrix,
bool  combine = false 
)

Sets the view's current transformation matrix to matrix.

If combine is true, then matrix is combined with the current matrix; otherwise, matrix replaces the current matrix. combine is false by default.

The transformation matrix tranforms the scene into view coordinates. Using the default transformation, provided by the identity matrix, one pixel in the view represents one unit in the scene (e.g., a 10x10 rectangular item is drawn using 10x10 pixels in the view). If a 2x2 scaling matrix is applied, the scene will be drawn in 1:2 (e.g., a 10x10 rectangular item is then drawn using 20x20 pixels in the view).

Example:

QGraphicsScene scene;

scene.addText("GraphicsView rotated clockwise");

QGraphicsView view(&scene);

view.rotate(90); // the text is rendered with a 90 degree clockwise rotation

view.show();

To simplify interation with items using a transformed view, QGraphicsView provides mapTo... and mapFrom... functions that can translate between scene and view coordinates. For example, you can call mapToScene() to map a view coordiate to a floating point scene coordinate, or mapFromScene() to map from floating point scene coordinates to view coordinates.

See also transform(), rotate(), scale(), shear(), and translate().

new void QtGui.QGraphicsView.SetupViewport ( QWidget  widget)
protected

This slot is called by QAbstractScrollArea after setViewport() has been called. Reimplement this function in a subclass of QGraphicsView to initialize the new viewport widget before it is used.

See also setViewport().

new void QtGui.QGraphicsView.Shear ( double  sh,
double  sv 
)

Shears the current view transformation by (sh, sv).

See also setTransform(), transform(), rotate(), scale(), and translate().

override QSize QtGui.QGraphicsView.SizeHint ( )
virtual

Reimplemented from QWidget::sizeHint().

Reimplemented from QtGui.QAbstractScrollArea.

static string QtGui.QGraphicsView.Tr ( string  s,
string  c = null 
)
static
static string QtGui.QGraphicsView.Tr ( string  s,
string  c,
int  n 
)
static
new void QtGui.QGraphicsView.Translate ( double  dx,
double  dy 
)

Translates the current view transformation by (dx, dy).

See also setTransform(), transform(), rotate(), and shear().

static string QtGui.QGraphicsView.TrUtf8 ( string  s,
string  c = null 
)
static
static string QtGui.QGraphicsView.TrUtf8 ( string  s,
string  c,
int  n 
)
static
new void QtGui.QGraphicsView.UpdateScene ( System.Collections.Generic.List< QRectF rects)

Schedules an update of the scene rectangles rects.

See also QGraphicsScene::changed().

new void QtGui.QGraphicsView.UpdateSceneRect ( QRectF  rect)

Notifies QGraphicsView that the scene's scene rect has changed. rect is the new scene rect. If the view already has an explicitly set scene rect, this function does nothing.

See also sceneRect and QGraphicsScene::sceneRectChanged().

new QTransform QtGui.QGraphicsView.ViewportTransform ( )

Returns a matrix that maps viewport coordinates to scene coordinates.

See also mapToScene() and mapFromScene().

Property Documentation

new Qt.AlignmentFlag QtGui.QGraphicsView.Alignment
getset

This property holds the alignment of the scene in the view when the whole scene is visible.

If the whole scene is visible in the view, (i.e., there are no visible scroll bars,) the view's alignment will decide where the scene will be rendered in the view. For example, if the alignment is Qt::AlignCenter, which is default, the scene will be centered in the view, and if the alignment is (Qt::AlignLeft | Qt::AlignTop), the scene will be rendered in the top-left corner of the view.

new QBrush QtGui.QGraphicsView.BackgroundBrush
getset

This property holds the background brush of the scene.

This property sets the background brush for the scene in this view. It is used to override the scene's own background, and defines the behavior of drawBackground(). To provide custom background drawing for this view, you can reimplement drawBackground() instead.

By default, this property contains a brush with the Qt::NoBrush pattern.

new CacheModeFlag QtGui.QGraphicsView.CacheMode
getset

This property holds which parts of the view are cached.

QGraphicsView can cache pre-rendered content in a QPixmap, which is then drawn onto the viewport. The purpose of such caching is to speed up the total rendering time for areas that are slow to render. Texture, gradient and alpha blended backgrounds, for example, can be notibly slow to render; especially with a transformed view. The CacheBackground flag enables caching of the view's background. For example:

QGraphicsView view;

view.setBackgroundBrush(QImage(":/images/backgroundtile.png"));

view.setCacheMode(QGraphicsView::CacheBackground);

The cache is invalidated every time the view is transformed. However, when scrolling, only partial invalidation is required.

By default, nothing is cached.

new DragMode QtGui.QGraphicsView.dragMode
getset

This property holds the behavior for dragging the mouse over the scene while the left mouse button is pressed.

This property defines what should happen when the user clicks on the scene background and drags the mouse (e.g., scrolling the viewport contents using a pointing hand cursor, or selecting multiple items with a rubber band). The default value, NoDrag, does nothing.

This behavior only affects mouse clicks that are not handled by any item. You can define a custom behavior by creating a subclass of QGraphicsView and reimplementing mouseMoveEvent().

new IQGraphicsViewSignals QtGui.QGraphicsView.Emit
getprotected
new QBrush QtGui.QGraphicsView.ForegroundBrush
getset

This property holds the foreground brush of the scene.

This property sets the foreground brush for the scene in this view. It is used to override the scene's own foreground, and defines the behavior of drawForeground(). To provide custom foreground drawing for this view, you can reimplement drawForeground() instead.

By default, this property contains a brush with the Qt::NoBrush pattern.

new bool QtGui.QGraphicsView.Interactive
getset

This property holds whether the view allowed scene interaction.

If enabled, this view is set to allow scene interaction. Otherwise, this view will not allow interaction, and any mouse or key events are ignored (i.e., it will act as a read-only view).

By default, this property is true.

new QMatrix QtGui.QGraphicsView.Matrix
get

Returns the current transformation matrix for the view. If no current transformation is set, the identity matrix is returned.

See also setMatrix(), transform(), rotate(), scale(), shear(), and translate().

new OptimizationFlag QtGui.QGraphicsView.OptimizationFlags
getset

This property holds flags that can be used to tune QGraphicsView's performance.

QGraphicsView uses clipping, extra bounding rect adjustments, and certain other aids to improve rendering quality and performance for the common case graphics scene. However, depending on the target platform, the scene, and the viewport in use, some of these operations can degrade performance.

The effect varies from flag to flag; see the OptimizationFlags documentation for details.

By default, no optimization flags are enabled.

This property was introduced in Qt 4.3.

new QPainter.RenderHint QtGui.QGraphicsView.RenderHints
getset

This property holds the default render hints for the view.

These hints are used to initialize QPainter before each visible item is drawn. QPainter uses render hints to toggle rendering features such as antialiasing and smooth pixmap transformation.

QPainter::TextAntialiasing is enabled by default.

Example:

QGraphicsScene scene;

scene.addRect(QRectF(-10, -10, 20, 20));

QGraphicsView view(&scene);

view.setRenderHints(QPainter::Antialiasing | QPainter::SmoothPixmapTransform);

view.show();

new ViewportAnchor QtGui.QGraphicsView.ResizeAnchor
getset

This property holds how the view should position the scene when the view is resized.

QGraphicsView uses this property to decide how to position the scene in the viewport when the viewport widget's size changes. The default behavior, NoAnchor, leaves the scene's position unchanged during a resize; the top-left corner of the view will appear to be anchored while resizing.

Note that the effect of this property is noticeable when only a part of the scene is visible (i.e., when there are scroll bars). Otherwise, if the whole scene fits in the view, QGraphicsScene uses the view alignment to position the scene in the view.

new Qt.ItemSelectionMode QtGui.QGraphicsView.RubberBandSelectionMode
getset

This property holds the behavior for selecting items with a rubber band selection rectangle.

This property defines how items are selected when using the RubberBandDrag drag mode.

The default value is Qt::IntersectsItemShape; all items whose shape intersects with or is contained by the rubber band are selected.

This property was introduced in Qt 4.3.

new QGraphicsScene QtGui.QGraphicsView.Scene
getset

Returns a pointer to the scene that is currently visualized in the view. If no scene is currently visualized, 0 is returned.

Sets the current scene to scene. If scene is already being viewed, this function does nothing.

When a scene is set on a view, the QGraphicsScene::changed() signal is automatically connected to this view's updateScene() slot, and the view's scroll bars are adjusted to fit the size of the scene.

new QRectF QtGui.QGraphicsView.SceneRect
getset

This property holds the area of the scene visualized by this view.

The scene rectangle defines the extent of the scene, and in the view's case, this means the area of the scene that you can navigate using the scroll bars.

If unset, or if a null QRectF is set, this property has the same value as QGraphicsScene::sceneRect, and it changes with QGraphicsScene::sceneRect. Otherwise, the view's scene rect is unaffected by the scene.

Note that, although the scene supports a virtually unlimited size, the range of the scroll bars will never exceed the range of an integer (INT_MIN, INT_MAX). When the scene is larger than the scroll bars' values, you can choose to use translate() to navigate the scene instead.

By default, this property contains a rectangle at the origin with zero width and height.

new QMetaObject QtGui.QGraphicsView.StaticMetaObject
staticget
new QTransform QtGui.QGraphicsView.Transform
get

Returns the current transformation matrix for the view. If no current transformation is set, the identity matrix is returned.

See also setTransform(), rotate(), scale(), shear(), and translate().

new ViewportAnchor QtGui.QGraphicsView.TransformationAnchor
getset

This property holds how the view should position the scene during transformations.

QGraphicsView uses this property to decide how to position the scene in the viewport when the transformation matrix changes, and the coordinate system of the view is transformed. The default behavior, AnchorViewCenter, ensures that the scene point at the center of the view remains unchanged during transformations (e.g., when rotating, the scene will appear to rotate around the center of the view).

Note that the effect of this property is noticeable when only a part of the scene is visible (i.e., when there are scroll bars). Otherwise, if the whole scene fits in the view, QGraphicsScene uses the view alignment to position the scene in the view.

new ViewportUpdateMode QtGui.QGraphicsView.viewportUpdateMode
getset

This property holds how the viewport should update its contents.

QGraphicsView uses this property to decide how to update areas of the scene that have been reexposed or changed. Usually you do not need to modify this property, but there are some cases where doing so can improve rendering performance. See the ViewportUpdateMode documentation for specific details.

The default value is MinimalViewportUpdate, where QGraphicsView will update as small an area of the viewport as possible when the contents change.

This property was introduced in Qt 4.3.