index.lxp@lxpwrap=c5783_252ehtm.htm

来自「GUI Programming with Python」· HTM 代码 · 共 266 行

HTM
266
字号
    <table border="0" cellspacing="0" cellpadding="3" width="100%"><tr><td>    <div align="center" id="bldcontent">      <a href="../default.htm"><img src="../images/opendocs.png" width="63" height="76" border="0"></a>      <br>      <div class="symbol">Your OpenSource Publisher&#153;</div>    </div>      </td></tr></table>    <div align="center" class="author">      	<a href="../products.lxp">Products</a>	&nbsp;|&nbsp;	<a href="../wheretobuy.lxp">Where to buy</a>	&nbsp;|&nbsp;	<a href="../bookstore.lxp">Retailers</a>	&nbsp;|&nbsp;	<a href="../faq.lxp">FAQ</a>	&nbsp;|&nbsp;        <a href="../writeforus.lxp">Write for Us.</a>        &nbsp;|&nbsp;        <a href="#contact">Contact Us.</a>  </div>    <table border="0" cellspacing="3" cellpadding="0" width="100%"><tr><td width="100%">      <div class="content">        <table border="0" cellspacing="2" cellpadding="0" width="100%"><tr><td width="100%">          <div align="center"><H4 CLASS="AUTHOR"><A NAME="AEN5">Boudewijn Rempt</A><br><a href="../../https@secure.linuxports.com/opendocs/default.htm"><img src=odpyqt125.png></a><br>ISBN: 0-97003300-4-4<br><a href="../../https@secure.linuxports.com/opendocs/default.htm">Available from bookstores everywhere or you can order it here.</a><p>You can download the source files for the book <a href="pyqtsrc.tgz">(code / eps) here.</a><hr></div>                    <HTML><HEAD><TITLE>Creating Application Functionality</TITLE><METANAME="GENERATOR"CONTENT="Modular DocBook HTML Stylesheet Version 1.72"><LINKREL="HOME"TITLE="GUI Programming with Python: QT Edition"HREF="book1.htm"><LINKREL="UP"TITLE="Creating real applications with PyQt"HREF="p4627.htm"><LINKREL="PREVIOUS"TITLE="Conclusion"HREF="x5778.htm"><LINKREL="NEXT"TITLE="The view"HREF="x5798.htm"></HEAD><BODYCLASS="CHAPTER"BGCOLOR="#FFFFFF"TEXT="#000000"LINK="#0000FF"VLINK="#840084"ALINK="#0000FF"><DIVCLASS="NAVHEADER"><TABLESUMMARY="Header navigation table"WIDTH="100%"BORDER="0"CELLPADDING="0"CELLSPACING="0"><TR><THCOLSPAN="3"ALIGN="center">GUI Programming with Python: QT Edition</TH></TR><TR><TDWIDTH="10%"ALIGN="left"VALIGN="bottom"><A accesskey="P" href="index.lxp@lxpwrap=x5778_252ehtm.htm">Prev</A></TD><TDWIDTH="80%"ALIGN="center"VALIGN="bottom"></TD><TDWIDTH="10%"ALIGN="right"VALIGN="bottom"><A accesskey="N" href="index.lxp@lxpwrap=x5798_252ehtm.htm">Next</A></TD></TR></TABLE><HRALIGN="LEFT"WIDTH="100%"></DIV><DIVCLASS="CHAPTER"><H1>Chapter 17. Creating Application Functionality</A></H1><DIVCLASS="TOC"><DL><DT><B>Table of Contents</B></DT><DT><A href="index.lxp@lxpwrap=c5783_252ehtm.htm#AEN5785">Introduction</A></DT><DT><A href="index.lxp@lxpwrap=x5798_252ehtm.htm">The view</A></DT><DT><A href="index.lxp@lxpwrap=x5879_252ehtm.htm">The document</A></DT><DT><A href="index.lxp@lxpwrap=x5925_252ehtm.htm">Saving and loading documents</A></DT><DT><A href="index.lxp@lxpwrap=x5968_252ehtm.htm">Undo, redo and other editing functions</A></DT><DT><A href="index.lxp@lxpwrap=x6008_252ehtm.htm">Conclusion</A></DT></DL></DIV><DIVCLASS="SECT1"><H1CLASS="SECT1">Introduction</A></H1><P>In the last few chapters, we have built a      useful framework for a file-oriented application. In this      chapter we add some real functionality to the document and view      modules.</P><P>As an example application, I propose to      develop a reasonably full-featured editor, using the standard      PyQt multi-line editor widget. This will give us a chance to      explore some outlying regions of the Qt library without having      to handle the complexity of a custom created widget (as we would      have to do if we were to create, for example, a paint      application). Not that PyQt isn't capable of this, or of nice      games &#8212; you can make those, too, if you want. Later, we      will have occasion to look at the versatile canvas widget, which      has been used for many things, including web browsers, games,      and the eric debugger that is part of PyQt.</P><P>We will extend our project with an input      method for Unicode text, which will give us a chance to work      with <TTCLASS="CLASSNAME">QCanvas</TT>, search and replace, and      macros. Additionally, there are some fun items that we can add,      such as a rolling chart that keeps track of how fast you      type.</P><DIVCLASS="SECT2"><H2CLASS="SECT2">Giving the project a name</A></H2><P>Before starting out, we should decide        upon a name for this project. I rather like        <SPAN><ICLASS="EMPHASIS">kalam</I></SPAN> &#8212; a word which means pen or        pencil, and which is derived from the Latin        <SPAN><ICLASS="EMPHASIS">calamus</I></SPAN>. I have snapshotted the version        we have at the end of each chapter so you can follow the        development of this project. I didn't print the complete code        of every class in every chapter, as that would be too tedious        for words!</P></DIV></DIV></DIV><DIVCLASS="NAVFOOTER"><HRALIGN="LEFT"WIDTH="100%"><TABLESUMMARY="Footer navigation table"WIDTH="100%"BORDER="0"CELLPADDING="0"CELLSPACING="0"><TR><TDWIDTH="33%"ALIGN="left"VALIGN="top"><A accesskey="P" href="index.lxp@lxpwrap=x5778_252ehtm.htm">Prev</A></TD><TDWIDTH="34%"ALIGN="center"VALIGN="top"><A accesskey="H" href="index.lxp@lxpwrap=book1_252ehtm">Home</A></TD><TDWIDTH="33%"ALIGN="right"VALIGN="top"><A accesskey="N" href="index.lxp@lxpwrap=x5798_252ehtm.htm">Next</A></TD></TR><TR><TDWIDTH="33%"ALIGN="left"VALIGN="top">Conclusion</TD><TDWIDTH="34%"ALIGN="center"VALIGN="top"><A accesskey="U" href="index.lxp@lxpwrap=p4627_252ehtm.htm">Up</A></TD><TDWIDTH="33%"ALIGN="right"VALIGN="top">The view</TD></TR></TABLE></DIV></BODY></HTML>      </td>      </tr>      </table>      </td>    </tr>  </table>      

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?