QStatusBar

Create and control progress bar widgets.

This class is a JS wrapper around Qt's QStatusBar class

A QStatusBar provides ability to add and manipulate the status bar of a window.

Example

const { QStatusBar } = require("@nodegui/nodegui");
const progressBar = new QStatusBar();

Hierarchy

NodeWidgetQStatusBarSignals

QStatusBar

Index

Constructors

Properties

Methods

Constructors

constructor

+ new QStatusBar(): QStatusBar

Overrides NodeWidget.constructor

Returns: QStatusBar

+ new QStatusBar(parent: NodeWidget‹any›): QStatusBar

Overrides NodeWidget.constructor

Parameters:

NameType
parentNodeWidget‹any›

Returns: QStatusBar

Properties

_rawInlineStyle

_rawInlineStyle: string = ""

Inherited from QMenu._rawInlineStyle


actions

actions: Set‹QAction

Inherited from QMenu.actions


Optional layout

layout? : NodeLayoutQStatusBarSignals

Inherited from QMenu.layout


native

native: NativeElement

Overrides Component.native


nodeChildren

nodeChildren: Set‹Component

Inherited from Component.nodeChildren


Optional nodeParent

nodeParent? : Component

Inherited from Component.nodeParent


permanentWidgets

permanentWidgets: Set‹NativeElement


type

type: string = "widget"

Inherited from QMenu.type


widgets

widgets: Set‹NativeElement

Methods

activateWindow

activateWindow(): void

Inherited from QMenu.activateWindow

Returns: void


addAction

addAction(action: QAction | string): QAction

Inherited from QMenu.addAction

Parameters:

NameType
actionQAction | string

Returns: QAction


addEventListener

addEventListener<SignalType>(signalType: SignalType, callback: QStatusBarSignals[SignalType]): void

Inherited from EventWidget.addEventListener

Type parameters:

SignalType: keyof QStatusBarSignals

Parameters:

NameTypeDescription
signalTypeSignalTypeSignalType is a signal from the widgets signals interface.
callbackQStatusBarSignals[SignalType]Corresponding callback for the signal as mentioned in the widget's signal interface

Returns: void

void

For example in the case of QPushButton:

const button = new QPushButton();
button.addEventListener('clicked',(checked)=>console.log("clicked"));
// here clicked is a value from QPushButtonSignals interface

addEventListener(eventType: WidgetEventTypes, callback: function): void

Inherited from EventWidget.addEventListener

Parameters:

eventType: WidgetEventTypes

callback: function

For example in the case of QPushButton:

const button = new QPushButton();
button.addEventListener(WidgetEventTypes.HoverEnter,()=>console.log("hovered"));

▸ (event?: NativeRawPointer‹"QEvent"›): void

Parameters:

NameType
event?NativeRawPointer‹"QEvent"›

Returns: void


addPermanentWidget

addPermanentWidget(widget: QWidget, stretch: number): void

Adds the given widget permanently to this status bar, reparenting the widget if it isn't already a child of this QStatusBar object. The stretch parameter is used to compute a suitable size for the given widget as the status bar grows and shrinks. The default stretch factor is 0, i.e giving the widget a minimum of space. Permanently means that the widget may not be obscured by temporary messages. It is is located at the far right of the status bar.

Parameters:

NameTypeDefaultDescription
widgetQWidget-The widget to permanently add to this status bar.
stretchnumber0Used to compute a suitable size for the given widget as the status bar grows and shrinks. The default stretch factor is 0, i.e giving the widget a minimum of space.

Returns: void


addWidget

addWidget(widget: QWidget, stretch: number): void

Adds the given widget to this status bar, reparenting the widget if it isn't already a child of this QStatusBar object. The stretch parameter is used to compute a suitable size for the given widget as the status bar grows and shrinks. The default stretch factor is 0, i.e giving the widget a minimum of space. The widget is located to the far left of the first permanent widget (see addPermanentWidget()) and may be obscured by temporary messages.

Parameters:

NameTypeDefaultDescription
widgetQWidget-The widget to add to this status bar.
stretchnumber0Used to compute a suitable size for the given widget as the status bar grows and shrinks. The default stretch factor is 0, i.e giving the widget a minimum of space.

Returns: void


adjustSize

adjustSize(): void

Inherited from QMenu.adjustSize

Returns: void


clearMessage

clearMessage(): void

Removes any temporary message being shown.

Returns: void


close

close(): boolean

Inherited from QMenu.close

Returns: boolean


currentMessage

currentMessage(): string

Returns the temporary message currently shown, or an empty string if there is no such message.

Returns: string


font

font(): QFont

Inherited from QMenu.font

Returns: QFont


geometry

geometry(): QRect

Inherited from QMenu.geometry

Returns: QRect


getFlexNode

getFlexNode(): FlexNode

Inherited from YogaWidget.getFlexNode

Returns: FlexNode


hasMouseTracking

hasMouseTracking(): boolean

Inherited from QMenu.hasMouseTracking

Returns: boolean


hide

hide(): void

Inherited from QMenu.hide

Returns: void


inherits

inherits(className: string): boolean

Inherited from NodeObject.inherits

