<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[[SOLVED =)]ComboBox Qstring but need an int or GLenumb]]></title><description><![CDATA[<p dir="auto">Hey everyone once again I got a question to ask,</p>
<p dir="auto">I got a combobox with 10 values:<br />
"Picture of the combobox values here":<a href="http://i.imgur.com/lYo9A.jpg" target="_blank" rel="noopener noreferrer nofollow ugc">http://i.imgur.com/lYo9A.jpg</a></p>
<p dir="auto">As you can see it's a list of OpenGL primitives that are GLenumb.</p>
<p dir="auto">I got this function:<br />
@void MainWindow::on_cmbx_primatives_currentIndexChanged(const QString &amp;arg1)<br />
{<br />
GLFrame-&gt;RenderThread.setPrimitiveType(arg1);<br />
primL = arg1;<br />
}@</p>
<p dir="auto">This sets the PrimitiveType value in the rendering class but clearly it's just a string and not an integer. Is it possible to set an additional value to a comboxbox argument for example the Text would be  as an additional value that I could pass???<br />
"Since you can set comments and other additional values":<a href="http://i.imgur.com/jYYrB.jpg" target="_blank" rel="noopener noreferrer nofollow ugc">http://i.imgur.com/jYYrB.jpg</a></p>
<p dir="auto">@GL_POINTS : but contain 0x0000@</p>
<p dir="auto">thank you</p>
]]></description><link>https://forum.qt.io/topic/15989/solved-combobox-qstring-but-need-an-int-or-glenumb</link><generator>RSS for Node</generator><lastBuildDate>Thu, 08 Oct 2026 03:50:40 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/15989.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 18 Apr 2012 07:03:30 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to [SOLVED =)]ComboBox Qstring but need an int or GLenumb on Wed, 18 Apr 2012 09:01:48 GMT]]></title><description><![CDATA[<p dir="auto">You are welcome! Please add "[SOLVED]" to the topic subject.</p>
]]></description><link>https://forum.qt.io/post/136127</link><guid isPermaLink="true">https://forum.qt.io/post/136127</guid><dc:creator><![CDATA[[[global:former-user]]]]></dc:creator><pubDate>Wed, 18 Apr 2012 09:01:48 GMT</pubDate></item><item><title><![CDATA[Reply to [SOLVED =)]ComboBox Qstring but need an int or GLenumb on Wed, 18 Apr 2012 08:56:53 GMT]]></title><description><![CDATA[<p dir="auto">Once again AcerExtensa thank very much =] all my problems are now solved!!!</p>
]]></description><link>https://forum.qt.io/post/136128</link><guid isPermaLink="true">https://forum.qt.io/post/136128</guid><dc:creator><![CDATA[[[global:former-user]]]]></dc:creator><pubDate>Wed, 18 Apr 2012 08:56:53 GMT</pubDate></item><item><title><![CDATA[Reply to [SOLVED =)]ComboBox Qstring but need an int or GLenumb on Wed, 18 Apr 2012 08:46:10 GMT]]></title><description><![CDATA[<p dir="auto">Maybe you're trying to access items or userData before there is any items in combobox? Sounds pretty like that....</p>
]]></description><link>https://forum.qt.io/post/136124</link><guid isPermaLink="true">https://forum.qt.io/post/136124</guid><dc:creator><![CDATA[[[global:former-user]]]]></dc:creator><pubDate>Wed, 18 Apr 2012 08:46:10 GMT</pubDate></item><item><title><![CDATA[Reply to [SOLVED =)]ComboBox Qstring but need an int or GLenumb on Wed, 18 Apr 2012 08:40:41 GMT]]></title><description><![CDATA[<p dir="auto">Yep that worked right away.</p>
<p dir="auto">Well I removed all the values from the comboxbox in the Qt creator interface and the program crashed.<br />
"The program has unexpectedly finished."</p>
<p dir="auto">So then I just randomly added an item to the combo box and it worked again. Why's that?</p>
]]></description><link>https://forum.qt.io/post/136122</link><guid isPermaLink="true">https://forum.qt.io/post/136122</guid><dc:creator><![CDATA[[[global:former-user]]]]></dc:creator><pubDate>Wed, 18 Apr 2012 08:40:41 GMT</pubDate></item><item><title><![CDATA[Reply to [SOLVED =)]ComboBox Qstring but need an int or GLenumb on Wed, 18 Apr 2012 08:31:57 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/qstring">@<bdi>QString</bdi></a> arg1 = ui-&gt;cmbx_primatives-&gt;itemText(index);@</p>
<p dir="auto">should be enough... or:</p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/qstring">@<bdi>QString</bdi></a> arg1 = ui-&gt;cmbx_primatives-&gt;currentText();@<br />
it will return text of currently selected item</p>
]]></description><link>https://forum.qt.io/post/136119</link><guid isPermaLink="true">https://forum.qt.io/post/136119</guid><dc:creator><![CDATA[[[global:former-user]]]]></dc:creator><pubDate>Wed, 18 Apr 2012 08:31:57 GMT</pubDate></item><item><title><![CDATA[Reply to [SOLVED =)]ComboBox Qstring but need an int or GLenumb on Wed, 18 Apr 2012 08:25:09 GMT]]></title><description><![CDATA[<p dir="auto">AcerExtensa your magic worker, is it possible to access the name of the index instead of the number.<br />
I tried <a class="plugin-mentions-user plugin-mentions-a" href="/user/qstring">@<bdi>QString</bdi></a> arg1 = ui-&gt;cmbx_primatives-&gt;itemText(index).toStdWString();@ but that's wrong</p>
]]></description><link>https://forum.qt.io/post/136115</link><guid isPermaLink="true">https://forum.qt.io/post/136115</guid><dc:creator><![CDATA[[[global:former-user]]]]></dc:creator><pubDate>Wed, 18 Apr 2012 08:25:09 GMT</pubDate></item><item><title><![CDATA[Reply to [SOLVED =)]ComboBox Qstring but need an int or GLenumb on Wed, 18 Apr 2012 08:04:13 GMT]]></title><description><![CDATA[<p dir="auto">use<br />
@void  currentIndexChanged ( int index )@<br />
signal instead one with QString.</p>
<p dir="auto">your slot will be when like this:<br />
@void MainWindow::on_cmbx_primatives_currentIndexChanged(int index)<br />
{<br />
primL = ui-&gt;cmbx_primatives-&gt;itemData(index).toInt();<br />
GLFrame-&gt;RenderThread.setPrimitiveType(primL);<br />
}@</p>
]]></description><link>https://forum.qt.io/post/136104</link><guid isPermaLink="true">https://forum.qt.io/post/136104</guid><dc:creator><![CDATA[[[global:former-user]]]]></dc:creator><pubDate>Wed, 18 Apr 2012 08:04:13 GMT</pubDate></item><item><title><![CDATA[Reply to [SOLVED =)]ComboBox Qstring but need an int or GLenumb on Wed, 18 Apr 2012 07:35:04 GMT]]></title><description><![CDATA[<p dir="auto">yep AcerExtensa that worked like a charm =]<br />
but how do I access the integer value from arg1 so I could pass it to the render class?</p>
]]></description><link>https://forum.qt.io/post/136098</link><guid isPermaLink="true">https://forum.qt.io/post/136098</guid><dc:creator><![CDATA[[[global:former-user]]]]></dc:creator><pubDate>Wed, 18 Apr 2012 07:35:04 GMT</pubDate></item><item><title><![CDATA[Reply to [SOLVED =)]ComboBox Qstring but need an int or GLenumb on Wed, 18 Apr 2012 07:30:03 GMT]]></title><description><![CDATA[<p dir="auto">Try this:<br />
@ui-&gt;cmbx_primatives-&gt;addItem("Test", QVariant::fromValue&lt;int&gt;(0x0000));@</p>
]]></description><link>https://forum.qt.io/post/136096</link><guid isPermaLink="true">https://forum.qt.io/post/136096</guid><dc:creator><![CDATA[[[global:former-user]]]]></dc:creator><pubDate>Wed, 18 Apr 2012 07:30:03 GMT</pubDate></item><item><title><![CDATA[Reply to [SOLVED =)]ComboBox Qstring but need an int or GLenumb on Wed, 18 Apr 2012 07:26:50 GMT]]></title><description><![CDATA[<p dir="auto">Thank you, it seems i am doing something wrong<br />
@ui-&gt;cmbx_primatives-&gt;addItem(const QString("Test"), const QVariant &amp; userdata = QVariant(const int(0x0000)));@</p>
]]></description><link>https://forum.qt.io/post/136094</link><guid isPermaLink="true">https://forum.qt.io/post/136094</guid><dc:creator><![CDATA[[[global:former-user]]]]></dc:creator><pubDate>Wed, 18 Apr 2012 07:26:50 GMT</pubDate></item><item><title><![CDATA[Reply to [SOLVED =)]ComboBox Qstring but need an int or GLenumb on Wed, 18 Apr 2012 07:09:06 GMT]]></title><description><![CDATA[<p dir="auto">You can populate your combobox with "this":<a href="http://qt-project.org/doc/qt-4.8/qcombobox.html#addItem" target="_blank" rel="noopener noreferrer nofollow ugc">http://qt-project.org/doc/qt-4.8/qcombobox.html#addItem</a> function:<br />
@void  void QComboBox::addItem ( const QString &amp; text, const QVariant &amp; userData = QVariant() )@</p>
<p dir="auto">userData can be all you want...</p>
]]></description><link>https://forum.qt.io/post/136093</link><guid isPermaLink="true">https://forum.qt.io/post/136093</guid><dc:creator><![CDATA[[[global:former-user]]]]></dc:creator><pubDate>Wed, 18 Apr 2012 07:09:06 GMT</pubDate></item></channel></rss>