Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8401239
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T21:45:18+00:00 2026-06-09T21:45:18+00:00

What is the easiest way (without subclassing QTableWidget if possible) to put a personnal

  • 0

What is the easiest way (without subclassing QTableWidget if possible) to put a personnal Widget (which is a group of QPixmap + QLabel + QComboBox in my case) as headers in a QTableWidget ?

It is relatively easy to do it for the array content as we have the function QTableWidget::setCellWidget(int row, int column, QWidget * widget), but for the headers, we only have QTableWidget::setHorizontalHeaderItem (int column, QTableWidgetItem * item)

Thank you very much !

EDIT :
Maybe I’ve found a very unelegant way to do this that may work :

1) I initialize each column with an empty QString header

2) I extract the size and position of each section of the header with _table->horizontalHeader()->sectionPosition(index) and _table->horizontalHeader()->sectionSize(index)

3) Then I draw a QFrame onto each section with a little margin

4) And finally, I load my QWidgets in these QFrame

If any one else has a better solution, I’m interested…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T21:45:19+00:00Added an answer on June 9, 2026 at 9:45 pm

    I guess setCellWidget() will do the job. I don’t see an easier way. Instead of a QFrame you might also use a QWidget, if you don’t use the additional functionality of QFrame.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

What is the most easiest way (if possible without using drawRect, subclassing, category) to
What's the easiest way to find Dom elements with a css selector, without using
What is the easiest/simplest way to delay inside a function without having to delay
Which is the easiest way to validate a file and to prevend changing it's
Whats the easiest way of stopping spammers from probing your forms (preferably without deterring
Whats the easiest way to build a simple 'web' application which is a single
Sorry for my beginner's question... What is the easiest way to define procedures, which
What is the easiest way (without opening a shell to curl and reading from
What's the easiest way to discover (without access to the source project) whether a
What is the easiest way vertically stack two HTML buttons without a table?

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.