Improve API docs

This commit is contained in:
Sebastian Kügler 2013-04-09 04:02:19 +02:00
parent e7887ee199
commit 3859dbdd07
2 changed files with 16 additions and 10 deletions

View File

@ -23,16 +23,25 @@ import org.kde.plasma.components 2.0 as PlasmaComponents
import org.kde.plasma.extras 2.0 as PlasmaExtras import org.kde.plasma.extras 2.0 as PlasmaExtras
/** /**
* This is a Plasma-themed tooltip. It is rendered in its own window * This is a Plasma-themed tooltip. It is rendered in its own window.
* *
* Example usage: * Example usage:
* @code * @code
* import org.kde.plasma.core 2.0 as PlasmaCore * import org.kde.plasma.core 2.0 as PlasmaCore
* import org.kde.plasma.components 2.0 as PlasmaComponents *
* [...] * [...]
* PlasmaComponents.IconItem { * PlasmaComponents.IconItem {
* PlasmaCore.ToolTip { ... } * ...
* [...] * PlasmaCore.ToolTip {
* mainText: "Tooltip Title"
* subText: "Some explanation."
* iconSource: "plasma"
* // alternatively, you can specify your own component
* // to be loaded when the tooltip shows
* mainComponent: Component {
* YourCustomItem { ... }
* }
* ... }
* } * }
* @endcode * @endcode
* *
@ -40,11 +49,11 @@ import org.kde.plasma.extras 2.0 as PlasmaExtras
MouseArea { MouseArea {
id: tooltip id: tooltip
property string mainText // string property string mainText // title text of the tooltip
property string subText // string property string subText // description text
property string iconSource // icon name property string iconSource // icon name
property string image // string / url to the image property string image // string / url to the image
property Item target: parent property Item target: parent // The item that has the tooltip, defaulting to parent item
property Component mainComponent: tooltipComponent // custom component to create inside the tooltip property Component mainComponent: tooltipComponent // custom component to create inside the tooltip
// private props // private props
@ -76,7 +85,6 @@ MouseArea {
repeat: false repeat: false
interval: 0 interval: 0
onTriggered: { onTriggered: {
//print("Hiding tooltip ...");
tooltipWindow.visible = false; tooltipWindow.visible = false;
tooltipWindow.mainItem.destroy(); tooltipWindow.mainItem.destroy();
} }

View File

@ -67,8 +67,6 @@ public:
bool isVisible() const; bool isVisible() const;
void setVisible(const bool visible); void setVisible(const bool visible);
QPoint popupPosition(QQuickItem *item = 0, Qt::AlignmentFlag alignment=Qt::AlignCenter) ;
Q_SIGNALS: Q_SIGNALS:
void mainItemChanged(); void mainItemChanged();
void visualParentChanged(); void visualParentChanged();