forked from qt-creator/qt-creator
Snippets: Feature enhancement start...
Provide an interface so users can create/edit/remove snippets.
This commit is contained in:
120
src/plugins/texteditor/snippets/snippets.xml
Normal file
120
src/plugins/texteditor/snippets/snippets.xml
Normal file
@@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<snippets>
|
||||
<snippet group="C++" trigger="class" id="genericclass">class $name$
|
||||
{
|
||||
public:
|
||||
$name$() {}
|
||||
};</snippet>
|
||||
<snippet group="C++" trigger="class" id="qobjectclass" complement="derived from QObject">class $name$ : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
$name$() {}
|
||||
virtual ~$name$() {}
|
||||
};</snippet>
|
||||
<snippet group="C++" trigger="class" id="qwidgetclass" complement="derived from QWidget">class $name$ : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
$name$() {}
|
||||
virtual ~$name$() {}
|
||||
};</snippet>
|
||||
<snippet group="C++" trigger="class" id="classtemplate" complement="template">template <typename $T$>
|
||||
class $name$
|
||||
{
|
||||
public:
|
||||
$name$() {}
|
||||
};</snippet>
|
||||
<snippet group="C++" trigger="do" id="do">do {
|
||||
|
||||
} while ($condition$);</snippet>
|
||||
<snippet group="C++" trigger="else" id="else" >else {
|
||||
|
||||
}</snippet>
|
||||
<snippet group="C++" trigger="else" id="elsewithif" complement="with if">else if ($condition$) {
|
||||
|
||||
}</snippet>
|
||||
<snippet group="C++" trigger="for" id="for">for (int $var$ = 0; $var$ < $total$; ++$var$) {
|
||||
|
||||
}</snippet>
|
||||
<snippet group="C++" trigger="foreach" id="foreach">foreach ($var$, $container$) {
|
||||
|
||||
}</snippet>
|
||||
<snippet group="C++" trigger="if" id="if">if ($condition$) {
|
||||
|
||||
}</snippet>
|
||||
<snippet group="C++" trigger="if" id="ifandelse" complement="and else">if ($condition$) {
|
||||
|
||||
} else {
|
||||
|
||||
}</snippet>
|
||||
<snippet group="C++" trigger="namespace" id="namespace">namespace $name$ {
|
||||
|
||||
}</snippet>
|
||||
<snippet group="C++" trigger="try" id="trycatch" complement="and catch">try {
|
||||
|
||||
} catch (...) {
|
||||
|
||||
}</snippet>
|
||||
<snippet group="C++" trigger="using" id="usingnamespace" complement="namespace">using namespace $name$;</snippet>
|
||||
<snippet group="C++" trigger="while" id="while">while ($condition$) {
|
||||
|
||||
}</snippet>
|
||||
<snippet group="QML" trigger="property" id="property">property $type$ $name$: $value$</snippet>
|
||||
<snippet group="QML" trigger="Item" id="item">Item {
|
||||
id: $name$
|
||||
}</snippet>
|
||||
<snippet group="QML" trigger="BorderImage" id="borderimage">BorderImage {
|
||||
id: $name$
|
||||
source: "$file$"
|
||||
width: $100$; height: $100$
|
||||
border.left: $5$; border.top: $5$
|
||||
border.right: $5$; border.bottom: $5$
|
||||
}</snippet>
|
||||
<snippet group="QML" trigger="Image" id="image">Image {
|
||||
id: $name$
|
||||
source: "$file$"
|
||||
}</snippet>
|
||||
<snippet group="QML" trigger="Text" id="text">Text {
|
||||
id: $name$
|
||||
text: "$text$"
|
||||
}</snippet>
|
||||
<snippet group="QML" trigger="states" id="states">states: [
|
||||
State {
|
||||
name: "$name$"
|
||||
PropertyChanges {
|
||||
target: $name$
|
||||
$$
|
||||
}
|
||||
}
|
||||
]</snippet>
|
||||
<snippet group="QML" trigger="State" id="state">State {
|
||||
name: "$name$"
|
||||
PropertyChanges {
|
||||
target: $name$
|
||||
$$
|
||||
}
|
||||
}</snippet>
|
||||
<snippet group="QML" trigger="transitions" id="transitions">transitions: [
|
||||
Transition {
|
||||
from: "$name$"
|
||||
to: "$name$"
|
||||
$$
|
||||
}
|
||||
]</snippet>
|
||||
<snippet group="QML" trigger="Transition" id="transition">Transition {
|
||||
from: "$name$"
|
||||
to: "$name$"
|
||||
$$
|
||||
}</snippet>
|
||||
<snippet group="QML" trigger="PropertyChanges" id="propertychanges">PropertyChanges {
|
||||
target: $name$
|
||||
$$
|
||||
}</snippet>
|
||||
<snippet group="QML" trigger="NumberAnimation" id="numberanimationwithtargets" complement="with targets">NumberAnimation { targets: [$name$]; properties: "$name$"; duration: $200$ }</snippet>
|
||||
<snippet group="QML" trigger="NumberAnimation" id="numberanimationwithtarget" complement="with target">NumberAnimation { target: $name$; property: "$name$"; to: $value$; duration: $200$ }</snippet>
|
||||
<snippet group="QML" trigger="PropertyAction" id="propertyactionwithtargets" complement="with targets">PropertyAction { targets: [$name$]; properties: "$name$" }</snippet>
|
||||
<snippet group="QML" trigger="PropertyAction" id="propertyactionwithtarget" complement="with target">PropertyAction { target: $name$; property: "$name$"; value: $value$ }</snippet>
|
||||
<snippet group="QML" trigger="PauseAnimation" id="pauseanimation">PauseAnimation { duration: $200$ }</snippet>
|
||||
<snippet group="QML" trigger="ColorAnimation" id="coloranimation">ColorAnimation { from: $"white"$; to: $"black"$; duration: $200$ }</snippet>
|
||||
</snippets>
|
||||
Reference in New Issue
Block a user