Qt Components Hildon  0.20
QML components for Maemo5 with Hildon styling.
 All Classes Functions Properties Groups Pages
Signals | Properties | List of all members
HomescreenWidget Class Reference

A desktop widget displayed on the homescreen. More...

Signals

void settingsRequested ()
 Emitted when the user requests settings.

Properties

list< QDeclarativeItem > children
 The visual children of the widget.
list< object > data
 The children of the widget.
bool isOnCurrentHomescreen
 Whether the widget is visible on the current homescreen.
string pluginId
 The plugin id of the widget.
bool settingsAvailable
 Whether the widget has settings available.
int writePipe
 The write pipe of the widget.

Detailed Description

A desktop widget displayed on the homescreen.

Other than its appearance on the homescreen, HomescreenWidget is used like any other top-level component such as Dialog or Window.

import QtQuick 1.0
import org.hildon.components 1.0
import org.hildon.desktop 1.0
HomescreenWidget {
id: widget
property Dialog settingsDialog
width: Math.max(100, widgetLabel.width * 2)
height: widgetLabel.height * 2
Rectangle {
id: widgetBackground
anchors {
fill: parent
margins: 1
}
color: "#000"
radius: 25
opacity: 0.5
smooth: true
}
id: widgetLabel
anchors.centerIn: parent
text: qsTr("Widget Example")
}
Component {
id: dialogComponent
id: dialog
title: qsTr("New text")
height: column.height + platformStyle.paddingMedium
Column {
id: column
anchors {
left: parent.left
right: button.left
bottom: parent.bottom
}
width: parent.width
text: qsTr("Please enter a new text:")
}
id: textField
width: parent.width
}
}
Button {
id: button
anchors {
right: parent.right
bottom: parent.bottom
}
text: qsTr("Done")
enabled: textField.text != ""
onClicked: dialog.accept()
}
onAccepted: widgetLabel.text = textField.text
onStatusChanged: {
if (status == DialogStatus.Open) {
textField.text = widgetLabel.text;
textField.forceActiveFocus();
}
}
}
}
onSettingsRequested: {
if (!settingsDialog) {
settingsDialog = dialogComponent.createObject(widget);
}
settingsDialog.open();
}
}

Member Function Documentation

void HomescreenWidget::settingsRequested ( )
signal

Emitted when the user requests settings.

See Also
settingsAvailable

Property Documentation

bool HomescreenWidget::settingsAvailable
readwrite

Whether the widget has settings available.

The default value is false.

See Also
settingsRequested()