Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for Python
  4. Disable particular cell of QTablewiget using pyqt5
Qt 6.11 is out! See what's new in the release blog

Disable particular cell of QTablewiget using pyqt5

Scheduled Pinned Locked Moved Unsolved Qt for Python
2 Posts 2 Posters 555 Views
  • 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.
  • S Offline
    S Offline
    Shashanksd07
    wrote on last edited by
    #1

    Hi ,

    Can Someone please provide some guidance or suggestions on how to effectively disable a cell within a QTableWidget using PyQt5? I'm looking to programmatically control the cell's functionality and appearance in my application.

    JonBJ 1 Reply Last reply
    0
    • S Shashanksd07

      Hi ,

      Can Someone please provide some guidance or suggestions on how to effectively disable a cell within a QTableWidget using PyQt5? I'm looking to programmatically control the cell's functionality and appearance in my application.

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by
      #2

      @Shashanksd07
      Depending on what exactly you mean by "disable" a cell, for an individual QTableWidgetItem you have Qt::ItemFlags QTableWidgetItem::flags() const

      Returns the flags used to describe the item. These determine whether the item can be checked, edited, and selected.

      For "functionality and appearance" you may have to use a QStyledItemDelegate. By the time you are altering like this you might consider moving to your own QTableView and model, rather than QTableWidget which is a "convenience" widget wrapping both of these.

      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