qt


How to get an auto incremented ID of a newly inserted row


In datebase I have these two tables, and want to add rows into them from QT using QSQLTableModel and QDataWidgetMapper.
Authors:
ID | Last name | First name
0 | Saroyan | William
1 | Meyers | Scott
AuthorDocument:
Author | Document name
0 | Human comedy
1 | c++
First I insert a row using a mapper into Authors table
mapper->addMapping(LastName,1);
mapper->addMapping(FirstName, 2);
The ID field is auto incremented.
Now when I want to add a row into AuthorDocument I need that ID, but I don't know how to get it.

Related Links

What 'model' am I getting in my ListView delegate?
How to manage Focus with States in my custom QML component?
in QT I Can't create project with a Kit
Youtube video not playing in qt webview
Launch function after init function Qt - Pyside
Not able to cancel the drag when we exit mouse area
Clear QPainter Drawing over Image on Label
Having trouble drawing an image in Qt using QGraphicsScene
Custom attached properties in QML
Does QT widgets has a ZUI (zoom user interface) library C++ or supports it?
QTcpServer::incomingConnection(qintptr) not calling
Tree models in Pyside
qt creator says file aliased in qrc not found
How to read data from a text file and store it in a QVector for plotting with QCustomPlot?
psoc 3 kit3 integrated with qt, gives error code -5(error not found)
Static linking Qt - linux - standalone app

Categories

HOME
typelite
apple-push-notifications
haproxy
informatica
celery
qooxdoo
openflow
tfs2015
iptables
cdi
joomla3.2
wagtail
cisco
eddystone
lc3
xamarin-zebble
amazon-emr
bazaar
tableview
animated-gif
crud
background-color
ruby-daemons
pyspark-sql
ibm-connections
es6-modules
lxml
overwrite
xerces-c
subclassing
xvfb
cloudera-quickstart-vm
plane
secure-coding
distributed-caching
notesview
morphline
reverse-dns
xcode8.2
kitura
simple-schema
webvtt
dex
.when
yui3
rational-performance-test
xcode6.4
logical
nunit-console
gcloud-node
maven-release-plugin
perforce-integrate
uibinder
asp.net-web-api-helppages
erlog
prism-4
createfile
famo.us
juttle
datagridcomboboxcolumn
quantify
libgcc
network-printers
prism.js
xulrunner
roxy-fileman
jomsocial
assetic
meteorite
xsd2code
dynamic-rdlc-generation
examine
gprof
websphere-6.1
thejit
liveconnect
qtextbrowser
glassfish-esb
tablet-pc
mongrel2
regression-testing
aptitude
yahoo-maps
activex-exe
isapi-redirect

Resources

Encrypt Message