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. QListView - marked Items
Forum Updated to NodeBB v4.3 + New Features

QListView - marked Items

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

    Hi! :-)

    In my program I have a QListView with some content from a SQLite Database. Now I want to enter the list view and display the content on my main form. This is my problem: When I enter the list view with the mouse click everythink works fine, but I also want to use my keyboard cursor buttons (up and down) to navigate through the content of the list view, the navigations works fine, but there is no update from the databse.. Now I use the clicked(...)-Slot for that and I have also tried the other slots, but nothing happens. First I thought the entered(...)-Slot is the correct way but it isn't. Is there any property of the list view I can use?

    Thank you :-)

    jeremy_kJ 1 Reply Last reply
    0
    • B buzz_lightzyear

      Hi! :-)

      In my program I have a QListView with some content from a SQLite Database. Now I want to enter the list view and display the content on my main form. This is my problem: When I enter the list view with the mouse click everythink works fine, but I also want to use my keyboard cursor buttons (up and down) to navigate through the content of the list view, the navigations works fine, but there is no update from the databse.. Now I use the clicked(...)-Slot for that and I have also tried the other slots, but nothing happens. First I thought the entered(...)-Slot is the correct way but it isn't. Is there any property of the list view I can use?

      Thank you :-)

      jeremy_kJ Offline
      jeremy_kJ Offline
      jeremy_k
      wrote on last edited by
      #2

      There may be some terminology confusion. Signals are emitted by objects when something happens. Connect a signal to a slot defined by the application or an instance of a framework provided type.

      QItemSelectionModel::currentChanged(const QModelIndex &current, const QModelIndex &previous) reports when the "current" item in a view changes. Use QAbstractItemView::selectionModel() to get the selection model the view is using.

      An alternative is to override the QAbstractItemView::currentChanged slot by inheriting from QListView. If this route is taken, don't forget to call the parent class implementation.

      Asking a question about code? http://eel.is/iso-c++/testcase/

      1 Reply Last reply
      0
      • B Offline
        B Offline
        buzz_lightzyear
        wrote on last edited by
        #3

        Hi,

        thank you for your answer, I was wrong with the term slot, I mean signal.

        I will try it on your suggested way.

        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