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. [Solved] Label on UI Form not changing
QtWS25 Last Chance

[Solved] Label on UI Form not changing

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 2.2k Views
  • 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.
  • E Offline
    E Offline
    Endless
    wrote on last edited by
    #1

    I have a mainwindow with a Designer UI form. I'm putting quite a few labels on it, but I don't use Designer for all of them. Here's one in particular that I'm placing using C++:
    @
    valve1ClosedLabel = new QLabel(this);
    valve1ClosedLabel->resize(32, 15);
    valve1ClosedLabel->move(656, 98);
    valve1ClosedLabel->setPixmap(QPixmap(":/Pump1KPix/1K RH Valve Closed.png"));
    @
    It showed up on the form, and everything looked great. I then wanted to only show it at certain times, so I put the following line of code after the above lines to make it invisible:
    @
    valve1ClosedLabel->setVisible(FALSE);
    @
    It didn't disappear. I thought maybe I was using the wrong statement to make it invisible, so I commented out all the code above. I rerun the application, and the label's still there (without it even being defined). I even tried to change the values in the move function, but that has no effect - it's always in the original place. Whenever I rerun the application in Qt Creator, nothing seems to change. What in the world is going on?

    1 Reply Last reply
    0
    • K Offline
      K Offline
      Kxyu
      wrote on last edited by
      #2

      In such situations you can try removing the build folder. It will make QtCreator to recompile all modules of your project, which fixes some problems.

      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