示例#1
0
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
"""

import sys
from PyQt4.QtGui import QApplication, QTextEdit, QWorkspace

if __name__ == "__main__":

    app = QApplication(sys.argv)
    workspace = QWorkspace()
    workspace.setWindowTitle("Simple Workspace Example")

    for i in range(5):
        textEdit = QTextEdit()
        textEdit.setPlainText("PyQt4 " * 100)
        textEdit.setWindowTitle("Document %i" % i)
        workspace.addWindow(textEdit)

    workspace.resize(480, 360)
    workspace.cascade()
    workspace.show()

    sys.exit(app.exec_())