Qt 4.8
Signals | Public Functions | Protected Functions | Properties | Friends | Related Functions | List of all members
QSplitter Class Reference

The QSplitter class implements a splitter widget. More...

#include <qsplitter.h>

Inheritance diagram for QSplitter:
QFrame QWidget QObject QPaintDevice

Signals

void splitterMoved (int pos, int index)
 This signal is emitted when the splitter handle at a particular index has been moved to position pos. More...
 
- Signals inherited from QWidget
void customContextMenuRequested (const QPoint &pos)
 This signal is emitted when the widget's contextMenuPolicy is Qt::CustomContextMenu, and the user has requested a context menu on the widget. More...
 
- Signals inherited from QObject
void destroyed (QObject *=0)
 This signal is emitted immediately before the object obj is destroyed, and can not be blocked. More...
 

Public Functions

void addWidget (QWidget *widget)
 Adds the given widget to the splitter's layout after all the other items. More...
 
bool childrenCollapsible () const
 
int count () const
 Returns the number of widgets contained in the splitter's layout. More...
 
void getRange (int index, int *, int *) const
 Returns the valid range of the splitter with index index in {min} and *{max} if min and max are not 0. More...
 
QSplitterHandlehandle (int index) const
 Returns the handle to the left (or above) for the item in the splitter's layout at the given index. More...
 
int handleWidth () const
 
int indexOf (QWidget *w) const
 Returns the index in the splitter's layout of the specified widget. More...
 
void insertWidget (int index, QWidget *widget)
 Inserts the widget specified into the splitter's layout at the given index. More...
 
bool isCollapsible (int index) const
 Returns true if the widget at index is collapsible, otherwise returns false. More...
 
QSize minimumSizeHint () const
 Reimplemented Function More...
 
bool opaqueResize () const
 
Qt::Orientation orientation () const
 
 QSplitter (QWidget *parent=0)
 Constructs a horizontal splitter with the parent argument passed on to the QFrame constructor. More...
 
 QSplitter (Qt::Orientation, QWidget *parent=0)
 Constructs a splitter with the given orientation and parent. More...
 
void refresh ()
 Updates the splitter's state. More...
 
bool restoreState (const QByteArray &state)
 Restores the splitter's layout to the state specified. More...
 
QByteArray saveState () const
 Saves the state of the splitter's layout. More...
 
void setChildrenCollapsible (bool)
 
void setCollapsible (int index, bool)
 Sets whether the child widget at index index is collapsible to collapse. More...
 
void setHandleWidth (int)
 
void setOpaqueResize (bool opaque=true)
 
void setOrientation (Qt::Orientation)
 
void setSizes (const QList< int > &list)
 Sets the child widgets respective sizes to the values given in the list. More...
 
void setStretchFactor (int index, int stretch)
 Updates the size policy of the widget at position index to have a stretch factor of stretch. More...
 
QSize sizeHint () const
 Reimplemented Function More...
 
QList< int > sizes () const
 Returns a list of the size parameters of all the widgets in this splitter. More...
 
QWidgetwidget (int index) const
 Returns the widget at the given index in the splitter's layout. More...
 
 ~QSplitter ()
 Destroys the splitter. More...
 
- Public Functions inherited from QFrame
QRect frameRect () const
 
Shadow frameShadow () const
 
Shape frameShape () const
 
int frameStyle () const
 Returns the frame style. More...
 
int frameWidth () const
 
int lineWidth () const
 
int midLineWidth () const
 
 QFrame (QWidget *parent=0, Qt::WindowFlags f=0)
 Constructs a frame widget with frame style NoFrame and a 1-pixel frame width. More...
 
void setFrameRect (const QRect &)
 em>Reimplemented Function More...
 
void setFrameShadow (Shadow)
 
void setFrameShape (Shape)
 
void setFrameStyle (int)
 Sets the frame style to style. More...
 
void setLineWidth (int)
 
void setMidLineWidth (int)
 
 ~QFrame ()
 Destroys the frame. More...
 
- Public Functions inherited from QWidget
bool acceptDrops () const
 
QString accessibleDescription () const
 
QString accessibleName () const
 
QList< QAction * > actions () const
 Returns the (possibly empty) list of this widget's actions. More...
 
void activateWindow ()
 Sets the top-level widget containing this widget to be the active window. More...
 
void addAction (QAction *action)
 Appends the action action to this widget's list of actions. More...
 
void addActions (QList< QAction *> actions)
 Appends the actions actions to this widget's list of actions. More...
 
void adjustSize ()
 Adjusts the size of the widget to fit its contents. More...
 
bool autoFillBackground () const
 
QPalette::ColorRole backgroundRole () const
 Returns the background role of the widget. More...
 
QSize baseSize () const
 
QWidgetchildAt (int x, int y) const
 Returns the visible child widget at the position ({x}, {y}) in the widget's coordinate system. More...
 
QWidgetchildAt (const QPoint &p) const
 Returns the visible child widget at point p in the widget's own coordinate system. More...
 
QRect childrenRect () const
 
QRegion childrenRegion () const
 
void clearFocus ()
 Takes keyboard input focus from the widget. More...
 
void clearMask ()
 Removes any mask set by setMask(). More...
 
QMargins contentsMargins () const
 The contentsMargins function returns the widget's contents margins. More...
 
QRect contentsRect () const
 Returns the area inside the widget's margins. More...
 
Qt::ContextMenuPolicy contextMenuPolicy () const
 
void createWinId ()
 
QCursor cursor () const
 
int devType () const
 
WId effectiveWinId () const
 Returns the effective window system identifier of the widget, i. More...
 
void ensurePolished () const
 Ensures that the widget has been polished by QStyle (i.e., has a proper font and palette). More...
 
Qt::FocusPolicy focusPolicy () const
 
QWidgetfocusProxy () const
 Returns the focus proxy, or 0 if there is no focus proxy. More...
 
QWidgetfocusWidget () const
 Returns the last child of this widget that setFocus had been called on. More...
 
const QFontfont () const
 
QFontInfo fontInfo () const
 Returns the font info for the widget's current font. More...
 
QFontMetrics fontMetrics () const
 Returns the font metrics for the widget's current font. More...
 
QPalette::ColorRole foregroundRole () const
 Returns the foreground role. More...
 
QRect frameGeometry () const
 
QSize frameSize () const
 
const QRectgeometry () const
 
void getContentsMargins (int *left, int *top, int *right, int *bottom) const
 Returns the widget's contents margins for left, top, right, and bottom. More...
 
HDC getDC () const
 Returns the window system handle of the widget, for low-level access. More...
 
void grabGesture (Qt::GestureType type, Qt::GestureFlags flags=Qt::GestureFlags())
 Subscribes the widget to a given gesture with specific flags. More...
 
void grabKeyboard ()
 Grabs the keyboard input. More...
 
void grabMouse ()
 Grabs the mouse input. More...
 
void grabMouse (const QCursor &)
 
int grabShortcut (const QKeySequence &key, Qt::ShortcutContext context=Qt::WindowShortcut)
 Adds a shortcut to Qt's shortcut system that watches for the given key sequence in the given context. More...
 
QGraphicsEffectgraphicsEffect () const
 The graphicsEffect function returns a pointer to the widget's graphics effect. More...
 
QGraphicsProxyWidgetgraphicsProxyWidget () const
 Returns the proxy widget for the corresponding embedded widget in a graphics view; otherwise returns 0. More...
 
bool hasFocus () const
 
bool hasMouseTracking () const
 
int height () const
 
virtual int heightForWidth (int) const
 Returns the preferred height for this widget, given the width w. More...
 
QInputContextinputContext ()
 This function returns the QInputContext for this widget. More...
 
Qt::InputMethodHints inputMethodHints () const
 
virtual QVariant inputMethodQuery (Qt::InputMethodQuery) const
 This method is only relevant for input widgets. More...
 
void insertAction (QAction *before, QAction *action)
 Inserts the action action to this widget's list of actions, before the action before. More...
 
void insertActions (QAction *before, QList< QAction *> actions)
 Inserts the actions actions to this widget's list of actions, before the action before. More...
 
WId internalWinId () const
 Returns the window system identifier of the widget, or 0 if the widget is not created yet. More...
 
bool isActiveWindow () const
 
bool isAncestorOf (const QWidget *child) const
 Returns true if this widget is a parent, (or grandparent and so on to any level), of the given child, and both widgets are within the same window; otherwise returns false. More...
 
bool isEnabled () const
 
bool isEnabledTo (QWidget *) const
 Returns true if this widget would become enabled if ancestor is enabled; otherwise returns false. More...
 
bool isEnabledToTLW () const
 This function is deprecated. More...
 
bool isFullScreen () const
 
bool isHidden () const
 Returns true if the widget is hidden, otherwise returns false. More...
 
bool isLeftToRight () const
 
bool isMaximized () const
 
bool isMinimized () const
 
bool isModal () const
 
bool isRightToLeft () const
 
bool isTopLevel () const
 Use isWindow() instead. More...
 
bool isVisible () const
 
bool isVisibleTo (QWidget *) const
 Returns true if this widget would become visible if ancestor is shown; otherwise returns false. More...
 
bool isWindow () const
 Returns true if the widget is an independent window, otherwise returns false. More...
 
bool isWindowModified () const
 
QLayoutlayout () const
 Returns the layout manager that is installed on this widget, or 0 if no layout manager is installed. More...
 
Qt::LayoutDirection layoutDirection () const
 
QLocale locale () const
 
Qt::HANDLE macCGHandle () const
 Returns the CoreGraphics handle of the widget. More...
 
Qt::HANDLE macQDHandle () const
 Returns the QuickDraw handle of the widget. More...
 
QPoint mapFrom (QWidget *, const QPoint &) const
 Translates the widget coordinate pos from the coordinate system of parent to this widget's coordinate system. More...
 
