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. How do I get the value from QDateEdit in QTableWidget? (Python)
Forum Updated to NodeBB v4.3 + New Features

How do I get the value from QDateEdit in QTableWidget? (Python)

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

    I put QDateEdit in side QTableWidget by .setCellWidget() how do I get the value (.date()) of QDateEdit if I already know row and column?

    JonBJ 1 Reply Last reply
    0
    • M Mikiqueen

      I put QDateEdit in side QTableWidget by .setCellWidget() how do I get the value (.date()) of QDateEdit if I already know row and column?

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

      @Mikiqueen
      You can't, you have to locate the item you want to look at somehow. Nor do I know why you would not know row/column. Anyway you need either that or a variable you kept for the QDateEdit when you created it.

      Oh, sorry

      if I already know row and column?

      I mis-read. So you do know the row/column. So just as you used setCellWidget(row, column, widget) to set it use widget = cellWidget(row, column) to read it back.

      M 1 Reply Last reply
      1
      • JonBJ JonB

        @Mikiqueen
        You can't, you have to locate the item you want to look at somehow. Nor do I know why you would not know row/column. Anyway you need either that or a variable you kept for the QDateEdit when you created it.

        Oh, sorry

        if I already know row and column?

        I mis-read. So you do know the row/column. So just as you used setCellWidget(row, column, widget) to set it use widget = cellWidget(row, column) to read it back.

        M Offline
        M Offline
        Mikiqueen
        wrote on last edited by
        #3

        @JonB In my QTableWidget I have both text and widget. And I have 3 QDateEdit in the table cell, when I use QTableWidget.cellWidget(row, column) it only detect 1 of the 3 QDateEdit. I don't know the reason of that.

        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