[Kst] extragear/graphics/kst/src/libkstapp

Eli Fidler eli at staikos.net
Tue Jan 9 22:25:28 CET 2007


SVN commit 621835 by fidler:

add string selector to label widget


 M  +35 -1     viewlabelwidget.ui  
 M  +8 -0      viewlabelwidget.ui.h  


--- trunk/extragear/graphics/kst/src/libkstapp/viewlabelwidget.ui #621834:621835
@@ -21,7 +21,7 @@
         </property>
         <widget class="QLayoutWidget" row="0" column="0">
             <property name="name">
-                <cstring>layout9</cstring>
+                <cstring>layout8</cstring>
             </property>
             <hbox>
                 <property name="name">
@@ -52,6 +52,37 @@
         </widget>
         <widget class="QLayoutWidget" row="1" column="0">
             <property name="name">
+                <cstring>layout9</cstring>
+            </property>
+            <hbox>
+                <property name="name">
+                    <cstring>unnamed</cstring>
+                </property>
+                <widget class="QLabel">
+                    <property name="name">
+                        <cstring>textLabel2</cstring>
+                    </property>
+                    <property name="sizePolicy">
+                        <sizepolicy>
+                            <hsizetype>0</hsizetype>
+                            <vsizetype>5</vsizetype>
+                            <horstretch>0</horstretch>
+                            <verstretch>0</verstretch>
+                        </sizepolicy>
+                    </property>
+                    <property name="text">
+                        <string>Strings: </string>
+                    </property>
+                </widget>
+                <widget class="StringSelector">
+                    <property name="name">
+                        <cstring>_strings</cstring>
+                    </property>
+                </widget>
+            </hbox>
+        </widget>
+        <widget class="QLayoutWidget" row="2" column="0">
+            <property name="name">
                 <cstring>layout20</cstring>
             </property>
             <vbox>
@@ -365,11 +396,13 @@
 <includes>
     <include location="global" impldecl="in implementation">knuminput.h</include>
     <include location="local" impldecl="in implementation">scalarselector.h</include>
+    <include location="local" impldecl="in implementation">stringselector.h</include>
     <include location="local" impldecl="in declaration">kst_export.h</include>
     <include location="local" impldecl="in implementation">viewlabelwidget.ui.h</include>
 </includes>
 <slots>
     <slot>insertScalarInText( const QString &amp; S )</slot>
+    <slot>insertStringInText( const QString &amp; S )</slot>
 </slots>
 <functions>
     <function>init()</function>
@@ -378,6 +411,7 @@
 <layoutdefaults spacing="6" margin="11"/>
 <includehints>
     <includehint>scalarselector.h</includehint>
+    <includehint>stringselector.h</includehint>
     <includehint>knuminput.h</includehint>
     <includehint>kfontcombo.h</includehint>
     <includehint>klineedit.h</includehint>
--- trunk/extragear/graphics/kst/src/libkstapp/viewlabelwidget.ui.h #621834:621835
@@ -16,6 +16,9 @@
     connect(_scalars, SIGNAL(selectionChanged(const QString &)),
 	    this, SLOT(insertScalarInText(const QString &)));
 
+    connect(_strings, SIGNAL(selectionChanged(const QString &)),
+	    this, SLOT(insertStringInText(const QString &)));
+
     QWhatsThis::add(_text, i18n("<qt>The syntax for labels is a derivative of a subset of LaTeX.  Supported syntax is: <b>\\[greeklettername]</b> and <b>\\[Greeklettername]</b>, <b>\\approx</b>, <b>\\cdot</b>, <b>\\ge</b>, <b>\\geq</b>, <b>\\inf</b>, <b>\\int</b>, <b>\\le</b>, <b>\\leq</b>, <b>\\ne</b>, <b>\\n</b>, <b>\\partial</b>, <b>\\prod</b>, <b>\\pm</b>, <b>\\textcolor{color name}{colored text}</b>, <b>\\textbf{bold text}</b>, <b>\\textit{italicized text}</b>, <b>\\t</b>, <b>\\sum</b>, <b>\\sqrt</b>, <b>\\underline{underlined text}</b>, <b>x^y</b>, <b>x_y</b>.  Data references and embedded expressions should be enclosed in square brackets.  Example: <i>[=[MyScalar]/2]</i>"));
 }
 
@@ -25,4 +28,9 @@
     _text->insert("["+S+"]");
 }
 
+void ViewLabelWidget::insertStringInText(const QString &S)
+{
+    _text->insert("["+S+"]");
+}
+
 // vim: ts=8 sw=4 noet


More information about the Kst mailing list