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. Make QTablewidget every cells Readonly.

Make QTablewidget every cells Readonly.

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

    How can i make every cell in table as read only?(Rows are dynamic)
    Is there any other way than Making them go through a loop(each item setting Flags)??
    Also is there a way to check QTablewidget empty or not??(other than item()->text()->isempty())

    VRoninV 1 Reply Last reply
    0
    • D devKing

      How can i make every cell in table as read only?(Rows are dynamic)
      Is there any other way than Making them go through a loop(each item setting Flags)??
      Also is there a way to check QTablewidget empty or not??(other than item()->text()->isempty())

      VRoninV Offline
      VRoninV Offline
      VRonin
      wrote on last edited by
      #2

      @devKing said in Make QTablewidget every cells Readonly.:

      How can i make every cell in table as read only?(Rows are dynamic)
      Is there any other way than Making them go through a loop(each item setting Flags)??

      tableWidget->setEditTriggers(QAbstractItemView::NoEditTriggers);

      Also is there a way to check QTablewidget empty or not??(other than item()->text()->isempty())

      Not clear if you want to check if the item is empty (tableWidget->model()->index(row,column).data().isNull()) or the entire widget (tableWidget->rowCount()>0)

      "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
      3
      • D Offline
        D Offline
        devKing
        wrote on last edited by
        #3

        Thanks a lot

        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