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. push Button seems disabled
Qt 6.11 is out! See what's new in the release blog

push Button seems disabled

Scheduled Pinned Locked Moved General and Desktop
4 Posts 3 Posters 986 Views 2 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.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by A Former User
    #1

    Hey Guys,

    I try to create a simple pushButton, but it does not work.
    I have a MainWindow, that calls customPlot, which plots real time data.
    Now I wanna create a pushButton, that starts plotting these data.

    MainWindow::MainWindow(QWidget *parent): QMainWindow(parent), ui (new Ui::MainWindow)
    {
         ui->setupUi(this);
    }
    
    void MainWindow:: on_pushButton_clicked()
    {
         open_serial();
         setupDemo();  //starts the plot
    }
    

    The push Button is above the graph, but if I run the programm the Button looks disabled, so that I cannot click on it.
    What does it mean, if the pushButton text is grey so that is looks disabled.
    I also checked the checkbox "enable" in the GUI, which is also enabled.
    No error is displayed.

    Thanks for your help.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      Is your QPushButton in a layout in another widget that is disabled ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • A Offline
        A Offline
        alex_malyu
        wrote on last edited by
        #3

        Does you MainWindow.h have Q_Object macro defined?
        Is on_pushButton_clicked a slot? is it connected?

        1 Reply Last reply
        0
        • ? Offline
          ? Offline
          A Former User
          wrote on last edited by A Former User
          #4

          The MainWindow object above the central widget wasn't enabled. I thought I checked it, but didn't.
          So thanks for the answers.

          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