Trolltech Home | Qt4-preview-feedback Home | Recent Threads | All Threads | Author | Date
All threads index page 1

Qt4-preview-feedback Archive, January 2008
crash when printing PDF


Message 1 in thread

Hi,

using qt-x11-commercial-src-4.4.0-snapshot-20080103 on Linux (openSuse 10.2) I 
get a crash when I play around with the QTextEdit::print() functionality when 
I select to print to file (PDF) -> Properties -> close -> print -> crash

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1235978544 (LWP 3080)]
0xb7441624 in QPrintPropertiesDialog::setupPrinter (this=0x9c17bc0) at 
dialogs/qprintdialog_unix.cpp:272
272         QOptionTreeItem* rootItem = model->rootItem;
(gdb) bt
#0  0xb7441624 in QPrintPropertiesDialog::setupPrinter (this=0x9c17bc0) at 
dialogs/qprintdialog_unix.cpp:272
#1  0xb74418be in QUnixPrintWidgetPrivate::setupPrinter (this=0x9ad86b8) at 
dialogs/qprintdialog_unix.cpp:869
#2  0xb7441b2d in QPrintDialogPrivate::setupPrinter (this=0x9c27568) at 
dialogs/qprintdialog_unix.cpp:475
#3  0xb7441b7e in QPrintDialog::exec (this=0xbfd1839c) at 
dialogs/qprintdialog_unix.cpp:553
#4  0xb71064e5 in qt_compat_QPrinter_printSetup (printer=0xbfd18410, 
pd=0x8521588, parent=0x9aa37b8)
    at painting/qprinter.cpp:1925
#5  0xb710652f in QPrinter::setup (this=0xbfd18410, parent=0x9aa37b8) at 
painting/qprinter.cpp:1973
#6  0x0831ca14 in TextEditor::filePrint (this=0x9aa37b8) at TextEditor.cxx:504
#7  0x08331d91 in TextEditor::qt_metacall (this=0x9aa37b8, 
_c=QMetaObject::InvokeMetaMethod, _id=3,
    _a=0xbfd1853c) at moc_TextEditor.cxx:89
#8  0xb77e26b1 in QMetaObject::activate (sender=0x9aadf00, 
from_signal_index=9, to_signal_index=10,
    argv=0xbfd1853c) at kernel/qobject.cpp:3169
#9  0xb77e28b4 in QMetaObject::activate (sender=0x9aadf00, m=0xb767fd38, 
from_local_signal_index=5,
    to_local_signal_index=6, argv=0xbfd1853c) at kernel/qobject.cpp:3262
#10 0xb6fc3cb0 in QAction::activated (this=0x9aadf00, _t1=-275) 
at .moc/debug-shared/moc_qaction.cpp:236
#11 0xb6fc5bd3 in QAction::activate (this=0x9aadf00, event=QAction::Trigger) 
at kernel/qaction.cpp:1101
#12 0xb6fc97b7 in QAction::trigger (this=0x9aadf00) 
at ../../include/QtGui/../../src/gui/kernel/qaction.h:179
#13 0xb7409a4b in QToolButton::nextCheckState (this=0x9aae118) at 
widgets/qtoolbutton.cpp:1060
#14 0xb732721b in QAbstractButtonPrivate::click (this=0x9aae130) at 
widgets/qabstractbutton.cpp:512
#15 0xb7327542 in QAbstractButton::mouseReleaseEvent (this=0x9aae118, 
e=0xbfd18db4)
    at widgets/qabstractbutton.cpp:1100
#16 0xb740b034 in QToolButton::mouseReleaseEvent (this=0x9aae118, 
e=0xbfd18db4) at widgets/qtoolbutton.cpp:649
#17 0xb702736d in QWidget::event (this=0x9aae118, event=0xbfd18db4) at 
kernel/qwidget.cpp:6599
#18 0xb7325dba in QAbstractButton::event (this=0x9aae118, e=0xbfd18db4) at 
widgets/qabstractbutton.cpp:1062
#19 0xb74099f6 in QToolButton::event (this=0x9aae118, e=0xbfd18db4) at 
widgets/qtoolbutton.cpp:1066
#20 0xb6fcb989 in QApplicationPrivate::notify_helper (this=0x84e7238, 
receiver=0x9aae118, e=0xbfd18db4)

-- 
 [ signature omitted ] 

Attachment: signature.asc
Description: This is a digitally signed message part.


Message 2 in thread

Hi,

> using qt-x11-commercial-src-4.4.0-snapshot-20080103 on Linux (openSuse 10.2) I 
> get a crash when I play around with the QTextEdit::print() functionality when 
> I select to print to file (PDF) -> Properties -> close -> print -> crash

I can reproduce that, in both the PDF and the PS case.

The crash happens somewhere here:
	void QPrintPropertiesDialog::setupPrinter() const
	{
	    [...]
		    QPPDOptionsModel* model =
	            static_cast<QPPDOptionsModel*>(widget.treeView->model());
	    [...]
The return value of widget.treeView->model() is NULL.

That's probably because in the case of a PDF or PS printer, function 
QPrintPropertiesDialog::selectPdfPsPrinter() is executed, which unlike 
QPrintPropertiesDialog::selectPrinter() doesn't set a model.

I don't know whether a PDF or a PS printer should have an associated options 
model.

--
 [ signature omitted ] 

Message 3 in thread

>> using qt-x11-commercial-src-4.4.0-snapshot-20080103 on Linux (openSuse 
>> 10.2) I get a crash when I play around with the QTextEdit::print() 
>> functionality when I select to print to file (PDF) -> Properties -> 
>> close -> print -> crash
> 
> I can reproduce that, in both the PDF and the PS case.

Additionally, in the PS case, the suggested filename is still print.pdf, which 
results in a PDF file instead of a PS file being generated.

--
 [ signature omitted ]