Returns the mask currently set on a widget. Orientation void setRange int minimum , int maximum void setValue int value. If the window is not visible i. Generally, you should refrain from calling update or repaint inside a paintEvent. However, if you call setWindowModified false on a widget, this will not propagate to its parent because other children of the parent might have been modified.
An updates enabled widget receives paint events and has a system background; a disabled widget does not. This also implies that calling update and repaint has no effect if updates are disabled.
In Qt, widgets normally do not generate screen flicker, but on X11 the server might erase regions on the screen when widgets get hidden before they can be replaced by other widgets. Disabling updates solves this. Enabling a widget enables all child widgets except top-level widgets or those that have been explicitly disabled.
Re-enabling updates implicitly calls update on the widget. Calling setVisible true or show sets the widget to visible status if all its parent widgets up to the window are visible.
If an ancestor is not visible, the widget won't become visible until all its ancestors are shown. If its size or position has changed, Qt guarantees that a widget gets move and resize events just before it is shown. If the widget has not been resized yet, Qt will adjust the widget's size to a useful default using adjustSize.
Calling setVisible false or hide hides a widget explicitly. An explicitly hidden widget will never become visible, even if all its ancestors become visible, unless you show it. A widget receives show and hide events when its visibility status changes. Between a hide and a show event, there is no need to waste CPU cycles preparing or displaying information to the user. A video application, for example, might simply stop generating new frames.
A widget that happens to be obscured by other windows on the screen is considered to be visible. The same applies to iconified windows and windows that exist on another virtual desktop on platforms that support this concept.
A widget receives spontaneous show and hide events when its mapping status is changed by the window system, e. You almost never have to reimplement the setVisible function.
If you need to change some settings before a widget is shown, use showEvent instead. If you need to do some delayed initialization use the Polish event delivered to the event function. Do not use this function to find the width of a screen on a multiple screen desktop. See also geometry , height , and size. It associates a file path with a window. If you set the file path, but have not set the window title, Qt sets the window title to the file name of the specified path, obtained using QFileInfo:: If the window title is set at any point, then the window title takes precedence and will be shown instead of the file path string.
Additionally, on macOS , this has an added benefit that it sets the proxy icon for the window, assuming that the file path exists. See also windowTitle and windowIcon. Window flags are a combination of a type e.
Dialog and zero or more hints to the window system e. If the widget had type Qt:: SubWindow and becomes a window Qt:: If the widget is a window and becomes a Qt:: SubWindow , it is put at position 0, 0 relative to its parent widget.
This function calls setParent when changing the flags for a window, causing the widget to be hidden. You must call show to make the widget visible again.. If no icon has been set, windowIcon returns the application icon QApplication:: A modal widget prevents widgets in other windows from getting input.
The value of this property controls which windows are blocked when the widget is visible. Changing this property while the window is visible has no effect; you must hide the widget first, then show it again. See also isWindow , QWidget:: A modified window is a window whose content has changed but has not been saved to disk.
This flag will have different effects varied by the platform. Normally, it should appear right after the file name e. If the window isn't modified, the placeholder is simply removed. Note that if a widget is set as modified, all its ancestors will also be set as modified. However, if you call setWindowModified false on a widget, this will not propagate to its parent because other children of the parent might have been modified.
Changing this property from opaque to transparent might issue a paint event that needs to be processed before the window is displayed correctly. This affects mainly the use of QPixmap:: Also note that semi-transparent windows update and resize significantly slower than opaque windows. This property only makes sense for top-level widgets, such as windows and dialogs. If no caption has been set, the title is based of the windowFilePath. If neither of these is set, then the title is an empty string.
If the windowModified property is false the default , the placeholder is simply removed. This is done by the QPA plugin, so it is shown to the user, but isn't part of the windowTitle string. See also windowIcon , windowModified , and windowFilePath. This property holds the x coordinate of the widget relative to its parent including any window frame.
See also frameGeometry , y , and pos. This property holds the y coordinate of the widget relative to its parent and including any window frame. See also frameGeometry , x , and pos. If parent is 0, the new widget becomes a window. If parent is another widget, this widget becomes a child window inside parent. The new widget is deleted when its parent is deleted. The widget flags argument, f , is normally 0, but it can be set to customize the frame of a window i. To customize the frame, use a value composed from the bitwise OR of any of the window flags.
If you add a child widget to an already visible widget you must explicitly show the child to make it visible. Note that the X11 version of Qt may not be able to deliver all combinations of style flags on all systems. This is because on X11, Qt can only ask the window manager, and the window manager can override the application's settings. On Windows, Qt can set whatever flags you want. All this widget's children are deleted first.
The application exits if this widget is the main widget. This event handler is called with the given event whenever the widget's actions are changed. See also contextMenuPolicy , insertAction , and removeAction. This function performs the same operation as clicking the mouse on the title bar of a top-level window.
On X11, the result depends on the Window Manager. If you want to ensure that the window is stacked on top as well you should also call raise. Note that the window must be visible, otherwise activateWindow has no effect. On Windows, if you are calling this when the application is not currently the active one then it will not make it the active window.
It will change the color of the taskbar entry to indicate that the window has changed in some way. This is because Microsoft does not allow an application to interrupt what the user is currently doing in another application.
All QWidgets have a list of QAction s, however they can be represented graphically in many different ways. The default use of the QAction list as returned by actions is to create a context QMenu.
A QWidget should only have one of each action and adding an action it already has will not cause the same action to be in the widget twice. See also removeAction , insertAction , actions , and QMenu.
See also removeAction , QMenu , and addAction. This function uses sizeHint if it is valid, i. Otherwise, it sets the size to the children rectangle that covers all child widgets the union of all child widget rectangles. For windows, the screen size is also taken into account. If the sizeHint is less than , and the size policy is expanding , the window will be at least , See also sizeHint and childrenRect.
The background role defines the brush from the widget's palette that is used to render the background. See also setBackgroundRole and foregroundRole. Returns the visible child widget at the position x , y in the widget's coordinate system. If there is no visible child widget at the specified position, the function returns 0.
If the widget has active focus, a focus out event is sent to this widget to tell it that it has lost the focus. This widget must enable focus setting in order to get the keyboard input focus, i. Returns true if the widget was closed; otherwise returns false. First it sends the widget a QCloseEvent. The widget is hidden if it accepts the close event. If it ignores the event, nothing happens. The default implementation of QWidget:: If the widget has the Qt:: A close events is delivered to the widget no matter if the widget is visible or not.
By default this attribute is set for all widgets except transient windows such as splash screens, tool windows, and popup menus. 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.
By default, the event is accepted and the widget is closed. You can reimplement this function to change the way the widget responds to window close requests. For example, you can prevent the window from closing by calling ignore on all events.
Main window applications typically use reimplementations of this function to check whether the user's work has been saved and ask for permission before closing. For example, the Application Example uses a helper function to determine whether or not to close the window:. See also setContentsMargins and getContentsMargins.
This event handler, for event event , can be reimplemented in a subclass to receive widget context menu events. The handler is called when the widget's contextMenuPolicy is Qt:: The default implementation ignores the context event.
See the QContextMenuEvent documentation for more details. The parameter window is ignored in Qt 5. Initializes the window sets the geometry etc. If initializeWindow is false, no initialization is performed.
This parameter only makes sense if window is a valid window. Destroys the old window if destroyOldWindow is true. If destroyOldWindow is false, you are responsible for destroying the window yourself using platform native code. The QWidget constructor calls create 0,true,true to create a window for this widget. See also createWindowContainer and QWindow:: Creates a QWidget that makes it possible to embed window into a QWidget -based application.
Once the window has been embedded into the container, the container will control the window's geometry and visibility. Explicit calls to QWindow:: The container takes over ownership of window. The window can be removed from the window container with a call to QWindow:: The window container is attached as a native child window to the toplevel window it is a child of. When a window container is used as a child of a QAbstractScrollArea or QMdiArea , it will create a native window for every widget in its parent chain to allow for proper stacking and clipping in this use case.
Creating a native window for the window container also allows for proper stacking and clipping. This must be done before showing the window container. Applications with many native child windows may suffer from performance issues.
This signal is emitted when the widget's contextMenuPolicy is Qt:: CustomContextMenu , and the user has requested a context menu on the widget. The position pos is the position of the context menu event that the widget receives. Normally this is in widget coordinates. The exception to this rule is QAbstractScrollArea and its subclasses that map the context menu event to coordinates of the viewport.
To have more control over destruction of subwidgets, destroy subwidgets selectively first. This event handler is called when a drag is in progress and the mouse enters this widget. The event is passed in the event parameter. If the event is ignored, the widget won't receive any drag move events. See the Drag-and-drop documentation for an overview of how to provide drag-and-drop in your application.
This event handler is called when a drag is in progress and the mouse leaves this widget. This event handler is called if a drag is in progress, and when any of the following conditions occur: This event handler is called when the drag is dropped on this widget.
Returns the effective window system identifier of the widget, i. If the widget is native, this function returns the native widget ID. Otherwise, the window ID of the first native parent widget, i. We recommend that you do not store this value as it is likely to change at run-time. Ensures that the widget and its children have been polished by QStyle i.
QWidget calls this function after it has been fully constructed but before it is shown the very first time. You can call this function if you want to ensure that the widget is polished before doing an operation, e. Note that this function is called from the default implementation of sizeHint. Polishing is useful for final initialization that must happen after all constructors from base classes as well as from subclasses have been called. If you need to change some settings when a widget is polished, reimplement event and handle the QEvent:: The function is declared const so that it can be called from other const functions e.
This event handler can be reimplemented in a subclass to receive widget enter events which are passed in the event parameter. See also leaveEvent , mouseMoveEvent , and event. This is the main event handler; it handles event event.
You can reimplement this function in a subclass, but we recommend using one of the specialized event handlers instead.
Key press and release events are treated differently from other events. Mouse and tablet event handling is also slightly special: This function returns true if the event was recognized, otherwise it returns false. If the recognized event was accepted see QEvent:: The window identifier type depends on the underlying window system, see qwindowdefs. If there is no widget with this identifier, 0 is returned.
This event handler can be reimplemented in a subclass to receive keyboard focus events focus received for the widget. A widget normally must setFocusPolicy to something other than Qt:: NoFocus in order to receive focus events.
Note that the application programmer can call setFocus on any widget, even those that do not normally accept focus. The default implementation updates the widget except for windows that do not specify a focusPolicy. 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.
If next is true, this function searches forward, if next is false, it searches backward. Sometimes, you will want to reimplement this function.
For example, a web browser might reimplement it to move its "current active link" forward or backward, and call focusNextPrevChild only when it reaches the last or first link on the "page".
Child widgets call focusNextPrevChild on their parent widgets, but only the window that contains the child widgets decides where to redirect focus. By reimplementing this function for an object, you thus gain control of focus traversal for all child widgets. See also focusNextChild and focusPreviousChild.
This event handler can be reimplemented in a subclass to receive keyboard focus events focus lost for the widget. The events is passed in the event parameter. Returns the last child of this widget that setFocus had been called on. For top level widgets this is the widget that will get focus in case this window gets activated. This is not the same as QApplication:: Returns the font info for the widget's current font.
See also font , fontMetrics , and setFont. Returns the font metrics for the widget's current font. See also font , fontInfo , and setFont. The foreground role defines the color from the widget's palette that is used to draw the foreground. If no explicit foreground role is set, the function returns a role that contrasts with the background role.
See also setForegroundRole and backgroundRole. Returns the widget's contents margins for left , top , right , and bottom. See also setContentsMargins and contentsRect. Renders the widget into a pixmap restricted by the given rectangle. If the widget has any children, then they are also painted in the appropriate positions.
This function can be invoked via the meta-object system and from QML. See also render and QPixmap. See also ungrabGesture and QGestureEvent.
This widget receives all keyboard events until releaseKeyboard is called; other widgets get no keyboard events at all. Mouse events are not affected. Use grabMouse if you want to grab that. The focus widget is not affected, except that it doesn't receive any keyboard events. If a different widget is currently grabbing keyboard input, that widget's grab is released first. See also releaseKeyboard , grabMouse , releaseMouse , and focusWidget. This widget receives all mouse events until releaseMouse is called; other widgets get no mouse events at all.
Keyboard events are not affected. Use grabKeyboard if you want to grab that. Bugs in mouse-grabbing applications very often lock the terminal. Use this function with extreme caution, and consider using the -nograb command line option while debugging. It is almost never necessary to grab the mouse when using Qt, as Qt grabs and releases it sensibly. In particular, Qt grabs the mouse when a mouse button is pressed and keeps it until the last button is released. Only visible widgets can grab mouse input.
If isVisible returns false for a widget, that widget cannot call grabMouse. On Windows, grabMouse only works when the mouse is inside a window owned by the process. On macOS , grabMouse only works when the mouse is inside the frame of that widget. See also releaseMouse , grabKeyboard , and releaseKeyboard.
The cursor will assume shape cursor for as long as the mouse focus is grabbed and this widget will be the only one to receive mouse events until releaseMouse is called. See also releaseMouse , grabKeyboard , releaseKeyboard , and setCursor. Adds a shortcut to Qt's shortcut system that watches for the given key sequence in the given context. If the context is Qt:: ApplicationShortcut , the shortcut applies to the application as a whole. Otherwise, it is either local to this widget, Qt:: WidgetShortcut , or to the window itself, Qt:: If the same key sequence has been grabbed by several widgets, when the key sequence occurs a QEvent:: You should not normally need to use this function; instead create QAction s with the shortcut key sequences you require if you also want equivalent menu options and toolbar buttons , or create QShortcut s if you just need key sequences.
Both QAction and QShortcut handle all the event filtering for you, and provide signals which are triggered when the user triggers the key sequence, so are much easier to use than this low-level function. See also releaseShortcut and setShortcutEnabled. Returns the proxy widget for the corresponding embedded widget in a graphics view; otherwise returns 0. See also setEditFocus and QApplication:: Returns true if the widget's preferred height depends on its width; otherwise returns false.
If this widget has a layout, the default implementation returns the layout's preferred height. This function is equivalent to setVisible false. If you are working with QDialog or its subclasses and you invoke the show function after this function, the dialog will be displayed in its original position. See also hideEvent , isHidden , show , setVisible , isVisible , and close. This event handler can be reimplemented in a subclass to receive widget hide events.
After receiving a spontaneous hide event, a widget is still considered visible in the sense of isVisible. See also visible , event , and QHideEvent. Initializes the painter pen, background and font to the same as the given widget's. This function is called automatically when the painter is opened on a QWidget. This event handler, for event event , can be reimplemented in a subclass to receive Input Method composition events.
This handler is called when the state of the input method changes. Note that when creating custom text editing widgets, the Qt:: See the QInputMethodEvent documentation for more details. See also event and QInputMethodEvent. This method is only relevant for input widgets. It is used by the input method to query a set of properties of the widget to be able to support complex input method operations as support for surrounding text and reconversions.
Inserts the action action to this widget's list of actions, before the action before. It appends the action if before is 0 or before is not a valid action for this widget. Inserts the actions actions to this widget's list of actions, before the action before. 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.
Returns true if this widget would become enabled if ancestor is enabled; otherwise returns false. This is the case if neither the widget itself nor every parent up to but excluding ancestor has been explicitly disabled. Therefore isEnabledTo 0 stops at this widget's window, unlike isEnabled which also takes parent windows into considerations.
See also setEnabled and enabled. A hidden widget will only become visible when show is called on it. It will not be automatically shown when the parent is shown. To check visibility, use! This is the case for widgets that are children of widgets that are not visible. Returns true if this widget would become visible if ancestor is shown; otherwise returns false. The true case occurs if neither the widget itself nor any parent up to but excluding ancestor has been explicitly hidden.
This function will still return true if the widget is obscured by other windows on the screen, but could be physically visible if it or they were to be moved. See also show , hide , and isVisible. Returns true if the widget is an independent window, otherwise returns false. A window is a widget that isn't visually the child of any other widget and that usually has a frame and a window title.
A window can have a parent widget. It will then be grouped with its parent and deleted when the parent is deleted, minimized when the parent is minimized etc. If supported by the window manager, it will also have a common taskbar entry with its parent. QDialog and QMainWindow widgets are by default windows, even if a parent widget is specified in the constructor.
This behavior is specified by the Qt:: See also window , isModal , and parentWidget. This event handler, for event event , can be reimplemented in a subclass to receive key press events for the widget.
A widget must call setFocusPolicy to accept focus initially and have focus in order to receive a key press event. If you reimplement this handler, it is very important that you call the base class implementation if you do not act upon the key. The default implementation closes popup widgets if the user presses the key sequence for QKeySequence:: Cancel typically the Escape key.
Otherwise the event is ignored, so that the widget's parent can interpret it. This event handler, for event event , can be reimplemented in a subclass to receive key release events for the widget. A widget must accept focus initially and have focus in order to receive a key release event.
See also keyPressEvent , QEvent:: See also grabMouse and mouseGrabber. Returns the layout manager that is installed on this widget, or 0 if no layout manager is installed.
The layout manager sets the geometry of the widget's children that have been added to the layout. See also setLayout , sizePolicy , and Layout Management.
This event handler can be reimplemented in a subclass to receive widget leave events which are passed in the event parameter. See also enterEvent , mouseMoveEvent , and event. After this call the widget will be visually behind and therefore obscured by any overlapping sibling widgets.
See also raise and stackUnder. Translates the widget coordinate pos from the coordinate system of parent to this widget's coordinate system. The parent must not be 0 and must be a parent of the calling widget.
Translates the widget coordinate pos to the coordinate system of parent. Translates the widget coordinate pos to global screen coordinates. For example, mapToGlobal QPoint 0,0 would give the global coordinates of the top-left pixel of the widget. Returns the mask currently set on a widget.
If no mask is set the return value will be an empty region. See also setMask , clearMask , QRegion:: Internal implementation of the virtual QPaintDevice:: This event handler, for event event , can be reimplemented in a subclass to receive mouse double click events for the widget. The widget will also receive mouse press and mouse release events in addition to the double click event. It is up to the developer to ensure that the application interprets these events correctly.
See also grabMouse and keyboardGrabber. This event handler, for event event , can be reimplemented in a subclass to receive mouse move events for the widget. If mouse tracking is switched off, mouse move events only occur if a mouse button is pressed while the mouse is being moved.
If mouse tracking is switched on, mouse move events occur even if no mouse button is pressed. For press and release events, the position is usually the same as the position of the last mouse move event, but it might be different if the user's hand shakes. This is a feature of the underlying window system, not Qt.
If you want to show a tooltip immediately, while the mouse is moving e. Then, to ensure that the tooltip is updated immediately, you must call QToolTip:: This event handler, for event event , can be reimplemented in a subclass to receive mouse press events for the widget.
If you create new widgets in the mousePressEvent the mouseReleaseEvent may not end up where you expect, depending on the underlying window system or X11 window manager , the widgets' location and maybe more.
The default implementation implements the closing of popup widgets when you click outside the window. For other widget types it does nothing. This event handler, for event event , can be reimplemented in a subclass to receive mouse release events for the widget. This event handler can be reimplemented in a subclass to receive widget move events which are passed in the event parameter.
When the widget receives this event, it is already at the new position. The old position is accessible through QMoveEvent:: See also resizeEvent , event , move , and QMoveEvent. This special event handler can be reimplemented in a subclass to receive native platform events identified by eventType which are passed in the message parameter.
In your reimplementation of this function, if you want to stop the event being handled by Qt, return true and set result. If you return false, this native event is passed back to Qt, which translates the event into a Qt event and sends it to the widget.
Events are only delivered to this event handler if the widget is has a native Window handle. This function superseedes the event filter functions x11Event , winEvent and macEvent of Qt 4. Returns the native parent for this widget, i.
Note that this function should not be called explicitly by the user, since it's meant for reimplementation purposes only. The function is called by Qt internally, and the default implementation may not always return a valid pointer. This event handler can be reimplemented in a subclass to receive paint events passed in event. A paint event is a request to repaint all or part of a widget. It can happen for one of the following reasons:.
Many widgets can simply repaint their entire surface when asked to, but some slow widgets need to optimize by painting only the requested region: This speed optimization does not change the result, as painting is clipped to that region during event processing. Qt also tries to speed up painting by merging multiple paint events into one. When update is called several times or the window system sends several paint events, Qt merges these events into one event with a larger region see QRegion:: The repaint function does not permit this optimization, so we suggest using update whenever possible.
When the paint event occurs, the update region has normally been erased, so you are painting on the widget's background. The background can be set using setBackgroundRole and setPalette.
Generally, you should refrain from calling update or repaint inside a paintEvent. For example, calling update or repaint on children inside a paintEvent results in undefined behavior; the child may or may not get a paint event.
If you are using a custom paint engine without Qt's backingstore, Qt:: When using activateWindow , you can call this function to ensure that the window is stacked on top. See also lower and stackUnder.
See also grabKeyboard , grabMouse , and releaseMouse. See also grabMouse , grabKeyboard , and releaseKeyboard. Removes the shortcut with the given id from Qt's shortcut system. The widget will no longer receive QEvent:: Shortcut events for the shortcut's key sequence unless it has other shortcuts with the same key sequence. You should not normally need to use this function since Qt's shortcut system removes shortcuts automatically when their parent widget is destroyed.
It is best to use QAction or QShortcut to handle shortcuts, since they are easier to use than this low-level function. Note also that this is an expensive operation. See also grabShortcut and setShortcutEnabled. See also insertAction , actions , and insertAction. Renders the sourceRegion of this widget into the target using renderFlags to determine how to render.
Rendering starts at targetOffset in the target. If sourceRegion is a null region, this function will use QWidget:: Ensure that you call QPainter:: Renders the widget into the painter 's QPainter:: The painter must be active.
On macOS the widget will be rendered into a QPixmap and then drawn by the painter. Repaints the widget directly by calling paintEvent immediately, unless updates are disabled or the widget is hidden. We suggest only using repaint if you need an immediate repaint, for example during animation. In almost all circumstances update is better, as it permits Qt to optimize for speed and minimize flicker.
If you call repaint in a function which may itself be called from paintEvent , you may get infinite recursion. The update function never causes recursion. See also update , paintEvent , and setUpdatesEnabled. If w is negative, it is replaced with width - x , and if h is negative, it is replaced width height - y. This event handler can be reimplemented in a subclass to receive widget resize events which are passed in the event parameter.
When resizeEvent is called, the widget already has its new geometry. The old size is accessible through QResizeEvent:: The widget will be erased and receive a paint event immediately after processing the resize event. No drawing need be or should be done inside this handler. Restores the geometry and state of top-level widgets stored in the byte array geometry.
Returns true on success; otherwise returns false. If the restored geometry is off-screen, it will be modified to be inside the available screen geometry. To restore geometry saved using QSettings , you can use code like this:. See also restoreGeometry , QMainWindow:: Scrolls the widget including its children dx pixels to the right and dy downward. Both dx and dy may be negative. After scrolling, the widgets will receive paint events for the areas that need to be repainted.
For widgets that Qt knows to be opaque, this is only the newly exposed parts. For example, if an opaque widget is scrolled 8 pixels to the left, only an 8-pixel wide stripe at the right edge needs updating. Since widgets propagate the contents of their parents by default, you need to set the autoFillBackground property, or use setAttribute to set the Qt:: For widgets that use contents propagation, a scroll will cause an update of the entire scroll area.
See also Transparency and Double Buffering. Sets the attribute attribute on this widget if on is true; otherwise clears the attribute. If role is QPalette:: NoRole , then the widget inherits its parent's background role. Note that styles are free to choose any color from the palette. You can modify the palette or set a style sheet if you don't achieve the result you want with setBackgroundRole.
See also backgroundRole and foregroundRole. This corresponds to setBaseSize QSize basew , baseh. Sets the widgets base size to width basew and height baseh. Sets the margins around the contents of the widget to have the sizes left , top , right , and bottom.
The margins are used by the layout system, and may be used by subclasses to specify the area to draw in e. See also contentsMargins , contentsRect , and getContentsMargins.
The setContentsMargins function sets the margins around the widget's contents. Sets the margins around the contents of the widget to have the sizes determined by margins. See also contentsRect and getContentsMargins. If enable is true, make this widget have edit focus, in which case Qt:: See also hasEditFocus and QApplication:: Sets both the minimum and maximum heights of the widget to h without changing the widths.
Sets both the minimum and maximum sizes of the widget to s , thereby preventing it from ever growing or shrinking. Alternatively, if you want the widget to have a fixed size based on its contents, you can call QLayout:: See also maximumSize and minimumSize. Sets both the minimum and maximum width of the widget to w without changing the heights.
Gives the keyboard input focus to this widget or its focus proxy if this widget or one of its parents is the active window. The reason argument will be passed into any focus event sent from this function, it is used to give an explanation of what caused the widget to get focus. If the window is not active, the widget will be given the focus when the window becomes active.
First, a focus about to change event is sent to the focus widget if any to tell it that it is about to lose the focus. Then focus is changed, a focus out event is sent to the previous focus item and a focus in event is sent to the new item to tell it that it just received the focus. Nothing happens if the focus in and focus out widgets are the same. On embedded platforms, setFocus will not cause an input panel to be opened by the input method.
If you want this to happen, you have to send a QEvent:: RequestSoftwareInputPanel event to the widget yourself. If you call setFocus in a function which may itself be called from focusOutEvent or focusInEvent , you may get an infinite recursion. Sets the widget's focus proxy to widget w.
If w is 0, the function resets this widget to have no focus proxy. Some widgets can "have focus", but create a child widget, such as QLineEdit , to actually handle the focus. In this case, the widget can set the line edit to be its focus proxy. Specifies the reading direction of the text for vertical progress bars.
Note that whether or not the text is drawn is dependent on the style. Currently CleanLooks and Plastique draw the text. Mac, Windows and WindowsVista style do not.
If this property is true , the progress bar grows in the other direction e. By default, the progress bar is not inverted. See also orientation and layoutDirection. When setting this property, the minimum is adjusted if necessary to ensure that the range remains valid.
If the current value falls outside the new range, the progress bar is reset with reset. When setting this property, the maximum is adjusted if necessary to ensure that the range remains valid. The orientation must be Qt:: Horizontal the default or Qt:: See also invertedAppearance and textDirection. The text returned is the same as the text displayed in the center or in some styles, to the left of the progress bar.
The progress shown in the text may be smaller than the minimum value, indicating that the progress bar is in the "reset" state before any progress is set. In the default implementation, the text either contains a percentage value that indicates the progress so far, or it is blank because the progress bar is in the reset state.
This property holds the reading direction of the text for vertical progress bars. This property has no impact on horizontal progress bars. By default, the reading direction is QProgressBar:: See also orientation and textVisible. Attempting to change the current value to one outside the minimum-maximum range has no effect on the current value. Initialize option with the values from this QProgressBar.
This method is useful for subclasses when they need a QStyleOptionProgressBar , but don't want to fill in all the information themselves. Sets the progress bar's minimum and maximum values to minimum and maximum respectively. The QProgressBar can be set to undetermined state by using setRange 0, 0. See also minimum and maximum. This signal is emitted when the value shown in the progress bar changes.