Snipt.net is closing on December 31st, 2016

For more information, please visit this blog post.

snipt

Ctrl+h for KB shortcuts

Text only

Hello World

1
2
3
4
5
This snipt is a test for qtsniptclient library development.
This lib will surely be used in MonkeyStudio IDE next generation.

Regards,
Fabien Wang
https://snipt.net/embed/a2842ed3fcff89c06c74c09140de08b1/
https://snipt.net/raw/a2842ed3fcff89c06c74c09140de08b1/
a2842ed3fcff89c06c74c09140de08b1
text
Text only
5
2016-12-08T23:02:54
True
False
False
Jul 30, 2012 at 04:18 AM
/api/public/snipt/44750/
hello-world-36
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a> <a href="#L-5">5</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>This snipt is a test for qtsniptclient library development. </span><span id="L-2"><a name="L-2"></a>This lib will surely be used in MonkeyStudio IDE next generation. </span><span id="L-3"><a name="L-3"></a> </span><span id="L-4"><a name="L-4"></a>Regards, </span><span id="L-5"><a name="L-5"></a>Fabien Wang </span></pre></div> </td></tr></table>
mks, qt

C++

QComboBox's addItem with userData

1
2
3
QComboxBox list;
list->addItem(QString("text"), QVariant(id));
int id = list.itemData(index);
https://snipt.net/embed/35e923a4c38960ef3b51c7b32cb4669e/
https://snipt.net/raw/35e923a4c38960ef3b51c7b32cb4669e/
35e923a4c38960ef3b51c7b32cb4669e
cpp
C++
4
2016-12-09T16:12:30
True
False
False
/api/public/snipt/7884/
qcomboboxs-additem-with-userdata
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="n">QComboxBox</span> <span class="n">list</span><span class="p">;</span> </span><span id="L-2"><a name="L-2"></a><span class="n">list</span><span class="o">-&gt;</span><span class="n">addItem</span><span class="p">(</span><span class="n">QString</span><span class="p">(</span><span class="s">&quot;text&quot;</span><span class="p">),</span> <span class="n">QVariant</span><span class="p">(</span><span class="n">id</span><span class="p">));</span> </span><span id="L-3"><a name="L-3"></a><span class="kt">int</span> <span class="n">id</span> <span class="o">=</span> <span class="n">list</span><span class="p">.</span><span class="n">itemData</span><span class="p">(</span><span class="n">index</span><span class="p">);</span> </span></pre></div> </td></tr></table>
qt
Copyrighted, illegal, or inappropriate content? Email [email protected].