Hi,
I an learning to use QTreeWidget, QTreeWidgetItem, etc. and I got a
segmentation fault. I think that because I am using some stupid thing,
so this mail is a report of how to crash pyqt and is a request to fix my
bad code :-)
I am doing:
self.model = QtGui.QStandardItemModel(8,3,self)
self.model.setHeaderData(0,QtCore.Qt.Horizontal, QtCore.QVariant(self.tr("Directori")))
self.model.setHeaderData(1, QtCore.Qt.Horizontal, QtCore.QVariant(self.tr("Suffix")))
self.model.setHeaderData(2, QtCore.Qt.Horizontal, QtCore.QVariant(self.tr("Offset")))
self.ui.merge_sources.setModel(self.model)
(merge_sources is type <widget class="QTreeWidget" name="merge_sources" > )
I have not had time to watch carefully QTreeWidget and QTreeView, etc. sorry -I
am sure that I am not using in the correct way
Then I have:
def on_merge_sources_itemDoubleClicked(self,item,column):
if column==0:
directori=QtGui.QFileDialog.getExistingDirectory(self,"Select a directory","Select a directory")
item.setText(0,"hola")
self.ui.merge_sources.setCurrentItem(item)
And here it crash. I just want that if user double clicks column 0 appears
a QFileDialog and set some text, nothing more. I think that I don't use
item variable in correct way.
The gdb report:
(gdb) bt
#0 0xb712bf47 in QTreeWidget::metaObject () from /usr/lib/libQtGui.so.4
#1 0x082f7ad8 in ?? ()
#2 0x0824fed0 in ?? ()
#3 0xbfb668e8 in ?? ()
#4 0xb7afd7f9 in QMetaObject::cast () from /usr/lib/libQtCore.so.4
#5 0xb7134fba in QTreeWidget::setCurrentItem () from /usr/lib/libQtGui.so.4
#6 0xb713500a in QTreeWidget::setCurrentItem () from /usr/lib/libQtGui.so.4
#7 0xb73e0c9b in ?? () from /usr/lib/python2.4/site-packages/PyQt4/QtGui.so
#8 0x080b954b in PyEval_EvalFrame ()
#9 0x080ba6b5 in PyEval_EvalCodeEx ()
#10 0x08100669 in PyClassMethod_New ()
#11 0x08058987 in PyObject_Call ()
#12 0x0805e26e in PyClass_IsSubclass ()
#13 0x08058987 in PyObject_Call ()
#14 0x080b3bdd in PyEval_CallObjectWithKeywords ()
#15 0xb7ba1eb2 in sip_api_emit_to_slot ()
from /usr/lib/python2.4/site-packages/sip.so
#16 0xb7c01219 in initQtCore ()
from /usr/lib/python2.4/site-packages/PyQt4/QtCore.so
#17 0xb7c0159c in initQtCore ()
from /usr/lib/python2.4/site-packages/PyQt4/QtCore.so
#18 0xb7b0a235 in QMetaObject::activate () from /usr/lib/libQtCore.so.4
#19 0xb7b0ab9c in QMetaObject::activate () from /usr/lib/libQtCore.so.4
#20 0xb712c2ca in QTreeWidget::itemDoubleClicked () from /usr/lib/libQtGui.so.4
#21 0xb7134daf in QTreeWidget::currentItem () from /usr/lib/libQtGui.so.4
#22 0xb71354df in QTreeWidget::qt_metacall () from /usr/lib/libQtGui.so.4
#23 0xb7b0a235 in QMetaObject::activate () from /usr/lib/libQtCore.so.4
#24 0xb7b0ab9c in QMetaObject::activate () from /usr/lib/libQtCore.so.4
#25 0xb70c7a94 in QAbstractItemView::doubleClicked ()
from /usr/lib/libQtGui.so.4
#26 0xb70fe100 in QTreeView::mouseDoubleClickEvent ()
from /usr/lib/libQtGui.so.4
#27 0xb744451c in initQtGui ()
from /usr/lib/python2.4/site-packages/PyQt4/QtGui.so
#28 0xb6d79037 in QWidget::event () from /usr/lib/libQtGui.so.4
#29 0xb6ff9a04 in QFrame::event () from /usr/lib/libQtGui.so.4
#30 0xb706dffc in QAbstractScrollArea::viewportEvent ()
from /usr/lib/libQtGui.so.4
#31 0xb70cb322 in QAbstractItemView::viewportEvent ()
from /usr/lib/libQtGui.so.4
#32 0xb7413223 in ?? () from /usr/lib/python2.4/site-packages/PyQt4/QtGui.so
#33 0xb706f715 in QAbstractScrollArea::setViewport ()
from /usr/lib/libQtGui.so.4
#34 0xb6d2f551 in QApplicationPrivate::notify_helper ()
from /usr/lib/libQtGui.so.4
#35 0xb6d32053 in QApplication::notify () from /usr/lib/libQtGui.so.4
#36 0xb7612673 in initQtGui ()
....
Using Debian with:
ii pyqt4-dev-tools 4.0.1-5 Development tools for PyQt4
ii python-qt4-dev 4.0.1-3 Development files for PyQt4
ii python-qtext 3.16-1.2 Qt extensions for PyQt
ii libqt4-core 4.2.0-1 Qt 4 core non-GUI functionality runtime libr
ii libqt4-dev 4.2.0-1 Qt 4 development files
ii libqt4-gui 4.2.0-1 Qt 4 core GUI functionality runtime library
ii libqt4-qt3support 4.2.0-1 Qt 3 compatibility library for Qt 4
ii libqt4-sql 4.2.0-1 Qt 4 SQL database module
ii pyqt4-dev-tools 4.0.1-5 Development tools for PyQt4
ii python-qt4 4.0.1-3 Python bindings for Qt4
ii python-qt4-dev 4.0.1-3 Development files for PyQt4
ii qt4-designer 4.1.4-1.1 Qt 4 Designer
ii qt4-dev-tools 4.2.0-1 Qt 4 development tools
ii qt4-doc 4.1.4-1.1 Qt 4 API documentation
ii python-qt4 4.0.1-3 Python bindings for Qt4
ii python 2.4.3-11 An interactive high-level object-oriented la
ii python-sip4 4.4.5-3 Python/C++ bindings generator runtime librar
If you need more information, tell me.
Maybe I should upgrade to new pyqt versions, I think that I have last
Debian ones.
I am sure that I am not using Qt in correct way. But, anyway, should not
crash in that way :-)
Thanks!
--
Carles Pina i Estany GPG id: 0x8CBDAE64
http://pinux.info Manresa - Barcelona
More information about the PyQt
mailing list
‘She has never mentioned her father to me. Was he—well, the sort of man whom the County Club would not have blackballed?’ "We walked by the side of our teams or behind the wagons, we slept on the ground at night, we did our own cooking, we washed our knives by sticking them into the ground rapidly a few times, and we washed our plates with sand and wisps of grass. When we stopped, we arranged our wagons in a circle, and thus formed a 'corral,' or yard, where we drove our oxen to yoke them up. And the corral was often very useful as a fort, or camp, for defending ourselves against the Indians. Do you see that little hollow down there?" he asked, pointing to a depression in the ground a short distance to the right of the train. "Well, in that hollow our wagon-train was kept three days and nights by the Indians. Three days and nights they stayed around, and made several attacks. Two of our men were killed and three were wounded by their arrows, and others had narrow escapes. One arrow hit me on the throat, but I was saved by the knot of my neckerchief, and the point only tore the skin a little. Since that time I have always had a fondness for large neckties. I don't know how many of the Indians we killed, as they carried off their dead and wounded, to save them from being scalped. Next to getting the scalps of their enemies, the most important thing with the Indians is to save their own. We had several fights during our journey, but that one was the worst. Once a little party of us were surrounded in a small 'wallow,' and had a tough time to defend ourselves successfully. Luckily for us, the Indians had no fire-arms then, and their bows and arrows were no match for our rifles. Nowadays they are well armed, but there are[Pg 41] not so many of them, and they are not inclined to trouble the railway trains. They used to do a great deal of mischief in the old times, and many a poor fellow has been killed by them." As dusk came on nearly the whole population of Maastricht, with all their temporary guests, formed an endless procession and went to invoke God's mercy by the Virgin Mary's intercession. They went to Our Lady's Church, in which stands the miraculous statue of Sancta Maria Stella Maris. The procession filled all the principal streets and squares of the town. I took my stand at the corner of the Vrijthof, where all marched past me, men, women, and children, all praying aloud, with loud voices beseeching: "Our Lady, Star of the Sea, pray for us ... pray for us ... pray for us ...!" It had not occurred to her for some hours after Mrs. Campbell had told her of Landor's death that she was free now to give herself to Cairness. She had gasped, indeed, when she did remember it, and had put the thought away, angrily and self-reproachfully. But it returned now, and she felt that she might cling to it. She had been grateful, and she had been faithful, too.[Pg 286] She remembered only that Landor had been kind to her, and forgot that for the last two years she had borne with much harsh coldness, and with a sort of contempt which she felt in her unanalyzing mind to have been entirely unmerited. Gradually she raised herself until she sat quite erect by the side of the mound, the old exultation of her half-wild girlhood shining in her face as she planned the future, which only a few minutes before had seemed so hopeless. After he had gloated over Sergeant Ramsey, Shorty got his men into the road ready to start. Si placed himself in front of the squad and deliberately loaded his musket in their sight. Shorty took his place in the rear, and gave out: The groups about each gun thinned out, as the shrieking fragments of shell mowed down man after man, but the rapidity of the fire did not slacken in the least. One of the Lieutenants turned and motioned with his saber to the riders seated on their horses in the line of limbers under the cover of the slope. One rider sprang from each team and ran up to take the place of men who had fallen. "As long as there's men and women in the world, the men 'ull be top and the women bottom." Then, in the house, the little girls were useful. Mrs. Backfield was not so energetic as she used to be. She had never been a robust woman, and though her husband's care had kept her well and strong, her frame was not equal to Reuben's demands; after fourteen years' hard labour, she suffered from rheumatism, which though seldom acute, was inclined to make her stiff and slow. It was here that Caro and Tilly came in, and Reuben began to appreciate his girls. After all, girls were needed in a house—and as for young men and marriage, their father could easily see that such follies did not spoil their usefulness or take them from him. Caro and Tilly helped their grandmother in all sorts of ways—they dusted, they watched pots, they shelled peas and peeled potatoes, they darned house-linen, they could even make a bed between them. HoME一级毛片视频免费公开
ENTER NUMBET 0018www.zs-tech.net.cn www.difanxi.com.cn syan.net.cn syhwy.com.cn skillyman.com.cn www.226888.com.cn www.hjyyls.com.cn www.xrdi.com.cn cfdtz.com.cn www.dmxl808.com.cn