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 to hide cellWidget of QTableWidget?
Forum Updated to NodeBB v4.3 + New Features

How to hide cellWidget of QTableWidget?

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

    How can I hide a cellWidget of (row,column) in QTableWidget?

    this->cellWidget(0, 6)->hide();
    this->cellWidget(0, 6)->setVisible(false);

    I called these two methods both no use.

    1 Reply Last reply
    0
    • DiracsbracketD Offline
      DiracsbracketD Offline
      Diracsbracket
      wrote on last edited by
      #2

      Hi. This seems to be a bug, still unresolved.
      For a possible workaround, have a look at
      https://stackoverflow.com/questions/33492837/qtablecellwidget-is-not-hiding

      1 Reply Last reply
      0
      • brucezcgB Offline
        brucezcgB Offline
        brucezcg
        wrote on last edited by
        #3

        Thanks, could you pls give the sample code snippet of the solution ?

        K DiracsbracketD 2 Replies Last reply
        0
        • brucezcgB brucezcg

          Thanks, could you pls give the sample code snippet of the solution ?

          K Offline
          K Offline
          koahnig
          wrote on last edited by
          #4

          @brucezcg @Diracsbracket

          If it is really a bug you can check on JIRA using the same account as here in the forum. JIRA is the only place where bugs have to be reported to.
          Neither the forum here nor any other place is monitored for potential bugs. If it is not reported, it can't be fixed.

          Vote the answer(s) that helped you to solve your issue(s)

          DiracsbracketD brucezcgB 2 Replies Last reply
          0
          • K koahnig

            @brucezcg @Diracsbracket

            If it is really a bug you can check on JIRA using the same account as here in the forum. JIRA is the only place where bugs have to be reported to.
            Neither the forum here nor any other place is monitored for potential bugs. If it is not reported, it can't be fixed.

            DiracsbracketD Offline
            DiracsbracketD Offline
            Diracsbracket
            wrote on last edited by
            #5

            @koahnig said in How to hide cellWidget of QTableWidget?:

            If it is not reported, it can't be fixed.

            This is a long-standing bug which has been reported several times already (some of which have been closed as duplicates, like this one: https://bugreports.qt.io/browse/QTBUG-22490.).

            1 Reply Last reply
            0
            • brucezcgB brucezcg

              Thanks, could you pls give the sample code snippet of the solution ?

              DiracsbracketD Offline
              DiracsbracketD Offline
              Diracsbracket
              wrote on last edited by Diracsbracket
              #6

              @brucezcg said in How to hide cellWidget of QTableWidget?:

              could you pls give the sample code snippet of the solution ?

              The proposed solution is in the link I provided. Apparently, you must subclass QTableWidget and override the paintEvent() method to hide the cells every time after the actual painting is done.

              DerivedQTableWidget::paintEvent(QPaintEvent * e)
              {
                 QTableWidget::paintEvent(e);
              
                 // do the hiding here
              }
              

              I have not tested this though...

              1 Reply Last reply
              0
              • K koahnig

                @brucezcg @Diracsbracket

                If it is really a bug you can check on JIRA using the same account as here in the forum. JIRA is the only place where bugs have to be reported to.
                Neither the forum here nor any other place is monitored for potential bugs. If it is not reported, it can't be fixed.

                brucezcgB Offline
                brucezcgB Offline
                brucezcg
                wrote on last edited by brucezcg
                #7

                @koahnig OKay,@Diracsbracket Thanks.

                Just like @koahnig said this is an very old bug!!!!!
                I don't know why still not resolved.

                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