Compilation errors with example UI application on S60 platform



  • I have already an example QT application which I have modified.
    I have used a label object from the QT C++ Widget Box for which I want to set the text in my program.

    My code snippet:
    backLightStatusLabel->setText((di->backLightOn() ? "On" : "Off"));

    However, the compiler does not recognize the object(backLightStatusLabel - which I have already added on the application UI) and returns error.

    Is there something else that I need to do?



  • Hi anobika, what's the compiler error?

    Is backLightStatusLabel in a .ui file?

    Tip: use @ around your code snippets to format it properly
    Tip2: Qt, not QT :-)



  • Hi Anselmo,

    the compilation error is: backLightStatusLabel is not defined.
    The label is in a .ui file.

    1. I have updated the .pro file which previously had a different .ui file assigned to FORM parameter.
    2. Did a qmake
    3. built the code using the command make release-armv5

    I don't see a new u_*.h file getting created.

    Is there a separate command to build changes in the .ui file?

    Thanks for the tips :)



  • Try calling 'make clean' and then 'qmake, followed by 'make ...' (whichever platform you are building for).



  • Have tried it but that has not helped.
    Is there a need to use the uic Tool in this case?
    I am working on the S60 platform as mentioned. Please let me know the steps to compile the changes made in the .ui file.



  • [quote author="anobika" date="1289813694"]Have tried it but that has not helped.
    Is there a need to use the uic Tool in this case?
    I am working on the S60 platform as mentioned. Please let me know the steps to compile the changes made in the .ui file.[/quote]

    Have you tried something like

    ui.setupUi(this);
    ui.backLightStatusLabel->setText((di->backLightOn() ? “On” : “Off”));



  • Hi there, sorry about the late answer, I did not have the expected Internet access while traveling. Well, QtK pointed well, you need to access the content of the class generated based on you .ui file - often a ui pointer declared in the header file of the class you're implementing (QtCreator does it automatically for you, I don't know if it is your case)


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.