QtCreator using QLCDNumber



  • Hello,

    I'm trying to create a Qt app to read in temperature values. I'm far from completing this as I'm new to Qt. I made a simple form which contains just a QLCDNumber widget on default settings.

    so in main.cpp file I try to use this

    lcdNumber->display(23); and I get a compiler error:
    error: 'lcdNumber' was not declared in this scope

    I'm not sure if I'm calling the object correctly or if I missed to add a header file or something else.



  • UI elements are usually contained in an ui object, I'd try

    @
    ui->lcdNumber->display(23);
    @



  • Koo, thanks.
    So let me get this straight, bare with me, I'm new to Qt.
    When I create the UI using form, Qt automatically creates the .ui qml for me and I have to use the ui-> to complete my task. Does this also apply to, or is it similar, to other widgets used? any reference to a tutorial or something might help me out.

    Thanks



  • That didn't work out for me.
    It says ui has not been declared

    [quote author="Volker" date="1328304600"]UI elements are usually contained in an ui object, I'd try

    @
    ui->lcdNumber->display(23);
    @
    [/quote]



  • Sorry, I don't know how you incorporate the ui file into your application. If you enlighten us here, we can help better.



  • [quote author="DominicanTech" date="1328505857"]When I create the UI using form, Qt automatically creates the .ui qml for me[/quote]
    You are confusing interface paradigms here. The things you create based on widgets will not result in QML at all. That will result in a c++ header file (after processing by the uic tools wich will be run by qmake), which is then included in your application.


Log in to reply
 

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