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. How can I remove duplicate values from QTableWidget
Forum Updated to NodeBB v4.3 + New Features

How can I remove duplicate values from QTableWidget

Scheduled Pinned Locked Moved Unsolved Qt for Python
5 Posts 3 Posters 2.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.
  • B Offline
    B Offline
    BlueBreezy
    wrote on last edited by
    #1

    Hello, I was wondering how I can remove any duplicates from a table in pyside2 as when my program runs there is a refresh button that adds ab values that previously did not exist but when I press the button it also duplicates values that are already there!

    So how do I go about stopping this?

    1 Reply Last reply
    0
    • B Offline
      B Offline
      BlueBreezy
      wrote on last edited by
      #2

      has no one come up with a solution?

      1 Reply Last reply
      0
      • Erudite MonkeyE Offline
        Erudite MonkeyE Offline
        Erudite Monkey
        wrote on last edited by
        #3

        I don't know how you're entering data into the widget but if you want to only store distinct items then maybe store the data of the table widget in a python 'set()' or maybe share your refresh function.

        1 Reply Last reply
        0
        • B Offline
          B Offline
          BlueBreezy
          wrote on last edited by
          #4

          @Denni-0 oh if the latter is easier do you mind showing me an example please?

          1 Reply Last reply
          0
          • B Offline
            B Offline
            BlueBreezy
            wrote on last edited by
            #5

            @Denni-0 oh right okay thanks I will try and see if i can put his in code!

            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