KDE 4.9 PyKDE API Reference

- KDE's Python API

# Dialog Class Reference

`from PyKDE4.plasma import *`

Inherits: QWidget → QObject
Namespace: Plasma

## Detailed Description

Dialog plasma/dialog.h <Plasma/Dialog>

A dialog that uses the Plasma style

Dialog provides a dialog-like widget that can be used to display additional information.

Dialog uses the plasma theme, and usually has no window decoration. It's meant as an interim solution to display widgets as extension to plasma applets, for example when you click on an applet like the devicenotifier or the clock, the widget that is then displayed, is a Dialog.

## Enumerations

ResizeCorner | { NoCorner, NorthEast, SouthEast, NorthWest, SouthWest, All }

## Signals

| dialogResized ()
| dialogVisible (bool status)

## Methods

| __init__ (self, QWidget parent=0, Qt::WindowFlags f=Qt.Window)
| animatedHide (self, Plasma.Direction direction)
| animatedShow (self, Plasma.Direction direction)
Plasma.AspectRatioMode | aspectRatioMode (self)
bool | event (self, QEvent event)
bool | eventFilter (self, QObject watched, QEvent event)
| focusInEvent (self, QFocusEvent event)
| getMinimumResizeLimits (self, int left, int top, int right, int bottom)
QGraphicsWidget | graphicsWidget (self)
| hideEvent (self, QHideEvent event)
bool | inControlArea (self, QPoint point)
bool | isUserResizing (self)
| keyPressEvent (self, QKeyEvent event)
| mouseMoveEvent (self, QMouseEvent event)
| mousePressEvent (self, QMouseEvent event)
| mouseReleaseEvent (self, QMouseEvent event)
| moveEvent (self, QMoveEvent event)
| paintEvent (self, QPaintEvent e)
Plasma.Dialog.ResizeCorners | resizeCorners (self)
| resizeEvent (self, QResizeEvent e)
| setAspectRatioMode (self, Plasma.AspectRatioMode mode)
| setGraphicsWidget (self, QGraphicsWidget widget)
| setMinimumResizeLimits (self, int left, int top, int right, int bottom)
| setResizeHandleCorners (self, Plasma.Dialog.ResizeCorners corners)
| showEvent (self, QShowEvent event)
| syncToGraphicsWidget (self)

## Signal Documentation

dialogResized | ( |  | ) |

Fires when the dialog automatically resizes.

Signal syntax:
  `QObject.connect(source, SIGNAL("dialogResized()"), target_slot)`

dialogVisible | ( | bool | status
| ) |  |  |

Emit a signal when the dialog become visible/invisible

Signal syntax:
  `QObject.connect(source, SIGNAL("dialogVisible(bool)"), target_slot)`

## Method Documentation

__init__ | ( | self, |
|  | QWidget | parent=0,
|  | Qt::WindowFlags | f=Qt.Window
| ) |  |  |

Parameters:

  | parent | the parent widget, for plasmoids, this is usually 0.
  | f | the Qt.WindowFlags, default is to not show a windowborder.

animatedHide | ( | self, |
|  | Plasma.Direction | direction
| ) |  |  |

Causes an animated hide; requires compositing to work, otherwise the dialog will simply hide.

Since:
  4.3

animatedShow | ( | self, |
|  | Plasma.Direction | direction
| ) |  |  |

Causes an animated show; requires compositing to work, otherwise the dialog will simply show.

Since:
  4.3

Plasma.AspectRatioMode aspectRatioMode | ( |  | self ) |

Returns:
  the preferred aspect ratio mode for placement and resizing

Since:
  4.4

bool event | ( | self, |
|  | QEvent | event
| ) |  |  |

bool eventFilter | ( | self, |
|  | QObject | watched,
|  | QEvent | event
| ) |  |  |

focusInEvent | ( | self, |
|  | QFocusEvent | event
| ) |  |  |

getMinimumResizeLimits | ( | self, |
|  | int | left,
|  | int | top,
|  | int | right,
|  | int | bottom
| ) |  |  |

Retrives the minimum resize limits for the dialog

Parameters:

  | left | the screen coordinate that the left may not go beyond; -1 for no limit
  | top | the screen coordinate that the top may not go beyond; -1 for no limit
  | right | the screen coordinate that the right may not go beyond; -1 for no limit
  | bottom | the screen coordinate that the bottom may not go beyond; -1 for no limit

QGraphicsWidget graphicsWidget | ( |  | self ) |

Returns:
  the graphics widget shown in this dialog

hideEvent | ( | self, |
|  | QHideEvent | event
| ) |  |  |

bool inControlArea | ( | self, |
|  | QPoint | point
| ) |  |  |

Convenience method to know whether the point is in a control area (e.g. resize area) or not.

Returns:
  true if the point is in the control area.

bool isUserResizing | ( |  | self ) |

Returns:
  true if currently being resized by the user

keyPressEvent | ( | self, |
|  | QKeyEvent | event
| ) |  |  |

mouseMoveEvent | ( | self, |
|  | QMouseEvent | event
| ) |  |  |

mousePressEvent | ( | self, |
|  | QMouseEvent | event
| ) |  |  |

mouseReleaseEvent | ( | self, |
|  | QMouseEvent | event
| ) |  |  |

moveEvent | ( | self, |
|  | QMoveEvent | event
| ) |  |  |

paintEvent | ( | self, |
|  | QPaintEvent | e
| ) |  |  |

Reimplemented from QWidget

Plasma.Dialog.ResizeCorners resizeCorners | ( |  | self ) |

Convenience method to get the enabled resize corners.

Returns:
  which resize corners are active.

resizeEvent | ( | self, |
|  | QResizeEvent | e
| ) |  |  |

setAspectRatioMode | ( | self, |
|  | Plasma.AspectRatioMode | mode
| ) |  |  |

Sets the preferred aspect ratio mode for placement and resizing

Since:
  4.4

setGraphicsWidget | ( | self, |
|  | QGraphicsWidget | widget
| ) |  |  |

Sets a QGraphicsWidget to be shown as the content in this dialog. The dialog will then set up a QGraphicsView and coordinate geometry with the widget automatically.

Parameters:

  | widget | the QGraphicsWidget to display in this dialog

setMinimumResizeLimits | ( | self, |
|  | int | left,
|  | int | top,
|  | int | right,
|  | int | bottom
| ) |  |  |

Sets the minimum values that each of four sides of the rect may expand to or from

Parameters:

  | left | the screen coordinate that the left may not go beyond; -1 for no limit
  | top | the screen coordinate that the top may not go beyond; -1 for no limit
  | right | the screen coordinate that the right may not go beyond; -1 for no limit
  | bottom | the screen coordinate that the bottom may not go beyond; -1 for no limit

setResizeHandleCorners | ( | self, |
|  | Plasma.Dialog.ResizeCorners | corners
| ) |  |  |

Parameters:

  | corners | the corners the resize handlers should be placed in.

showEvent | ( | self, |
|  | QShowEvent | event
| ) |  |  |

syncToGraphicsWidget | ( |  | self ) |

Adjusts the dialog to the associated QGraphicsWidget's geometry Should not normally need to be called by users of Dialog as Dialog does it automatically. Event compression may cause unwanted delays, however, and so this method may be called to immediately cause a synchronization.

Since:
  4.5

## Enumeration Documentation

ResizeCorner

Use these flags to choose the active resize corners.

Enumerator:

  NoCorner = 0 |
  NorthEast = 1 |
  SouthEast = 2 |
  NorthWest = 4 |
  SouthWest = 8 |
  All = NorthEast|SouthEast|NorthWest|SouthWest |