164 lines
9.4 KiB
HTML
164 lines
9.4 KiB
HTML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
<!-- CSShellCommand.qml -->
|
|
<title>CSShellCommand QML Type | CSDataQuick Documentation 1.2</title>
|
|
<link rel="stylesheet" type="text/css" href="style/online.css" />
|
|
<script type="text/javascript">
|
|
(function (i, s, o, g, r, a, m) {
|
|
i['GoogleAnalyticsObject'] = r; i[r] = i[r] || function () {
|
|
(i[r].q = i[r].q || []).push(arguments)
|
|
}, i[r].l = 1 * new Date(); a = s.createElement(o),
|
|
m = s.getElementsByTagName(o)[0]; a.async = 1; a.src = g; m.parentNode.insertBefore(a, m)
|
|
})(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga');
|
|
|
|
ga('create', 'UA-24645639-4', 'qt.io');
|
|
ga('set', 'forceSSL', true);
|
|
ga('send', 'pageview');
|
|
</script>
|
|
</head>
|
|
<body>
|
|
<div class="header" id="header">
|
|
<header id="navbar" class="">
|
|
</header>
|
|
</div>
|
|
<div class="main">
|
|
<div class="main-rounded">
|
|
<div class="navigationbar">
|
|
<ul class="sub-navigation">
|
|
<li><a href="../../CSDataQuick.html">Home</a></li>
|
|
<li><a href="../docs.html" class="active">Documentation</a></li>
|
|
<li><a href="http://github.com/xiaoqiangwang/CSDataQuick/">Code</a></li>
|
|
<li><a href="https://github.com/xiaoqiangwang/CSDataQuick/issues/">Bug Reports</a></li>
|
|
</ul>
|
|
<div id="main_title_bar">
|
|
<h1>CSDataQuick Documentation</h1>
|
|
<div class="search_bar">
|
|
<script>
|
|
(function() {
|
|
var cx = '001693341472456439948:u9v0snkru3q';
|
|
var gcse = document.createElement('script');
|
|
gcse.type = 'text/javascript';
|
|
gcse.async = true;
|
|
gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') + '//www.google.com/cse/cse.js?cx=' + cx;
|
|
var s = document.getElementsByTagName('script')[0];
|
|
s.parentNode.insertBefore(gcse, s);
|
|
})();
|
|
</script>
|
|
<gcse:searchbox-only resultsUrl="search-results.html"></gcse:searchbox-only>
|
|
</div></div>
|
|
<ul>
|
|
<li><a href="index.html">CSDataQuick Documentation</a></li>
|
|
<li><a href="csdataquick-qmlmodules.html">QML Types</a></li>
|
|
<li>CSShellCommand QML Type</li>
|
|
</ul>
|
|
</div>
|
|
<div class="content">
|
|
<div class="line">
|
|
<div class="content mainContent">
|
|
<div class="sidebar">
|
|
<div class="toc">
|
|
<h3><a name="toc">Contents</a></h3>
|
|
<ul>
|
|
<li class="level1"><a href="qml-csdataquick-components-csshellcommand.html#properties">Properties</a></li>
|
|
<li class="level1"><a href="qml-csdataquick-components-csshellcommand.html#details">Detailed Description</a></li>
|
|
</ul>
|
|
</div>
|
|
<div class="sidebar-content" id="sidebar-content"></div></div>
|
|
<div class="context">
|
|
<h1 class="title">CSShellCommand QML Type</h1>
|
|
<span class="subtitle"></span>
|
|
<!-- $$$CSShellCommand-brief -->
|
|
<p>Run shell commands. <a href="qml-csdataquick-components-csshellcommand.html#details">More...</a></p>
|
|
<!-- @@@CSShellCommand -->
|
|
<div class="table"><table class="alignedsummary">
|
|
<tr><td class="memItemLeft rightAlign topAlign"> Import Statement:</td><td class="memItemRight bottomAlign"> import CSDataQuick.Components 1.0</td></tr><tr><td class="memItemLeft rightAlign topAlign"> Inherits:</td><td class="memItemRight bottomAlign"> <p><a href="qml-csdataquick-components-baseitem.html">BaseItem</a></p>
|
|
</td></tr></table></div><ul>
|
|
<li><a href="qml-csdataquick-components-csshellcommand-members.html">List of all members, including inherited members</a></li>
|
|
</ul>
|
|
<a name="properties"></a>
|
|
<h2 id="properties">Properties</h2>
|
|
<ul>
|
|
<li class="fn"><b><b><a href="qml-csdataquick-components-csshellcommand.html#font-prop">font</a></b></b> : font</li>
|
|
<li class="fn"><b><b><a href="qml-csdataquick-components-csshellcommand.html#fontSizeMode-prop">fontSizeMode</a></b></b> : enumeration</li>
|
|
<li class="fn"><b><b><a href="qml-csdataquick-components-csshellcommand.html#label-prop">label</a></b></b> : string</li>
|
|
<li class="fn"><b><b><a href="qml-csdataquick-components-csshellcommand.html#model-prop">model</a></b></b> : var</li>
|
|
</ul>
|
|
<!-- $$$CSShellCommand-description -->
|
|
<a name="details"></a>
|
|
<h2 id="details">Detailed Description</h2>
|
|
<p>It is a menu button that usually has a graphic consisting of an “!” and a <a href="qml-csdataquick-components-csshellcommand.html#label-prop">label</a>. The <a href="qml-csdataquick-components-csshellcommand.html#model-prop">model</a> denote the commands that can be executed. If there is only one command specified in the menu, then the “!” and/or label appear in the middle of the button, and the command is activated immediately without bringing up a menu. If there is more than one item on the menu, the “!” and/or label are at the left of the button.</p>
|
|
<p>It is not activated until the button is released, so you can depress the button to check if there is more than one menu item or not, then abort by releasing the button away from the Shell Command.</p>
|
|
<p>If the command contains a “?”, then the rest of the command will be ignored, and a dialog box will prompt the user to complete (or otherwise edit) the command.</p>
|
|
<pre class="qml"><span class="type"><a href="qml-csdataquick-components-csshellcommand.html">CSShellCommand</a></span> {
|
|
<span class="name">width</span>: <span class="number">150</span>
|
|
<span class="name">height</span>: <span class="number">25</span>
|
|
<span class="name">label</span>: <span class="string">'Shell Commands'</span>
|
|
<span class="name">model</span>: <span class="name">ListModel</span> {
|
|
<span class="type"><a href="http://doc.qt.io/qt-5/qml-qtqml-models-listelement.html">ListElement</a></span> {<span class="name">label</span>: <span class="string">'ls'</span>; <span class="name">command</span>: <span class="string">'ls'</span>}
|
|
<span class="type"><a href="http://doc.qt.io/qt-5/qml-qtqml-models-listelement.html">ListElement</a></span> {<span class="name">label</span>: <span class="string">'xterm'</span>; <span class="name">command</span>: <span class="string">'xterm'</span>}
|
|
<span class="type"><a href="http://doc.qt.io/qt-5/qml-qtqml-models-listelement.html">ListElement</a></span> {<span class="name">label</span>: <span class="string">'run anything'</span>; <span class="name">command</span>: <span class="string">'?'</span>;}
|
|
}
|
|
}</pre>
|
|
<p class="centerAlign"><img src="images/shellcommand.png" alt="" /></p><!-- @@@CSShellCommand -->
|
|
<h2>Property Documentation</h2>
|
|
<!-- $$$font -->
|
|
<div class="qmlitem"><div class="qmlproto">
|
|
<div class="table"><table class="qmlname">
|
|
<tr valign="top" class="odd" id="font-prop">
|
|
<td class="tblQmlPropNode"><p>
|
|
<a name="font-prop"></a><span class="name">font</span> : <span class="type"><a href="qml-csdataquick-components-csshellcommand.html#font-prop">font</a></span></p></td></tr>
|
|
</table></div>
|
|
</div><div class="qmldoc"><p>The text font.</p>
|
|
</div></div><!-- @@@font -->
|
|
<br/>
|
|
<!-- $$$fontSizeMode -->
|
|
<div class="qmlitem"><div class="qmlproto">
|
|
<div class="table"><table class="qmlname">
|
|
<tr valign="top" class="odd" id="fontSizeMode-prop">
|
|
<td class="tblQmlPropNode"><p>
|
|
<a name="fontSizeMode-prop"></a><span class="name">fontSizeMode</span> : <span class="type">enumeration</span></p></td></tr>
|
|
</table></div>
|
|
</div><div class="qmldoc"><p>This property specifies how the font size of the displayed text is determined.</p>
|
|
<p><b>See also </b><a href="http://doc.qt.io/qt-5/qml-qtquick-text.html#fontSizeMode-prop">fontSizeMode</a>.</p>
|
|
</div></div><!-- @@@fontSizeMode -->
|
|
<br/>
|
|
<!-- $$$label -->
|
|
<div class="qmlitem"><div class="qmlproto">
|
|
<div class="table"><table class="qmlname">
|
|
<tr valign="top" class="odd" id="label-prop">
|
|
<td class="tblQmlPropNode"><p>
|
|
<a name="label-prop"></a><span class="name">label</span> : <span class="type">string</span></p></td></tr>
|
|
</table></div>
|
|
</div><div class="qmldoc"><p>This property holds the text on the button.</p>
|
|
<p>The Label is the optional label that appears on the button. Normally, whether there is a label or not, there is a “!” symbol on the button to denote a Shell Command control. However, if the label text begins with "-" (for example "-My Label"), the “!” symbol will not appear.</p>
|
|
</div></div><!-- @@@label -->
|
|
<br/>
|
|
<!-- $$$model -->
|
|
<div class="qmlitem"><div class="qmlproto">
|
|
<div class="table"><table class="qmlname">
|
|
<tr valign="top" class="odd" id="model-prop">
|
|
<td class="tblQmlPropNode"><p>
|
|
<a name="model-prop"></a><span class="name">model</span> : <span class="type"><a href="http://doc.qt.io/qt-5/qml-var.html">var</a></span></p></td></tr>
|
|
</table></div>
|
|
</div><div class="qmldoc"><p>The property holds the command list model.</p>
|
|
<p>The model can be <a href="http://doc.qt.io/qt-5/qml-qtqml-models-listmodel.html">ListModel</a> or JSON object array. In any case, each element contains two properties:</p>
|
|
<ul>
|
|
<li>label - the label on the menu item in the menu that is brought up when the Shell Command button is pressed.</li>
|
|
<li>command - the string in command will be executed as a system command when the menu item with that label is selected.</li>
|
|
</ul>
|
|
<p>The GUI will block until the command is executed, so it is almost always wise to include an “&” at the end of the command so that it will execute in the background.</p>
|
|
<p><i>Note: Only in the form of JSON object array, it can be used in Qt Quick Designer</i></p>
|
|
</div></div><!-- @@@model -->
|
|
<br/>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="footer">Copyright (C) 2012-2021 Xiaoqiang Wang, Paul Scherrer Institute.</div>
|
|
</body>
|
|
</html>
|