QPoint mapFromGlobal (const QPoint &) const
 Translates the global screen coordinate pos to widget coordinates. More...
 
QPoint mapFromParent (const QPoint &) const
 Translates the parent widget coordinate pos to widget coordinates. More...
 
QPoint mapTo (QWidget *, const QPoint &) const
 Translates the widget coordinate pos to the coordinate system of parent. More...
 
QPoint mapToGlobal (const QPoint &) const
 Translates the widget coordinate pos to global screen coordinates. More...
 
QPoint mapToParent (const QPoint &) const
 Translates the widget coordinate pos to a coordinate in the parent widget. More...
 
QRegion mask () const
 Returns the mask currently set on a widget. More...
 
int maximumHeight () const
 
QSize maximumSize () const
 
int maximumWidth () const
 
int minimumHeight () const
 
QSize minimumSize () const
 
int minimumWidth () const
 
void move (int x, int y)
 This corresponds to move(QPoint(x, y)). More...
 
void move (const QPoint &)
 
QWidgetnativeParentWidget () const
 Returns the native parent for this widget, i. More...
 
QWidgetnextInFocusChain () const
 Returns the next widget in this widget's focus chain. More...
 
QRect normalGeometry () const
 
void overrideWindowFlags (Qt::WindowFlags type)
 Sets the window flags for the widget to flags, without telling the window system. More...
 
void overrideWindowState (Qt::WindowStates state)
 
QPaintEnginepaintEngine () const
 Returns the widget's paint engine. More...
 
const QPalettepalette () const
 
QWidgetparentWidget () const
 Returns the parent of this widget, or 0 if it does not have any parent widget. More...
 
QPoint pos () const
 
QWidgetpreviousInFocusChain () const
 The previousInFocusChain function returns the previous widget in this widget's focus chain. More...
 
 QWidget (QWidget *parent=0, Qt::WindowFlags f=0)
 Constructs a widget which is a child of parent, with widget flags set to f. More...
 
QRect rect () const
 
void releaseDC (HDC) const
 Releases the HDC hdc acquired by a previous call to getDC(). More...
 
void releaseKeyboard ()
 Releases the keyboard grab. More...
 
void releaseMouse ()
 Releases the mouse grab. More...
 
void releaseShortcut (int id)
 Removes the shortcut with the given id from Qt's shortcut system. More...
 
void removeAction (QAction *action)
 Removes the action action from this widget's list of actions. More...
 
void render (QPaintDevice *target, const QPoint &targetOffset=QPoint(), const QRegion &sourceRegion=QRegion(), RenderFlags renderFlags=RenderFlags(DrawWindowBackground|DrawChildren))
 Renders the sourceRegion of this widget into the target using renderFlags to determine how to render. More...
 
void render (QPainter *painter, const QPoint &targetOffset=QPoint(), const QRegion &sourceRegion=QRegion(), RenderFlags renderFlags=RenderFlags(DrawWindowBackground|DrawChildren))
 Renders the widget into the painter's QPainter::device(). More...
 
void repaint (int x, int y, int w, int h)
 This version repaints a rectangle (x, y, w, h) inside the widget. More...
 
void repaint (const QRect &)
 This version repaints a rectangle rect inside the widget. More...
 
void repaint (const QRegion &)
 This version repaints a region rgn inside the widget. More...
 
void resize (int w, int h)
 This corresponds to resize(QSize(w, h)). More...
 
void resize (const QSize &)
 
bool restoreGeometry (const QByteArray &geometry)
 Restores the geometry and state top-level widgets stored in the byte array geometry. More...
 
QByteArray saveGeometry () const
 Saves the current geometry and state for top-level widgets. More...
 
void scroll (int dx, int dy)
 Scrolls the widget including its children dx pixels to the right and dy downward. More...
 
void scroll (int dx, int dy, const QRect &)
 This version only scrolls r and does not move the children of the widget. More...
 
void setAcceptDrops (bool on)
 
void setAccessibleDescription (const QString &description)
 
void setAccessibleName (const QString &name)
 
void setAttribute (Qt::WidgetAttribute, bool on=true)
 Sets the attribute attribute on this widget if on is true; otherwise clears the attribute. More...
 
void setAutoFillBackground (bool enabled)
 
void setBackgroundRole (QPalette::ColorRole)
 Sets the background role of the widget to role. More...
 
void setBaseSize (const QSize &)
 
void setBaseSize (int basew, int baseh)
 This corresponds to setBaseSize(QSize(basew, baseh)). More...
 
void setContentsMargins (int left, int top, int right, int bottom)
 Sets the margins around the contents of the widget to have the sizes left, top, right, and bottom. More...
 
void setContentsMargins (const QMargins &margins)
 The setContentsMargins function sets the margins around the widget's contents. More...
 
void setContextMenuPolicy (Qt::ContextMenuPolicy policy)
 
void setCursor (const QCursor &)
 
void setFixedHeight (int h)
 Sets both the minimum and maximum heights of the widget to h without changing the widths. More...
 
void setFixedSize (const QSize &)
 Sets both the minimum and maximum sizes of the widget to s, thereby preventing it from ever growing or shrinking. More...
 
void setFixedSize (int w, int h)
 Sets the width of the widget to w and the height to h. More...
 
void setFixedWidth (int w)
 Sets both the minimum and maximum width of the widget to w without changing the heights. More...
 
void setFocus (Qt::FocusReason reason)
 Gives the keyboard input focus to this widget (or its focus proxy) if this widget or one of its parents is the active window. More...
 
void setFocusPolicy (Qt::FocusPolicy policy)
 
void setFocusProxy (QWidget *)
 Sets the widget's focus proxy to widget w. More...
 
void setFont (const QFont &)
 Use the single-argument overload instead. More...
 
void setForegroundRole (QPalette::ColorRole)
 Sets the foreground role of the widget to role. More...
 
void setGeometry (int x, int y, int w, int h)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.This corresponds to setGeometry(QRect(x, y, w, h)). More...
 
void setGeometry (const QRect &)
 
void setGraphicsEffect (QGraphicsEffect *effect)
 The setGraphicsEffect function is for setting the widget's graphics effect. More...
 
void setInputContext (QInputContext *)
 This function sets the input context context on this widget. More...
 
void setInputMethodHints (Qt::InputMethodHints hints)
 
void setLayout (QLayout *)
 Sets the layout manager for this widget to layout. More...
 
void setLayoutDirection (Qt::LayoutDirection direction)
 
void setLocale (const QLocale &locale)
 
void setMask (const QBitmap &)
 Causes only the pixels of the widget for which bitmap has a corresponding 1 bit to be visible. More...
 
void setMask (const QRegion &)
 Causes only the parts of the widget which overlap region to be visible. More...
 
void setMaximumHeight (int maxh)
 
void setMaximumSize (const QSize &)
 
void setMaximumSize (int maxw, int maxh)
 This function corresponds to setMaximumSize(QSize(maxw, maxh)). More...
 
void setMaximumWidth (int maxw)
 
void setMinimumHeight (int minh)
 
void setMinimumSize (const QSize &)
 
void setMinimumSize (int minw, int minh)
 This function corresponds to setMinimumSize(QSize(minw, minh)). More...
 
void setMinimumWidth (int minw)
 
void setMouseTracking (bool enable)
 
void setPalette (const QPalette &)
 Use the single-argument overload instead. More...
 
void setParent (QWidget *parent)
 Sets the parent of the widget to parent, and resets the window flags. More...
 
void setParent (QWidget *parent, Qt::WindowFlags f)
 This function also takes widget flags, f as an argument. More...
 
void setShortcutAutoRepeat (int id, bool enable=true)
 If enable is true, auto repeat of the shortcut with the given id is enabled; otherwise it is disabled. More...
 
void setShortcutEnabled (int id, bool enable=true)
 If enable is true, the shortcut with the given id is enabled; otherwise the shortcut is disabled. More...
 
void setSizeIncrement (const QSize &)
 
void setSizeIncrement (int w, int h)
 Sets the x (width) size increment to w and the y (height) size increment to h. More...
 
void setSizePolicy (QSizePolicy)
 
void setSizePolicy (QSizePolicy::Policy horizontal, QSizePolicy::Policy vertical)
 Sets the size policy of the widget to horizontal and vertical, with standard stretch and no height-for-width. More...
 
void setStatusTip (const QString &)
 
void setStyle (QStyle *)
 Sets the widget's GUI style to style. More...
 
void setToolTip (const QString &)
 
void setUpdatesEnabled (bool enable)
 
void setupUi (QWidget *widget)
 Sets up the user interface for the specified widget. More...
 
void setWhatsThis (const QString &)
 
void setWindowFilePath (const QString &filePath)
 
void setWindowFlags (Qt::WindowFlags type)
 
void setWindowIcon (const QIcon &icon)
 
void setWindowIconText (const QString &)
 
void setWindowModality (Qt::WindowModality windowModality)
 
void setWindowOpacity (qreal level)
 
void setWindowRole (const QString &)
 Sets the window's role to role. More...
 
void setWindowState (Qt::WindowStates state)
 Sets the window state to windowState. More...
 
void setWindowSurface (QWindowSurface *surface)
 Sets the window surface to be the surface specified. More...
 
QSize size () const
 
QSize sizeIncrement () const
 
QSizePolicy sizePolicy () const
 
void stackUnder (QWidget *)
 Places the widget under w in the parent widget's stack. More...
 
QString statusTip () const
 
QStylestyle () const
 
QString styleSheet () const
 
bool testAttribute (Qt::WidgetAttribute) const
 Returns true if attribute attribute is set on this widget; otherwise returns false. More...
 
QString toolTip () const
 
QWidgettopLevelWidget () const
 
