KDE 4.9 PyKDE API Reference

- KDE's Python API

# ToolTipContent Class Reference

`from PyKDE4.plasma import *`

Namespace: Plasma

## Detailed Description

## Enumerations
ResourceType | { ImageResource, HtmlResource, CssResource }
## Methods
| __init__ (self)
| __init__ (self, Plasma.ToolTipContent other)
| __init__ (self, QString mainText, QString subText, QPixmap image=QPixmap())
| __init__ (self, QString mainText, QString subText, QIcon icon)
| addResource (self, Plasma.ToolTipContent.ResourceType type, QUrl path, QVariant resource)
bool | autohide (self)
QGraphicsWidget | graphicsWidget (self)
bool | highlightWindows (self)
QPixmap | image (self)
bool | isClickable (self)
bool | isEmpty (self)
bool | isInstantPopup (self)
QString | mainText (self)
| registerResources (self, QTextDocument document)
| setAutohide (self, bool autohide)
| setClickable (self, bool clickable)
| setGraphicsWidget (self, QGraphicsWidget widget)
| setHighlightWindows (self, bool highlight)
| setImage (self, QPixmap image)
| setImage (self, QIcon icon)
| setInstantPopup (self, bool enabled)
| setMainText (self, QString text)
| setSubText (self, QString text)
| setWindowToPreview (self, long id)
| setWindowsToPreview (self, [long] ids)
QString | subText (self)
long | windowToPreview (self)
[long] | windowsToPreview (self)

## Method Documentation

__init__ | ( |  | self ) |

Creates an empty Content

__init__ | ( | self, |
|  | Plasma.ToolTipContent | other
| ) |  |  |

Copy constructor

__init__ | ( | self, |
|  | QString | mainText,
|  | QString | subText,
|  | QPixmap | image=QPixmap()
| ) |  |  |

Constructor that sets the common fields

__init__ | ( | self, |
|  | QString | mainText,
|  | QString | subText,
|  | QIcon | icon
| ) |  |  |

Constructor that sets the common fields

addResource | ( | self, |
|  | Plasma.ToolTipContent.ResourceType | type,
|  | QUrl | path,
|  | QVariant | resource
| ) |  |  |

Adds a resource that can then be referenced from the text elements using rich text

bool autohide | ( |  | self ) |

Whether or not to autohide the tooltip, defaults to true

QGraphicsWidget graphicsWidget | ( |  | self ) |

the graphicsWidget used for positioning the tooltip, if any

Since:
  4.6

bool highlightWindows | ( |  | self ) |

true if when the mouse will be over a thumbnail the corresponding window will be highlighted by reducing opacity of all the other windows

Since:
  4.4

QPixmap image | ( |  | self ) |

An icon to display

bool isClickable | ( |  | self ) |

Returns:
  true if the tooltip is clickabel

Since:
  4.3

bool isEmpty | ( |  | self ) |

Returns:
  true if all the fields are empty

bool isInstantPopup | ( |  | self ) |

Whether or not the tooltip should popup instantly when the widget is hovered, defaults to false.

Since:
  4.7

QString mainText | ( |  | self ) |

Important information, e.g. the title

registerResources | ( | self, |
|  | QTextDocument | document
| ) |  |  |

Registers all resources with a given document

setAutohide | ( | self, |
|  | bool | autohide
| ) |  |  |

Sets whether or not to autohide the tooltip, defaults to true

setClickable | ( | self, |
|  | bool | clickable
| ) |  |  |

Sets whether or not the tooltip contains clickable content, such as window previews. Defaults to false, or not clickable.

Since:
  4.3

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

Sets an optional graphicsWidget that will be used for positioning the tooltip

Since:
  4.6

setHighlightWindows | ( | self, |
|  | bool | highlight
| ) |  |  |

sets if when the mouse will be over a thumbnail the corresponding window will be highlighted by reducing opacity of all the other windows

Since:
  4.4

setImage | ( | self, |
|  | QPixmap | image
| ) |  |  |

Sets the icon to show

setImage | ( | self, |
|  | QIcon | icon
| ) |  |  |

Sets the icon to show

setInstantPopup | ( | self, |
|  | bool | enabled
| ) |  |  |

Sets whether or not the tooltip should popup instantly when the widget is hovered, defaults to false.

Since:
  4.7

setMainText | ( | self, |
|  | QString | text
| ) |  |  |

Sets the main text which containts important information, e.g. the title

setSubText | ( | self, |
|  | QString | text
| ) |  |  |

Sets text which elaborates on the mainText

setWindowToPreview | ( | self, |
|  | long | id
| ) |  |  |

Sets the ID of the window to show a preview for.

Deprecated:

See also:
  setWindowsToPreview

setWindowsToPreview | ( | self, |
|  | [long] | ids
| ) |  |  |

Sets the IDS of the windows to show a preview for

Since:
  4.3

QString subText | ( |  | self ) |

Elaborates on the mainText

long windowToPreview | ( |  | self ) |

Id of a window if you want to show a preview

Deprecated:

See also:
  windowsToPreview

[long] windowsToPreview | ( |  | self ) |

Ids of a windows if you want to show a preview

Since:
  4.3

## Enumeration Documentation

ResourceType

Enumerator:

  ImageResource = 0 |
  HtmlResource |
  CssResource |