--Sig_/Q.Rtf8tprpcLayuYeCZs__Z Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Fri, 25 Jan 2019 15:12:52 +0100 Thomas Friedrichsmeier wrote: > I'm currently trying to figure out how to show argument hints in a > ktexteditor view. I can register a CodeCompletionModel all right, but > any completions where I set ArgumentHintDepth to non-zero just > disappear. Ok, I admit that was a difficult type of question, so more specifically: In the following minimal example, why does the hint disappear as soon as I return 1 for ArgumentHintDepth (instead of popping up in a separate tip, as I would expect): class MyDummyModel : public KTextEditor::CodeCompletionModel { public: MyDummyModel(QObject *parent) : KTextEditor::CodeCompletionModel(parent) { setRowCount(1); setHasGroups(false); }; ~MyDummyModel() {}; QVariant data(const QModelIndex & index, int role) const { int col =3D index.column (); if (role =3D=3D Qt::DisplayRole) { if (col =3D=3D KTextEditor::CodeCompletionModel::Name) { return i18n("dummyhint"); } } else if (role =3D=3D KTextEditor::CodeCompletionModel::ArgumentHintDepth) { return 1; // change to 0, and the dummy hint is visible } return QVariant(); } void completionInvoked(KTextEditor::View * view, const KTextEditor::Range & range, KTextEditor::CodeCompletionModel::InvocationType invocationType) { // fake an update: beginResetModel(); endResetModel(); } }; void testMyDummyModel() { KTextEditor::Editor* editor =3D KTextEditor::Editor::instance(); KTextEditor::Document* m_doc =3D editor->createDocument(0); KTextEditor::View* m_view =3D m_doc->createView(0); KTextEditor::CodeCompletionInterface* m_iface =3D qobject_cast(m_view); m_iface->registerCompletionModel(new MyDummyModel(m_view)); m_iface->setAutomaticInvocationEnabled(true); m_view->show (); }; Thanks! Thomas --Sig_/Q.Rtf8tprpcLayuYeCZs__Z Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEby3AwIMM6jiQ/yLPORWR3xhYy7YFAlxSve0ACgkQORWR3xhY y7aaSg//bRxaweco2VGP4fx7prVp2bzEC58yXKAe9TTw5bRIKhyzVUm/6o92Q1ZQ Lz2AF4y0grt67MCijnseEP83y8+TYgR9PAv6m0v2q3T5Eyim8ctmf/dphRKR9JCN uf49+GnPVNixacxkAALHewasUpPyLg9CFypp9joKW3Ns4DofFjjIpoIIXdKHVwgD qycFi/QTOw+/T0uOpkRu0DZVJxmCK9hS2Wa/2hBMED217mbY+3NiYTXZkHuRh3Xj ST5r7HA3jIZpSFox3WucYzuAfWKA07MyGCwo8e40tzyNG/t0mxbECsS4EAG2RClo 9Mo32QNXmqQps0gCdp7WeYIkx2K1ZU7FlsT9uGrn/gPKyFPBpBihbe3+aTXF8wCN 2EnrthWivRsWow0sdZcMJK8VuMDtjhT3O4/BWVbrAxo79tKXuz9DthPYuispxHqz fsCKUciUuVkyJd02skkD9TR91l2aw3Iof/+G15ZUWsdTuiyLv4Ht2z2fSX+JGfPI o8WK4KVS8UVGUiUshNrQggkQHj8tECLsoPkPfBqmeRIkWlEvHiTbsXo1uUMzorhf CbpQ1eFhg7Ay5ihC3+s7UwneUEq2b0Yhqi6qVPK/I7QCJvcFQZlKtmHjxXl9DQgh cPUQXSpuPjwOmrNQ7wdJyaYkKRIE/FkGx3OUJts2YfUlFALEIP4= =cNoo -----END PGP SIGNATURE----- --Sig_/Q.Rtf8tprpcLayuYeCZs__Z--