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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T09:59:17+00:00 2026-06-14T09:59:17+00:00

I have a basic QTableView displaying data from an SQLite table with QSqlTableModel. Data

  • 0

I have a basic QTableView displaying data from an SQLite table with QSqlTableModel.

Data entry is done by the parent dialog having a number of widgets representing the field data and an “Add” button.
Data removal is done via a “Remove selected rows” button.

Everything is very functional but I find it incredibly clunky and want to try a Better Way.

Ideally, I would like an empty row in the view into which the user can simply begin typing their data. At the end of each row a button to delete that specific row (kind of like the vertical headers but with a push button instead of row numbers).

I think this may be achievable with sub-classing QTableView, but the idea of having to repaint everything is a little daunting…

Does anyone have advice on how I could go about this, maybe using Delegates (admittedly something I have not used before) or another simpler method that I have overlooked??

  • 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-14T09:59:18+00:00Added an answer on June 14, 2026 at 9:59 am

    From what you describe you shouldn’t have to worry about repainting anything. Simply you can add a QButton in the last cell of row. There are several answers/articles on adding a button to a QTableView:

    1. http://qtadventures.wordpress.com/2012/02/04/adding-button-to-qviewtable/
    2. Adding button to QTableview

    Secondly, with allowing a user to add a row directly read this article sections on making the model editable and inserting/remove rows.

    1. http://doc.qt.io/archives/qt-4.7/model-view-programming.html#making-the-model-editable
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have fetched some records from core data, and presented it in a table
I have a basic math question. I am trying to get a percentage from
I have a UISplitViewController which implements a masterNavigationController and a detailNavigationController , basic from
I'm having some trouble with displaying results from a datasource. This code will show
I have basic Spring MVC 3 setup for i18n where I can show labels
I have basic idea on Kilo Virtual Machine on Mobiles , I have clear
I have basic hello word example of Prime Faces. I have created dynamic web
I have a basic nServicebus 3.2.0 setup with a web application endpoint and a
I have a basic web application written in Java, running on a tomcat on
I have a basic PHP form (a few fields and 2 checkboxes, I want

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.