View Full Version : QToolTip width
Vladimir
1st March 2007, 17:31
Hello !
I'm using rich-text formated QToolTip and it seems that the width of tooltip is computed incorrectly: there is a lot of extra free space. My tooltip text looks like the following:
<nobr><h4><u>name: Type</u></h4></nobr><br />name: value
Are there any ways to adjust tooltip width more precisely ?
patrik08
1st March 2007, 19:27
Hello !
I'm using rich-text formated QToolTip and it seems that the width of tooltip is computed incorrectly: there is a lot of extra free space. My tooltip text looks like the following:
<nobr><h4><u>name: Type</u></h4></nobr><br />name: value
Are there any ways to adjust tooltip width more precisely ?
You can write qt html && make html -> table large xx pixel...
To work on this html is you can build your hown editor... or....
/* require qt2 && subversion svn */
mkdir tmp && cd tmp
svn co https://qt-webdav.svn.sourceforge.net/svnroot/qt-webdav/html_editor/ html
cd html
qmake && make
cd d*
./htmledit
On this tool you can switch source edit or Wysiwyg table & image ... only link href must make from hand.....
http://ppk.ciz.ch/latex_1/linux/pics/Screenshot.png
wysota
1st March 2007, 20:09
Hello !
I'm using rich-text formated QToolTip and it seems that the width of tooltip is computed incorrectly: there is a lot of extra free space.
Could we see a screenshot?
What happens if you change the contents to:
<h4><u>name: Type</u></h4>
<p>name: value</p>
Vladimir
1st March 2007, 22:18
Could we see a screenshot?
Yes, here is a screenshot with the following tooltip text:
<h4><u>name: Type</u></h4>
<p>name: value</p>
The same tooltip can be shown in treeview at the right, and there is exactly the same effect.
wysota
1st March 2007, 22:29
Did you try to limit the width with CSS? For example by using:
<h4 style="width: 100px;">xxx</h4>
You can also try:
<h4 style="display:inline;">xxx</h4><br/>
What happens if you omit the h4 tag completely?
Vladimir
2nd March 2007, 07:38
I've played more with it and found that:
1. When using rich text the tooltip always has some minimal size: if text width is smaller than it there is extra free space, it text width is larger - everything is ok
2. Each tag that adds new-line (<br />, <p>, <h1>, <table>, ...) increases this size
3. "width" property and style is completely ignored
You can reproduce it very easily: create any widget in Qt4 designer, assign tooltip with rich text to it, preview the widget and take a look at displayed tooltip.
Maybe its time for bugreport ?
wysota
2nd March 2007, 07:49
Maybe it is. Looks like the "page width" is too big but I can't decrease it in any way.
Vladimir
3rd March 2007, 08:15
I've just submitted bugreport to trolltech.
Thanks for your attention.
Powered by vBulletin® Version 4.2.5 Copyright © 2024 vBulletin Solutions Inc. All rights reserved.