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. QPushButton does not respond when first time click?
Forum Updated to NodeBB v4.3 + New Features

QPushButton does not respond when first time click?

Scheduled Pinned Locked Moved Unsolved General and Desktop
qt5.4
4 Posts 2 Posters 1.5k 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.
  • D Offline
    D Offline
    Davidcheng
    wrote on last edited by A Former User
    #1

    When I have a QListWidget and a QPushButton, have selected a listItem, then click pushbutton, why does it only respond when I click at second time?

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

      Hi
      Show the code. Impossible to guess at when you are not showing what button
      does on clicked()

      1 Reply Last reply
      1
      • D Offline
        D Offline
        Davidcheng
        wrote on last edited by
        #3
        This post is deleted!
        1 Reply Last reply
        0
        • mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on last edited by mrjj
          #4

          Ah, i see from your deleted post what you say.
          When QListWidget is clicked first time, it receives focus
          When you then click a button, that button is now given focus.
          Focus is not the same as selected for QListWidget.- one or more item can be selected.
          You can try
          qDebug() << ui->listWidget->currentItem()->text();
          in button.

          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