Hi, I am developing a plugins to Kate[1] with PyKDE .
In a plugin I want to highlight one piece of a text. Something like this[2]: KTextEditor::Attribute::Ptr attr(new KTextEditor::Attribute()); attr->setBackground(Qt::yellow); ... KTextEditor::MovingRange* mr = miface->newMovingRange(matches.first()); mr->setAttribute(attr); But in python this does not work: attr = KTextEditor.Attribute(KTextEditor.Attribute()) attr.setBackground(Qt.yellow) si = doc.smartInterface() sstart = si.newSmartCursor(start.line()+1, start.column()+1) send = si.newSmartCursor(end.line()-2, end.column()-2) mr = si.newSmartRange(sstart, send) mr.setAttribute(attr) *** TypeError: argument 1 of SmartRange.setAttribute() has an invalid type I think that the problem is that I am passing a param of the "KTextEditor::Attribute" class, and I have to pass a param of the "KTextEditor::Attribute::Ptr" class [1]: https://github.com/goinnn/Kate-plugins [2]: https://projects.kde.org/projects/kde/kde-baseapps/kate/repository/revisions/master/entry/part/plugins/hlselection/hlselectionplugin.cpp#L144 Best Regards, -- Pablo Martín
_______________________________________________ PyQt mailing list PyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt