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. Best way to implement a Button for an action in a QTableView
Forum Updated to NodeBB v4.3 + New Features

Best way to implement a Button for an action in a QTableView

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

    I need a simple QPushButton in all rows in a specific column which performs an action (for the row).
    I want no twice click to first enable an editor and then click the button.

    There seem a lot of possible methods - what method is common used.

    1 Reply Last reply
    0
    • VRoninV Offline
      VRoninV Offline
      VRonin
      wrote on last edited by VRonin
      #2

      I'd implement a delegate that does the painting and nothing else and connect a slot to QAbstractItemView::clicked to handle the event as you don't have to worry about identifying what button was clicked

      "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
      ~Napoleon Bonaparte

      On a crusade to banish setIndexWidget() from the holy land of Qt

      1 Reply Last reply
      2

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved