Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
qtws26_logo

The Qt Event of the Year: Qt World Summit 2026

Save Your Spot >
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. "single left click " on the QListWidget "item" runs BOTH slots
Qt 6.12 LTS is out! See what's new in the release blog

"single left click " on the QListWidget "item" runs BOTH slots

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 504 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.
  • A Offline
    A Offline
    Anonymous_Banned275
    wrote on last edited by
    #1

    Using "go to slot " I have optioned QtDesigner and the result of "single left click " on the QListWidget "item" runs BOTH slots.

    Here is my debug output :

    void DeviceDiscoveryDialog::on_list_currentTextChanged(const QString &)
    TASK  TRACE  DEBUG  pair selection 
    @ line  "927"
    void DeviceDiscoveryDialog::on_list_itemSelectionChanged()
    TASK  pair selection 
    @ line  "912"
    

    I desire to run specific code - Bluetooth pairing - and it really does not matter which SIGNAL is generated.

    I am asking - is there a way - using QtDesigner - to distinguish he between " left click" on the "list" item
    and "highlight item selection " on same "list" item ?

    1 Reply Last reply
    0
    • C Offline
      C Offline
      ChrisW67
      wrote on last edited by
      #2

      The list issues both signals because both conditions have occurred (probably also issued currentItemChanged(), currentRowChanged() and itemClicked()).

      If you only want to act on one then only connect to one.

      The current item and the current selection are not the same thing in general. You can turn off/adjust tracking the selection with setSelectionMode()

      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
      • Unsolved