From ktexteditor-devel Wed Sep 21 18:42:03 2005 From: Dominik Haumann Date: Wed, 21 Sep 2005 18:42:03 +0000 To: ktexteditor-devel Subject: Re: texthint interface (kde4) Message-Id: <200509212042.03291.dhdev () gmx ! de> X-MARC-Message: https://marc.info/?l=ktexteditor-devel&m=112732815103783 On Wednesday 21 September 2005 13:52, Vladimir Prus wrote: > On Wednesday 21 September 2005 15:28, Dominik Haumann wrote: > > so the TextHintInterface provides: > > virtual void setEnableTextHints(bool enable); > > virtual bool textHintsEnabled(); > > > > virtual void setTextHint(const Range&, const QString& text, int > > timeout); virtual void setTextHint(const Cursor&, const QString& text, > > int timeout); > > > > signal: > > void needTextHint(const View&, const Cursor&); > > That would be good. To clarify: it I setTextHint on certain region on > text, the mouse leaves that region, tool-tip is hidden and the mouse > enters that region again, I'd like the same tooltip to be shown again, > without 'needTextHint'. In other words, I want tooltips to be kind of > "sticky", to minimize queries to debugger in KDevelop. > > And there should be a way to reset all tooltips (after program restart). > > Ideally, there should be also tooltip for selections. Say, I have > expression like this in debugger: > > a + foo > > I can view the value of 'a' and 'foo' via mouse, but I also want to > quickly get the value of the entire expression. It would be nice to just > select it with a mouse, and get immediate tooltip with value. hm, right now you would have to save the ranges yourself, so you still would not have to query the debugger every time. The selection stuff is really missing, though. Another try with persistent texthints, that means the user has to maintain the list himself completely: void setEnableTextHints(bool enalbe); bool textHintsEnabeld() const; void setTextHintTimeout(int milliseconds); int textHintTimeout() const; void addTextHint(const Range&, const QString& hint); QMap& textHints() const; void removeTextHint(const Range&); void changeTextHint(const Range&, const QString& newHint); void clearTextHints(); signals: void needTextHint(View*, QCursor&, bool hasSelection); Problem: if a range already has a texthint, no signal is emitted, and so outdated hints might be there. Another drawback: the interface already grows ;) Probably there are much better solutions, so please be creative ;) -- Dominik GPG Fingerprint: AC88 49E3 D8A5 0541 5B71 AC6E 29AA 1696 FF64 EDBC User-Agent: KMail; Desktop: KDE; OS: Gentoo/Linux; *free software* _______________________________________________ Ktexteditor-devel mailing list Ktexteditor-devel@kde.org https://mail.kde.org/mailman/listinfo/ktexteditor-devel