bool underMouse () const
 Returns true if the widget is under the mouse cursor; otherwise returns false. More...
 
void ungrabGesture (Qt::GestureType type)
 Unsubscribes the widget from a given gesture type. More...
 
void unsetCursor ()
 
void unsetLayoutDirection ()
 
void unsetLocale ()
 
void update (int x, int y, int w, int h)
 This version updates a rectangle (x, y, w, h) inside the widget. More...
 
void update (const QRect &)
 This version updates a rectangle rect inside the widget. More...
 
void update (const QRegion &)
 This version repaints a region rgn inside the widget. More...
 
void updateGeometry ()
 Notifies the layout system that this widget has changed and may need to change geometry. More...
 
bool updatesEnabled () const
 
QRegion visibleRegion () const
 Returns the unobscured region where paint events can occur. More...
 
QString whatsThis () const
 
int width () const
 
QWidgetwindow () const
 Returns the window for this widget, i.e. More...
 
QString windowFilePath () const
 
Qt::WindowFlags windowFlags () const
 Window flags are a combination of a type (e. More...
 
QIcon windowIcon () const
 
QString windowIconText () const
 
Qt::WindowModality windowModality () const
 
qreal windowOpacity () const
 
QString windowRole () const
 Returns the window's role, or an empty string. More...
 
Qt::WindowStates windowState () const
 Returns the current window state. More...
 
QWindowSurfacewindowSurface () const
 Returns the QWindowSurface this widget will be drawn into. More...
 
QString windowTitle () const
 
Qt::WindowType windowType () const
 Returns the window type of this widget. More...
 
WId winId () const
 Returns the window system identifier of the widget. More...
 
int x () const
 
const QX11Infox11Info () const
 Returns information about the configuration of the X display used to display the widget. More...
 
Qt::HANDLE x11PictureHandle () const
 Returns the X11 Picture handle of the widget for XRender support. More...
 
int y () const
 
 ~QWidget ()
 Destroys the widget. More...
 
- Public Functions inherited from QObject
bool blockSignals (bool b)
 If block is true, signals emitted by this object are blocked (i.e., emitting a signal will not invoke anything connected to it). More...
 
const QObjectListchildren () const
 Returns a list of child objects. More...
 
bool connect (const QObject *sender, const char *signal, const char *member, Qt::ConnectionType type=Qt::AutoConnection) const
 
bool disconnect (const char *signal=0, const QObject *receiver=0, const char *member=0)
 
bool disconnect (const QObject *receiver, const char *member=0)
 
void dumpObjectInfo ()
 Dumps information about signal connections, etc. More...
 
void dumpObjectTree ()
 Dumps a tree of children to the debug output. More...
 
QList< QByteArraydynamicPropertyNames () const
 Returns the names of all properties that were dynamically added to the object using setProperty(). More...
 
virtual bool eventFilter (QObject *, QEvent *)
 Filters events if this object has been installed as an event filter for the watched object. More...
 
template<typename T >
findChild (const QString &aName=QString()) const
 Returns the child of this object that can be cast into type T and that is called name, or 0 if there is no such object. More...
 
template<typename T >
QList< T > findChildren (const QString &aName=QString()) const
 Returns all children of this object with the given name that can be cast to type T, or an empty list if there are no such objects. More...
 
template<typename T >
QList< T > findChildren (const QRegExp &re) const
 
bool inherits (const char *classname) const
 Returns true if this object is an instance of a class that inherits className or a QObject subclass that inherits className; otherwise returns false. More...
 
void installEventFilter (QObject *)
 Installs an event filter filterObj on this object. More...
 
bool isWidgetType () const
 Returns true if the object is a widget; otherwise returns false. More...
 
void killTimer (int id)
 Kills the timer with timer identifier, id. More...
 
virtual const QMetaObjectmetaObject () const
 Returns a pointer to the meta-object of this object. More...
 
void moveToThread (QThread *thread)
 Changes the thread affinity for this object and its children. More...
 
QString objectName () const
 
QObjectparent () const
 Returns a pointer to the parent object. More...
 
QVariant property (const char *name) const
 Returns the value of the object's name property. More...
 
Q_INVOKABLE QObject (QObject *parent=0)
 Constructs an object with parent object parent. More...
 
void removeEventFilter (QObject *)
 Removes an event filter object obj from this object. More...
 
void setObjectName (const QString &name)
 
void setParent (QObject *)
 Makes the object a child of parent. More...
 
bool setProperty (const char *name, const QVariant &value)
 Sets the value of the object's name property to value. More...
 
void setUserData (uint id, QObjectUserData *data)
 
bool signalsBlocked () const
 Returns true if signals are blocked; otherwise returns false. More...
 
int startTimer (int interval)
 Starts a timer and returns a timer identifier, or returns zero if it could not start a timer. More...
 
QThreadthread () const
 Returns the thread in which the object lives. More...
 
QObjectUserDatauserData (uint id) const
 
virtual ~QObject ()
 Destroys the object, deleting all its child objects. More...
 
- Public Functions inherited from QPaintDevice
int colorCount () const
 
int depth () const
 
int height () const
 
int heightMM () const
 
int logicalDpiX () const
 
int logicalDpiY () const
 
QT_DEPRECATED int numColors () const
 
bool paintingActive () const
 
int physicalDpiX () const
 
int physicalDpiY () const
 
int width () const
 
int widthMM () const
 
virtual ~QPaintDevice ()
 

Protected Functions

void changeEvent (QEvent *)
 Reimplemented Function More...
 
void childEvent (QChildEvent *)
 Tells the splitter that the child widget described by c has been inserted or removed. More...
 
int closestLegalPosition (int, int)
 Returns the closest legal position to pos of the widget with index index. More...
 
virtual QSplitterHandlecreateHandle ()
 Returns a new splitter handle as a child widget of this splitter. More...
 
bool event (QEvent *)
 Reimplemented Function More...
 
void moveSplitter (int pos, int index)
 Moves the left or top edge of the splitter handle at index as close as possible to position pos, which is the distance from the left or top edge of the widget. More...
 
void resizeEvent (QResizeEvent *)
 Reimplemented Function More...
 
void setRubberBand (int position)
 Displays a rubber band at position pos. More...
 
- Protected Functions inherited from QFrame
void drawFrame (QPainter *)
 em>Reimplemented Function More...
 
void paintEvent (QPaintEvent *)
 This event handler can be reimplemented in a subclass to receive paint events passed in event. More...
 
 QFrame (QFramePrivate &dd, QWidget *parent=0, Qt::WindowFlags f=0)
 
- Protected Functions inherited from QWidget
virtual void actionEvent (QActionEvent *)
 This event handler is called with the given event whenever the widget's actions are changed. More...
 
virtual void closeEvent (QCloseEvent *)
 This event handler is called with the given event when Qt receives a window close request for a top-level widget from the window system. More...
 
virtual void contextMenuEvent (QContextMenuEvent *)
 This event handler, for event event, can be reimplemented in a subclass to receive widget context menu events. More...
 
void create (WId=0, bool initializeWindow=true, bool destroyOldWindow=true)
 Creates a new widget window if window is 0, otherwise sets the widget's window to window. More...
 
void destroy (bool destroyWindow=true, bool destroySubWindows=true)
 Frees up window system resources. More...
 
virtual void dragEnterEvent (QDragEnterEvent *)
 This event handler is called when a drag is in progress and the mouse enters this widget. More...
 
virtual void dragLeaveEvent (QDragLeaveEvent *)
 This event handler is called when a drag is in progress and the mouse leaves this widget. More...
 
virtual void dragMoveEvent (QDragMoveEvent *)
 This event handler is called if a drag is in progress, and when any of the following conditions occur: the cursor enters this widget, the cursor moves within this widget, or a modifier key is pressed on the keyboard while this widget has the focus. More...
 
virtual void dropEvent (QDropEvent *)
 This event handler is called when the drag is dropped on this widget. More...
 
virtual void enabledChange (bool)
 
virtual void enterEvent (QEvent *)
 This event handler can be reimplemented in a subclass to receive widget enter events which are passed in the event parameter. More...
 
virtual void focusInEvent (QFocusEvent *)
 This event handler can be reimplemented in a subclass to receive keyboard focus events (focus received) for the widget. More...
 
bool focusNextChild ()
 Finds a new widget to give the keyboard focus to, as appropriate for Tab, and returns true if it can find a new widget, or false if it can't. More...
 
virtual bool focusNextPrevChild (bool next)
 Finds a new widget to give the keyboard focus to, as appropriate for Tab and Shift+Tab, and returns true if it can find a new widget, or false if it can't. More...
 
virtual void focusOutEvent (QFocusEvent *)
 This event handler can be reimplemented in a subclass to receive keyboard focus events (focus lost) for the widget. More...
 
bool focusPreviousChild ()
 Finds a new widget to give the keyboard focus to, as appropriate for Shift+Tab, and returns true if it can find a new widget, or false if it can't. More...
 
virtual void fontChange (const QFont &)
 
virtual void hideEvent (QHideEvent *)
 This event handler can be reimplemented in a subclass to receive widget hide events. More...
 
virtual void inputMethodEvent (QInputMethodEvent *)
 This event handler, for event event, can be reimplemented in a subclass to receive Input Method composition events. More...
 
virtual void keyPressEvent (QKeyEvent *)
 This event handler, for event event, can be reimplemented in a subclass to receive key press events for the widget. More...
 
virtual void keyReleaseEvent (QKeyEvent *)
 This event handler, for event event, can be reimplemented in a subclass to receive key release events for the widget. More...
 
virtual void languageChange ()
 
virtual void leaveEvent (QEvent *)
 This event handler can be reimplemented in a subclass to receive widget leave events which are passed in the event parameter. More...
 
virtual bool macEvent (EventHandlerCallRef, EventRef)
 This special event handler can be reimplemented in a subclass to receive native Macintosh events. More...
 
int metric (PaintDeviceMetric) const
 Internal implementation of the virtual QPaintDevice::metric() function. More...
 
virtual void mouseDoubleClickEvent (QMouseEvent *)
 This event handler, for event event, can be reimplemented in a subclass to receive mouse double click events for the widget. More...
 
virtual void mouseMoveEvent (QMouseEvent *)
 This event handler, for event event, can be reimplemented in a subclass to receive mouse move events for the widget. More...
 
virtual void mousePressEvent (QMouseEvent *)
 This event handler, for event event, can be reimplemented in a subclass to receive mouse press events for the widget. More...
 
virtual void mouseReleaseEvent (QMouseEvent *)
 This event handler, for event event, can be reimplemented in a subclass to receive mouse release events for the widget. More...
 
virtual void moveEvent (QMoveEvent *)
 This event handler can be reimplemented in a subclass to receive widget move events which are passed in the event parameter. More...
 
virtual void paletteChange (const QPalette &)
 
 QWidget (QWidgetPrivate &d, QWidget *parent, Qt::WindowFlags f)
 
virtual bool qwsEvent (QWSEvent *)
 This special event handler can be reimplemented in a subclass to receive native Qt for Embedded Linux events which are passed in the event parameter. More...
 
void resetInputContext ()
 This function can be called on the widget that currently has focus to reset the input method operating on it. More...
 
virtual void showEvent (QShowEvent *)
 This event handler can be reimplemented in a subclass to receive widget show events which are passed in the event parameter. More...
 
virtual void styleChange (QStyle &)
 
virtual void tabletEvent (QTabletEvent *)
 This event handler, for event event, can be reimplemented in a subclass to receive tablet events for the widget. More...
 
virtual void wheelEvent (QWheelEvent *)
 This event handler, for event event, can be reimplemented in a subclass to receive wheel events for the widget. More...
 
virtual void windowActivationChange (bool)
 
virtual bool winEvent (MSG *message, long *result)
 This special event handler can be reimplemented in a subclass to receive native Windows events which are passed in the message parameter. More...
 
virtual bool x11Event (XEvent *)
 This special event handler can be reimplemented in a subclass to receive native X11 events passed in the event parameter. More...
 
- Protected Functions inherited from QObject
virtual void connectNotify (const char *signal)
 This virtual function is called when something has been connected to signal in this object. More...
 
virtual void customEvent (QEvent *)
 This event handler can be reimplemented in a subclass to receive custom events. More...
 
virtual void disconnectNotify (const char *signal)
 This virtual function is called when something has been disconnected from signal in this object. More...
 
 QObject (QObjectPrivate &dd, QObject *parent=0)
 
int receivers (const char *signal) const
 Returns the number of receivers connected to the signal. More...
 
QObjectsender () const
 Returns a pointer to the object that sent the signal, if called in a slot activated by a signal; otherwise it returns 0. More...
 
int senderSignalIndex () const
 
virtual void timerEvent (QTimerEvent *)
 This event handler can be reimplemented in a subclass to receive timer events for the object. More...
 
- Protected Functions inherited from QPaintDevice
 QPaintDevice ()
 

Properties

bool childrenCollapsible
 whether child widgets can be resized down to size 0 by the user More...
 
int handleWidth
 the width of the splitter handles More...
 
bool opaqueResize
 whether resizing is opaque More...
 
Qt::Orientation orientation
 the orientation of the splitter More...
 

Friends

class QSplitterHandle
 

Related Functions

(Note that these are not member functions.)

QTextStreamoperator<< (QTextStream &ts, const QSplitter &splitter)
 Use ts << {splitter}. More...
 
QTextStreamoperator>> (QTextStream &ts, QSplitter &splitter)
 Use ts >> {splitter}. More...
 

Additional Inherited Members

- Public Types inherited from QFrame
enum  Shadow { Plain = 0x0010, Raised = 0x0020, Sunken = 0x0030 }
 This enum type defines the types of shadow that are used to give a 3D effect to frames. More...
 
enum  Shape {
  NoFrame = 0, Box = 0x0001, Panel = 0x0002, WinPanel = 0x0003,
  HLine = 0x0004, VLine = 0x0005, StyledPanel = 0x0006
}
 This enum type defines the shapes of frame available. More...
 
enum  StyleMask { Shadow_Mask = 0x00f0, Shape_Mask = 0x000f }
 This enum defines two constants that can be used to extract the two components of frameStyle(): More...
 
- Public Types inherited from QWidget
enum  RenderFlag { DrawWindowBackground = 0x1, DrawChildren = 0x2, IgnoreMask = 0x4 }
 This enum describes how to render the widget when calling QWidget::render(). More...
 
- Public Types inherited from QPaintDevice
enum  PaintDeviceMetric {
  PdmWidth = 1, PdmHeight, PdmWidthMM, PdmHeightMM,
  PdmNumColors, PdmDepth, PdmDpiX, PdmDpiY,
  PdmPhysicalDpiX, PdmPhysicalDpiY
}
 
- Public Slots inherited from QWidget
bool close ()
 Closes this widget. More...
 
void hide ()
 Hides the widget. More...
 
void lower ()
 Lowers the widget to the bottom of the parent widget's stack. More...
 
void raise ()
 Raises this widget to the top of the parent widget's stack. More...
 
void repaint ()
 Repaints the widget directly by calling paintEvent() immediately, unless updates are disabled or the widget is hidden. More...
 
void setDisabled (bool)
 Disables widget input events if disable is true; otherwise enables input events. More...
 
void setEnabled (bool)
 
void setFocus ()
 Gives the keyboard input focus to this widget (or its focus proxy) if this widget or one of its parents is the active window. More...
 
void setHidden (bool hidden)
 Convenience function, equivalent to setVisible(!hidden). More...
 
QT_MOC_COMPAT void setShown (bool shown)
 Use setVisible(shown) instead. More...
 
void setStyleSheet (const QString &styleSheet)
 
virtual void setVisible (bool visible)
 
void setWindowModified (bool)
 
void setWindowTitle (const QString &)
 
void show ()
 Shows the widget and its child widgets. More...
 
void showFullScreen ()
 Shows the widget in full-screen mode. More...
 
void showMaximized ()
 Shows the widget maximized. More...
 
void showMinimized ()
 Shows the widget minimized, as an icon. More...
 
void showNormal ()
 Restores the widget after it has been maximized or minimized. More...
 
void update ()
 Updates the widget unless updates are disabled or the widget is hidden. More...
 
- Public Slots inherited from QObject
void deleteLater ()
 Schedules this object for deletion. More...
 
- Static Public Functions inherited from QWidget
static QWidgetfind (WId)
 Returns a pointer to the widget with window identifer/handle id. More...
 
static QWidgetkeyboardGrabber ()
 Returns the widget that is currently grabbing the keyboard input. More...
 
static QWidgetmouseGrabber ()
 Returns the widget that is currently grabbing the mouse input. More...
 
static void setTabOrder (QWidget *, QWidget *)
 Puts the second widget after the first widget in the focus order. More...
 
- Static Public Functions inherited from QObject
static bool connect (const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
 Creates a connection of the given type from the signal in the sender object to the method in the receiver object. More...
 
static bool connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type=Qt::AutoConnection)
 
static bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *member)
 Disconnects signal in object sender from method in object receiver. More...
 
static bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &member)
 
static uint registerUserData ()
 
static QString tr (const char *sourceText, const char *comment=0, int n=-1)
 
static QString trUtf8 (const char *sourceText, const char *comment=0, int n=-1)
 
- Static Public Functions inherited from QPaintDevice
static QWSDisplayqwsDisplay ()
 
- Static Public Variables inherited from QObject
static const QMetaObject staticMetaObject
 This variable stores the meta-object for the class. More...
 
- Protected Slots inherited from QWidget
void updateMicroFocus ()
 Updates the widget's micro focus. More...
 
- Protected Variables inherited from QObject
QScopedPointer< QObjectDatad_ptr
 
- Protected Variables inherited from QPaintDevice
ushort painters
 
- Static Protected Variables inherited from QObject
static const QMetaObject staticQtMetaObject
 

Detailed Description

The QSplitter class implements a splitter widget.

A splitter lets the user control the size of child widgets by dragging the boundary between the children. Any number of widgets may be controlled by a single splitter. The typical use of a QSplitter is to create several widgets and add them using insertWidget() or addWidget().

The following example will show a QListView, QTreeView, and QTextEdit side by side, with two splitter handles:

QSplitter *splitter = new QSplitter(parent);
QListView *listview = new QListView;
QTreeView *treeview = new QTreeView;
QTextEdit *textedit = new QTextEdit;
splitter->addWidget(listview);
splitter->addWidget(treeview);
splitter->addWidget(textedit);

If a widget is already inside a QSplitter when insertWidget() or addWidget() is called, it will move to the new position. This can be used to reorder widgets in the splitter later. You can use indexOf(), widget(), and count() to get access to the widgets inside the splitter.

A default QSplitter lays out its children horizontally (side by side); you can use setOrientation(Qt::Vertical) to lay its children out vertically.

By default, all widgets can be as large or as small as the user wishes, between the minimumSizeHint() (or minimumSize()) and maximumSize() of the widgets.

QSplitter resizes its children dynamically by default. If you would rather have QSplitter resize the children only at the end of a resize operation, call setOpaqueResize(false).

The initial distribution of size between the widgets is determined by multiplying the initial size with the stretch factor. You can also use setSizes() to set the sizes of all the widgets. The function sizes() returns the sizes set by the user. Alternatively, you can save and restore the sizes of the widgets from a QByteArray using saveState() and restoreState() respectively.

When you hide() a child its space will be distributed among the other children. It will be reinstated when you show() it again.

