Squish/Verifying the Value of a QLabel: Difference between revisions

From Qt Wiki
Jump to navigation Jump to search
No edit summary
 
No edit summary
Line 1: Line 1:
this page in: [[:Category:Tools::Squish::VerifyingTheValueOfAQLabelSpanish|Español]]
this page in: [[Category:Tools::Squish::VerifyingTheValueOfAQLabelSpanish|Español]]


=Verifying the value of a QLabel=
[[Category:Tools::Squish]]


In some applications you might show dynamic data in QLabel and you want the value of this QLabel to be verified during playback. The problem however is that Squish uses the text property of QLabel to identify the QLabel object, which works just fine as long as the value is the expected value. But as soon as the value of the QLabel changes, Squish won’t be able to find your QLabel and instead of a verification failure at playback you have a playback error due to a missing object.
= Verifying the value of a QLabel =
 
In some applications you might show dynamic data in QLabel and you want the value of this QLabel to be verified during playback. The problem however is that Squish uses the text property of QLabel to identify the QLabel object, which works just fine as long as the value is the expected value. But as soon as the value of the QLabel changes, Squish won't be able to find your QLabel and instead of a verification failure at playback you have a playback error due to a missing object.


This problem can be solved by not using the text property for identification of that QLabel. This is done by opening the Object Map, selecting the affected QLabel and remove the text property in the list of properties being shown. This will however only solve the problem for this specific label. If you have several more labels being affected by this, it might be a better idea to add a permanent solution, to avoid doing this manual work for every label.
This problem can be solved by not using the text property for identification of that QLabel. This is done by opening the Object Map, selecting the affected QLabel and remove the text property in the list of properties being shown. This will however only solve the problem for this specific label. If you have several more labels being affected by this, it might be a better idea to add a permanent solution, to avoid doing this manual work for every label.


This is done by adding a file called qtwrapper_user_descriptors.xml to your ~/.squish folder (<span class="caps">APPDATA</span>\froglogic\Squish on Windows) with the following content:<br />
This is done by adding a file called qtwrapper_user_descriptors.xml to your ~/.squish folder (APPDATAon Windows) with the following content:<br /><code>&amp;lt;objectdescriptors&amp;amp;gt;<br /> &amp;lt;descriptor&amp;amp;gt;<br /> &amp;lt;type name=&quot;QLabel&amp;quot;/&amp;amp;gt;<br /> &amp;lt;realidentifiers&amp;amp;gt;<br /> &amp;lt;property exclude=&quot;yes&amp;quot;&amp;gt;text&amp;amp;lt;/property&amp;amp;gt;<br /> &amp;lt;/realidentifiers&amp;amp;gt;<br /> &amp;lt;/descriptor&amp;amp;gt;<br />&amp;lt;/objectdescriptors&amp;amp;gt;</code>
 
This will tell Squish to ignore the text property when creating new QLabel entries in the object map. For already existing QLabels in the object map, you still need to do the manual work above.
 
===There is only one article in "Tools -&gt; Squish -&gt; Verifying_the_value_of_a_QLabel":===
 
===T===
* [[:Category:Tools::Squish::VerifyingTheValueOfAQLabelSpanish|Category:Tools -&gt; Squish -&gt; VerifyingTheValueOfAQLabelSpanish]]
 
===Categories:===
 
* [[:Category:Tools|Tools]]
** [[:Category:Tools::Squish|Squish]]
* [[:Category:Tools::Squish::VerifyingTheValueOfAQLabelSpanish|VerifyingTheValueOfAQLabelSpanish]]

Revision as of 06:38, 24 February 2015

this page in:

Verifying the value of a QLabel

In some applications you might show dynamic data in QLabel and you want the value of this QLabel to be verified during playback. The problem however is that Squish uses the text property of QLabel to identify the QLabel object, which works just fine as long as the value is the expected value. But as soon as the value of the QLabel changes, Squish won't be able to find your QLabel and instead of a verification failure at playback you have a playback error due to a missing object.

This problem can be solved by not using the text property for identification of that QLabel. This is done by opening the Object Map, selecting the affected QLabel and remove the text property in the list of properties being shown. This will however only solve the problem for this specific label. If you have several more labels being affected by this, it might be a better idea to add a permanent solution, to avoid doing this manual work for every label.

This is done by adding a file called qtwrapper_user_descriptors.xml to your ~/.squish folder (APPDATAon Windows) with the following content:

&amp;lt;objectdescriptors&amp;amp;gt;<br /> &amp;lt;descriptor&amp;amp;gt;<br /> &amp;lt;type name=&quot;QLabel&amp;quot;/&amp;amp;gt;<br /> &amp;lt;realidentifiers&amp;amp;gt;<br /> &amp;lt;property exclude=&quot;yes&amp;quot;&amp;gt;text&amp;amp;lt;/property&amp;amp;gt;<br /> &amp;lt;/realidentifiers&amp;amp;gt;<br /> &amp;lt;/descriptor&amp;amp;gt;<br />&amp;lt;/objectdescriptors&amp;amp;gt;