PopupPage

Search for usage in LXR

Inheritance diagram for PopupPage:

Properties

alias actionBar
 
list< Actionactions
 
bool autoClose
 
bool closeButtonVisible
 
alias flickable
 
alias footBar
 
alias headBar
 
int horizontalScrollBarPolicy
 
alias page
 
bool persistent
 
alias scrollable
 
alias scrollView
 
alias stack
 
alias title
 
int verticalScrollBarPolicy
 

Signals

void closeTriggered ()
 

Public Member Functions

void alert (message, level)
 
- Public Member Functions inherited from QtQuick.Controls.Popup
void aboutToHide ()
 
void aboutToShow ()
 
void close ()
 
void closed ()
 
 forceActiveFocus (enumeration reason)
 
void open ()
 
void opened ()
 

Detailed Description

A QQC2 Popup with extra built-in features, such as a snapping surface, scrollable contents, and action buttons.

Since
org.mauikit.controls 1.0

This control inherits from QQC2 Popup, to checkout its inherited properties refer to the Qt Docs.

The image depicts the control a floating VS snapped surface

Structure

The inner container is handled by a MauiKit Page, and this can be accessed via the alias property page - which means this control can have a header and footer bar, and all the other Page features.

See also
page

By default the children content is positioned into a MauiKit ScrollColumn, that's scrollable. If it's desired, this can be avoided by placing the children manually, using the property stack. This way any other element can be positioned manually using the Layout attached properties.

See also
stack
Note
The stack children are positioned using a ColumnLayout.

Features

Snapping

The Popup can snap to the full window area on constrained spaces. To allow this behavior there a few steps to look after, first make hint: 1and set persistent: true. ScrollColumn#notes Notes

See also
persistent

Scrollable Layout

By default the children content of this element will be placed on a MauiKit ScrollColumn, which allows the content to be scrollable/flickable when its implicit height is bigger than the actual popup area. To position the children content use the implicitHeight and the Layout attached properties, such as Layout.fillWidth.

See also
content
ScrollColumn

Action Buttons

The regular QQC2 Popup control does not have support for setting standard action buttons like the Dialog controls does; but this control allows it. The action buttons will be styled in the same manner as the Dialog buttons, but the actions here are added differently. To set the actions, use the actions property.

See also
actions
Maui.PopupPage
{
id: _popupPage
title: "Title"
persistent: true
hint: 1
Rectangle
{
implicitHeight: 200
Layout.fillWidth: true
color: "purple"
}
Rectangle
{
implicitHeight: 200
Layout.fillWidth: true
color: "orange"
}
Rectangle
{
implicitHeight: 200
Layout.fillWidth: true
color: "yellow"
}
{
text: "Action1"
},
{
text: "Action2"
}
]
}
bool persistent
Whether the dialog should be closed when it loses focus or not.
list< Action > actions
List of actions to be added to the bottom section as buttons.
alias title

Notes

Some properties have been obscure by the Maui Style layer. The style layer adds some extra properties to the Popup control:

  • filling : bool Whether the popup area should be style as if filling the whole window area.
  • maxWidth : int The maximum width the popup area can have. If the window width space becomes smaller then the popup area, then it will be resized to fit. Or if the hint: 1 then it will snap to fill the whole window area.
  • maxHeight : int The maximum height the popup area can have. If the window height space becomes smaller then the popup area, then it will be resized to fit. Or if the hint: 1 then it will snap to fill the whole window area. -hint : double Determines the resizing final size of the popup area when it reaches the maxWidth or maxHeight constrains. For example a 1 value means the popup area will be resize to fill the window available space, but a 0.5 value means it will be conserving a margin when resized of 25% at left and right sides.
  • heightHint : double By default this is bind to the hint value.
  • widthHint : double By default this is bind to the hint value.

You can find a more complete example at this link.

Definition at line 118 of file PopupPage.qml.

Property Documentation

◆ actionBar

alias PopupPage::actionBar
read

