A<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
		<id>http://cppe.ru/index.php?action=history&amp;feed=atom&amp;title=C%2B%2B%2FQt%2FToolTip</id>
		<title>C++/Qt/ToolTip - История изменений</title>
		<link rel="self" type="application/atom+xml" href="http://cppe.ru/index.php?action=history&amp;feed=atom&amp;title=C%2B%2B%2FQt%2FToolTip"/>
		<link rel="alternate" type="text/html" href="http://cppe.ru/index.php?title=C%2B%2B/Qt/ToolTip&amp;action=history"/>
		<updated>2026-04-10T03:36:46Z</updated>
		<subtitle>История изменений этой страницы в вики</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>http://cppe.ru/index.php?title=C%2B%2B/Qt/ToolTip&amp;diff=1248&amp;oldid=prev</id>
		<title> в 14:21, 25 мая 2010</title>
		<link rel="alternate" type="text/html" href="http://cppe.ru/index.php?title=C%2B%2B/Qt/ToolTip&amp;diff=1248&amp;oldid=prev"/>
				<updated>2010-05-25T14:21:06Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr style=&quot;vertical-align: top;&quot; lang=&quot;ru&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Предыдущая&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Версия 14:21, 25 мая 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; style=&quot;text-align: center;&quot; lang=&quot;ru&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(нет различий)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
			</entry>

	<entry>
		<id>http://cppe.ru/index.php?title=C%2B%2B/Qt/ToolTip&amp;diff=1249&amp;oldid=prev</id>
		<title>Admin: 1 версия:&amp;#32;Импорт контента...</title>
		<link rel="alternate" type="text/html" href="http://cppe.ru/index.php?title=C%2B%2B/Qt/ToolTip&amp;diff=1249&amp;oldid=prev"/>
				<updated>2010-05-25T10:25:15Z</updated>
		
		<summary type="html">&lt;p&gt;1 версия: Импорт контента...&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Adding HTML based tooltip==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;  &lt;br /&gt;
Foundations of Qt Development\Chapter09\tooltips\main.cpp&lt;br /&gt;
/*&lt;br /&gt;
 * Copyright (c) 2006-2007, Johan Thelin&lt;br /&gt;
 * &lt;br /&gt;
 * All rights reserved.&lt;br /&gt;
 * &lt;br /&gt;
 * Redistribution and use in source and binary forms, with or without modification, &lt;br /&gt;
 * are permitted provided that the following conditions are met:&lt;br /&gt;
 * &lt;br /&gt;
 *     * Redistributions of source code must retain the above copyright notice, &lt;br /&gt;
 *       this list of conditions and the following disclaimer.&lt;br /&gt;
 *     * Redistributions in binary form must reproduce the above copyright notice,  &lt;br /&gt;
 *       this list of conditions and the following disclaimer in the documentation &lt;br /&gt;
 *       and/or other materials provided with the distribution.&lt;br /&gt;
 *     * Neither the name of APress nor the names of its contributors &lt;br /&gt;
 *       may be used to endorse or promote products derived from this software &lt;br /&gt;
 *       without specific prior written permission.&lt;br /&gt;
 * &lt;br /&gt;
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS&lt;br /&gt;
 * &amp;quot;AS IS&amp;quot; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT&lt;br /&gt;
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR&lt;br /&gt;
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR&lt;br /&gt;
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,&lt;br /&gt;
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,&lt;br /&gt;
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR&lt;br /&gt;
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF&lt;br /&gt;
 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING&lt;br /&gt;
 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS&lt;br /&gt;
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.&lt;br /&gt;
 *&lt;br /&gt;
 */&lt;br /&gt;
#include &amp;lt;QApplication&amp;gt;&lt;br /&gt;
#include &amp;quot;tooltipdialog.h&amp;quot;&lt;br /&gt;
int main( int argc, char **argv )&lt;br /&gt;
{&lt;br /&gt;
  QApplication app( argc, argv );&lt;br /&gt;
  &lt;br /&gt;
  ToolTipDialog dlg;&lt;br /&gt;
  dlg.show();&lt;br /&gt;
  &lt;br /&gt;
  return app.exec();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
Foundations of Qt Development\Chapter09\tooltips\tooltipdialog.cpp&lt;br /&gt;
/*&lt;br /&gt;
 * Copyright (c) 2006-2007, Johan Thelin&lt;br /&gt;
 * &lt;br /&gt;
 * All rights reserved.&lt;br /&gt;
 * &lt;br /&gt;
 * Redistribution and use in source and binary forms, with or without modification, &lt;br /&gt;
 * are permitted provided that the following conditions are met:&lt;br /&gt;
 * &lt;br /&gt;
 *     * Redistributions of source code must retain the above copyright notice, &lt;br /&gt;
 *       this list of conditions and the following disclaimer.&lt;br /&gt;
 *     * Redistributions in binary form must reproduce the above copyright notice,  &lt;br /&gt;
 *       this list of conditions and the following disclaimer in the documentation &lt;br /&gt;
 *       and/or other materials provided with the distribution.&lt;br /&gt;
 *     * Neither the name of APress nor the names of its contributors &lt;br /&gt;
 *       may be used to endorse or promote products derived from this software &lt;br /&gt;
 *       without specific prior written permission.&lt;br /&gt;
 * &lt;br /&gt;
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS&lt;br /&gt;
 * &amp;quot;AS IS&amp;quot; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT&lt;br /&gt;
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR&lt;br /&gt;
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR&lt;br /&gt;
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,&lt;br /&gt;
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,&lt;br /&gt;
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR&lt;br /&gt;
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF&lt;br /&gt;
 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING&lt;br /&gt;
 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS&lt;br /&gt;
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.&lt;br /&gt;
 *&lt;br /&gt;
 */&lt;br /&gt;
#include &amp;lt;QPushButton&amp;gt;&lt;br /&gt;
#include &amp;lt;QCheckBox&amp;gt;&lt;br /&gt;
#include &amp;lt;QLabel&amp;gt;&lt;br /&gt;
#include &amp;lt;QGroupBox&amp;gt;&lt;br /&gt;
#include &amp;lt;QGridLayout&amp;gt;&lt;br /&gt;
#include &amp;quot;tooltipdialog.h&amp;quot;&lt;br /&gt;
ToolTipDialog::ToolTipDialog() : QDialog()&lt;br /&gt;
{&lt;br /&gt;
  QGroupBox *groupBox = new QGroupBox( tr(&amp;quot;Group&amp;quot;) );&lt;br /&gt;
  QGridLayout *gbLayout = new QGridLayout( groupBox );&lt;br /&gt;
  &lt;br /&gt;
  QCheckBox *checkBox = new QCheckBox( tr(&amp;quot;Check!&amp;quot;) );&lt;br /&gt;
  QLabel *label = new QLabel( tr(&amp;quot;label&amp;quot;) );&lt;br /&gt;
  QPushButton *pushButton = new QPushButton( tr(&amp;quot;Push me!&amp;quot;) );&lt;br /&gt;
  &lt;br /&gt;
  gbLayout-&amp;gt;addWidget( checkBox, 0, 0 );&lt;br /&gt;
  gbLayout-&amp;gt;addWidget( label, 0, 1 );&lt;br /&gt;
  gbLayout-&amp;gt;addWidget( pushButton, 1, 0, 1, 2 );&lt;br /&gt;
  &lt;br /&gt;
  QGridLayout *dlgLayout = new QGridLayout( this );&lt;br /&gt;
  dlgLayout-&amp;gt;addWidget( groupBox, 0, 0 );&lt;br /&gt;
  &lt;br /&gt;
  checkBox-&amp;gt;setToolTip( tr(&amp;quot;This is a simple tool tip for the check box.&amp;quot;) );&lt;br /&gt;
  groupBox-&amp;gt;setToolTip( tr(&amp;quot;This is a group box tool tip.\n&amp;quot;&lt;br /&gt;
                           &amp;quot;Notice that it appears between and around the contained widgets.\n&amp;quot;&lt;br /&gt;
                           &amp;quot;It is also spanning several lines.&amp;quot;) );&lt;br /&gt;
  label-&amp;gt;setToolTip( tr(&amp;quot;&amp;lt;p&amp;gt;It is possible to do lists.&amp;lt;/p&amp;gt;&amp;quot;&lt;br /&gt;
                        &amp;quot;&amp;lt;ul&amp;gt;&amp;quot;&lt;br /&gt;
                          &amp;quot;&amp;lt;li&amp;gt;You can &amp;lt;i&amp;gt;format&amp;lt;/i&amp;gt; text.&amp;lt;/li&amp;gt;&amp;quot;&lt;br /&gt;
                          &amp;quot;&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Bold&amp;lt;/b&amp;gt; is possible too.&amp;lt;/li&amp;gt;&amp;quot;&lt;br /&gt;
                          &amp;quot;&amp;lt;li&amp;gt;And the &amp;lt;font color=&amp;quot;#22aaff&amp;quot;&amp;gt;color&amp;lt;/font&amp;gt; and &amp;quot;&lt;br /&gt;
                            &amp;quot;&amp;lt;font size=&amp;quot;+2&amp;quot;&amp;gt;size&amp;lt;/font&amp;gt;.&amp;lt;/li&amp;gt;&amp;quot;&lt;br /&gt;
                        &amp;quot;&amp;lt;/ul&amp;gt;&amp;quot;&lt;br /&gt;
                        &amp;quot;&amp;lt;p&amp;gt;You can do ordered lists as well.&amp;lt;/p&amp;gt;&amp;quot;&lt;br /&gt;
                        &amp;quot;&amp;lt;ol&amp;gt;&amp;quot;&lt;br /&gt;
                          &amp;quot;&amp;lt;li&amp;gt;First.&amp;lt;/li&amp;gt;&amp;quot;&lt;br /&gt;
                          &amp;quot;&amp;lt;li&amp;gt;Second.&amp;lt;/li&amp;gt;&amp;quot;&lt;br /&gt;
                          &amp;quot;&amp;lt;li&amp;gt;Third.&amp;lt;/li&amp;gt;&amp;quot;&lt;br /&gt;
                        &amp;quot;&amp;lt;/ol&amp;gt;&amp;quot;) );&lt;br /&gt;
  pushButton-&amp;gt;setToolTip( tr(&amp;quot;&amp;lt;img src=&amp;quot;:/images/qt.png&amp;quot;&amp;gt;&amp;quot;&lt;br /&gt;
                             &amp;quot;You can also insert images into your tool tips.&amp;quot;) );&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
Foundations of Qt Development\Chapter09\tooltips\tooltipdialog.h&lt;br /&gt;
/*&lt;br /&gt;
 * Copyright (c) 2006-2007, Johan Thelin&lt;br /&gt;
 * &lt;br /&gt;
 * All rights reserved.&lt;br /&gt;
 * &lt;br /&gt;
 * Redistribution and use in source and binary forms, with or without modification, &lt;br /&gt;
 * are permitted provided that the following conditions are met:&lt;br /&gt;
 * &lt;br /&gt;
 *     * Redistributions of source code must retain the above copyright notice, &lt;br /&gt;
 *       this list of conditions and the following disclaimer.&lt;br /&gt;
 *     * Redistributions in binary form must reproduce the above copyright notice,  &lt;br /&gt;
 *       this list of conditions and the following disclaimer in the documentation &lt;br /&gt;
 *       and/or other materials provided with the distribution.&lt;br /&gt;
 *     * Neither the name of APress nor the names of its contributors &lt;br /&gt;
 *       may be used to endorse or promote products derived from this software &lt;br /&gt;
 *       without specific prior written permission.&lt;br /&gt;
 * &lt;br /&gt;
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS&lt;br /&gt;
 * &amp;quot;AS IS&amp;quot; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT&lt;br /&gt;
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR&lt;br /&gt;
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR&lt;br /&gt;
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,&lt;br /&gt;
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,&lt;br /&gt;
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR&lt;br /&gt;
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF&lt;br /&gt;
 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING&lt;br /&gt;
 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS&lt;br /&gt;
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.&lt;br /&gt;
 *&lt;br /&gt;
 */&lt;br /&gt;
#ifndef TOOLTIPDIALOG_H&lt;br /&gt;
#define TOOLTIPDIALOG_H&lt;br /&gt;
#include &amp;lt;QDialog&amp;gt;&lt;br /&gt;
class ToolTipDialog : public QDialog&lt;br /&gt;
{&lt;br /&gt;
public:&lt;br /&gt;
  ToolTipDialog();&lt;br /&gt;
};&lt;br /&gt;
#endif // TOOLTIPDIALOG_H&lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Adding image to tooltip==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
Foundations of Qt Development\Chapter09\tooltips\main.cpp&lt;br /&gt;
/*&lt;br /&gt;
 * Copyright (c) 2006-2007, Johan Thelin&lt;br /&gt;
 * &lt;br /&gt;
 * All rights reserved.&lt;br /&gt;
 * &lt;br /&gt;
 * Redistribution and use in source and binary forms, with or without modification, &lt;br /&gt;
 * are permitted provided that the following conditions are met:&lt;br /&gt;
 * &lt;br /&gt;
 *     * Redistributions of source code must retain the above copyright notice, &lt;br /&gt;
 *       this list of conditions and the following disclaimer.&lt;br /&gt;
 *     * Redistributions in binary form must reproduce the above copyright notice,  &lt;br /&gt;
 *       this list of conditions and the following disclaimer in the documentation &lt;br /&gt;
 *       and/or other materials provided with the distribution.&lt;br /&gt;
 *     * Neither the name of APress nor the names of its contributors &lt;br /&gt;
 *       may be used to endorse or promote products derived from this software &lt;br /&gt;
 *       without specific prior written permission.&lt;br /&gt;
 * &lt;br /&gt;
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS&lt;br /&gt;
 * &amp;quot;AS IS&amp;quot; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT&lt;br /&gt;
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR&lt;br /&gt;
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR&lt;br /&gt;
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,&lt;br /&gt;
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,&lt;br /&gt;
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR&lt;br /&gt;
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF&lt;br /&gt;
 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING&lt;br /&gt;
 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS&lt;br /&gt;
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.&lt;br /&gt;
 *&lt;br /&gt;
 */&lt;br /&gt;
#include &amp;lt;QApplication&amp;gt;&lt;br /&gt;
#include &amp;quot;tooltipdialog.h&amp;quot;&lt;br /&gt;
int main( int argc, char **argv )&lt;br /&gt;
{&lt;br /&gt;
  QApplication app( argc, argv );&lt;br /&gt;
  &lt;br /&gt;
  ToolTipDialog dlg;&lt;br /&gt;
  dlg.show();&lt;br /&gt;
  &lt;br /&gt;
  return app.exec();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
Foundations of Qt Development\Chapter09\tooltips\tooltipdialog.cpp&lt;br /&gt;
/*&lt;br /&gt;
 * Copyright (c) 2006-2007, Johan Thelin&lt;br /&gt;
 * &lt;br /&gt;
 * All rights reserved.&lt;br /&gt;
 * &lt;br /&gt;
 * Redistribution and use in source and binary forms, with or without modification, &lt;br /&gt;
 * are permitted provided that the following conditions are met:&lt;br /&gt;
 * &lt;br /&gt;
 *     * Redistributions of source code must retain the above copyright notice, &lt;br /&gt;
 *       this list of conditions and the following disclaimer.&lt;br /&gt;
 *     * Redistributions in binary form must reproduce the above copyright notice,  &lt;br /&gt;
 *       this list of conditions and the following disclaimer in the documentation &lt;br /&gt;
 *       and/or other materials provided with the distribution.&lt;br /&gt;
 *     * Neither the name of APress nor the names of its contributors &lt;br /&gt;
 *       may be used to endorse or promote products derived from this software &lt;br /&gt;
 *       without specific prior written permission.&lt;br /&gt;
 * &lt;br /&gt;
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS&lt;br /&gt;
 * &amp;quot;AS IS&amp;quot; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT&lt;br /&gt;
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR&lt;br /&gt;
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR&lt;br /&gt;
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,&lt;br /&gt;
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,&lt;br /&gt;
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR&lt;br /&gt;
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF&lt;br /&gt;
 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING&lt;br /&gt;
 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS&lt;br /&gt;
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.&lt;br /&gt;
 *&lt;br /&gt;
 */&lt;br /&gt;
#include &amp;lt;QPushButton&amp;gt;&lt;br /&gt;
#include &amp;lt;QCheckBox&amp;gt;&lt;br /&gt;
#include &amp;lt;QLabel&amp;gt;&lt;br /&gt;
#include &amp;lt;QGroupBox&amp;gt;&lt;br /&gt;
#include &amp;lt;QGridLayout&amp;gt;&lt;br /&gt;
#include &amp;quot;tooltipdialog.h&amp;quot;&lt;br /&gt;
ToolTipDialog::ToolTipDialog() : QDialog()&lt;br /&gt;
{&lt;br /&gt;
  QGroupBox *groupBox = new QGroupBox( tr(&amp;quot;Group&amp;quot;) );&lt;br /&gt;
  QGridLayout *gbLayout = new QGridLayout( groupBox );&lt;br /&gt;
  &lt;br /&gt;
  QCheckBox *checkBox = new QCheckBox( tr(&amp;quot;Check!&amp;quot;) );&lt;br /&gt;
  QLabel *label = new QLabel( tr(&amp;quot;label&amp;quot;) );&lt;br /&gt;
  QPushButton *pushButton = new QPushButton( tr(&amp;quot;Push me!&amp;quot;) );&lt;br /&gt;
  &lt;br /&gt;
  gbLayout-&amp;gt;addWidget( checkBox, 0, 0 );&lt;br /&gt;
  gbLayout-&amp;gt;addWidget( label, 0, 1 );&lt;br /&gt;
  gbLayout-&amp;gt;addWidget( pushButton, 1, 0, 1, 2 );&lt;br /&gt;
  &lt;br /&gt;
  QGridLayout *dlgLayout = new QGridLayout( this );&lt;br /&gt;
  dlgLayout-&amp;gt;addWidget( groupBox, 0, 0 );&lt;br /&gt;
  &lt;br /&gt;
  checkBox-&amp;gt;setToolTip( tr(&amp;quot;This is a simple tool tip for the check box.&amp;quot;) );&lt;br /&gt;
  groupBox-&amp;gt;setToolTip( tr(&amp;quot;This is a group box tool tip.\n&amp;quot;&lt;br /&gt;
                           &amp;quot;Notice that it appears between and around the contained widgets.\n&amp;quot;&lt;br /&gt;
                           &amp;quot;It is also spanning several lines.&amp;quot;) );&lt;br /&gt;
  label-&amp;gt;setToolTip( tr(&amp;quot;&amp;lt;p&amp;gt;It is possible to do lists.&amp;lt;/p&amp;gt;&amp;quot;&lt;br /&gt;
                        &amp;quot;&amp;lt;ul&amp;gt;&amp;quot;&lt;br /&gt;
                          &amp;quot;&amp;lt;li&amp;gt;You can &amp;lt;i&amp;gt;format&amp;lt;/i&amp;gt; text.&amp;lt;/li&amp;gt;&amp;quot;&lt;br /&gt;
                          &amp;quot;&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Bold&amp;lt;/b&amp;gt; is possible too.&amp;lt;/li&amp;gt;&amp;quot;&lt;br /&gt;
                          &amp;quot;&amp;lt;li&amp;gt;And the &amp;lt;font color=&amp;quot;#22aaff&amp;quot;&amp;gt;color&amp;lt;/font&amp;gt; and &amp;quot;&lt;br /&gt;
                            &amp;quot;&amp;lt;font size=&amp;quot;+2&amp;quot;&amp;gt;size&amp;lt;/font&amp;gt;.&amp;lt;/li&amp;gt;&amp;quot;&lt;br /&gt;
                        &amp;quot;&amp;lt;/ul&amp;gt;&amp;quot;&lt;br /&gt;
                        &amp;quot;&amp;lt;p&amp;gt;You can do ordered lists as well.&amp;lt;/p&amp;gt;&amp;quot;&lt;br /&gt;
                        &amp;quot;&amp;lt;ol&amp;gt;&amp;quot;&lt;br /&gt;
                          &amp;quot;&amp;lt;li&amp;gt;First.&amp;lt;/li&amp;gt;&amp;quot;&lt;br /&gt;
                          &amp;quot;&amp;lt;li&amp;gt;Second.&amp;lt;/li&amp;gt;&amp;quot;&lt;br /&gt;
                          &amp;quot;&amp;lt;li&amp;gt;Third.&amp;lt;/li&amp;gt;&amp;quot;&lt;br /&gt;
                        &amp;quot;&amp;lt;/ol&amp;gt;&amp;quot;) );&lt;br /&gt;
  pushButton-&amp;gt;setToolTip( tr(&amp;quot;&amp;lt;img src=&amp;quot;:/images/qt.png&amp;quot;&amp;gt;&amp;quot;&lt;br /&gt;
                             &amp;quot;You can also insert images into your tool tips.&amp;quot;) );&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
Foundations of Qt Development\Chapter09\tooltips\tooltipdialog.h&lt;br /&gt;
/*&lt;br /&gt;
 * Copyright (c) 2006-2007, Johan Thelin&lt;br /&gt;
 * &lt;br /&gt;
 * All rights reserved.&lt;br /&gt;
 * &lt;br /&gt;
 * Redistribution and use in source and binary forms, with or without modification, &lt;br /&gt;
 * are permitted provided that the following conditions are met:&lt;br /&gt;
 * &lt;br /&gt;
 *     * Redistributions of source code must retain the above copyright notice, &lt;br /&gt;
 *       this list of conditions and the following disclaimer.&lt;br /&gt;
 *     * Redistributions in binary form must reproduce the above copyright notice,  &lt;br /&gt;
 *       this list of conditions and the following disclaimer in the documentation &lt;br /&gt;
 *       and/or other materials provided with the distribution.&lt;br /&gt;
 *     * Neither the name of APress nor the names of its contributors &lt;br /&gt;
 *       may be used to endorse or promote products derived from this software &lt;br /&gt;
 *       without specific prior written permission.&lt;br /&gt;
 * &lt;br /&gt;
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS&lt;br /&gt;
 * &amp;quot;AS IS&amp;quot; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT&lt;br /&gt;
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR&lt;br /&gt;
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR&lt;br /&gt;
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,&lt;br /&gt;
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,&lt;br /&gt;
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR&lt;br /&gt;
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF&lt;br /&gt;
 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING&lt;br /&gt;
 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS&lt;br /&gt;
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.&lt;br /&gt;
 *&lt;br /&gt;
 */&lt;br /&gt;
#ifndef TOOLTIPDIALOG_H&lt;br /&gt;
#define TOOLTIPDIALOG_H&lt;br /&gt;
#include &amp;lt;QDialog&amp;gt;&lt;br /&gt;
class ToolTipDialog : public QDialog&lt;br /&gt;
{&lt;br /&gt;
public:&lt;br /&gt;
  ToolTipDialog();&lt;br /&gt;
};&lt;br /&gt;
#endif // TOOLTIPDIALOG_H&lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Set zone for tooltip==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;  &lt;br /&gt;
Foundations of Qt Development\Chapter09\tooltipzones\main.cpp&lt;br /&gt;
/*&lt;br /&gt;
 * Copyright (c) 2006-2007, Johan Thelin&lt;br /&gt;
 * &lt;br /&gt;
 * All rights reserved.&lt;br /&gt;
 * &lt;br /&gt;
 * Redistribution and use in source and binary forms, with or without modification, &lt;br /&gt;
 * are permitted provided that the following conditions are met:&lt;br /&gt;
 * &lt;br /&gt;
 *     * Redistributions of source code must retain the above copyright notice, &lt;br /&gt;
 *       this list of conditions and the following disclaimer.&lt;br /&gt;
 *     * Redistributions in binary form must reproduce the above copyright notice,  &lt;br /&gt;
 *       this list of conditions and the following disclaimer in the documentation &lt;br /&gt;
 *       and/or other materials provided with the distribution.&lt;br /&gt;
 *     * Neither the name of APress nor the names of its contributors &lt;br /&gt;
 *       may be used to endorse or promote products derived from this software &lt;br /&gt;
 *       without specific prior written permission.&lt;br /&gt;
 * &lt;br /&gt;
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS&lt;br /&gt;
 * &amp;quot;AS IS&amp;quot; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT&lt;br /&gt;
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR&lt;br /&gt;
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR&lt;br /&gt;
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,&lt;br /&gt;
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,&lt;br /&gt;
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR&lt;br /&gt;
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF&lt;br /&gt;
 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING&lt;br /&gt;
 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS&lt;br /&gt;
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.&lt;br /&gt;
 *&lt;br /&gt;
 */&lt;br /&gt;
#include &amp;lt;QApplication&amp;gt;&lt;br /&gt;
#include &amp;quot;tipzones.h&amp;quot;&lt;br /&gt;
int main( int argc, char **argv )&lt;br /&gt;
{&lt;br /&gt;
  QApplication app( argc, argv );&lt;br /&gt;
  &lt;br /&gt;
  TipZones tipZones;&lt;br /&gt;
  tipZones.show();&lt;br /&gt;
  &lt;br /&gt;
  return app.exec();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
Foundations of Qt Development\Chapter09\tooltipzones\tipzones.cpp&lt;br /&gt;
/*&lt;br /&gt;
 * Copyright (c) 2006-2007, Johan Thelin&lt;br /&gt;
 * &lt;br /&gt;
 * All rights reserved.&lt;br /&gt;
 * &lt;br /&gt;
 * Redistribution and use in source and binary forms, with or without modification, &lt;br /&gt;
 * are permitted provided that the following conditions are met:&lt;br /&gt;
 * &lt;br /&gt;
 *     * Redistributions of source code must retain the above copyright notice, &lt;br /&gt;
 *       this list of conditions and the following disclaimer.&lt;br /&gt;
 *     * Redistributions in binary form must reproduce the above copyright notice,  &lt;br /&gt;
 *       this list of conditions and the following disclaimer in the documentation &lt;br /&gt;
 *       and/or other materials provided with the distribution.&lt;br /&gt;
 *     * Neither the name of APress nor the names of its contributors &lt;br /&gt;
 *       may be used to endorse or promote products derived from this software &lt;br /&gt;
 *       without specific prior written permission.&lt;br /&gt;
 * &lt;br /&gt;
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS&lt;br /&gt;
 * &amp;quot;AS IS&amp;quot; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT&lt;br /&gt;
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR&lt;br /&gt;
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR&lt;br /&gt;
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,&lt;br /&gt;
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,&lt;br /&gt;
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR&lt;br /&gt;
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF&lt;br /&gt;
 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING&lt;br /&gt;
 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS&lt;br /&gt;
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.&lt;br /&gt;
 *&lt;br /&gt;
 */&lt;br /&gt;
#include &amp;lt;QPainter&amp;gt;&lt;br /&gt;
#include &amp;lt;QPaintEvent&amp;gt;&lt;br /&gt;
#include &amp;lt;QEvent&amp;gt;&lt;br /&gt;
#include &amp;lt;QHelpEvent&amp;gt;&lt;br /&gt;
#include &amp;quot;tipzones.h&amp;quot;&lt;br /&gt;
TipZones::TipZones() : QWidget()&lt;br /&gt;
{&lt;br /&gt;
}&lt;br /&gt;
void TipZones::paintEvent( QPaintEvent* )&lt;br /&gt;
{&lt;br /&gt;
  QRect redRect, greenRect, blueRect, yellowRect;&lt;br /&gt;
  &lt;br /&gt;
  redRect = QRect( 0, 0, width()/2, height()/2 );&lt;br /&gt;
  greenRect = QRect( width()/2, 0, width()/2, height()/2 );&lt;br /&gt;
  blueRect = QRect( 0, height()/2, width()/2, height()/2 );&lt;br /&gt;
  yellowRect = QRect( width()/2, height()/2, width()/2, height()/2 );&lt;br /&gt;
  &lt;br /&gt;
  QPainter p( this );&lt;br /&gt;
  &lt;br /&gt;
  p.setPen( Qt::black );&lt;br /&gt;
  &lt;br /&gt;
  p.setBrush( Qt::red );&lt;br /&gt;
  p.drawRect( redRect );&lt;br /&gt;
  &lt;br /&gt;
  p.setBrush( Qt::green );&lt;br /&gt;
  p.drawRect( greenRect );&lt;br /&gt;
  p.setBrush( Qt::blue );&lt;br /&gt;
  p.drawRect( blueRect );&lt;br /&gt;
  p.setBrush( Qt::yellow );&lt;br /&gt;
  p.drawRect( yellowRect );&lt;br /&gt;
}&lt;br /&gt;
  &lt;br /&gt;
bool TipZones::event( QEvent *event )&lt;br /&gt;
{&lt;br /&gt;
  if( event-&amp;gt;type() == QEvent::ToolTip )&lt;br /&gt;
  {&lt;br /&gt;
    QHelpEvent *helpEvent = static_cast&amp;lt;QHelpEvent*&amp;gt;( event );&lt;br /&gt;
    &lt;br /&gt;
    QRect redRect, greenRect, blueRect, yellowRect;&lt;br /&gt;
  &lt;br /&gt;
    redRect = QRect( 0, 0, width()/2, height()/2 );&lt;br /&gt;
    greenRect = QRect( width()/2, 0, width()/2, height()/2 );&lt;br /&gt;
    blueRect = QRect( 0, height()/2, width()/2, height()/2 );&lt;br /&gt;
    yellowRect = QRect( width()/2, height()/2, width()/2, height()/2 );&lt;br /&gt;
    if( redRect.contains( helpEvent-&amp;gt;pos() ) )&lt;br /&gt;
      setToolTip( tr(&amp;quot;Red&amp;quot;) );&lt;br /&gt;
    else if( greenRect.contains( helpEvent-&amp;gt;pos() ) )&lt;br /&gt;
      setToolTip( tr(&amp;quot;Green&amp;quot;) );&lt;br /&gt;
    else if( blueRect.contains( helpEvent-&amp;gt;pos() ) )&lt;br /&gt;
      setToolTip( tr(&amp;quot;Blue&amp;quot;) );&lt;br /&gt;
    else &lt;br /&gt;
      setToolTip( tr(&amp;quot;Yellow&amp;quot;) );&lt;br /&gt;
  }&lt;br /&gt;
  return QWidget::event( event );  &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
Foundations of Qt Development\Chapter09\tooltipzones\tipzones.h&lt;br /&gt;
/*&lt;br /&gt;
 * Copyright (c) 2006-2007, Johan Thelin&lt;br /&gt;
 * &lt;br /&gt;
 * All rights reserved.&lt;br /&gt;
 * &lt;br /&gt;
 * Redistribution and use in source and binary forms, with or without modification, &lt;br /&gt;
 * are permitted provided that the following conditions are met:&lt;br /&gt;
 * &lt;br /&gt;
 *     * Redistributions of source code must retain the above copyright notice, &lt;br /&gt;
 *       this list of conditions and the following disclaimer.&lt;br /&gt;
 *     * Redistributions in binary form must reproduce the above copyright notice,  &lt;br /&gt;
 *       this list of conditions and the following disclaimer in the documentation &lt;br /&gt;
 *       and/or other materials provided with the distribution.&lt;br /&gt;
 *     * Neither the name of APress nor the names of its contributors &lt;br /&gt;
 *       may be used to endorse or promote products derived from this software &lt;br /&gt;
 *       without specific prior written permission.&lt;br /&gt;
 * &lt;br /&gt;
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS&lt;br /&gt;
 * &amp;quot;AS IS&amp;quot; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT&lt;br /&gt;
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR&lt;br /&gt;
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR&lt;br /&gt;
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,&lt;br /&gt;
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,&lt;br /&gt;
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR&lt;br /&gt;
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF&lt;br /&gt;
 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING&lt;br /&gt;
 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS&lt;br /&gt;
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.&lt;br /&gt;
 *&lt;br /&gt;
 */&lt;br /&gt;
#ifndef TIPZONES_H&lt;br /&gt;
#define TIPZONES_H&lt;br /&gt;
#include &amp;lt;QWidget&amp;gt;&lt;br /&gt;
class TipZones : public QWidget&lt;br /&gt;
{&lt;br /&gt;
public:&lt;br /&gt;
  TipZones();&lt;br /&gt;
protected:&lt;br /&gt;
  void paintEvent( QPaintEvent* );&lt;br /&gt;
  bool event( QEvent* );&lt;br /&gt;
};&lt;br /&gt;
#endif // TIPZONES_H&lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	</feed>