亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? c5584.htm

?? GUI Programming with Python
?? HTM
字號:
<HTML><HEAD><TITLE>User Interface Paradigms</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="x5581.htm"><LINKREL="NEXT"TITLE="Back to the MDI windows"HREF="x5657.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="x5581.htm"ACCESSKEY="P">Prev</A></TD><TDWIDTH="80%"ALIGN="center"VALIGN="bottom"></TD><TDWIDTH="10%"ALIGN="right"VALIGN="bottom"><AHREF="x5657.htm"ACCESSKEY="N">Next</A></TD></TR></TABLE><HRALIGN="LEFT"WIDTH="100%"></DIV><DIVCLASS="CHAPTER"><H1><ANAME="CH11">Chapter 16. User Interface Paradigms</A></H1><DIVCLASS="TOC"><DL><DT><B>Table of Contents</B></DT><DT><AHREF="c5584.htm#AEN5591">Tabbed documents</A></DT><DT><AHREF="x5657.htm">Back to the MDI windows</A></DT><DT><AHREF="x5679.htm">A row of split windows</A></DT><DT><AHREF="x5700.htm">A stack of documents</A></DT><DT><AHREF="x5722.htm">A more complex view management solution</A></DT><DT><AHREF="x5778.htm">Conclusion</A></DT></DL></DIV><P>In <AHREF="c5288.htm">Chapter 15</A>, we created a    general framework to handle the complexities of applications that    have more than one document open at the same time &#8212; with    possibly more than one view on the same document, too. We also    discussed the various paradigms for representing those views in    the application.</P><P>In this chapter, we will explore the actual    implementation of some of those paradigms, starting with one of    the most useful and modern paradigms: the tabbed document    model.</P><DIVCLASS="SECT1"><H1CLASS="SECT1"><ANAME="AEN5591">Tabbed documents</A></H1><P>Like most user interface paradigms, the      tabbed document paradigm has been popularized by current      integrated development environments. A tabbed document collects      all open documents in one window, with a row of tabs to facilitate easy navigation of      documents. This paradigm has become so prevalent that even the      old stalwart of user interface conservatism, XEmacs, supports      it.</P><P>It turns out to be remarkably easy to      implement a tabbed document interface. First, let's determine      what we want to get out of this component. It is the first of      several generic components that can take views &#8212; i.e.      <TTCLASS="CLASSNAME">QWidget</TT>'s&#8212; and show them in an      application workspace. All view managers should have the same      API. That allows the user to choose his favorite way of working      without giving us lots of work &#8212; because, from the point      of view of the application, all view managers are exactly the      same.</P><P>We will provisionally call the component      that manages tabbed views <TTCLASS="CLASSNAME">TabManager</TT>. The      <TTCLASS="CLASSNAME">TabManager</TT> is meant to be almost a      drop-in replacement for the <TTCLASS="CLASSNAME">QWorkspace</TT> we      used in the <AHREF="c5288.htm">Chapter 15</A>. Therefore, it should support      most of the same functionality: adding, removing and listing      actual views. Other capabilities of      <TTCLASS="CLASSNAME">QWorkspace</TT> don't make sense: you cannot      tile or cascade tabbed windows. There must be some way to      indicate to the wrapping application whether the view manager      supports these capabilities.</P><P>PyQt offers a      <TTCLASS="CLASSNAME">QTabWidget</TT>, which fits the basics of our      needs perfectly. However, in contrast with the      <TTCLASS="CLASSNAME">QWorkspace</TT>, where merely creating a      widget with the workspace as parent widget was enough to let it      be managed, <TTCLASS="CLASSNAME">QTabWidget</TT> wants us to      explicitly add pages, and thus widgets, to its list of tabs.      Finally, it also allows the addition and removal of pages. We      can also request a reference to the active view, and ask to be      notified of page changes.</P><P><TTCLASS="CLASSNAME">QTabWidget</TT> is used      in the <TTCLASS="CLASSNAME">QTabDialog</TT> dialog window class,      and makes use of <TTCLASS="CLASSNAME">QWidgetStack</TT> and      <TTCLASS="CLASSNAME">QTabBar</TT>.      <TTCLASS="CLASSNAME">QWidgetStack</TT> keeps a stack of widgets of      which only one is shown at a time.      <TTCLASS="CLASSNAME">QTabBar</TT>, which keeps a row of tabs.      Tabs can be square or triangular (the      latter is seldom seen nowadays, for it is very ugly), and shown      on the top or bottom of the window.</P><P>Applications that handle documents that      consist of several (but not many) pages often show a row of      triangular tabs at the bottom of the window. You cannot set the      tabs to appear at the side of the window. That's a pity, since      it is a position that is quite often preferred by users.</P><P>Let us take a look at the implementation of      a tabbed document manager:</P><PRECLASS="PROGRAMLISTING">"""tabmanager.py - tabbed document manager for the mdi frameworkcopyright: (C) 2001, Boudewijn Remptemail:     boud@rempt.xs4all.nl"""from qt import *from resources import TRUE, FALSEclass TabManager(QTabWidget):    def __init__(self, *args):        apply(QTabWidget.__init__,(self, ) + args)        self.views=[]        self.setMargin(10)    </PRE><P>The <TTCLASS="CLASSNAME">TabManager</TT> is      derived from <TTCLASS="CLASSNAME">QTabWidget</TT>. A simple python      list of views is kept, otherwise we would not be able to      retrieve a list of all open views for the &#8216;windows' menu. The      margin between tab and document should really be a user-settable      property, but we won't develop a user preferences framework      until chapter      <AHREF="c6013.htm">Chapter 18</A>.</P><PRECLASS="PROGRAMLISTING">    def addView(self, view):        if view not in self.views:            self.views.append(view)            self.addTab(view, view.caption())            self.showPage(view)    </PRE><P>Adding a new view is a simple exercise.      However, note that until you actually call      <TTCLASS="FUNCTION">showPage()</TT> on your view, the      <TTCLASS="CLASSNAME">QTabWidget</TT> appears to be innocent of your      addition, and won't manage the layout of the page. This means      that when you create a new window and resize the application      window, the contents won't resize with it. Simply drawing the      tab widget's attention to the page will suffice, however.</P><P>With PyQt's      <TTCLASS="CLASSNAME">QWorkspace</TT> it was enough to create a      widget with the workspace as its parent&#8212;the widget was      automatically managed shown. This is no longer enough when we      use <TTCLASS="CLASSNAME">QTabWidget</TT>.  This means that we will have to adapt the      <TTCLASS="CLASSNAME">DocManager</TT> class to work with      <TTCLASS="FUNCTION">addView</TT>. This is done in the private      <TTCLASS="FUNCTION">_createView()</TT> function:</P><PRECLASS="PROGRAMLISTING">    def _createView(self, document, viewClass):        view = viewClass(self._viewManager,                         document,                         None,                         QWidget.WDestructiveClose)        if self._docToViewMap.has_key(document):            index = len(self._docToViewMap[document]) + 1        else:            index = 1        view.setCaption(document.title() + " %s" % index)        self._viewManager.addView(view)        view.installEventFilter(self._parent)        if self._viewToDocMap == {}:            view.showMaximized()        else:            view.show()        return view    </PRE><P>To return to the      <TTCLASS="CLASSNAME">TabManager</TT> class:</P><PRECLASS="PROGRAMLISTING">    def removeView(self, view):        if view in self.views:            self.views.remove(view)            self.removePage(view)    def activeWindow(self):        return self.currentPage()    def windowList(self):        return self.views    </PRE><P>The first of these three functions is new.      Simply closing a widget was enough to remove it when it was      managed by the <TTCLASS="CLASSNAME">QWorkspace</TT> object; now we      must explicitly remove it. This, too, demands a change in the      <TTCLASS="CLASSNAME">DocManager</TT> class, but fortunately, it's a      simple change:</P><PRECLASS="PROGRAMLISTING">    def _removeView(self, view, document):        try:            self._docToViewMap[document].remove(view)            self._viewManager.removeView(view)            del self._viewToDocMap[view]        except ValueError, e:            pass # apparently already deleted    </PRE><P>Both <TTCLASS="FUNCTION">activeWindow()</TT>      and <TTCLASS="FUNCTION">windowList</TT> have been included to make      the interface of the tabmanager more similar to that of      <TTCLASS="CLASSNAME">QWorkspace</TT>. If you want to have      transparently interchangeable components, they must have the      same functions.</P><PRECLASS="PROGRAMLISTING">    def cascade(self): pass    def tile(self): pass    def canCascade(self):        return FALSE    def canTile(self):        return FALSE    </PRE><P>You cannot cascade nor tile a set of tab      pages. The functions are included, but merely to avoid runtime      exceptions when the application inadvertently does try to call      them. The functions <TTCLASS="FUNCTION">canCascade()</TT> and      <TTCLASS="FUNCTION">canTile()</TT> can be used to determine whether      this component supports this functionality.</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="x5581.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="x5657.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">Back to the MDI windows</TD></TR></TABLE></DIV></BODY></HTML>

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久久精品欧美丰满| 亚洲.国产.中文慕字在线| 国产午夜精品一区二区三区四区| 欧美电影免费观看高清完整版在线观看 | 欧美视频在线播放| 欧美性猛交xxxxxx富婆| 在线观看亚洲专区| 欧美人妖巨大在线| 欧美一区二区三区视频在线| 91精品国产免费| 精品国产区一区| 久久综合资源网| 中文字幕的久久| 国产精品美女久久久久aⅴ国产馆| 欧美日韩国产免费一区二区| 国产精品一区一区三区| av在线这里只有精品| 欧美日韩一区二区三区免费看| 黑人精品欧美一区二区蜜桃| 激情综合网激情| 夜夜嗨av一区二区三区中文字幕| 久久精品一区二区三区不卡| 欧美va亚洲va| 欧美精品丝袜中出| 91精品在线一区二区| 欧美色图在线观看| 国产欧美精品一区二区三区四区| 成人精品国产福利| 七七婷婷婷婷精品国产| 国产一区久久久| 色中色一区二区| 日韩欧美一级二级| 免费欧美高清视频| 亚洲精品菠萝久久久久久久| 日韩精品一二区| 国产成人精品综合在线观看| 色婷婷久久99综合精品jk白丝 | 91精品国产综合久久精品图片| 日韩视频在线永久播放| 国产精品乱码一区二区三区软件 | 欧美成人女星排行榜| 亚洲国产高清在线| 日韩高清不卡在线| 成人h精品动漫一区二区三区| 欧美日本韩国一区| 国产亚洲一区二区三区| 性久久久久久久久久久久| 国产精品99久久久久久宅男| 日本丶国产丶欧美色综合| 日韩欧美国产一二三区| 日韩理论片中文av| 国产一区二区91| 欧美视频一区二区在线观看| 国产午夜亚洲精品羞羞网站| 亚洲成人在线网站| 成人av影视在线观看| 亚洲人成精品久久久久| 久久99蜜桃精品| 欧美色视频一区| 国产精品久久久久久久久晋中| 日本成人在线不卡视频| 色婷婷av一区二区| 国产色爱av资源综合区| 日本女优在线视频一区二区| 色婷婷久久99综合精品jk白丝| 国产欧美在线观看一区| 蜜桃视频第一区免费观看| 色婷婷av一区二区三区软件| 国产精品卡一卡二卡三| 国产美女精品人人做人人爽 | 国产精品看片你懂得| 黄网站免费久久| 国产亚洲人成网站| 偷拍一区二区三区四区| 99精品国产热久久91蜜凸| 久久久美女艺术照精彩视频福利播放 | 国产欧美日韩在线| 青娱乐精品在线视频| 欧美亚洲图片小说| 亚洲日本在线视频观看| 风间由美中文字幕在线看视频国产欧美| 欧美一区二区啪啪| 午夜精品福利在线| 欧美熟乱第一页| 亚洲香肠在线观看| 色婷婷综合激情| 一区二区三区在线免费播放| 国产91对白在线观看九色| 久久久久久久综合| 国产乱色国产精品免费视频| 精品粉嫩aⅴ一区二区三区四区| 婷婷开心激情综合| 欧美日韩视频在线观看一区二区三区 | 在线观看日韩av先锋影音电影院| 国产精品丝袜一区| 成人短视频下载| 国产精品福利影院| 99久久er热在这里只有精品66| 国产精品区一区二区三区| 国产99久久久国产精品潘金网站| 欧美激情一区二区三区| 成人午夜av电影| 亚洲视频在线观看三级| 91小视频免费观看| 亚洲一区二区三区四区的| 欧美久久久久中文字幕| 青青青伊人色综合久久| 日韩欧美黄色影院| 麻豆成人久久精品二区三区小说| 在线不卡欧美精品一区二区三区| 三级久久三级久久| 欧美电影免费观看高清完整版在线 | 精品视频1区2区3区| 日韩电影在线看| www久久精品| a美女胸又www黄视频久久| 亚洲自拍偷拍综合| 欧美高清hd18日本| 精品无人码麻豆乱码1区2区| 久久久久久久一区| 一本到一区二区三区| 午夜久久福利影院| 日韩欧美你懂的| 成人一级黄色片| 亚洲综合另类小说| 日韩欧美黄色影院| 丁香桃色午夜亚洲一区二区三区| 国产精品不卡在线| 欧美另类高清zo欧美| 免费在线视频一区| 久久久精品免费观看| 91蜜桃在线免费视频| 香蕉av福利精品导航| www国产成人| 在线看日韩精品电影| 性做久久久久久| 精品国产伦一区二区三区免费| 国产99一区视频免费| 亚洲一二三级电影| 久久综合资源网| 欧美在线影院一区二区| 国产一区二区在线观看免费| 亚洲欧美另类在线| 日韩精品一区二区三区在线| 91原创在线视频| 日韩激情一二三区| 国产午夜亚洲精品不卡| 欧美丝袜丝nylons| 国产成人免费视频| 五月天视频一区| 国产精品久久毛片a| 欧美日韩精品三区| 国产剧情一区在线| 一区二区国产盗摄色噜噜| 日韩欧美国产1| 91久久奴性调教| 精品无人区卡一卡二卡三乱码免费卡| 亚洲欧美日韩中文字幕一区二区三区| 日韩一级二级三级| 91九色最新地址| 狠狠色丁香婷综合久久| 亚洲精品乱码久久久久| 久久精品人人做| 日韩欧美成人激情| 91香蕉视频黄| 国产在线国偷精品产拍免费yy| 一区二区视频在线看| 久久嫩草精品久久久精品一| 欧美日韩成人一区| 一本一本久久a久久精品综合麻豆| 国产美女在线观看一区| 日本亚洲三级在线| 亚洲国产中文字幕在线视频综合| 国产精品国产精品国产专区不蜜| 精品奇米国产一区二区三区| 欧美日韩在线综合| 91蜜桃在线免费视频| 成人激情文学综合网| 国产高清不卡一区| 精品综合久久久久久8888| 丝袜国产日韩另类美女| 亚洲国产成人高清精品| 亚洲美女免费视频| 国产亚洲精品超碰| 成人av免费在线| 成人国产精品免费观看| 亚洲三级在线看| 国产视频一区在线观看| 精品88久久久久88久久久| 欧美一区午夜精品| 欧美美女一区二区三区| 欧美在线不卡一区| 99精品视频中文字幕| a亚洲天堂av| www.久久精品| av不卡免费在线观看| 大陆成人av片| 99精品视频一区二区三区| 成人app网站| 不卡视频在线看|