The GridLayout handling the bottom part of action buttons added via the actions property.

Remarks
This property is read-only

Definition at line 224 of file PopupPage.qml.

◆ actions

list<Action> PopupPage::actions
read

List of actions to be added to the bottom section as buttons.

Definition at line 218 of file PopupPage.qml.

◆ autoClose

bool PopupPage::autoClose
read

Whether the control should be closed automatically after the close button is pressed.

If this is set to false, then the closeTriggered will be emitted instead. This is useful if a conformation action needs to take place before closing the control. By default this is set to true.

Definition at line 214 of file PopupPage.qml.

◆ closeButtonVisible

bool PopupPage::closeButtonVisible
read

Whether the close button is visible.

By default this is bind to the persistent value.

See also
persistent.

Definition at line 186 of file PopupPage.qml.

◆ flickable

alias PopupPage::flickable
read
See also
ScrollColumn::flickable
Remarks
This property is read-only

Definition at line 191 of file PopupPage.qml.

◆ footBar

alias PopupPage::footBar
read
See also
Page::footBar

Definition at line 176 of file PopupPage.qml.

◆ headBar

alias PopupPage::headBar
read
See also
Page::headBar

Definition at line 180 of file PopupPage.qml.

◆ horizontalScrollBarPolicy

int PopupPage::horizontalScrollBarPolicy
read

The policy for the scroll view horizontal scroll bar.

By default this is set to ScrollBar.AlwaysOff.

Definition at line 207 of file PopupPage.qml.

◆ page

alias PopupPage::page
read

An alias to the MauiKit Page, which is the main container of this control.

Remarks
This property is read-only

It is exposed to allow access to the Page properties.

See also
Page

Definition at line 172 of file PopupPage.qml.

◆ persistent

bool PopupPage::persistent
read

Whether the dialog should be closed when it loses focus or not.

If it is marked as persistent a close button is shown in the header bar, other wise the header bar is hidden if there is not more elements on it. By default this is set to true.

Definition at line 164 of file PopupPage.qml.

◆ scrollable

alias PopupPage::scrollable
read

Default children content will be added to a scrollable ColumnLayout.

Remarks
This is the default property

When adding a item keep on mind that to correctly have the scrollable behavior the item must have an implicit height set. And the positioning should be handled via the Layout attached properties.

Definition at line 138 of file PopupPage.qml.

◆ scrollView

alias PopupPage::scrollView
read

An alias to the MauiKit ScrollColumn handling the scrollable content.

Remarks
This property is read-only

Definition at line 197 of file PopupPage.qml.

◆ stack

alias PopupPage::stack
read

To skip the default scrollable-layout behavior, there is a stack overlay component to which items can be added, this is also controlled by a ColumnLayout, but it is not scrollable.

Maui.PopupPage
{
stack: Rectangle
{
Layout.fillWidth: true
Layout.fillHeight: true
Layout.preferredHeight: 800
}
}
alias stack
To skip the default scrollable-layout behavior, there is a stack overlay component to which items can...

Definition at line 154 of file PopupPage.qml.

◆ title

alias PopupPage::title
read
See also
Page::title

Definition at line 158 of file PopupPage.qml.

◆ verticalScrollBarPolicy

int PopupPage::verticalScrollBarPolicy
read

The policy for the scroll view vertical scroll bar.

By default this is set to ScrollBar.AsNeeded.

Definition at line 202 of file PopupPage.qml.

Member Function Documentation

◆ alert()

void PopupPage::alert ( message ,
level  )

Sends an inline alert notification that is displayed in the dialog.

Parameters
messageThe text for the message. Keep it short if possible.
levelDepending on the level the color may differ. The levels are:
  • 0 positive
  • 1 neutral
  • 2 negative

◆ closeTriggered

void PopupPage::closeTriggered ( )
signal

Emitted when the close button has been clicked and the autoClose property has been disabled.

See also
autoClose
closeButtonVisible

The documentation for this class was generated from the following file:
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Dec 6 2024 12:06:04 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.