Parameters:

NameType
classNamestring

Returns: boolean


insertPermanentWidget

insertPermanentWidget(index: number, widget: QWidget, stretch: number): number

Inserts the given widget at the given index permanently to this status bar, reparenting the widget if it isn't already a child of this QStatusBar object. If index is out of range, the widget is appended (in which case it is the actual index of the widget that is returned). The stretch parameter is used to compute a suitable size for the given widget as the status bar grows and shrinks. The default stretch factor is 0, i.e giving the widget a minimum of space. Permanently means that the widget may not be obscured by temporary messages. It is is located at the far right of the status bar.

Parameters:

NameTypeDefaultDescription
indexnumber-The index at which to insert the given widget permanently.
widgetQWidget-The widget to insert into this status bar permanently.
stretchnumber0Used to compute a suitable size for the given widget as the status bar grows and shrinks. The default stretch factor is 0, i.e giving the widget a minimum of space.

Returns: number


insertWidget

insertWidget(index: number, widget: QWidget, stretch: number): number

Inserts the given widget at the given index to this status bar, reparenting the widget if it isn't already a child of this QStatusBar object. If index is out of range, the widget is appended (in which case it is the actual index of the widget that is returned). The stretch parameter is used to compute a suitable size for the given widget as the status bar grows and shrinks. The default stretch factor is 0, i.e giving the widget a minimum of space. The widget is located to the far left of the first permanent widget (see addPermanentWidget()) and may be obscured by temporary messages.

Parameters:

NameTypeDefaultDescription
indexnumber-The index at which to insert the given widget.
widgetQWidget-The widget to insert into this status bar.
stretchnumber0Used to compute a suitable size for the given widget as the status bar grows and shrinks. The default stretch factor is 0, i.e giving the widget a minimum of space.

Returns: number


isEnabled

isEnabled(): boolean

Inherited from QMenu.isEnabled

Returns: boolean


isSizeGripEnabled

isSizeGripEnabled(): boolean

Determines whether the QSizeGrip in the bottom-right corner of the status bar is enabled

Returns: boolean


isVisible

isVisible(): boolean

Inherited from QMenu.isVisible

Returns: boolean


lower

lower(): void

Inherited from QMenu.lower

Returns: void


move

move(x: number, y: number): void

Inherited from QMenu.move

Parameters:

NameType
xnumber
ynumber

Returns: void


objectName

objectName(): string

Inherited from NodeObject.objectName

Returns: string


pos

pos(): object

Inherited from QMenu.pos

Returns: object

  • x: number

  • y: number


property

property(name: string): QVariant

Inherited from NodeObject.property

Parameters:

NameType
namestring

Returns: QVariant


raise

raise(): void

Inherited from QMenu.raise

Returns: void


removeEventListener

removeEventListener<SignalType>(signalType: SignalType, callback: QStatusBarSignals[SignalType]): void

Inherited from EventWidget.removeEventListener

Type parameters:

SignalType: keyof QStatusBarSignals

Parameters:

NameType
signalTypeSignalType
callbackQStatusBarSignals[SignalType]

Returns: void

removeEventListener(eventType: WidgetEventTypes, callback: function): void

Inherited from EventWidget.removeEventListener

Parameters:

eventType: WidgetEventTypes

callback: function

▸ (event?: NativeRawPointer‹"QEvent"›): void

Parameters:

NameType
event?NativeRawPointer‹"QEvent"›

Returns: void


removeWidget

removeWidget(widget: QWidget): void

Removes the specified widget from the status bar. Note: This function does not delete the widget but hides it. To add the widget again, you must call both the addWidget() and show() functions.

Parameters:

NameTypeDescription
widgetQWidgetThe widget to remove from this status bar.

Returns: void


repaint

repaint(): void

Inherited from QMenu.repaint

Returns: void


repolish

repolish(): void

Inherited from QMenu.repolish

Returns: void


resize

resize(width: number, height: number): void

Inherited from QMenu.resize

Parameters:

NameType
widthnumber
heightnumber

Returns: void


setAttribute

setAttribute(attribute: WidgetAttribute, switchOn: boolean): void

Inherited from QMenu.setAttribute

Parameters:

NameType
attributeWidgetAttribute
switchOnboolean

Returns: void


setContextMenuPolicy

setContextMenuPolicy(contextMenuPolicy: ContextMenuPolicy): void

Inherited from QMenu.setContextMenuPolicy

Parameters:

NameType
contextMenuPolicyContextMenuPolicy

Returns: void


setCursor

setCursor(cursor: CursorShape | QCursor): void

Inherited from QMenu.setCursor

Parameters:

NameType
cursorCursorShape | QCursor

Returns: void


setEnabled

setEnabled(enabled: boolean): void

Inherited from QMenu.setEnabled

Parameters:

NameType
enabledboolean

Returns: void


setFixedSize

setFixedSize(width: number, height: number): void

Inherited from QMenu.setFixedSize

Parameters:

NameType
widthnumber
heightnumber

Returns: void


setFlexNodeSizeControlled

setFlexNodeSizeControlled(isSizeControlled: boolean): void

