[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ktexteditor-devel
Subject:    Re: texthint interface (kde4)
From:       Dominik Haumann <dhdev () gmx ! de>
Date:       2005-09-21 18:42:03
Message-ID: 200509212042.03291.dhdev () gmx ! de
[Download RAW message or body]

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<Range*, QString>& 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

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic