PlasmaQuick::Dialog Class

Header: #include <Dialog>
CMake: find_package(PlasmaQuick REQUIRED)
target_link_libraries(mytarget PRIVATE Plasma::PlasmaQuick)
Inherits: QQuickWindow and

Properties

Public Functions

QQuickItem *appletInterface() const
PlasmaQuick::Dialog::BackgroundHints backgroundHints() const
int floating() const
bool hideOnWindowDeactivate() const
QObject *inset() const
bool isOutputOnly() const
bool isVisible() const
Plasma::Types::Location location() const
QQuickItem *mainItem() const
QObject *margins() const
virtual QPoint popupPosition(QQuickItem *item, const QSize &size)
void setAppletInterface(QQuickItem *appletInterface)
void setBackgroundHints(PlasmaQuick::Dialog::BackgroundHints hints)
void setFloating(int floating)
void setFramelessFlags(Qt::WindowFlags flags)
void setHideOnWindowDeactivate(bool hide)
void setLocation(Plasma::Types::Location location)
void setMainItem(QQuickItem *mainItem)
void setOutputOnly(bool outputOnly)
void setType(PlasmaQuick::Dialog::WindowType type)
void setVisible(bool visible)
void setVisualParent(QQuickItem *visualParent)
PlasmaQuick::Dialog::WindowType type() const
QQuickItem *visualParent() const

Signals

Protected Functions

virtual void adjustGeometry(const QRect &geom)

Detailed Description

Dialog creates a Plasma themed top level window that can contain any QML component.

It can be automatically positioned relative to a visual parent The dialog will resize to the size of the main item

 import QtQuick 2.0
 import org.kde.plasma.core as PlasmaCore
 Item {
    PlasmaCore.Dialog {
         visible: true
         mainItem: Item {
             width: 500
             height: 500

             Text {
                 anchors.centerIn: parent
                 color: "red"
                 text: "text"
             }
         }
     }
}

Import Statement:

import org.kde.plasma.core

Property Documentation

appletInterface : QQuickItem*

This property holds a pointer to the AppletInterface used by an applet. It is null when the dialog is not used for an applet.

Access functions:

QQuickItem *appletInterface() const
void setAppletInterface(QQuickItem *appletInterface)

Notifier signal:

void appletInterfaceChanged()

backgroundHints : BackgroundHints

This property holds how (and if at all) the dialog should draw its own background or if it is complete responsibility of the content item to render a background. Note that in case of NoBackground it loses kwin side shadows and blur

Access functions:

PlasmaQuick::Dialog::BackgroundHints backgroundHints() const
void setBackgroundHints(PlasmaQuick::Dialog::BackgroundHints hints)

Notifier signal:

void backgroundHintsChanged()

flags : Qt::WindowFlags

This property holds the window flags of the window. The window flags control the window's appearance in the windowing system, whether it's a dialog, popup, or a regular window, and whether it should have a title bar, etc. Regardless to what the user sets, the flags will always have the FramelessWindowHint flag set

Access functions:

void setFramelessFlags(Qt::WindowFlags flags)

Notifier signal:

void flagsChanged()

floating : int

This property holds by how much the applet should be floating even if the location is set to a certain screen side; if this value is positive, the dialog will draw all four sides and maintain the required distance from the screen borders.

Access functions:

int floating() const
void setFloating(int floating)

Notifier signal:

void floatingChanged()

hideOnWindowDeactivate : bool

Whether the dialog should be hidden when the dialog loses focus.

The default value is false.

Access functions:

bool hideOnWindowDeactivate() const
void setHideOnWindowDeactivate(bool hide)

Notifier signal:

void hideOnWindowDeactivateChanged()

[read-only] inset : QObject* const

Margins where the dialog background actually starts, excluiding things like shadows or borders

Access functions:

QObject *inset() const

See also DialogMargins.

location : Plasma::Types::Location

Plasma Location of the dialog window.

Useful if this dialog is a popup for a panel.

Access functions:

Plasma::Types::Location location() const
void setLocation(Plasma::Types::Location location)

Notifier signal:

void locationChanged()

mainItem : QQuickItem*

The main QML item that will be displayed in the Dialog

Access functions:

QQuickItem *mainItem() const
void setMainItem(QQuickItem *mainItem)

Notifier signal:

void mainItemChanged()

[read-only] margins : QObject* const

Margins of the dialog around the mainItem.

Access functions:

QObject *margins() const

See also DialogMargins.

outputOnly : bool

Whether the dialog is output only. Default value is false. If it is true the dialog does not accept input and all pointer events are not accepted, thus the dialog is click through.

This property is currently only supported on the X11 platform. On any other platform the property has no effect.

Access functions:

bool isOutputOnly() const
void setOutputOnly(bool outputOnly)

Notifier signal:

void outputOnlyChanged()

type : WindowType

Type of the window

Access functions:

PlasmaQuick::Dialog::WindowType type() const
void setType(PlasmaQuick::Dialog::WindowType type)

Notifier signal:

void typeChanged()

visible : bool

Access functions:

bool isVisible() const
void setVisible(bool visible)

Notifier signal:

void visibleChangedProxy()

visualParent : QQuickItem*

The main QML item that will be displayed in the Dialog

Access functions:

QQuickItem *visualParent() const
void setVisualParent(QQuickItem *visualParent)

Notifier signal:

void visualParentChanged()

Member Function Documentation

[virtual protected] void Dialog::adjustGeometry(const QRect &geom)

Sets the dialog position.

Subclasses may change it. ToolTipDialog adjusts the position in an animated way.

[virtual] QPoint Dialog::popupPosition(QQuickItem *item, const QSize &size)

Returns the suggested screen position for the popup.

item The item the popup has to be positioned relatively to. If null, the popup will be positioned in the center of the window.

size The size that the popup will have, which influences the final position.

[signal] void Dialog::windowDeactivated()

Emitted when the hideOnWindowDeactivate property is true and this dialog lost focus to a window that is neither a parent dialog to nor a child dialog of this dialog.