Inherited from YogaWidget.setFlexNodeSizeControlled

sets whether the widget's size is controlled by someone else (for example a window's size is controlled by its frame when dragged).

Parameters:

NameTypeDescription
isSizeControlledboolean

Returns: void


setFont

setFont(font: QFont): void

Inherited from QMenu.setFont

Parameters:

NameType
fontQFont

Returns: void


setGeometry

setGeometry(x: number, y: number, w: number, h: number): void

Inherited from QMenu.setGeometry

Parameters:

NameType
xnumber
ynumber
wnumber
hnumber

Returns: void


setInlineStyle

setInlineStyle(style: string): void

Inherited from QMenu.setInlineStyle

Parameters:

NameType
stylestring

Returns: void


setLayout

setLayout(parentLayout: NodeLayoutQStatusBarSignals›): void

Inherited from QMenu.setLayout

Parameters:

NameType
parentLayoutNodeLayoutQStatusBarSignals

Returns: void


setMaximumSize

setMaximumSize(maxw: number, maxh: number): void

Inherited from QMenu.setMaximumSize

Parameters:

NameType
maxwnumber
maxhnumber

Returns: void


setMinimumSize

setMinimumSize(minw: number, minh: number): void

Inherited from QMenu.setMinimumSize

Parameters:

NameType
minwnumber
minhnumber

Returns: void


setMouseTracking

setMouseTracking(isMouseTracked: boolean): void

Inherited from QMenu.setMouseTracking

Parameters:

NameType
isMouseTrackedboolean

Returns: void


setNodeParent

setNodeParent(parent?: Component): void

Inherited from Component.setNodeParent

Parameters:

NameType
parent?Component

Returns: void


setObjectName

setObjectName(objectName: string): void

Inherited from QMenu.setObjectName

Overrides NodeObject.setObjectName

Parameters:

NameType
objectNamestring

Returns: void


setProperty

setProperty(name: string, value: QVariantType): boolean

Inherited from NodeObject.setProperty

Parameters:

NameType
namestring
valueQVariantType

Returns: boolean


setSizeGripEnabled

setSizeGripEnabled(enabled: boolean): void

Enables or disables the QSizeGrip in the bottom-right corner of this status bar.

Parameters:

NameTypeDescription
enabledbooleanDetermines if the QSizeGrip should be enabled or disabled.

Returns: void


setStyleSheet

setStyleSheet(styleSheet: string): void

Inherited from QMenu.setStyleSheet

Parameters:

NameType
styleSheetstring

Returns: void


setWindowFlag

setWindowFlag(windowType: WindowType, switchOn: boolean): void

Inherited from QMenu.setWindowFlag

Parameters:

NameType
windowTypeWindowType
switchOnboolean

Returns: void


setWindowIcon

setWindowIcon(icon: QIcon): void

Inherited from QMenu.setWindowIcon

Parameters:

NameType
iconQIcon

Returns: void


setWindowOpacity

setWindowOpacity(opacity: number): void

Inherited from QMenu.setWindowOpacity

Parameters:

NameType
opacitynumber

Returns: void


setWindowState

setWindowState(state: WindowState): void

Inherited from QMenu.setWindowState

Parameters:

NameType
stateWindowState

Returns: void


setWindowTitle

setWindowTitle(title: string): void

Inherited from QMenu.setWindowTitle

Parameters:

NameType
titlestring

Returns: void


show

show(): void

Inherited from QMenu.show

Returns: void


showFullScreen

showFullScreen(): void

Inherited from QMenu.showFullScreen

Returns: void


showMaximized

showMaximized(): void

Inherited from QMenu.showMaximized

Returns: void


showMessage

showMessage(message: string, timeout: number): void

Hides the normal status indications and displays the given message for the specified number of milli-seconds (timeout). If timeout is 0 (default), the message remains displayed until the clearMessage() slot is called or until the showMessage() slot is called again to change the message. Note that showMessage() is called to show temporary explanations of tool tip texts, so passing a timeout of 0 is not sufficient to display a permanent message.

Parameters:

NameTypeDefaultDescription
messagestring-The message to display.
timeoutnumber0The number of milliseconds to display the message.

Returns: void


showMinimized

showMinimized(): void

Inherited from QMenu.showMinimized

Returns: void


showNormal

showNormal(): void

Inherited from QMenu.showNormal

Returns: void


size

size(): QSize

Inherited from QMenu.size

Returns: QSize


styleSheet

styleSheet(): string

Inherited from QMenu.styleSheet

Returns: string


testAttribute

testAttribute(attribute: WidgetAttribute): boolean

Inherited from QMenu.testAttribute

Parameters:

NameType
attributeWidgetAttribute

Returns: boolean


update

update(): void

Inherited from QMenu.update

Returns: void


updateGeometry

updateGeometry(): void

Inherited from QMenu.updateGeometry

Returns: void


windowOpacity

windowOpacity(): number

Inherited from QMenu.windowOpacity

Returns: number


windowState

windowState(): number

Inherited from QMenu.windowState

Returns: number


windowTitle

windowTitle(): string

Inherited from QMenu.windowTitle

Returns: string