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

	<entry>
		<id>http://www.cppe.ru/index.php?title=C%2B%2B/Qt/QTextEdit&amp;diff=996&amp;oldid=prev</id>
		<title> в 14:21, 25 мая 2010</title>
		<link rel="alternate" type="text/html" href="http://www.cppe.ru/index.php?title=C%2B%2B/Qt/QTextEdit&amp;diff=996&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://www.cppe.ru/index.php?title=C%2B%2B/Qt/QTextEdit&amp;diff=997&amp;oldid=prev</id>
		<title>Admin: 1 версия:&amp;#32;Импорт контента...</title>
		<link rel="alternate" type="text/html" href="http://www.cppe.ru/index.php?title=C%2B%2B/Qt/QTextEdit&amp;diff=997&amp;oldid=prev"/>
				<updated>2010-05-25T10:24:28Z</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;==extends QTextEdit==&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\Chapter04\mdi\documentwindow.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;lt;QMenuBar&amp;gt;&lt;br /&gt;
#include &amp;lt;QToolBar&amp;gt;&lt;br /&gt;
#include &amp;lt;QStatusBar&amp;gt;&lt;br /&gt;
#include &amp;lt;QCloseEvent&amp;gt;&lt;br /&gt;
#include &amp;lt;QMessageBox&amp;gt;&lt;br /&gt;
#include &amp;lt;QTextEdit&amp;gt;&lt;br /&gt;
#include &amp;quot;documentwindow.h&amp;quot;&lt;br /&gt;
DocumentWindow::DocumentWindow( QWidget *parent ) : QTextEdit( parent )&lt;br /&gt;
{&lt;br /&gt;
  setAttribute( Qt::WA_DeleteOnClose );&lt;br /&gt;
  setWindowTitle( tr(&amp;quot;%1[*]&amp;quot; ).arg(&amp;quot;unnamed&amp;quot;) );&lt;br /&gt;
  &lt;br /&gt;
  connect( document(), SIGNAL(modificationChanged(bool)), this, SLOT(setWindowModified(bool)) );&lt;br /&gt;
}&lt;br /&gt;
  &lt;br /&gt;
