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

The Archive Base Latest Questions

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

Is there a way to add my QSqlQueryModel to a QListWidget ? If not

  • 0

Is there a way to add my QSqlQueryModel to a QListWidget? If not is there a way to add the database row id to a QListWidgetItem?

I cant figure this out from the documentation on QListWidget. I can add items to the list but can only think to use the row number of the item as the hidden index which wont work if index numbers are out of order.

  • 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:35:59+00:00Added an answer on June 9, 2026 at 4:35 pm

    OK, here is the deal:

    The QListWidget is part of the older Qt3 data widget set.

    The widget you actually want is part of the newer “interview” Qt MVC framework. It is called QListView.

    It can be a bit confusing.

    In general: A “QxxxxView” widget can be bound to a “QxxxxModel” object, such as the QSqlQueryModel you asked about.

    See:
    http://qt-project.org/doc/qt-4.8/qlistview.html

    And:
    http://qt-project.org/doc/qt-4.8/model-view-programming.html

    Lot’s of good examples. For instance:
    http://qt-project.org/doc/qt-4.8/sql-querymodel.html

    Good luck.
    🙂

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

Sidebar

Related Questions

I created this regular expression to validate names: ^[a-zA-Z0-9\s\-\,]+.\*?$ Is there a way add
Is there any way to add funds to my PP account from associated bank
Is there a way to add assets (JS) to the manifest from within a
Is there any way to add a video (not .gif pictures) as a background
Is there way to add new method to List object over the object from
Is there a way to add an Attribute on the Controller level but not
Is there a way to add ImageViews to a PreferenceCategory? How? I know this
is there a way to add cell.accessoryType = UITableViewCellAccessoryDetailDisclosureButton; to each row in a
Is there a way to add a resource to a ResourceDictionary from code without
Is there any way to add Field (or FieldInfo , maybe this is the

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.