This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Help, Creating new message widget like tooltips but better

Tags: None
(comma "," separated)
mchavezg
Registered Member
Posts
2
Karma
0
OS
Hi,

Im trying to make a new way of showing little messages below a widget. Some kind of tooltip but animated.
The purpose is to inform the user about some warning or error regarding the information entered on the widget, for example when entering text in a lineEdit, instead of launching a dialog to show the error, or showing the ugly tooltip, this new message can slide out from the lineEdit.

I have created that and it works partially. But im facing a problem when the widget is on the bottom of the container (a groupbox, or the window), the tipMessage is not shown completely, it is not shown beyond the container. Of course this is because the tipMessage is a child of that container and it is not attached to the container layout (to allow expand the containter, which is my objective -not expand it-).

I have been trying some solutions without any good results, for example the QWidget::mapToGlobal() to get global coordinates of the widget, but i got different coordinates each time i call the mapToGlobal() method.

I have my code showing an example and the widget code here:
http://lemonpos.sourceforge.net/testMyWidgets.tar.gz

Any help would be appreciated.

Miguel Chavez.
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
You need to make the tooltips that "slide out" parent-less, so that they can draw everywhere. See ToolTipManager.cpp and the ToolTips folder. http://websvn.kde.org/trunk/KDE/kdebase ... ings/core/


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
mchavezg
Registered Member
Posts
2
Karma
0
OS
bcooksley wrote:You need to make the tooltips that "slide out" parent-less, so that they can draw everywhere. See ToolTipManager.cpp and the ToolTips folder. http://websvn.kde.org/trunk/KDE/kdebase ... ings/core/


Thanks, i have fixed them for now.
I think that for my use is working fine, although it may be buggy on other layout.

I have added two ways for showing the tip, one appearing below its partner widget, and other appearing above it partner widget. Also it auto hides after 5 seconds or when users click the tip.

for anyone that wants to use it, it is on my github repo:

http://github.com/miguelchavez/mibitWidgets


Bookmarks



Who is online

Registered users: Bing [Bot], claydoh, Google [Bot], markhm, rblackwell, sethaaaa, Sogou [Bot], Yahoo [Bot]