Я разветвил вилку EQMenu, я изменил внешний вид, но теперь я хотел бы использовать программное обеспечение tts, чтобы сообщить название элемента, поэтому я пишу это, но где ошибка? Я пытаюсь найти способ сделать это, теперь я пытаюсь это сделать:
в меню, в котором логи c были созданы с помощью: tools. js
function tospeak(TextToSpeech) {
var process = require('child_process');
process.exec('/etc/alternatives/tts'+TextToSpeech,function (err,stdout,stderr) {
if (err) {
console.log("\n"+stderr);
} else {
console.log(stdout);
}
});
}
/ etc / альтернативы / tts, чтобы выбрать с различным программным обеспечением tts.
В этом файле это код QML меню:
ItemGridDelegate.qml
-
import "../code/tools.js" as Tools
-
-
PlasmaCore.IconItem {
id: icon
y: showLabel ? (2 * highlightItemSvg.margins.top) : 0
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: showLabel ? undefined : parent.verticalCenter
width: mouseArea.containsMouse ? iconSize*1.25 : iconSize
height: width
animated: false
usesPlasmaTheme: item.GridView.view.usesPlasmaTheme
source: model.decoration
}
PlasmaComponents.Label {
id: label
visible: showLabel
anchors {
top: icon.bottom
topMargin: units.smallSpacing
left: parent.left
leftMargin: highlightItemSvg.margins.left
right: parent.right
rightMargin: highlightItemSvg.margins.right
}
horizontalAlignment: Text.AlignHCenter
elide: Text.ElideRight
wrapMode: Text.NoWrap
font.pointSize: mouseArea.containsMouse ? 26 : 14
text: model.display
Tools.tospeak(model.display.toString());
}
MouseArea {
id: mouseArea
anchors.fill: parent
hoverEnabled: true
}
ItemGridView.qml
-
import "../code/tools.js" as Tools
-
-
id: dropArea
anchors.fill: parent
onDragMove: {
if (!dragEnabled || gridView.animating) {
return;
}
var cPos = mapToItem(gridView.contentItem, event.x, event.y);
var item = gridView.itemAt(cPos.x, cPos.y);
if (item && item != kicker.dragSource && kicker.dragSource && kicker.dragSource.parent == gridView.contentItem) {
item.GridView.view.model.moveRow(dragSource.itemIndex, item.itemIndex);
}
Tools.tospeak(item.itemIndex.toString())
}