c7878.htm

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

HTM
258
字号
<HTML><HEAD><TITLE>Gui Design in the Baroque Age</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="x7875.htm"><LINKREL="NEXT"TITLE="Faking it with bitmaps"HREF="x7898.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"><AHREF="x7875.htm"ACCESSKEY="P">Prev</A></TD><TDWIDTH="80%"ALIGN="center"VALIGN="bottom"></TD><TDWIDTH="10%"ALIGN="right"VALIGN="bottom"><AHREF="x7898.htm"ACCESSKEY="N">Next</A></TD></TR></TABLE><HRALIGN="LEFT"WIDTH="100%"></DIV><DIVCLASS="CHAPTER"><H1><ANAME="CH5">Chapter 22. Gui Design in the Baroque Age</A></H1><DIVCLASS="TOC"><DL><DT><B>Table of Contents</B></DT><DT><AHREF="c7878.htm#AEN7882">Types of gui customization</A></DT><DT><AHREF="x7898.htm">Faking it with bitmaps</A></DT><DT><AHREF="x7947.htm">Creating themes with QStyle</A></DT></DL></DIV><P>One of the greatest achievements of GUI    interfaces such as CDE, Windows or MacOS is the uniform look and    feel of the applications. Once a user has learned to use one    application effectively, he will be familiar with the way    <SPAN><ICLASS="EMPHASIS">all</I></SPAN> applications work on that platform. Of    course, there are also users who complain they forget exactly    which application they are working with when all applications look    the same. Be that as it may, the current trend, perhaps initiated    with the wide variety of design for websites, is toward ever-more    distinctive and baroque interfaces. Indeed, we seem to be entering    the age of the &#8216;designer' interface, and PyQt offers everything we    need to create database applications in the form of an audio rack    or spreadsheets in the form of a medieval book of hours.</P><DIVCLASS="SECT1"><H1CLASS="SECT1"><ANAME="AEN7882">Types of gui customization</A></H1><P>Despite the slight banter in the      introduction, there are many valid reasons to design a gui for      your application that diverges from the platform standard. For      instance, while a word processor shouldn't look like the desk of      a medieval scribe, the paste-board gui used in an application      like Adobe FrameMaker is very effective, especially since many      layout designers are still familiar with the glue-and-scissors      approach of creating a layout. Likewise, designing an mp3-player      that looks a bit like an audio rack is effective (while making      it look like an angry fish-eye is less so). Generally speaking,      creating an interface that matches closely the real world      experience of your users is a good idea.</P><P>There is another area where a custom gui      would fit well: the general redesign, or      <SPAN><ICLASS="EMPHASIS">theming</I></SPAN> of the whole set of widgets, to      make them more esthetically pleasing to your users. Qt already      offers a selection of those themes. Your user can decide whether      they want their applications to look like Motif, CDE, Silicon      Graphics IRIX, Windows 95 or MacOS 9. Offering this choice means      that the applications you make can always blend in unobtrusively      with the other applications your users use. A toolkit like      Tkinter does not offer this advantage; a user will always be      aware that he or she is not working with a application native to      his computing environment.</P><P>There are two ways to create a totally      custom interface. You can reimplement      <TTCLASS="CLASSNAME">QWidget</TT> using pixmaps and masks, or you      can use the PyQt <TTCLASS="CLASSNAME">QStyle</TT> mechanism to      reimplement the drawing routines of the standard widgets like      <TTCLASS="CLASSNAME">QPushButton</TT>.</P><P>The first solution is applicable for simple      applications like audio players or for applications that need to      be totally skinnable (again, like audio players). You need also      to reimplement <TTCLASS="CLASSNAME">QWidget</TT> if you have      designed a totally new type of widget, like Adobe did with the      PageMager paste-board. (You can also simulate the pasteboard      quite easily with <TTCLASS="CLASSNAME">QCanvas</TT>, but you might      have an idea for a widget that's more complicated than      this.)</P></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"><AHREF="x7875.htm"ACCESSKEY="P">Prev</A></TD><TDWIDTH="34%"ALIGN="center"VALIGN="top"><AHREF="book1.htm"ACCESSKEY="H">Home</A></TD><TDWIDTH="33%"ALIGN="right"VALIGN="top"><AHREF="x7898.htm"ACCESSKEY="N">Next</A></TD></TR><TR><TDWIDTH="33%"ALIGN="left"VALIGN="top">Conclusion</TD><TDWIDTH="34%"ALIGN="center"VALIGN="top"><AHREF="p4627.htm"ACCESSKEY="U">Up</A></TD><TDWIDTH="33%"ALIGN="right"VALIGN="top">Faking it with bitmaps</TD></TR></TABLE></DIV></BODY></HTML>

⌨️ 快捷键说明

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