Forum Discussion

ChristopheC's avatar
ChristopheC
Contributor
16 years ago

Checkpoint in a QTreeWidget

Hello,



I want to retrieve the elements and sub elements of a QTreeWidget in a
Checkpoint.



Initially,
my QTreeWidget is empty then the result of data extraction is done in my QTreeWidget object. I would
like
to make a content checkpoint to verify extraction.



Thank you to take time to reply us and please give me an exemple in VBScript.

12 Replies


  • Hi Christophe,





    I've just found a way to do this without compiling the application with debug information. Replace the following line







    with this one:




  • Hi Allen,



    here is the final code that allows me to do whatever I want :



    Key_IconeSite = 12884901888 'QIcon_cacheKey expected



    Set qtw = NameMapping.Sys.testComplete.MainWindow.centralWidget.trw

    Key_Icone = qtw.QTreeWidget_currentItem().QTreeWidgetItem_icon(1).QIcon_cacheKey()



    Call qtw.ClickItem("Elément 1|Sous-Elément 1.2", "Colonne 2")

    If(qtw.QTreeWidget_currentItem().QTreeWidgetItem_icon(1).QIcon_isNull()) Then

         Log.Message "An icon is not set"

    Else

         Log.Message "An icon is set"

         If (CCur(Key_Icone) = CCur(Key_IconeSite) ) Then

         Log.Message   "Icon Site OK"

         Else

         Log.Error "Icon Site Not OK"

         End If

    End If



    thank you for your help.



    Best regards,

    Christophe