KDE 4.2 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)
QPixmap | image (self)
bool | isEmpty (self)
QString | mainText (self)
| registerResources (self, QTextDocument document)
| setAutohide (self, bool autohide)
| setImage (self, QPixmap image)
| setImage (self, QIcon icon)
| setMainText (self, QString text)
| setSubText (self, QString text)
| setWindowToPreview (self, WId id)
QString | subText (self)
WId | windowToPreview (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

QPixmap image | ( |  | self ) |

An icon to display

bool isEmpty | ( |  | self ) |

Returns:
  true if all the fields are empty

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

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

Sets the icon to show *

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

Sets the icon to show *

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, |
|  | WId | id
| ) |  |  |

Sets the ID of the window to show a preview for

QString subText | ( |  | self ) |

Elaborates on the mainText

WId windowToPreview | ( |  | self ) |

Id of a window if you want to show a preview

## Enumeration Documentation

ResourceType

Enumerator:

  ImageResource = 0 |
  HtmlResource |
  CssResource |