void DocumentWindow::closeEvent( QCloseEvent *event )&lt;br /&gt;
{&lt;br /&gt;
  if( isSafeToClose() )&lt;br /&gt;
    event-&amp;gt;accept();&lt;br /&gt;
  else&lt;br /&gt;
    event-&amp;gt;ignore();&lt;br /&gt;
}&lt;br /&gt;
bool DocumentWindow::isSafeToClose()&lt;br /&gt;
{&lt;br /&gt;
  if( document()-&amp;gt;isModified() ) &lt;br /&gt;
  {&lt;br /&gt;
    switch( QMessageBox::warning( this, tr(&amp;quot;MDI&amp;quot;), &lt;br /&gt;
      tr(&amp;quot;The document has unsaved changes.\n&amp;quot;&lt;br /&gt;
         &amp;quot;Do you want to save it before it is closed?&amp;quot;), &lt;br /&gt;
         QMessageBox::Discard | QMessageBox::Cancel ) )&lt;br /&gt;
    {&lt;br /&gt;
    case QMessageBox::Cancel:&lt;br /&gt;
      return false;&lt;br /&gt;
    default:&lt;br /&gt;
      return true;&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
  return true;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
Foundations of Qt Development\Chapter04\mdi\documentwindow.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 DOCUMENTWINDOW_H&lt;br /&gt;
#define DOCUMENTWINDOW_H&lt;br /&gt;
#include &amp;lt;QTextEdit&amp;gt;&lt;br /&gt;
class DocumentWindow : public QTextEdit&lt;br /&gt;
{&lt;br /&gt;
  Q_OBJECT&lt;br /&gt;
  &lt;br /&gt;
public:&lt;br /&gt;
  DocumentWindow( QWidget *parent = 0 );&lt;br /&gt;
  &lt;br /&gt;
protected:&lt;br /&gt;
  void closeEvent( QCloseEvent *event );&lt;br /&gt;
  &lt;br /&gt;
private:&lt;br /&gt;
  bool isSafeToClose();&lt;br /&gt;
};&lt;br /&gt;
  &lt;br /&gt;
#endif // DOCUMENTWINDOW_H&lt;br /&gt;
&lt;br /&gt;
Foundations of Qt Development\Chapter04\mdi\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;mdiwindow.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;
  MdiWindow win;&lt;br /&gt;
  win.show();&lt;br /&gt;
  &lt;br /&gt;
  return app.exec();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
Foundations of Qt Development\Chapter04\mdi\mdiwindow.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;lt;QMenuBar&amp;gt;&lt;br /&gt;
#include &amp;lt;QToolBar&amp;gt;&lt;br /&gt;
#include &amp;lt;QStatusBar&amp;gt;&lt;br /&gt;
#include &amp;lt;QCloseEvent&amp;gt;&lt;br /&gt;
#include &amp;lt;QMessageBox&amp;gt;&lt;br /&gt;
#include &amp;lt;QWorkspace&amp;gt;&lt;br /&gt;
#include &amp;lt;QSignalMapper&amp;gt;&lt;br /&gt;
#include &amp;quot;mdiwindow.h&amp;quot;&lt;br /&gt;
#include &amp;quot;documentwindow.h&amp;quot;&lt;br /&gt;
MdiWindow::MdiWindow( QWidget *parent ) : QMainWindow( parent )&lt;br /&gt;
{&lt;br /&gt;
  setWindowTitle( tr( &amp;quot;MDI&amp;quot; ) );&lt;br /&gt;
  workspace = new QWorkspace;&lt;br /&gt;
  setCentralWidget( workspace );&lt;br /&gt;
  &lt;br /&gt;
  connect( workspace, SIGNAL(windowActivated(QWidget *)), this, SLOT(enableActions()));&lt;br /&gt;
  mapper = new QSignalMapper( this );&lt;br /&gt;
  connect( mapper, SIGNAL(mapped(QWidget*)), workspace, SLOT(setActiveWindow(QWidget*)) );&lt;br /&gt;
  createActions();&lt;br /&gt;
  createMenus();&lt;br /&gt;
  createToolbars();&lt;br /&gt;
  statusBar()-&amp;gt;showMessage( tr(&amp;quot;Done&amp;quot;) );&lt;br /&gt;
  &lt;br /&gt;
  enableActions();&lt;br /&gt;
}&lt;br /&gt;
  &lt;br /&gt;
void MdiWindow::closeEvent( QCloseEvent *event )&lt;br /&gt;
{&lt;br /&gt;
  workspace-&amp;gt;closeAllWindows();&lt;br /&gt;
  if( !activeDocument() )&lt;br /&gt;
    event-&amp;gt;accept();&lt;br /&gt;
  else&lt;br /&gt;
    event-&amp;gt;ignore();&lt;br /&gt;
}&lt;br /&gt;
  &lt;br /&gt;
void MdiWindow::fileNew()&lt;br /&gt;
{&lt;br /&gt;
  DocumentWindow *document = new DocumentWindow;&lt;br /&gt;
  workspace-&amp;gt;addWindow( document );&lt;br /&gt;
  connect( document, SIGNAL(copyAvailable(bool)), cutAction, SLOT(setEnabled(bool)) );&lt;br /&gt;
  connect( document, SIGNAL(copyAvailable(bool)), copyAction, SLOT(setEnabled(bool)) );&lt;br /&gt;
  &lt;br /&gt;
  document-&amp;gt;show();&lt;br /&gt;
}&lt;br /&gt;
void MdiWindow::helpAbout()&lt;br /&gt;
{&lt;br /&gt;
  QMessageBox::about( this, tr(&amp;quot;About MDI&amp;quot;), tr(&amp;quot;A multiple document interface application.&amp;quot;) );&lt;br /&gt;
}&lt;br /&gt;
DocumentWindow *MdiWindow::activeDocument()&lt;br /&gt;
{&lt;br /&gt;
  return qobject_cast&amp;lt;DocumentWindow*&amp;gt;(workspace-&amp;gt;activeWindow());&lt;br /&gt;
}&lt;br /&gt;
void MdiWindow::enableActions()&lt;br /&gt;
{&lt;br /&gt;
  bool hasDocuments = (activeDocument() != 0 );&lt;br /&gt;
  &lt;br /&gt;
  closeAction-&amp;gt;setEnabled( hasDocuments );  &lt;br /&gt;
  pasteAction-&amp;gt;setEnabled( hasDocuments );  &lt;br /&gt;
  tileAction-&amp;gt;setEnabled( hasDocuments );&lt;br /&gt;
  cascadeAction-&amp;gt;setEnabled( hasDocuments );&lt;br /&gt;
  nextAction-&amp;gt;setEnabled( hasDocuments );&lt;br /&gt;
  previousAction-&amp;gt;setEnabled( hasDocuments );&lt;br /&gt;
  separatorAction-&amp;gt;setVisible( hasDocuments );&lt;br /&gt;
  bool hasSelection = hasDocuments &amp;amp;&amp;amp; activeDocument()-&amp;gt;textCursor().hasSelection();&lt;br /&gt;
  cutAction-&amp;gt;setEnabled( hasSelection );  &lt;br /&gt;
  copyAction-&amp;gt;setEnabled( hasSelection );  &lt;br /&gt;
}&lt;br /&gt;
void MdiWindow::createActions()&lt;br /&gt;
{&lt;br /&gt;
  newAction = new QAction( QIcon(&amp;quot;:/images/new.png&amp;quot;), tr(&amp;quot;&amp;amp;New&amp;quot;), this );&lt;br /&gt;
  newAction-&amp;gt;setShortcut( tr(&amp;quot;Ctrl+N&amp;quot;) );&lt;br /&gt;
  newAction-&amp;gt;setStatusTip( tr(&amp;quot;Create a new document&amp;quot;) );&lt;br /&gt;
  connect( newAction, SIGNAL(triggered()), this, SLOT(fileNew()) );&lt;br /&gt;
  &lt;br /&gt;
  closeAction = new QAction( tr(&amp;quot;&amp;amp;Close&amp;quot;), this );&lt;br /&gt;
  closeAction-&amp;gt;setShortcut( tr(&amp;quot;Ctrl+W&amp;quot;) );&lt;br /&gt;
  closeAction-&amp;gt;setStatusTip( tr(&amp;quot;Close this document&amp;quot;) );&lt;br /&gt;
  connect( closeAction, SIGNAL(triggered()), workspace, SLOT(closeActiveWindow()) );&lt;br /&gt;
  exitAction = new QAction( tr(&amp;quot;E&amp;amp;xit&amp;quot;), this );&lt;br /&gt;
  exitAction-&amp;gt;setShortcut( tr(&amp;quot;Ctrl+Q&amp;quot;) );&lt;br /&gt;
  exitAction-&amp;gt;setStatusTip( tr(&amp;quot;Quit the application&amp;quot;) );&lt;br /&gt;
  connect( exitAction, SIGNAL(triggered()), qApp, SLOT(closeAllWindows()) );&lt;br /&gt;
  &lt;br /&gt;
  cutAction = new QAction( QIcon(&amp;quot;:/images/cut.png&amp;quot;), tr(&amp;quot;Cu&amp;amp;t&amp;quot;), this );&lt;br /&gt;
  cutAction-&amp;gt;setShortcut( tr(&amp;quot;Ctrl+X&amp;quot;) );&lt;br /&gt;
  cutAction-&amp;gt;setStatusTip( tr(&amp;quot;Cut&amp;quot;) );&lt;br /&gt;
  cutAction-&amp;gt;setEnabled(false);&lt;br /&gt;
  connect( cutAction, SIGNAL(triggered()), this, SLOT(editCut()) );&lt;br /&gt;
  &lt;br /&gt;
  copyAction = new QAction( QIcon(&amp;quot;:/images/copy.png&amp;quot;), tr(&amp;quot;&amp;amp;Copy&amp;quot;), this );&lt;br /&gt;
  copyAction-&amp;gt;setShortcut( tr(&amp;quot;Ctrl+C&amp;quot;) );&lt;br /&gt;
  copyAction-&amp;gt;setStatusTip( tr(&amp;quot;Copy&amp;quot;) );&lt;br /&gt;
  copyAction-&amp;gt;setEnabled(false);&lt;br /&gt;
  connect( copyAction, SIGNAL(triggered()), this, SLOT(editCopy()) );&lt;br /&gt;
  pasteAction = new QAction( QIcon(&amp;quot;:/images/paste.png&amp;quot;), tr(&amp;quot;&amp;amp;Paste&amp;quot;), this );&lt;br /&gt;
  pasteAction-&amp;gt;setShortcut( tr(&amp;quot;Ctrl+V&amp;quot;) );&lt;br /&gt;
  pasteAction-&amp;gt;setStatusTip( tr(&amp;quot;Paste&amp;quot;) );&lt;br /&gt;
  connect( pasteAction, SIGNAL(triggered()), this, SLOT(editPaste()) );&lt;br /&gt;
  &lt;br /&gt;
  tileAction = new QAction( tr(&amp;quot;&amp;amp;Tile&amp;quot;), this );&lt;br /&gt;
  tileAction-&amp;gt;setStatusTip( tr(&amp;quot;Tile the windows&amp;quot;) );&lt;br /&gt;
  connect( tileAction, SIGNAL(triggered()), workspace, SLOT(tile()) );&lt;br /&gt;
  &lt;br /&gt;
  cascadeAction = new QAction( tr(&amp;quot;&amp;amp;Cascade&amp;quot;), this );&lt;br /&gt;
  cascadeAction-&amp;gt;setStatusTip( tr(&amp;quot;Cascade the windows&amp;quot;) );&lt;br /&gt;
  connect( cascadeAction, SIGNAL(triggered()), workspace, SLOT(cascade()) );&lt;br /&gt;
  nextAction = new QAction( tr(&amp;quot;&amp;amp;Next window&amp;quot;), this );&lt;br /&gt;
  nextAction-&amp;gt;setStatusTip( tr(&amp;quot;Move to the next window&amp;quot;) );&lt;br /&gt;
  connect( nextAction, SIGNAL(triggered()), workspace, SLOT(activateNextWindow()) );&lt;br /&gt;
  &lt;br /&gt;
  previousAction = new QAction( tr(&amp;quot;&amp;amp;Previous window&amp;quot;), this );&lt;br /&gt;
  previousAction-&amp;gt;setStatusTip( tr(&amp;quot;Move to the previous window&amp;quot;) );&lt;br /&gt;
  connect( previousAction, SIGNAL(triggered()), workspace, SLOT(activatePreviousWindow()) );&lt;br /&gt;
  &lt;br /&gt;
  separatorAction = new QAction( this );&lt;br /&gt;
  separatorAction-&amp;gt;setSeparator( true );&lt;br /&gt;
  &lt;br /&gt;
  aboutAction = new QAction( tr(&amp;quot;&amp;amp;About&amp;quot;), this );&lt;br /&gt;
  aboutAction-&amp;gt;setStatusTip( tr(&amp;quot;About this application&amp;quot;) );&lt;br /&gt;
  connect( aboutAction, SIGNAL(triggered()), this, SLOT(helpAbout()) );&lt;br /&gt;
  aboutQtAction = new QAction( tr(&amp;quot;About &amp;amp;Qt&amp;quot;), this );&lt;br /&gt;
  aboutQtAction-&amp;gt;setStatusTip( tr(&amp;quot;About the Qt toolkit&amp;quot;) );&lt;br /&gt;
  connect( aboutQtAction, SIGNAL(triggered()), qApp, SLOT(aboutQt()) );&lt;br /&gt;
}&lt;br /&gt;
void MdiWindow::createMenus()&lt;br /&gt;
{&lt;br /&gt;
  QMenu *menu;&lt;br /&gt;
  &lt;br /&gt;
  menu = menuBar()-&amp;gt;addMenu( tr(&amp;quot;&amp;amp;File&amp;quot;) );&lt;br /&gt;
  menu-&amp;gt;addAction( newAction );&lt;br /&gt;
  menu-&amp;gt;addAction( closeAction );&lt;br /&gt;
  menu-&amp;gt;addSeparator();&lt;br /&gt;
  menu-&amp;gt;addAction( exitAction );&lt;br /&gt;
  &lt;br /&gt;
  menu = menuBar()-&amp;gt;addMenu( tr(&amp;quot;&amp;amp;Edit&amp;quot;) );&lt;br /&gt;
  menu-&amp;gt;addAction( cutAction );&lt;br /&gt;
  menu-&amp;gt;addAction( copyAction );&lt;br /&gt;
  menu-&amp;gt;addAction( pasteAction );&lt;br /&gt;
  &lt;br /&gt;
  windowMenu = menuBar()-&amp;gt;addMenu( tr(&amp;quot;&amp;amp;Window&amp;quot;) );&lt;br /&gt;
  connect( windowMenu, SIGNAL(aboutToShow()), this, SLOT(updateWindowList()) );&lt;br /&gt;
  &lt;br /&gt;
  menu = menuBar()-&amp;gt;addMenu( tr(&amp;quot;&amp;amp;Help&amp;quot;) );&lt;br /&gt;
  menu-&amp;gt;addAction( aboutAction );&lt;br /&gt;
  menu-&amp;gt;addAction( aboutQtAction );&lt;br /&gt;
}&lt;br /&gt;
void MdiWindow::createToolbars()&lt;br /&gt;
{&lt;br /&gt;
  QToolBar *toolbar;&lt;br /&gt;
  &lt;br /&gt;
  toolbar = addToolBar( tr(&amp;quot;File&amp;quot;) );&lt;br /&gt;
  toolbar-&amp;gt;addAction( newAction );&lt;br /&gt;
  &lt;br /&gt;
  toolbar = addToolBar( tr(&amp;quot;Edit&amp;quot;) );&lt;br /&gt;
  toolbar-&amp;gt;addAction( cutAction );&lt;br /&gt;
  toolbar-&amp;gt;addAction( copyAction );&lt;br /&gt;
  toolbar-&amp;gt;addAction( pasteAction );&lt;br /&gt;
}&lt;br /&gt;
void MdiWindow::editCut()&lt;br /&gt;
{&lt;br /&gt;
  activeDocument()-&amp;gt;cut();&lt;br /&gt;
}&lt;br /&gt;
  &lt;br /&gt;
void MdiWindow::editCopy()&lt;br /&gt;
{&lt;br /&gt;
  activeDocument()-&amp;gt;copy();&lt;br /&gt;
}&lt;br /&gt;
  &lt;br /&gt;
void MdiWindow::editPaste()&lt;br /&gt;
{&lt;br /&gt;
  activeDocument()-&amp;gt;paste();&lt;br /&gt;
}&lt;br /&gt;
void MdiWindow::updateWindowList()&lt;br /&gt;
{&lt;br /&gt;
  windowMenu-&amp;gt;clear();&lt;br /&gt;
  &lt;br /&gt;
  windowMenu-&amp;gt;addAction( tileAction );&lt;br /&gt;
  windowMenu-&amp;gt;addAction( cascadeAction );&lt;br /&gt;
  windowMenu-&amp;gt;addSeparator();&lt;br /&gt;
  windowMenu-&amp;gt;addAction( nextAction );&lt;br /&gt;
  windowMenu-&amp;gt;addAction( previousAction );&lt;br /&gt;
  windowMenu-&amp;gt;addAction( separatorAction );&lt;br /&gt;
  &lt;br /&gt;
  int i=1;&lt;br /&gt;
  foreach( QWidget *w, workspace-&amp;gt;windowList() )&lt;br /&gt;
  {&lt;br /&gt;
    QString text;&lt;br /&gt;
    if( i&amp;lt;10 )&lt;br /&gt;
      text = tr(&amp;quot;&amp;amp;%1 %2&amp;quot;).arg( i++ ).arg( w-&amp;gt;windowTitle() );&lt;br /&gt;
    else&lt;br /&gt;
      text = w-&amp;gt;windowTitle();&lt;br /&gt;
      &lt;br /&gt;
    QAction *action = windowMenu-&amp;gt;addAction( text );&lt;br /&gt;
    action-&amp;gt;setCheckable( true );&lt;br /&gt;
    action-&amp;gt;setChecked( w == activeDocument() );&lt;br /&gt;
    connect( action, SIGNAL(triggered()), mapper, SLOT(map()) );&lt;br /&gt;
    mapper-&amp;gt;setMapping( action, w );&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
Foundations of Qt Development\Chapter04\mdi\mdiwindow.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 MDIWINDOW_H&lt;br /&gt;
#define MDIWINDOW_H&lt;br /&gt;
#include &amp;lt;QMainWindow&amp;gt;&lt;br /&gt;
class QAction;&lt;br /&gt;
class QWorkspace;&lt;br /&gt;
class QSignalMapper;&lt;br /&gt;
class QMenu;&lt;br /&gt;
class DocumentWindow;&lt;br /&gt;
class MdiWindow : public QMainWindow&lt;br /&gt;
{&lt;br /&gt;
  Q_OBJECT&lt;br /&gt;
  &lt;br /&gt;
public:&lt;br /&gt;
  MdiWindow( QWidget *parent = 0 );&lt;br /&gt;
  &lt;br /&gt;
protected:&lt;br /&gt;
  void closeEvent( QCloseEvent *event );&lt;br /&gt;
  &lt;br /&gt;
private slots:&lt;br /&gt;
  void fileNew();&lt;br /&gt;
  &lt;br /&gt;
  void editCut();&lt;br /&gt;
  void editCopy();&lt;br /&gt;
  void editPaste();&lt;br /&gt;
  &lt;br /&gt;
  void helpAbout();&lt;br /&gt;
  &lt;br /&gt;
  void enableActions();&lt;br /&gt;
  void updateWindowList();&lt;br /&gt;
private:&lt;br /&gt;
  void createActions();&lt;br /&gt;
  void createMenus();&lt;br /&gt;
  void createToolbars();&lt;br /&gt;
  DocumentWindow *activeDocument();&lt;br /&gt;
  QWorkspace *workspace;&lt;br /&gt;
  QSignalMapper *mapper;&lt;br /&gt;
  &lt;br /&gt;
  QAction *newAction;&lt;br /&gt;
  QAction *closeAction;&lt;br /&gt;
  QAction *exitAction;&lt;br /&gt;
  &lt;br /&gt;
  QAction *cutAction;&lt;br /&gt;
  QAction *copyAction;&lt;br /&gt;
  QAction *pasteAction;&lt;br /&gt;
  &lt;br /&gt;
  QAction *tileAction;&lt;br /&gt;
  QAction *cascadeAction;&lt;br /&gt;
  QAction *nextAction;&lt;br /&gt;
  QAction *previousAction;&lt;br /&gt;
  QAction *separatorAction;&lt;br /&gt;
  &lt;br /&gt;
  QAction *aboutAction;&lt;br /&gt;
  QAction *aboutQtAction;&lt;br /&gt;
  &lt;br /&gt;
  QMenu *windowMenu;&lt;br /&gt;
};&lt;br /&gt;
  &lt;br /&gt;
#endif // MDIWINDOW_H&lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==QTextEdit and QTextCursor==&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;
**&lt;br /&gt;
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).&lt;br /&gt;
** All rights reserved.&lt;br /&gt;
** Contact: Nokia Corporation (qt-info@nokia.com)&lt;br /&gt;
**&lt;br /&gt;
** This file is part of the documentation of the Qt Toolkit.&lt;br /&gt;
**&lt;br /&gt;
** $QT_BEGIN_LICENSE:LGPL$&lt;br /&gt;
** Commercial Usage&lt;br /&gt;
** Licensees holding valid Qt Commercial licenses may use this file in&lt;br /&gt;
** accordance with the Qt Commercial License Agreement provided with the&lt;br /&gt;
** Software or, alternatively, in accordance with the terms contained in&lt;br /&gt;
** a written agreement between you and Nokia.&lt;br /&gt;
**&lt;br /&gt;
** GNU Lesser General Public License Usage&lt;br /&gt;
** Alternatively, this file may be used under the terms of the GNU Lesser&lt;br /&gt;
** General Public License version 2.1 as published by the Free Software&lt;br /&gt;
** Foundation and appearing in the file LICENSE.LGPL included in the&lt;br /&gt;
** packaging of this file.  Please review the following information to&lt;br /&gt;
** ensure the GNU Lesser General Public License version 2.1 requirements&lt;br /&gt;
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.&lt;br /&gt;
**&lt;br /&gt;
** In addition, as a special exception, Nokia gives you certain additional&lt;br /&gt;
** rights.  These rights are described in the Nokia Qt LGPL Exception&lt;br /&gt;
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.&lt;br /&gt;
**&lt;br /&gt;
** GNU General Public License Usage&lt;br /&gt;
** Alternatively, this file may be used under the terms of the GNU&lt;br /&gt;
** General Public License version 3.0 as published by the Free Software&lt;br /&gt;
** Foundation and appearing in the file LICENSE.GPL included in the&lt;br /&gt;
** packaging of this file.  Please review the following information to&lt;br /&gt;
** ensure the GNU General Public License version 3.0 requirements will be&lt;br /&gt;
** met: http://www.gnu.org/copyleft/gpl.html.&lt;br /&gt;
**&lt;br /&gt;
** If you have questions regarding the use of this file, please contact&lt;br /&gt;
** Nokia at qt-info@nokia.com.&lt;br /&gt;
** $QT_END_LICENSE$&lt;br /&gt;
**&lt;br /&gt;
****************************************************************************/&lt;br /&gt;
#include &amp;lt;QtGui&amp;gt;&lt;br /&gt;
void mergeFormat(QTextEdit *edit)&lt;br /&gt;
{&lt;br /&gt;
    QTextDocument *document = edit-&amp;gt;document(); &lt;br /&gt;
    QTextCursor cursor(document);&lt;br /&gt;
    cursor.movePosition(QTextCursor::Start); &lt;br /&gt;
    cursor.movePosition(QTextCursor::EndOfLine, QTextCursor::KeepAnchor);&lt;br /&gt;
    QTextCharFormat format;&lt;br /&gt;
    format.setFontWeight(QFont::Bold);&lt;br /&gt;
    cursor.mergeCharFormat(format);&lt;br /&gt;
}&lt;br /&gt;
int main(int argc, char *argv[])&lt;br /&gt;
{&lt;br /&gt;
    QWidget *parent = 0;&lt;br /&gt;
    QString aStringContainingHTMLtext(&amp;quot;&amp;lt;h1&amp;gt;Scribe Overview&amp;lt;/h1&amp;gt;&amp;quot;);&lt;br /&gt;
    QApplication app(argc, argv);&lt;br /&gt;
&lt;br /&gt;
    QTextEdit *editor = new QTextEdit(parent);&lt;br /&gt;
    editor-&amp;gt;setHtml(aStringContainingHTMLtext);&lt;br /&gt;
    editor-&amp;gt;show();&lt;br /&gt;
&lt;br /&gt;
    return app.exec();&lt;br /&gt;
}&lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Using QTextEdit==&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;
**&lt;br /&gt;
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).&lt;br /&gt;
** All rights reserved.&lt;br /&gt;
** Contact: Nokia Corporation (qt-info@nokia.com)&lt;br /&gt;
**&lt;br /&gt;
** This file is part of the documentation of the Qt Toolkit.&lt;br /&gt;
**&lt;br /&gt;
** $QT_BEGIN_LICENSE:LGPL$&lt;br /&gt;
** Commercial Usage&lt;br /&gt;
** Licensees holding valid Qt Commercial licenses may use this file in&lt;br /&gt;
** accordance with the Qt Commercial License Agreement provided with the&lt;br /&gt;
** Software or, alternatively, in accordance with the terms contained in&lt;br /&gt;
** a written agreement between you and Nokia.&lt;br /&gt;
**&lt;br /&gt;
** GNU Lesser General Public License Usage&lt;br /&gt;
** Alternatively, this file may be used under the terms of the GNU Lesser&lt;br /&gt;
** General Public License version 2.1 as published by the Free Software&lt;br /&gt;
** Foundation and appearing in the file LICENSE.LGPL included in the&lt;br /&gt;
** packaging of this file.  Please review the following information to&lt;br /&gt;
** ensure the GNU Lesser General Public License version 2.1 requirements&lt;br /&gt;
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.&lt;br /&gt;
**&lt;br /&gt;
** In addition, as a special exception, Nokia gives you certain additional&lt;br /&gt;
** rights.  These rights are described in the Nokia Qt LGPL Exception&lt;br /&gt;
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.&lt;br /&gt;
**&lt;br /&gt;
** GNU General Public License Usage&lt;br /&gt;
** Alternatively, this file may be used under the terms of the GNU&lt;br /&gt;
** General Public License version 3.0 as published by the Free Software&lt;br /&gt;
** Foundation and appearing in the file LICENSE.GPL included in the&lt;br /&gt;
** packaging of this file.  Please review the following information to&lt;br /&gt;
** ensure the GNU General Public License version 3.0 requirements will be&lt;br /&gt;
** met: http://www.gnu.org/copyleft/gpl.html.&lt;br /&gt;
**&lt;br /&gt;
** If you have questions regarding the use of this file, please contact&lt;br /&gt;
** Nokia at qt-info@nokia.com.&lt;br /&gt;
** $QT_END_LICENSE$&lt;br /&gt;
**&lt;br /&gt;
****************************************************************************/&lt;br /&gt;
#ifndef TEXTEDIT_H&lt;br /&gt;
#define TEXTEDIT_H&lt;br /&gt;
#include &amp;lt;QTextEdit&amp;gt;&lt;br /&gt;
class TextEdit : public QTextEdit&lt;br /&gt;
{&lt;br /&gt;
    Q_OBJECT&lt;br /&gt;
    &lt;br /&gt;
public: &lt;br /&gt;
    TextEdit(QWidget *parent=0);&lt;br /&gt;
    bool canInsertFromMimeData( const QMimeData *source ) const;&lt;br /&gt;
    void insertFromMimeData( const QMimeData *source );&lt;br /&gt;
};&lt;br /&gt;
#endif&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#include &amp;quot;textedit.h&amp;quot;&lt;br /&gt;
#include &amp;lt;QtGui&amp;gt;&lt;br /&gt;
TextEdit::TextEdit(QWidget *parent)&lt;br /&gt;
  : QTextEdit(parent)&lt;br /&gt;
{&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
bool TextEdit::canInsertFromMimeData( const QMimeData *source ) const&lt;br /&gt;
{&lt;br /&gt;
    if (source-&amp;gt;hasImage())&lt;br /&gt;
        return true;&lt;br /&gt;
    else&lt;br /&gt;
        return QTextEdit::canInsertFromMimeData(source);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void TextEdit::insertFromMimeData( const QMimeData *source )&lt;br /&gt;
{&lt;br /&gt;
    if (source-&amp;gt;hasImage())&lt;br /&gt;
    {&lt;br /&gt;
        QImage image = qvariant_cast&amp;lt;QImage&amp;gt;(source-&amp;gt;imageData());&lt;br /&gt;
        QTextCursor cursor = this-&amp;gt;textCursor();&lt;br /&gt;
        QTextDocument *document = this-&amp;gt;document();&lt;br /&gt;
        document-&amp;gt;addResource(QTextDocument::ImageResource, QUrl(&amp;quot;image&amp;quot;), image);&lt;br /&gt;
        cursor.insertImage(&amp;quot;image&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;QtGui&amp;gt;&lt;br /&gt;
#include &amp;quot;textedit.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;
    TextEdit *textEdit = new TextEdit;&lt;br /&gt;
    textEdit-&amp;gt;show();&lt;br /&gt;
    return app.exec();&lt;br /&gt;
}&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>