Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    How to insert QProgressBar in QTableWidget cell

    General and Desktop
    3
    4
    9304
    Loading More Posts
    • 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.
    • A
      adnan last edited by

      I want to display progress bar in QTableWidget cell, is it possible at all!

      1 Reply Last reply Reply Quote 0
      • F
        francomartins last edited by

        Try it :
        @

        QTableWidget tw = new QTableWidget(1,1);
        QProgressBar *pgbar = new QProgressBar();
        tw.setCellWidget(0,0,pgbar);
        @

        This example inserts a QProgressBar in a QTableWidget with one row and one column;

        1 Reply Last reply Reply Quote 0
        • A
          adnan last edited by

          Thanks for the reply!

          1 Reply Last reply Reply Quote 0
          • A
            andre last edited by

            Or, take a look at libQxt. It has a "delegate":http://libqxt.bitbucket.org/doc/0.6/qxtitemdelegate.html that can do this without relying on adding widgets explicitly, and that works with data from the model itself.

            1 Reply Last reply Reply Quote 0
            • First post
              Last post