Agaj ilobretoj
About Kirigami API documentation: use https://api-staging.kde.org/kirigami-index.html for now
Click here to read more
We are aware of issues involving broken links to Kirigami API documentation. We are currently working on a better website to address these issues, porting the API docs where possible.
In its current state, the staging API website under development for Kirigami can be used to access all relevant Kirigami API pages, and it should already work better than the previous API website. You can access the staging API website through https://api-staging.kde.org/kirigami-index.html.
If you'd like to assist us in our efforts to port the API documentation, take a look at our Port API documentation to QDoc metatask.
Dum Kirigami-paĝoj permesas vin facile meti aron da agoj en la paĝokapo, estas tempoj kiam vi eble preferas havi ion pli fleksebla.
Kirigami provizas la komponanton Kirigami.ActionToolBar. Ĝi montras liston de Kirigami.Action objektoj kaj montros kiel eble plej multajn el ili, disponigante superfluan menuon por tiuj, kiuj ne taŭgas. La ActionToolBar estas dinamika kaj movos agojn en kaj el la superflua menuo depende de la grandeco disponebla al ĝi.
Noto
Ĉi tiu paĝo supozas, ke vi konas Kirigami.Action objektojn. Se vi ne estas, vi povas lerni ĉion pri ili en nia komencanta lernilo aŭ en la dediĉita dokumentadopaĝo por ili.Kreante nian unuan ActionToolBar
La aranĝo kaj loko de via Kirigami.ActionToolBar vere dependas de vi, kvankam pro facileco de uzado estas kutime bona ideo aliĝi al UI-konvencioj kaj meti vian ilobreton proksime al la supro. aŭ malsupro de via paĝo kaj havi ĝin disvastigi larĝeco.
Kiel plej multaj aliaj ag-tenantaj komponentoj, Kirigami.ActionToolBar havas actions proprecon. Ni povas asigni tabelon de Kirigami.Action komponantoj al ĉi tiu propreco.
import QtQuick
import QtQuick.Layouts
import QtQuick.Controls as Controls
import org.kde.kirigami as Kirigami
Kirigami.ApplicationWindow {
id: root
title: "ActionToolBar App"
width: 600
height: 400
pageStack.initialPage: Kirigami.Page {
Kirigami.ActionToolBar {
anchors.left: parent.left
anchors.right: parent.right
actions: [
Kirigami.Action {
text: "Beep"
icon.name: "notifications"
onTriggered: showPassiveNotification("BEEP!")
},
Kirigami.Action {
text: "Action Menu"
icon.name: "overflow-menu"
Kirigami.Action {
text: "Deet";
icon.name: "notifications"
onTriggered: showPassiveNotification("DEET!")
}
Kirigami.Action {
text: "Doot";
icon.name: "notifications"
onTriggered: showPassiveNotification("DOOT!")
}
},
Kirigami.Action {
icon.name: "search"
displayComponent: Kirigami.SearchField { }
}
]
}
}
}

ActionToolBar kun sufiĉe da spaco por ĉiuj infanoj

ActionToolBar kun superflua menuo enhavanta infanojn
Vicigo
Defaŭlte, agoj en la ActionToolBar restos vicigitaj. Ĉi tio eble ne estas dezirinda en ĉiuj situacioj. Feliĉe ni povas ŝanĝi ĉi tion per la proprieto alignment. Ni povas agordi ĉi tiun proprecon al gamo da valoroj, sed la tri plej gravaj estas Qt.AlignLeft
, Qt.AlignCenter
, kaj Qt.AlignRight
(kiuj traktas horizontala vicigo. ::Alineado)).
import QtQuick
import QtQuick.Layouts
import QtQuick.Controls as Controls
import org.kde.kirigami as Kirigami
Kirigami.ApplicationWindow {
id: root
title: "ActionToolBar App"
width: 600
height: 400
pageStack.initialPage: Kirigami.Page {
Controls.GroupBox {
anchors.left: parent.left
anchors.right: parent.right
Kirigami.ActionToolBar {
anchors.fill: parent
alignment: Qt.AlignCenter
actions: [
Kirigami.Action {
text: "Beep"
icon.name: "notifications"
onTriggered: showPassiveNotification("BEEP!")
}
]
}
}
}
}