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 8379893
In Process

The Archive Base Latest Questions

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

How to get some value which specifies which column the data is sorted by

  • 0

How to get some value which specifies which column the data is sorted by (and whether it’s ascending or descending) in QTableWidget? I couldn’t find anything in the documentation about it, only about sorting programmatically.

  • 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-09T16:18:40+00:00Added an answer on June 9, 2026 at 4:18 pm

    You can access that through the table header. Basically in Qt everything that is related to whole columns is accesses through the horizontal header of the table, and everything related to whole rows is accessed though the vertical headers. This includes default sizes, stretches, or, in your case, the sort properties.

    SortIndicatorOrder() function returns the sort order as Qt::SortOrder enum wihch can be either Qt::AscendingOrder a.k.a. 0, or Qt::DescendingOrder a.k.a. 1. You can use it ilke this:

    ui.yourTable->horizontalHeader()->sortIndicatorOrder();
    

    sortIndicatorSection() function returns the column by wihch data is sorted. Column numbers start with 0. You can call it like this:

    ui.yourTable->horizontalHeader()->sortIndicatorSection();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I run to get some value as score. score = soup.find('div', attrs={'class' : 'summarycount'})
i get some Color Value like #FF6100. now i was need Covert #FF6100 to
Can I get the value of an object field some other way than obj.field
I have a via with some jQuery function to get value from HTML element
How can i get value in <tr cost=xx.xx> if i click on some button
On my JSP page, I defined some javascript with a variable that get value
I get some wierd logs, which obviously only occurs on Android-Devices with Versions below
I have a non-nullable database column which has a default value set. When inserting
I'm using parse_str to get a raw value from a URL (which is obviously
I have some XML that stores column information and row data from 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.