See also
QSplitterHandle, QHBoxLayout, QVBoxLayout, QTabWidget

Definition at line 62 of file qsplitter.h.

Constructors and Destructors

◆ QSplitter() [1/2]

QSplitter::QSplitter ( QWidget parent = 0)
explicit

Constructs a horizontal splitter with the parent argument passed on to the QFrame constructor.

See also
setOrientation()

Definition at line 1028 of file qsplitter.cpp.

Referenced by QSplitterPrivate::findWidget().

1029  : QFrame(*new QSplitterPrivate, parent)
1030 {
1031  Q_D(QSplitter);
1032  d->orient = Qt::Horizontal;
1033  d->init();
1034 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482
QFrame(QWidget *parent=0, Qt::WindowFlags f=0)
Constructs a frame widget with frame style NoFrame and a 1-pixel frame width.
Definition: qframe.cpp:219
The QSplitter class implements a splitter widget.
Definition: qsplitter.h:62

◆ QSplitter() [2/2]

QSplitter::QSplitter ( Qt::Orientation  orientation,
QWidget parent = 0 
)
explicit

Constructs a splitter with the given orientation and parent.

See also
setOrientation()

Definition at line 1042 of file qsplitter.cpp.

1043  : QFrame(*new QSplitterPrivate, parent)
1044 {
1045  Q_D(QSplitter);
1046  d->orient = orientation;
1047  d->init();
1048 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482
QFrame(QWidget *parent=0, Qt::WindowFlags f=0)
Constructs a frame widget with frame style NoFrame and a 1-pixel frame width.
Definition: qframe.cpp:219
The QSplitter class implements a splitter widget.
Definition: qsplitter.h:62
Qt::Orientation orientation() const

◆ ~QSplitter()

QSplitter::~QSplitter ( )

Destroys the splitter.

All children are deleted.

Definition at line 1055 of file qsplitter.cpp.

1056 {
1057  Q_D(QSplitter);
1058  delete d->rubberBand;
1059  while (!d->list.isEmpty())
1060  delete d->list.takeFirst();
1061 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482
The QSplitter class implements a splitter widget.
Definition: qsplitter.h:62

Functions

◆ addWidget()

void QSplitter::addWidget ( QWidget widget)

Adds the given widget to the splitter's layout after all the other items.

If widget is already in the splitter, it will be moved to the new position.

See also
insertWidget() widget() indexOf()

Definition at line 1194 of file qsplitter.cpp.

1195 {
1196  Q_D(QSplitter);
1197  insertWidget(d->list.count(), widget);
1198 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482
QWidget * widget(int index) const
Returns the widget at the given index in the splitter&#39;s layout.
Definition: qsplitter.cpp:1276
void insertWidget(int index, QWidget *widget)
Inserts the widget specified into the splitter&#39;s layout at the given index.
Definition: qsplitter.cpp:1210
The QSplitter class implements a splitter widget.
Definition: qsplitter.h:62

◆ changeEvent()

void QSplitter::changeEvent ( QEvent ev)
protectedvirtual

Reimplemented Function

Reimplemented from QFrame.

Definition at line 1748 of file qsplitter.cpp.

1749 {
1750  Q_D(QSplitter);
1751  if(ev->type() == QEvent::StyleChange)
1752  d->updateHandles();
1753  QFrame::changeEvent(ev);
1754 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482
void changeEvent(QEvent *)
This event handler can be reimplemented to handle state changes.
Definition: qframe.cpp:574
Type type() const
Returns the event type.
Definition: qcoreevent.h:303
The QSplitter class implements a splitter widget.
Definition: qsplitter.h:62

◆ childEvent()

void QSplitter::childEvent ( QChildEvent c)
protectedvirtual

Tells the splitter that the child widget described by c has been inserted or removed.

Reimplemented Function

This method is also used to handle the situation where a widget is created with the splitter as a parent but not explicitly added with insertWidget() or addWidget(). This is for compatibility and not the recommended way of putting widgets into a splitter in new code. Please use insertWidget() or addWidget() in new code.

See also
addWidget() insertWidget()

Reimplemented from QObject.

Definition at line 1313 of file qsplitter.cpp.

1314 {
1315  Q_D(QSplitter);
1316  if (!c->child()->isWidgetType())
1317  return;
1318  QWidget *w = static_cast<QWidget*>(c->child());
1319  if (c->added() && !d->blockChildAdd && !w->isWindow() && !d->findWidget(w)) {
1320  d->insertWidget_helper(d->list.count(), w, false);
1321  } else if (c->polished() && !d->blockChildAdd) {
1323  w->show();
1324  } else if (c->type() == QEvent::ChildRemoved) {
1325  for (int i = 0; i < d->list.size(); ++i) {
1326  QSplitterLayoutStruct *s = d->list.at(i);
1327  if (s->widget == w) {
1328  d->list.removeAt(i);
1329  delete s;
1330  d->recalc(isVisible());
1331  return;
1332  }
1333  }
1334  }
1335 }
double d
Definition: qnumeric_p.h:62
bool polished() const
Returns true if type() is QEvent::ChildPolished; otherwise returns false.
Definition: qcoreevent.h:363
bool isWindow() const
Returns true if the widget is an independent window, otherwise returns false.
Definition: qwidget.h:945
bool isVisible() const
Definition: qwidget.h:1005
bool added() const
Returns true if type() is QEvent::ChildAdded; otherwise returns false.
Definition: qcoreevent.h:359
The QWidget class is the base class of all user interface objects.
Definition: qwidget.h:150
#define Q_D(Class)
Definition: qglobal.h:2482
bool isHidden() const
Returns true if the widget is hidden, otherwise returns false.
Definition: qwidget.h:1008
bool testAttribute(Qt::WidgetAttribute) const
Returns true if attribute attribute is set on this widget; otherwise returns false.
Definition: qwidget.h:1041
void show()
Shows the widget and its child widgets.
bool isWidgetType() const
Returns true if the object is a widget; otherwise returns false.
Definition: qobject.h:146
Type type() const
Returns the event type.
Definition: qcoreevent.h:303
The QSplitter class implements a splitter widget.
Definition: qsplitter.h:62
QObject * child() const
Returns the child object that was added or removed.
Definition: qcoreevent.h:358

◆ childrenCollapsible()

bool QSplitter::childrenCollapsible ( ) const

◆ closestLegalPosition()

int QSplitter::closestLegalPosition ( int  pos,
int  index 
)
protected

Returns the closest legal position to pos of the widget with index index.

For right-to-left languages such as Arabic and Hebrew, the layout of horizontal splitters is reversed. Positions are then measured from the right edge of the widget.

See also
getRange()

Definition at line 1495 of file qsplitter.cpp.

Referenced by QSplitterHandle::closestLegalPosition().

1496 {
1497  Q_D(QSplitter);
1498  int x, i, n, u;
1499  return d->adjustPos(pos, index, &u, &n, &i, &x);
1500 }
QPoint pos() const
double d
Definition: qnumeric_p.h:62
quint16 u
#define Q_D(Class)
Definition: qglobal.h:2482
int x() const
quint16 index
The QSplitter class implements a splitter widget.
Definition: qsplitter.h:62

◆ count()

int QSplitter::count ( ) const

Returns the number of widgets contained in the splitter's layout.

See also
widget(), handle()

Definition at line 1289 of file qsplitter.cpp.

Referenced by handleSplittersAttribute(), and moveSplitter().

1290 {
1291  Q_D(const QSplitter);
1292  return d->list.count();
1293 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482
The QSplitter class implements a splitter widget.
Definition: qsplitter.h:62

◆ createHandle()

QSplitterHandle * QSplitter::createHandle ( )
protectedvirtual

Returns a new splitter handle as a child widget of this splitter.

This function can be reimplemented in subclasses to provide support for custom handles.

See also
handle(), indexOf()

Definition at line 1246 of file qsplitter.cpp.

1247 {
1248  Q_D(QSplitter);
1249  return new QSplitterHandle(d->orient, this);
1250 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482
friend class QSplitterHandle
Definition: qsplitter.h:147
The QSplitter class implements a splitter widget.
Definition: qsplitter.h:62

◆ event()

bool QSplitter::event ( QEvent e)
protectedvirtual

Reimplemented Function

Reimplemented from QFrame.

Definition at line 1371 of file qsplitter.cpp.

1372 {
1373  Q_D(QSplitter);
1374  switch (e->type()) {
1375  case QEvent::Hide:
1376  // Reset firstShow to false here since things can be done to the splitter in between
1377  if (!d->firstShow)
1378  d->firstShow = true;
1379  break;
1380  case QEvent::Show:
1381  if (!d->firstShow)
1382  break;
1383  d->firstShow = false;
1384  // fall through
1385  case QEvent::HideToParent:
1386  case QEvent::ShowToParent:
1387  case QEvent::LayoutRequest:
1388 #ifdef QT3_SUPPORT
1389  case QEvent::LayoutHint:
1390 #endif
1391  d->recalc(isVisible());
1392  break;
1393  default:
1394  ;
1395  }
1396  return QWidget::event(e);
1397 }
double d
Definition: qnumeric_p.h:62
bool isVisible() const
Definition: qwidget.h:1005
#define Q_D(Class)
Definition: qglobal.h:2482
bool event(QEvent *)
This is the main event handler; it handles event event.
Definition: qwidget.cpp:8636
Type type() const
Returns the event type.
Definition: qcoreevent.h:303
The QSplitter class implements a splitter widget.
Definition: qsplitter.h:62

◆ getRange()

void QSplitter::getRange ( int  index,
int *  min,
int *  max 
) const

Returns the valid range of the splitter with index index in {min} and *{max} if min and max are not 0.

Definition at line 1477 of file qsplitter.cpp.

1478 {
1479  Q_D(const QSplitter);
1480  d->getRange(index, min, 0, 0, max);
1481 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482
quint16 index
The QSplitter class implements a splitter widget.
Definition: qsplitter.h:62

◆ handle()

QSplitterHandle * QSplitter::handle ( int  index) const

Returns the handle to the left (or above) for the item in the splitter's layout at the given index.

The handle at index 0 is always hidden.

For right-to-left languages such as Arabic and Hebrew, the layout of horizontal splitters is reversed. The handle will be to the right of the widget at index.

See also
count(), widget(), indexOf(), createHandle(), setHandleWidth()

Definition at line 1263 of file qsplitter.cpp.

Referenced by handleSplittersAttribute().

1264 {
1265  Q_D(const QSplitter);
1266  if (index < 0 || index >= d->list.size())
1267  return 0;
1268  return d->list.at(index)->handle;
1269 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482
quint16 index
The QSplitter class implements a splitter widget.
Definition: qsplitter.h:62

◆ handleWidth()

int QSplitter::handleWidth ( ) const

Referenced by saveState(), setRubberBand(), and setSizes().

◆ indexOf()

int QSplitter::indexOf ( QWidget widget) const

Returns the index in the splitter's layout of the specified widget.

This also works for handles.

Handles are numbered from 0. There are as many handles as there are child widgets, but the handle at position 0 is always hidden.

See also
count(), widget()

Definition at line 1228 of file qsplitter.cpp.

Referenced by QSplitterHandle::closestLegalPosition(), and handleSplitterContentsAttribute().

1229 {
1230  Q_D(const QSplitter);
1231  for (int i = 0; i < d->list.size(); ++i) {
1232  QSplitterLayoutStruct *s = d->list.at(i);
1233  if (s->widget == w || s->handle == w)
1234  return i;
1235  }
1236  return -1;
1237 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482
QSplitterHandle * handle
Definition: qsplitter_p.h:71
The QSplitter class implements a splitter widget.
Definition: qsplitter.h:62

◆ insertWidget()

void QSplitter::insertWidget ( int  index,
QWidget widget 
)

Inserts the widget specified into the splitter's layout at the given index.

If widget is already in the splitter, it will be moved to the new position.

if index is an invalid index, then the widget will be inserted at the end.

See also
addWidget() indexOf() widget()

Definition at line 1210 of file qsplitter.cpp.

Referenced by addWidget().

1211 {
1212  Q_D(QSplitter);
1213  d->insertWidget_helper(index, widget, true);
1214 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482
quint16 index
The QSplitter class implements a splitter widget.
Definition: qsplitter.h:62

◆ isCollapsible()

bool QSplitter::isCollapsible ( int  index) const

Returns true if the widget at index is collapsible, otherwise returns false.

Definition at line 1167 of file qsplitter.cpp.

1168 {
1169  Q_D(const QSplitter);
1170  if (index < 0 || index >= d->list.size()) {
1171  qWarning("QSplitter::isCollapsible: Index %d out of range", index);
1172  return false;
1173  }
1174  return d->list.at(index)->collapsible;
1175 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482
Q_CORE_EXPORT void qWarning(const char *,...)
quint16 index
The QSplitter class implements a splitter widget.
Definition: qsplitter.h:62

◆ minimumSizeHint()

QSize QSplitter::minimumSizeHint ( ) const
virtual

Reimplemented Function

Reimplemented from QWidget.

Definition at line 1628 of file qsplitter.cpp.

1629 {
1630  Q_D(const QSplitter);
1631  ensurePolished();
1632  int l = 0;
1633  int t = 0;
1634 
1635  for (int i = 0; i < d->list.size(); ++i) {
1636  QSplitterLayoutStruct *s = d->list.at(i);
1637  if (!s || !s->widget)
1638  continue;
1639  if (s->widget->isHidden())
1640  continue;
1641  QSize widgetSize = qSmartMinSize(s->widget);
1642  if (widgetSize.isValid()) {
1643  l += d->pick(widgetSize);
1644  t = qMax(t, d->trans(widgetSize));
1645  }
1646  if (!s->handle || s->handle->isHidden())
1647  continue;
1648  QSize splitterSize = s->handle->sizeHint();
1649  if (splitterSize.isValid()) {
1650  l += d->pick(splitterSize);
1651  t = qMax(t, d->trans(splitterSize));
1652  }
1653  }
1654  return orientation() == Qt::Horizontal ? QSize(l, t) : QSize(t, l);
1655 }
double d
Definition: qnumeric_p.h:62
Q_GUI_EXPORT QSize qSmartMinSize(const QSize &sizeHint, const QSize &minSizeHint, const QSize &minSize, const QSize &maxSize, const QSizePolicy &sizePolicy)
void ensurePolished() const
Ensures that the widget has been polished by QStyle (i.e., has a proper font and palette).
Definition: qwidget.cpp:10024
#define Q_D(Class)
Definition: qglobal.h:2482
Q_DECL_CONSTEXPR const T & qMax(const T &a, const T &b)
Definition: qglobal.h:1217
bool isHidden() const
Returns true if the widget is hidden, otherwise returns false.
Definition: qwidget.h:1008
QSize sizeHint() const
Reimplemented Function
Definition: qsplitter.cpp:219
QSplitterHandle * handle
Definition: qsplitter_p.h:71
bool isValid() const
Returns true if both the width and height is equal to or greater than 0; otherwise returns false...
Definition: qsize.h:123
QFactoryLoader * l
The QSize class defines the size of a two-dimensional object using integer point precision.
Definition: qsize.h:53
The QSplitter class implements a splitter widget.
Definition: qsplitter.h:62
Qt::Orientation orientation() const

◆ moveSplitter()

void QSplitter::moveSplitter ( int  pos,
int  index 
)
protected

Moves the left or top edge of the splitter handle at index as close as possible to position pos, which is the distance from the left or top edge of the widget.

For right-to-left languages such as Arabic and Hebrew, the layout of horizontal splitters is reversed. pos is then the distance from the right edge of the widget.

See also
splitterMoved(), closestLegalPosition(), getRange()

Definition at line 1426 of file qsplitter.cpp.

1427 {
1428  Q_D(QSplitter);
1429  QSplitterLayoutStruct *s = d->list.at(index);
1430  int farMin;
1431  int min;
1432  int max;
1433  int farMax;
1434 
1435 #ifdef QSPLITTER_DEBUG
1436  int debugp = pos;
1437 #endif
1438 
1439  pos = d->adjustPos(pos, index, &farMin, &min, &max, &farMax);
1440  int oldP = d->pick(s->rect.topLeft());
1441 #ifdef QSPLITTER_DEBUG
1442  qDebug() << "QSplitter::moveSplitter" << debugp << index << "adjusted" << pos << "oldP" << oldP;
1443 #endif
1444 
1445  QVarLengthArray<int, 32> poss(d->list.count());
1446  QVarLengthArray<int, 32> ws(d->list.count());
1447  bool upLeft;
1448 
1449  d->doMove(false, pos, index, +1, (d->collapsible(s) && (pos > max)), poss.data(), ws.data());
1450  d->doMove(true, pos, index - 1, +1, (d->collapsible(index - 1) && (pos < min)), poss.data(), ws.data());
1451  upLeft = (pos < oldP);
1452 
1453  int wid, delta, count = d->list.count();
1454  if (upLeft) {
1455  wid = 0;
1456  delta = 1;
1457  } else {
1458  wid = count - 1;
1459  delta = -1;
1460  }
1461  for (; wid >= 0 && wid < count; wid += delta) {
1462  QSplitterLayoutStruct *sls = d->list.at( wid );
1463  if (!sls->widget->isHidden())
1464  d->setGeo(sls, poss[wid], ws[wid], true);
1465  }
1466  d->storeSizes();
1467 
1469 }
QPoint pos() const
double d
Definition: qnumeric_p.h:62
Q_CORE_EXPORT QTextStream & ws(QTextStream &s)
#define Q_D(Class)
Definition: qglobal.h:2482
bool isHidden() const
Returns true if the widget is hidden, otherwise returns false.
Definition: qwidget.h:1008
Q_CORE_EXPORT void qDebug(const char *,...)
int count() const
Returns the number of widgets contained in the splitter&#39;s layout.
Definition: qsplitter.cpp:1289
#define emit
Definition: qobjectdefs.h:76
void splitterMoved(int pos, int index)
This signal is emitted when the splitter handle at a particular index has been moved to position pos...
quint16 index
The QSplitter class implements a splitter widget.
Definition: qsplitter.h:62
QPoint topLeft() const
Returns the position of the rectangle&#39;s top-left corner.
Definition: qrect.h:288

◆ opaqueResize()

bool QSplitter::opaqueResize ( ) const

Referenced by closestLegalPosition(), and saveState().

◆ orientation()

Qt::Orientation QSplitter::orientation ( ) const

◆ refresh()

void QSplitter::refresh ( )

Updates the splitter's state.

You should not need to call this function.

Definition at line 1067 of file qsplitter.cpp.

1068 {
1069  Q_D(QSplitter);
1070  d->recalc(true);
1071 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482
The QSplitter class implements a splitter widget.
Definition: qsplitter.h:62

◆ resizeEvent()

void QSplitter::resizeEvent ( QResizeEvent )
protectedvirtual

Reimplemented Function

Reimplemented from QWidget.

Definition at line 1180 of file qsplitter.cpp.

1181 {
1182  Q_D(QSplitter);
1183  d->doResize();
1184 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482
The QSplitter class implements a splitter widget.
Definition: qsplitter.h:62

◆ restoreState()

bool QSplitter::restoreState ( const QByteArray state)

Restores the splitter's layout to the state specified.

Returns true if the state is restored; otherwise returns false.

Typically this is used in conjunction with QSettings to restore the size from a past session. Here is an example:

Restore the splitters's state:

QSettings settings;
splitter->restoreState(settings.value("splitterSizes").toByteArray());

A failure to restore the splitter's layout may result from either invalid or out-of-date data in the supplied byte array.

See also
saveState()

Definition at line 1807 of file qsplitter.cpp.

Referenced by operator>>().

1808 {
1809  Q_D(QSplitter);
1810  int version = 0;
1811  QByteArray sd = state;
1813  QList<int> list;
1814  bool b;
1815  qint32 i;
1816  qint32 marker;
1817  qint32 v;
1818 
1819  stream >> marker;
1820  stream >> v;
1821  if (marker != SplitterMagic || v != version)
1822  return false;
1823 
1824  stream >> list;
1825  d->setSizes_helper(list, false);
1826 
1827  stream >> b;
1829 
1830  stream >> i;
1831  setHandleWidth(i);
1832 
1833  stream >> b;
1834  setOpaqueResize(b);
1835 
1836  stream >> i;
1838  d->doResize();
1839 
1840  return true;
1841 }
double d
Definition: qnumeric_p.h:62
int qint32
Definition: qglobal.h:937
The QByteArray class provides an array of bytes.
Definition: qbytearray.h:135
void setChildrenCollapsible(bool)
Definition: qsplitter.cpp:1129
#define Q_D(Class)
Definition: qglobal.h:2482
void setOrientation(Qt::Orientation)
Definition: qsplitter.cpp:1087
static FILE * stream
static const qint32 SplitterMagic
Definition: qsplitter.cpp:1756
void setOpaqueResize(bool opaque=true)
Definition: qsplitter.cpp:1519
void setHandleWidth(int)
Definition: qsplitter.cpp:1738
The QDataStream class provides serialization of binary data to a QIODevice.
Definition: qdatastream.h:71
Orientation
Definition: qnamespace.h:174
The QSplitter class implements a splitter widget.
Definition: qsplitter.h:62

◆ saveState()

QByteArray QSplitter::saveState ( ) const

Saves the state of the splitter's layout.

Typically this is used in conjunction with QSettings to remember the size for a future session. A version number is stored as part of the data. Here is an example:

QSettings settings;
settings.setValue("splitterSizes", splitter->saveState());
See also
restoreState()

Definition at line 1769 of file qsplitter.cpp.

Referenced by operator<<().

1770 {
1771  Q_D(const QSplitter);
1772  int version = 0;
1773  QByteArray data;
1775 
1777  stream << qint32(version);
1778  QList<int> list;
1779  for (int i = 0; i < d->list.size(); ++i) {
1780  QSplitterLayoutStruct *s = d->list.at(i);
1781  list.append(s->sizer);
1782  }
1783  stream << list;
1785  stream << qint32(handleWidth());
1786  stream << opaqueResize();
1787  stream << qint32(orientation());
1788  return data;
1789 }
double d
Definition: qnumeric_p.h:62
int qint32
Definition: qglobal.h:937
The QByteArray class provides an array of bytes.
Definition: qbytearray.h:135
#define Q_D(Class)
Definition: qglobal.h:2482
int handleWidth() const
void append(const T &t)
Inserts value at the end of the list.
Definition: qlist.h:507
static FILE * stream
static const qint32 SplitterMagic
Definition: qsplitter.cpp:1756
QWidgetData * data
Definition: qwidget.h:815
bool childrenCollapsible() const
bool opaqueResize() const
The QDataStream class provides serialization of binary data to a QIODevice.
Definition: qdatastream.h:71
The QSplitter class implements a splitter widget.
Definition: qsplitter.h:62
Qt::Orientation orientation() const

◆ setChildrenCollapsible()

void QSplitter::setChildrenCollapsible ( bool  collapse)

Definition at line 1129 of file qsplitter.cpp.

Referenced by restoreState().

1130 {
1131  Q_D(QSplitter);
1132  d->childrenCollapsible = collapse;
1133 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482
The QSplitter class implements a splitter widget.
Definition: qsplitter.h:62

◆ setCollapsible()

void QSplitter::setCollapsible ( int  index,
bool  collapse 
)

Sets whether the child widget at index index is collapsible to collapse.

By default, children are collapsible, meaning that the user can resize them down to size 0, even if they have a non-zero minimumSize() or minimumSizeHint(). This behavior can be changed on a per-widget basis by calling this function, or globally for all the widgets in the splitter by setting the childrenCollapsible property.

See also
childrenCollapsible

Definition at line 1153 of file qsplitter.cpp.

1154 {
1155  Q_D(QSplitter);
1156 
1157  if (index < 0 || index >= d->list.size()) {
1158  qWarning("QSplitter::setCollapsible: Index %d out of range", index);
1159  return;
1160  }
1161  d->list.at(index)->collapsible = collapse ? 1 : 0;
1162 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482
Q_CORE_EXPORT void qWarning(const char *,...)
quint16 index
The QSplitter class implements a splitter widget.
Definition: qsplitter.h:62

◆ setHandleWidth()

void QSplitter::setHandleWidth ( int  width)

Definition at line 1738 of file qsplitter.cpp.

Referenced by restoreState().

1739 {
1740  Q_D(QSplitter);
1741  d->handleWidth = width;
1742  d->updateHandles();
1743 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482
int width() const
The QSplitter class implements a splitter widget.
Definition: qsplitter.h:62

◆ setOpaqueResize()

void QSplitter::setOpaqueResize ( bool  opaque = true)

Definition at line 1519 of file qsplitter.cpp.

Referenced by restoreState().

1520 {
1521  Q_D(QSplitter);
1522  d->opaque = on;
1523 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482
The QSplitter class implements a splitter widget.
Definition: qsplitter.h:62

◆ setOrientation()

void QSplitter::setOrientation ( Qt::Orientation  orientation)

Definition at line 1087 of file qsplitter.cpp.

Referenced by restoreState().

1088 {
1089  Q_D(QSplitter);
1090  if (d->orient == orientation)
1091  return;
1092 
1094  QSizePolicy sp = sizePolicy();
1095  sp.transpose();
1096  setSizePolicy(sp);
1098  }
1099 
1100  d->orient = orientation;
1101 
1102  for (int i = 0; i < d->list.size(); ++i) {
1103  QSplitterLayoutStruct *s = d->list.at(i);
1105  }
1106  d->recalc(isVisible());
1107 }
double d
Definition: qnumeric_p.h:62
bool isVisible() const
Definition: qwidget.h:1005
#define Q_D(Class)
Definition: qglobal.h:2482
QSizePolicy sizePolicy() const
bool testAttribute(Qt::WidgetAttribute) const
Returns true if attribute attribute is set on this widget; otherwise returns false.
Definition: qwidget.h:1041
void setOrientation(Qt::Orientation o)
Sets the orientation of the splitter handle to orientation.
Definition: qsplitter.cpp:134
QSplitterHandle * handle
Definition: qsplitter_p.h:71
void transpose()
Definition: qsizepolicy.h:229
void setAttribute(Qt::WidgetAttribute, bool on=true)
Sets the attribute attribute on this widget if on is true; otherwise clears the attribute.
Definition: qwidget.cpp:11087
void setSizePolicy(QSizePolicy)
Definition: qwidget.cpp:10198
The QSplitter class implements a splitter widget.
Definition: qsplitter.h:62
Qt::Orientation orientation() const

◆ setRubberBand()

void QSplitter::setRubberBand ( int  pos)
protected

Displays a rubber band at position pos.

If pos is negative, the rubber band is removed.

Definition at line 1343 of file qsplitter.cpp.

1344 {
1345  Q_D(QSplitter);
1346  if (pos < 0) {
1347  if (d->rubberBand)
1348  d->rubberBand->deleteLater();
1349  return;
1350  }
1351  QRect r = contentsRect();
1352  const int rBord = 3; // customizable?
1353  int hw = handleWidth();
1354  if (!d->rubberBand) {
1355  QBoolBlocker b(d->blockChildAdd);
1356  d->rubberBand = new QRubberBand(QRubberBand::Line, this);
1357  // For accessibility to identify this special widget.
1358  d->rubberBand->setObjectName(QLatin1String("qt_rubberband"));
1359  }
1360 
1361  const QRect newGeom = d->orient == Qt::Horizontal ? QRect(QPoint(pos + hw / 2 - rBord, r.y()), QSize(2 * rBord, r.height()))
1362  : QRect(QPoint(r.x(), pos + hw / 2 - rBord), QSize(r.width(), 2 * rBord));
1363  d->rubberBand->setGeometry(newGeom);
1364  d->rubberBand->show();
1365 }
QPoint pos() const
double d
Definition: qnumeric_p.h:62
QRect contentsRect() const
Returns the area inside the widget&#39;s margins.
Definition: qwidget.cpp:7544
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
int height() const
Returns the height of the rectangle.
Definition: qrect.h:306
#define Q_D(Class)
Definition: qglobal.h:2482
int handleWidth() const
int width() const
int x() const
int y() const
Returns the y-coordinate of the rectangle&#39;s top edge.
Definition: qrect.h:255
The QPoint class defines a point in the plane using integer precision.
Definition: qpoint.h:53
The QRect class defines a rectangle in the plane using integer precision.
Definition: qrect.h:58
The QSize class defines the size of a two-dimensional object using integer point precision.
Definition: qsize.h:53
The QRubberBand class provides a rectangle or line that can indicate a selection or a boundary...
Definition: qrubberband.h:58
The QSplitter class implements a splitter widget.
Definition: qsplitter.h:62

◆ setSizes()

void QSplitter::setSizes ( const QList< int > &  list)

Sets the child widgets respective sizes to the values given in the list.

If the splitter is horizontal, the values set the widths of each widget in pixels, from left to right. If the splitter is vertical, the heights of each widget is set, from top to bottom.

Extra values in the list are ignored. If list contains too few values, the result is undefined but the program will still be well-behaved.

The overall size of the splitter widget is not affected. Instead, any additional/missing space is distributed amongst the widgets according to the relative weight of the sizes.

If you specify a size of 0, the widget will be invisible. The size policies of the widgets are preserved. That is, a value smaller then the minimal size hint of the respective widget will be replaced by the value of the hint.

See also
sizes()

Definition at line 1708 of file qsplitter.cpp.

1709 {
1710  Q_D(QSplitter);
1711  d->setSizes_helper(list, true);
1712 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482
The QSplitter class implements a splitter widget.
Definition: qsplitter.h:62

◆ setStretchFactor()

void QSplitter::setStretchFactor ( int  index,
int  stretch 
)

Updates the size policy of the widget at position index to have a stretch factor of stretch.

stretch is not the effective stretch factor; the effective stretch factor is calculated by taking the initial size of the widget and multiplying it with stretch.

This function is provided for convenience. It is equivalent to

QWidget *widget = splitter->widget(index);
QSizePolicy policy = widget->sizePolicy();
policy.setHorizontalStretch(stretch);
policy.setVerticalStretch(stretch);
widget->setSizePolicy(policy);
See also
setSizes(), widget()

Definition at line 1857 of file qsplitter.cpp.

1858 {
1859  Q_D(QSplitter);
1860  if (index <= -1 || index >= d->list.count())
1861  return;
1862 
1863  QWidget *widget = d->list.at(index)->widget;
1864  QSizePolicy sp = widget->sizePolicy();
1865  sp.setHorizontalStretch(stretch);
1866  sp.setVerticalStretch(stretch);
1867  widget->setSizePolicy(sp);
1868 }
double d
Definition: qnumeric_p.h:62
void setHorizontalStretch(uchar stretchFactor)
Definition: qsizepolicy.h:146
The QWidget class is the base class of all user interface objects.
Definition: qwidget.h:150
#define Q_D(Class)
Definition: qglobal.h:2482
QWidget * widget(int index) const
Returns the widget at the given index in the splitter&#39;s layout.
Definition: qsplitter.cpp:1276
QSizePolicy sizePolicy
the default layout behavior of the widget
Definition: qwidget.h:171
quint16 index
void setVerticalStretch(uchar stretchFactor)
Definition: qsizepolicy.h:147
void setSizePolicy(QSizePolicy)
Definition: qwidget.cpp:10198
The QSplitter class implements a splitter widget.
Definition: qsplitter.h:62

◆ sizeHint()

QSize QSplitter::sizeHint ( ) const
virtual

Reimplemented Function

Reimplemented from QFrame.

Definition at line 1604 of file qsplitter.cpp.

1605 {
1606  Q_D(const QSplitter);
1607  ensurePolished();
1608  int l = 0;
1609  int t = 0;
1610  for (int i = 0; i < d->list.size(); ++i) {
1611  QWidget *w = d->list.at(i)->widget;
1612  if (w->isHidden())
1613  continue;
1614  QSize s = w->sizeHint();
1615  if (s.isValid()) {
1616  l += d->pick(s);
1617  t = qMax(t, d->trans(s));
1618  }
1619  }
1620  return orientation() == Qt::Horizontal ? QSize(l, t) : QSize(t, l);
1621 }
double d
Definition: qnumeric_p.h:62
void ensurePolished() const
Ensures that the widget has been polished by QStyle (i.e., has a proper font and palette).
Definition: qwidget.cpp:10024
The QWidget class is the base class of all user interface objects.
Definition: qwidget.h:150
#define Q_D(Class)
Definition: qglobal.h:2482
Q_DECL_CONSTEXPR const T & qMax(const T &a, const T &b)
Definition: qglobal.h:1217
bool isHidden() const
Returns true if the widget is hidden, otherwise returns false.
Definition: qwidget.h:1008
bool isValid() const
Returns true if both the width and height is equal to or greater than 0; otherwise returns false...
Definition: qsize.h:123
QFactoryLoader * l
The QSize class defines the size of a two-dimensional object using integer point precision.
Definition: qsize.h:53
QSize sizeHint
the recommended size for the widget
Definition: qwidget.h:195
The QSplitter class implements a splitter widget.
Definition: qsplitter.h:62
Qt::Orientation orientation() const

◆ sizes()

QList< int > QSplitter::sizes ( ) const

Returns a list of the size parameters of all the widgets in this splitter.

If the splitter's orientation is horizontal, the list contains the widgets width in pixels, from left to right; if the orientation is vertical, the list contains the widgets height in pixels, from top to bottom.

Giving the values to another splitter's setSizes() function will produce a splitter with the same layout as this one.

Note that invisible widgets have a size of 0.

See also
setSizes()

Definition at line 1674 of file qsplitter.cpp.

1675 {
1676  Q_D(const QSplitter);
1677  ensurePolished();
1678 
1679  QList<int> list;
1680  for (int i = 0; i < d->list.size(); ++i) {
1681  QSplitterLayoutStruct *s = d->list.at(i);
1682  list.append(d->pick(s->rect.size()));
1683  }
1684  return list;
1685 }
double d
Definition: qnumeric_p.h:62
void ensurePolished() const
Ensures that the widget has been polished by QStyle (i.e., has a proper font and palette).
Definition: qwidget.cpp:10024
#define Q_D(Class)
Definition: qglobal.h:2482
void append(const T &t)
Inserts value at the end of the list.
Definition: qlist.h:507
QSize size() const
Returns the size of the rectangle.
Definition: qrect.h:309
The QSplitter class implements a splitter widget.
Definition: qsplitter.h:62

◆ splitterMoved

QSplitter::splitterMoved ( int  pos,
int  index 
)
signal

This signal is emitted when the splitter handle at a particular index has been moved to position pos.

For right-to-left languages such as Arabic and Hebrew, the layout of horizontal splitters is reversed. pos is then the distance from the right edge of the widget.

See also
moveSplitter()

Referenced by moveSplitter().

◆ widget()

QWidget * QSplitter::widget ( int  index) const

Returns the widget at the given index in the splitter's layout.

See also
count(), handle(), indexOf(), insertWidget()

Definition at line 1276 of file qsplitter.cpp.

Referenced by addWidget(), handleSplitterContentsAttribute(), and setStretchFactor().

1277 {
1278  Q_D(const QSplitter);
1279  if (index < 0 || index >= d->list.size())
1280  return 0;
1281  return d->list.at(index)->widget;
1282 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482
quint16 index
The QSplitter class implements a splitter widget.
Definition: qsplitter.h:62

Friends and Related Functions

◆ operator<<()

QTextStream & operator<< ( QTextStream ts,
const QSplitter splitter 
)
related

Use ts << {splitter}.

saveState() instead.

Definition at line 1883 of file qsplitter.cpp.

1884 {
1885  ts << splitter.saveState() << endl;
1886  return ts;
1887 }
QByteArray saveState() const
Saves the state of the splitter&#39;s layout.
Definition: qsplitter.cpp:1769
Q_CORE_EXPORT QTextStream & endl(QTextStream &s)

◆ operator>>()

QTextStream & operator>> ( QTextStream ts,
QSplitter splitter 
)
related

Use ts >> {splitter}.

restoreState() instead.

Definition at line 1899 of file qsplitter.cpp.

1900 {
1901  QString line = ts.readLine();
1902  line = line.simplified();
1903  line.replace(QLatin1Char(' '), QString());
1904  line = line.toUpper();
1905 
1906  splitter.restoreState(line.toAscii());
1907  return ts;
1908 }
QString readLine(qint64 maxlen=0)
Reads one line of text from the stream, and returns it as a QString.
QString & replace(int i, int len, QChar after)
Definition: qstring.cpp:2005
QString toUpper() const Q_REQUIRED_RESULT
Returns an uppercase copy of the string.
Definition: qstring.cpp:5483
bool restoreState(const QByteArray &state)
Restores the splitter&#39;s layout to the state specified.
Definition: qsplitter.cpp:1807
The QString class provides a Unicode character string.
Definition: qstring.h:83
QString simplified() const Q_REQUIRED_RESULT
Returns a string that has whitespace removed from the start and the end, and that has each sequence o...
Definition: qstring.cpp:4415
QByteArray toAscii() const Q_REQUIRED_RESULT
Returns an 8-bit representation of the string as a QByteArray.
Definition: qstring.cpp:4014
The QLatin1Char class provides an 8-bit ASCII/Latin-1 character.
Definition: qchar.h:55

◆ QSplitterHandle

friend class QSplitterHandle
friend

Definition at line 147 of file qsplitter.h.

Referenced by createHandle().

Properties

◆ childrenCollapsible

bool QSplitter::childrenCollapsible
private

whether child widgets can be resized down to size 0 by the user

By default, children are collapsible. It is possible to enable and disable the collapsing of individual children using setCollapsible().

See also
setCollapsible()

Definition at line 69 of file qsplitter.h.

◆ handleWidth

int QSplitter::handleWidth
private

the width of the splitter handles

By default, this property contains a value that depends on the user's platform and style preferences.

If you set handleWidth to 1, the actual grab area will grow to overlap a few pixels of it's respective widgets.

Definition at line 68 of file qsplitter.h.

◆ opaqueResize

bool QSplitter::opaqueResize
private

whether resizing is opaque

Opaque resizing is on by default.

Definition at line 67 of file qsplitter.h.

◆ orientation

Qt::Orientation QSplitter::orientation
private

the orientation of the splitter

By default the orientation is horizontal (i.e., the widgets are laid out side by side). The possible orientations are Qt::Horizontal and Qt::Vertical.

See also
QSplitterHandle::orientation()

Definition at line 66 of file qsplitter.h.


The documentation for this class was generated from the following files: