Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QtCreator using QLCDNumber
Forum Updated to NodeBB v4.3 + New Features

QtCreator using QLCDNumber

Scheduled Pinned Locked Moved General and Desktop
6 Posts 3 Posters 5.1k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    valerio.j
    wrote on last edited by
    #1

    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.

    1 Reply Last reply
    0
    • G Offline
      G Offline
      goetz
      wrote on last edited by
      #2

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

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

      http://www.catb.org/~esr/faqs/smart-questions.html

      1 Reply Last reply
      0
      • V Offline
        V Offline
        valerio.j
        wrote on last edited by
        #3

        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

        1 Reply Last reply
        0
        • V Offline
          V Offline
          valerio.j
          wrote on last edited by
          #4

          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]

          1 Reply Last reply
          0
          • G Offline
            G Offline
            goetz
            wrote on last edited by
            #5

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

            http://www.catb.org/~esr/faqs/smart-questions.html

            1 Reply Last reply
            0
            • A Offline
              A Offline
              andre
              wrote on last edited by
              #6

              [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.

              1 Reply Last reply
              0

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved