-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Crash using QgsComposerAttributeTableV2 after setting columns #25080
Comments
Author Name: Loïc BARTOLETTI (@lbartoletti) No, they're different issues. |
Author Name: Giovanni Manghi (@gioman) Loïc BARTOLETTI wrote:
thanks, so please add a description to #25079 just not leave the link to stackexchange, thanks.
|
Author Name: Jürgen Fischer (@jef-n)
|
Author Name: Denis Rouzaud (@3nids)
|
Author Name: Nyall Dawson (@nyalldawson) Your code is a bit wrong: cols = table.columns() table.columns() is returning a pointer to the table's columns, so any edits (such as appending columns) happens immediately. There's no need to call table.setColumns() after. This is causing the crash, because the table already has ownership of that columns object. Admittedly, not the nicest api!
|
Author Name: Loïc BARTOLETTI (@lbartoletti)
Original Redmine Issue: 17181
Affected QGIS version: 2.18.13
Redmine category:python_bindings_/_sipify
QGis crash when you use this code into the console (with a real project):
@table = QgsComposerAttributeTableV2(iface.activeComposers()[0].composition(), False)
cols = table.columns()
newCol = QgsComposerTableColumn("test_for_crash")
newCol.setAttribute("$id")
cols.append(newCol)
table.setColumns(cols)
[i.heading() for i in table.columns()]@
Tested on Windows 7 QGis 2.18, Debian QGis 2.14 and FreeBSD 2.18.
Seems to be a bad_alloc. Here some logs from Debian:
FreeBSD show a windows with this error:
Related issue(s): #25079 (relates)
Redmine related issue(s): 17180
The text was updated successfully, but these errors were encountered: