<class name="QSplitterHandle" doc="/** <p>The <a href="QSplitterHandle.html#QSplitterHandle(com.trolltech.qt.core.Qt.Orientation, com.trolltech.qt.gui.QSplitter)"><tt>QSplitterHandle</tt></a> class provides handle functionality of the splitter.</p> <p><a href="QSplitterHandle.html#QSplitterHandle(com.trolltech.qt.core.Qt.Orientation, com.trolltech.qt.gui.QSplitter)"><tt>QSplitterHandle</tt></a> is typically what people think about when they think about a splitter. It is the handle that is used to resize the widgets.</p> <p>A typical developer using <a href="QSplitter.html"><tt>QSplitter</tt></a> will never have to worry about <a href="QSplitterHandle.html#QSplitterHandle(com.trolltech.qt.core.Qt.Orientation, com.trolltech.qt.gui.QSplitter)"><tt>QSplitterHandle</tt></a>. It is provided for developers who want splitter handles that provide extra features, such as popup menus.</p> <p>The typical way one would create splitter handles is to subclass <a href="QSplitter.html"><tt>QSplitter</tt></a> then reimplement QSplitter::createHandle() to instantiate the custom splitter handle. For example, a minimum <a href="QSplitter.html"><tt>QSplitter</tt></a> subclass might look like this:</p> <pre> class Splitter : public QSplitter { public: Splitter(Qt::Orientation orientation, QWidget *parent = 0); protected: QSplitterHandle *createHandle(); };</pre> <p>The createHandle() implementation simply constructs a custom splitter handle, called <tt>Splitter</tt> in this example:</p> <pre> QSplitterHandle *Splitter::createHandle() { return new SplitterHandle(orientation(), this); }</pre> <p>Information about a given handle can be obtained using functions like <a href="QSplitterHandle.html#orientation()"><tt>orientation</tt></a> and <a href="QSplitterHandle.html#opaqueResize()"><tt>opaqueResize</tt></a>, and is retrieved from its parent splitter. Details like these can be used to give custom handles different appearances depending on the splitter's orientation.</p> <p>The complexity of a custom handle subclass depends on the tasks that it needs to perform. A simple subclass might only provide a <a href="QSplitterHandle.html#paintEvent(com.trolltech.qt.gui.QPaintEvent)"><tt>paintEvent</tt></a> implementation:</p> <pre> void SplitterHandle::paintEvent(QPaintEvent *event) { QPainter painter(this); if (orientation() == Qt::Horizontal) { gradient.setStart(rect().left(), rect().height()/2); gradient.setFinalStop(rect().right(), rect().height()/2); } else { gradient.setStart(rect().width()/2, rect().top()); gradient.setFinalStop(rect().width()/2, rect().bottom()); } painter.fillRect(event-&gt;rect(), QBrush(gradient)); }</pre> <p>In this example, a predefined gradient is set up differently depending on the orientation of the handle. <a href="QSplitterHandle.html#QSplitterHandle(com.trolltech.qt.core.Qt.Orientation, com.trolltech.qt.gui.QSplitter)"><tt>QSplitterHandle</tt></a> provides a reasonable size hint for the handle, so the subclass does not need to provide a reimplementation of <a href="QSplitterHandle.html#sizeHint()"><tt>sizeHint</tt></a> unless the handle has special size requirements.</p> @see <a href="QSplitter.html"><tt>QSplitter</tt></a> */"> <signal name="protected final void customContextMenuRequested(com.trolltech.qt.core.QPoint pos)" doc="/** <p>This signal is emitted when the widget's <a href="QWidget.html#contextMenuPolicy()"><tt>contextMenuPolicy</tt></a> is Qt::CustomContextMenu, and the user has requested a context menu on the widget. The position <tt>pos</tt> is the position of the context menu event that the widget receives. Normally this is in widget coordinates. The exception to this rule is <a href="QAbstractScrollArea.html"><tt>QAbstractScrollArea</tt></a> and its subclasses that map the context menu event to coordinates of the viewport()</tt> .</p> <dl> <dt><b>Compatible Slot Signatures:</b></dt> <dd><tt>void mySlot(com.trolltech.qt.core.QPoint pos)</tt></dd> <dd><tt>void mySlot()</tt></dd> </dl> <dl> <dt><b>See Also:</b></dt> <dd><a href="QWidget.html#mapToGlobal(com.trolltech.qt.core.QPoint)"><tt>mapToGlobal</tt></a>, <a href="QMenu.html"><tt>QMenu</tt></a>, <a href="QWidget.html#contextMenuPolicy()"><tt>contextMenuPolicy</tt></a></dd> </dl> */"/> <method name="public QSplitterHandle(com.trolltech.qt.core.Qt.Orientation o, com.trolltech.qt.gui.QSplitter parent)" doc="/** <p>Creates a <a href="QSplitter.html"><tt>QSplitter</tt></a> handle with the given <tt>o</tt> and <a href="QSplitter.html"><tt>QSplitter</tt></a> <tt>parent</tt>.</p> */"/> <method name="protected final int closestLegalPosition(int p)" doc="/** <p>Returns the closest legal position to <tt>p</tt> of the splitter handle. The positions are measured from the left or top edge of the splitter, even for right-to-left languages.</p> @see <tt>QSplitter::closestLegalPosition</tt> @see <a href="QSplitterHandle.html#moveSplitter(int)"><tt>moveSplitter</tt></a> */"/> <method name="protected final void moveSplitter(int p)" doc="/** <p>Tells the splitter to move this handle to position <tt>p</tt>, which is the distance from the left or top edge of the widget.</p> <p>Note that <tt>p</tt> is also measured from the left (or top) for right-to-left languages. This function will map <tt>p</tt> to the appropriate position before calling QSplitter::moveSplitter().</p> @see <tt>QSplitter::moveSplitter</tt> @see <a href="QSplitterHandle.html#closestLegalPosition(int)"><tt>closestLegalPosition</tt></a> */"/> <method name="public final boolean opaqueResize()" doc="/** <p>Returns true if widgets are resized dynamically (opaquely), otherwise returns false. This value is controlled by the <a href="QSplitter.html"><tt>QSplitter</tt></a>.</p> @see <tt>QSplitter::opaqueResize</tt> */"/> <method name="public final com.trolltech.qt.core.Qt.Orientation orientation()" doc="/** <p>Returns the handle's orientation. This is usually propagated from the <a href="QSplitter.html"><tt>QSplitter</tt></a>.</p> @see <a href="QSplitterHandle.html#setOrientation(com.trolltech.qt.core.Qt.Orientation)"><tt>setOrientation</tt></a> @see <tt>QSplitter::orientation</tt> */"/> <method name="public final void setOrientation(com.trolltech.qt.core.Qt.Orientation o)" doc="/** <p>Sets the orientation of the splitter handle to <tt>o</tt>. This is usually propogated from the <a href="QSplitter.html"><tt>QSplitter</tt></a>.</p> @see <a href="QSplitterHandle.html#orientation()"><tt>orientation</tt></a> @see <tt>QSplitter::setOrientation</tt> */"/> <method name="public final com.trolltech.qt.gui.QSplitter splitter()" doc="/** <p>Returns the splitter associated with this splitter handle.</p> @see <tt>QSplitter::handle</tt> */"/> <method name="public boolean event(com.trolltech.qt.core.QEvent arg__1)" doc="/** <p>This function is reimplemented for internal reasons.</p> */"/> <method name="protected void mouseMoveEvent(com.trolltech.qt.gui.QMouseEvent arg__1)" doc="/** <p>This function is reimplemented for internal reasons.</p> */"/> <method name="protected void mousePressEvent(com.trolltech.qt.gui.QMouseEvent arg__1)" doc="/** <p>This function is reimplemented for internal reasons.</p> */"/> <method name="protected void mouseReleaseEvent(com.trolltech.qt.gui.QMouseEvent arg__1)" doc="/** <p>This function is reimplemented for internal reasons.</p> */"/> <method name="protected void paintEvent(com.trolltech.qt.gui.QPaintEvent arg__1)" doc="/** <p>This function is reimplemented for internal reasons.</p> */"/> <method name="public com.trolltech.qt.core.QSize sizeHint()" doc="/** <p>This function is reimplemented for internal reasons.</p> */"/> </class>