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 can I add custom widget to tableWidget header.
Forum Updated to NodeBB v4.3 + New Features

How can I add custom widget to tableWidget header.

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 3 Posters 4.3k 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.
  • umurcgU Offline
    umurcgU Offline
    umurcg
    wrote on last edited by
    #1

    Hello,
    I want to add custom widget (subclass of QWidget) to header of QTableWidget. I searched lots of quetions about that but I couldn't find a clear answer. I am using pyqt.

    Basically my custom widget includes 6 checkbox and a label.

    Is it doable? I am new to qt and python. So please explain clearly if you have an answer.

    Thanks :)

    1 Reply Last reply
    0
    • S Offline
      S Offline
      Sam
      wrote on last edited by
      #2

      Hi,

      Welcome to devnet, to add a custom widget to tableView/Widget header please have a look at this link Widgets on a header

      Regards,
      Sam

      1 Reply Last reply
      0
      • umurcgU Offline
        umurcgU Offline
        umurcg
        wrote on last edited by
        #3

        Thanks. Are there any tutorial for python? I cant understand c++.

        1 Reply Last reply
        0
        • VRoninV Offline
          VRoninV Offline
          VRonin
          wrote on last edited by
          #4

          You can either subclass QHeaderView or just create a QVBoxLayout and but your widget first then the table widget.

          Without a better indication of how you want it to look like it's difficult to be more specific

          "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
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved