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. Receive event when list view element was selected via keyboard arrows
Qt 6.11 is out! See what's new in the release blog

Receive event when list view element was selected via keyboard arrows

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 663 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.
  • W Offline
    W Offline
    Wdowiak
    wrote on last edited by Wdowiak
    #1

    Hey,
    Is there a way to receive event when an element in list view was selected via up/down arrows?
    I have tried these signals, they work for mouse buttons/enter etc. but not up/down arrows.

    connect(ui_->dc6_listview_, &QListView::pressed, this, &MainWindow::selected);
    connect(ui_->dc6_listview_, &QListView::activated, this, &MainWindow::selected);
    connect(ui_->dc6_listview_, &QListView::clicked, this, &MainWindow::selected);
    connect(ui_->dc6_listview_, &QListView::doubleClicked, this, &MainWindow::selected);
    connect(ui_->dc6_listview_, &QListView::entered, this, &MainWindow::selected);
    
    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      I think you are looking for currentChanged.

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

      W 1 Reply Last reply
      1
      • SGaistS SGaist

        Hi,

        I think you are looking for currentChanged.

        W Offline
        W Offline
        Wdowiak
        wrote on last edited by
        #3

        @SGaist Hey, yeah, that's it. Didn't notice it as it's a protected slot. Thank you.

        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