Qt wiki will be updated on October 12th 2023 starting at 11:30 AM (EEST) and the maintenance will last around 2-3 hours. During the maintenance the site will be unavailable.

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

From Qt Wiki
Jump to navigation Jump to search
No edit summary
(Decode HTML entity names)
Line 10: Line 10:


This is done by adding a file called qtwrapper_user_descriptors.xml to your ~/.squish folder (APPDATAon Windows) with the following content:
This is done by adding a file called qtwrapper_user_descriptors.xml to your ~/.squish folder (APPDATAon Windows) with the following content:
<code><objectdescriptors&amp;amp;gt;
<code><objectdescriptors>
  <descriptor&amp;amp;gt;
  <descriptor>
  <type name="QLabel"/&amp;amp;gt;
  <type name="QLabel"/>
  <realidentifiers&amp;amp;gt;
  <realidentifiers>
  <property exclude="yes">text&amp;amp;lt;/property&amp;amp;gt;
  <property exclude="yes">text</property>
  </realidentifiers&amp;amp;gt;
  </realidentifiers>
  </descriptor&amp;amp;gt;
  </descriptor>
</objectdescriptors&amp;amp;gt;</code>
</objectdescriptors></code>

Revision as of 12:35, 23 August 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:

<objectdescriptors>
 <descriptor>
 <type name="QLabel"/>
 <realidentifiers>
 <property exclude="yes">text</property>
 </realidentifiers>
 </descriptor>
</objectdescriptors>