Files
gitea-pages/software/CSDataQuick/docs/qml-csdataquick-components-cstext.html
T
2025-07-08 08:18:09 +02:00

161 lines
8.1 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" />
<!-- CSText.qml -->
<title>CSText 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>CSText 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-cstext.html#properties">Properties</a></li>
<li class="level1"><a href="qml-csdataquick-components-cstext.html#details">Detailed Description</a></li>
</ul>
</div>
<div class="sidebar-content" id="sidebar-content"></div></div>
<div class="context">
<h1 class="title">CSText QML Type</h1>
<span class="subtitle"></span>
<!-- $$$CSText-brief -->
<p>Display a text label. <a href="qml-csdataquick-components-cstext.html#details">More...</a></p>
<!-- @@@CSText -->
<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-csgraphics.html">CSGraphics</a></p>
</td></tr></table></div><ul>
<li><a href="qml-csdataquick-components-cstext-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-cstext.html#align-prop">align</a></b></b> : enumeration</li>
<li class="fn"><b><b><a href="qml-csdataquick-components-cstext.html#font-prop">font</a></b></b> : font</li>
<li class="fn"><b><b><a href="qml-csdataquick-components-cstext.html#fontSizeMode-prop">fontSizeMode</a></b></b> : enumeration</li>
<li class="fn"><b><b><a href="qml-csdataquick-components-cstext.html#text-prop">text</a></b></b> : string</li>
</ul>
<!-- $$$CSText-description -->
<a name="details"></a>
<h2 id="details">Detailed Description</h2>
<p>It can display both plain and rich text in HTML-style markup.</p>
<p>The <a href="qml-csdataquick-components-cstext.html#font-prop">font</a> property can specify the font family, pixelSize, weight, style etc. If unspecified font family is returned from function <a href="qml-csdataquick-components-utilsjs.html#getBestFontSize-method">UtilsJS::getBestFontSize</a>.</p>
<p>If <a href="qml-csdataquick-components-cstext.html#fontSizeMode-prop">fontSizeMode</a> is Text.Fit, the font pixelSize will fit within the item width and height. If <a href="qml-csdataquick-components-cstext.html#fontSizeMode-prop">fontSizeMode</a> is Text.FixedSize, Text.VerticalFit or Text.HorizontalFit, the text may extend beyond the height and width specified for the Text item or may not use up all the specified height and width. The text typically does not fill all of the specified height for the Text item.</p>
<pre class="qml"><span class="type"><a href="http://doc.qt.io/qt-5/qml-qtquick-column.html">Column</a></span> {
<span class="name">spacing</span>: <span class="number">5</span>
<span class="type"><a href="qml-csdataquick-components-cstext.html">CSText</a></span> {
<span class="name">width</span>: <span class="number">100</span>
<span class="name">height</span>: <span class="number">20</span>
<span class="name">text</span>: <span class="string">'Plain Text'</span>
}
<span class="type"><a href="qml-csdataquick-components-cstext.html">CSText</a></span> {
<span class="name">width</span>: <span class="number">100</span>
<span class="name">height</span>: <span class="number">20</span>
<span class="name">text</span>: <span class="string">'&lt;b&gt;Rich&lt;/b&gt; &lt;i&gt;Text&lt;/i&gt;'</span>
}
}</pre>
<p class="centerAlign"><img src="images/text.png" alt="" /></p><!-- @@@CSText -->
<h2>Property Documentation</h2>
<!-- $$$align -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="align-prop">
<td class="tblQmlPropNode"><p>
<a name="align-prop"></a><span class="name">align</span> : <span class="type">enumeration</span></p></td></tr>
</table></div>
</div><div class="qmldoc"><p>Sets the horizontal alignment of the text within the item width.</p>
<p>The valid values for horizontalAlignment are Text.AlignLeft, Text.AlignRight, Text.AlignHCenter and Text.AlignJustify.</p>
</div></div><!-- @@@align -->
<br/>
<!-- $$$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-cstext.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/>
<!-- $$$text -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="text-prop">
<td class="tblQmlPropNode"><p>
<a name="text-prop"></a><span class="name">text</span> : <span class="type">string</span></p></td></tr>
</table></div>
</div><div class="qmldoc"><p>This property holds the text to display.</p>
<p>It can be plain text or richt text defined using HTML markup.</p>
</div></div><!-- @@@text -->
<br/>
</div>
</div>
</div>
</div>
</div>
<div class="footer">Copyright (C) 2012-2021 Xiaoqiang Wang, Paul Scherrer Institute.</div>
</body>
</html>