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. TableWidget border, Hearder Size Fixed, etc...
Forum Updated to NodeBB v4.3 + New Features

TableWidget border, Hearder Size Fixed, etc...

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

    2f54827e-01bb-444a-9e3f-bbbaa06bc466-image.png

    3164cbdc-194d-4ccb-8ee2-4d8e759c7d76-image.png

    7dd88785-70f7-4868-b8f1-0bc0f3781e10-image.png

    1. If you look at number 1 of the capture picture, I want to set the outer boarder of the tableWidget, what can I do?
    2. I'd like to change the background color of location number 2, what can I do?
    3. I want to fix the size of the header in position three, and I don't want it to move with the mouse.
    4. I don't want you to choose location four.
    5. I want the whole row clicked.

    Five questions. Too many questions.ㅜㅜ
    I'll say thank you in advance!

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by mrjj
      #2

      Hi

      • 1:
        It seems you just painted the border another color and set it size hence the gaps.
        From a plain TableWidget i don't get so huge gaps so check your stylesheet
        Normally the Table don't have any huge border so I think you set the border size yourself
        in the stylesheet to bigger than normally.

      alt text
      No border ?

      alt text

      2:

      QTableWidget{
      background-color: rgb(255, 170, 0); 
      }
      also colors that area for me ?
      
      • 3:
        I think you can either allow dragging for all columns or none.
        You could make a custom header and check if you can disallow it from being dragged,
        say with mousePress function and check which section its over.

      • 4:
        Well each item can be set if can be selected/edited etc but not seen for sections
        https://stackoverflow.com/questions/5421947/disable-selecting-row-or-column-by-clicking-the-header-in-qtablewidget

      • 5:
        table->setSelectionBehavior(QAbstractItemView::SelectRows);
        If you mean JUST for that row, all else is selected by cells, then you have to hand code it
        so when clicking in any of the cells in the magic row, you slot select all other cell in same rw as the item clicked.

      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