2015年4月17日

摘要: TheQtGui.QComboBoxis a widget that allows a user to choose from a list of options.#!/usr/bin/python# -*- coding: utf-8 -*-"""ZetCode PyQt4 tutorial Th... 阅读全文
posted @ 2015-04-17 20:13 帅胡 阅读(589) 评论(0) 推荐(0)
摘要: AQtGui.QSplitterlets the user control the size of child widgets by dragging the boundary between the children. In our example, we show threeQtGui.QFra... 阅读全文
posted @ 2015-04-17 20:12 帅胡 阅读(706) 评论(0) 推荐(0)
摘要: AQtGui.QLineEditis a widget that allows to enter and edit a single line of plain text. There are undo and redo, cut and paste, and drag & drop functio... 阅读全文
posted @ 2015-04-17 20:11 帅胡 阅读(677) 评论(0) 推荐(0)
摘要: AQtGui.QPixmapis one of the widgets used to work with images. It is optimized for showing images on screen. In our code example, we will use theQtGui.... 阅读全文
posted @ 2015-04-17 20:09 帅胡 阅读(1546) 评论(0) 推荐(0)
摘要: AQtGui.QCalendarWidgetprovides a monthly based calendar widget. It allows a user to select a date in a simple and intuitive way.#!/usr/bin/python# -*-... 阅读全文
posted @ 2015-04-17 19:06 帅胡 阅读(1067) 评论(0) 推荐(0)
摘要: A progress bar is a widget that is used when we process lengthy tasks. It is animated so that the user knows that the task is progressing. TheQtGui.QP... 阅读全文
posted @ 2015-04-17 19:05 帅胡 阅读(524) 评论(0) 推荐(0)
摘要: AQtGui.QSlideris a widget that has a simple handle. This handle can be pulled back and forth. This way we are choosing a value for a specific task. So... 阅读全文
posted @ 2015-04-17 19:03 帅胡 阅读(716) 评论(0) 推荐(0)
摘要: A toggle button is aQtGui.QPushButtonin a special mode. It is a button that has two states: pressed and not pressed. We toggle between these two state... 阅读全文
posted @ 2015-04-17 19:01 帅胡 阅读(458) 评论(0) 推荐(0)
摘要: AQtGui.QCheckBoxis a widget that has two states: on and off. It is a box with a label. Check boxes are typically used to represent features in an appl... 阅读全文
posted @ 2015-04-17 19:00 帅胡 阅读(1018) 评论(0) 推荐(0)
摘要: TheQtGui.QFileDialogis a dialog that allows users to select files or directories. The files can be selected for both opening and saving.#!/usr/bin/pyt... 阅读全文
posted @ 2015-04-17 18:33 帅胡 阅读(730) 评论(0) 推荐(0)
摘要: TheQtGui.QFontDialogis a dialog widget for selecting a font.#!/usr/bin/python# -*- coding: utf-8 -*-"""ZetCode PyQt4 tutorial In this example, we sele... 阅读全文
posted @ 2015-04-17 18:32 帅胡 阅读(688) 评论(0) 推荐(0)
摘要: heQtGui.QColorDialogprovides a dialog widget for selecting colour values.#!/usr/bin/python# -*- coding: utf-8 -*-"""ZetCode PyQt4 tutorial In this exa... 阅读全文
posted @ 2015-04-17 18:31 帅胡 阅读(752) 评论(0) 推荐(0)
摘要: TheQtGui.QInputDialogprovides a simple convenience dialog to get a single value from the user. The input value can be a string, a number or an item fr... 阅读全文
posted @ 2015-04-17 18:30 帅胡 阅读(537) 评论(0) 推荐(0)
摘要: Objects created from aQtCore.QObjectcan emit signals. In the following example we will see how we can emit custom signals.#!/usr/bin/python# -*- codin... 阅读全文
posted @ 2015-04-17 17:37 帅胡 阅读(262) 评论(0) 推荐(0)
摘要: Sometimes it is convenient to know which widget is the sender of a signal. For this, PyQt4 has thesender()method.#!/usr/bin/python# -*- coding: utf-8 ... 阅读全文
posted @ 2015-04-17 17:35 帅胡 阅读(400) 评论(0) 推荐(0)
摘要: Events in PyQt4 are processed often by reimplementing event handlers.#!/usr/bin/python# -*- coding: utf-8 -*-"""ZetCode PyQt4 tutorial In this example... 阅读全文
posted @ 2015-04-17 17:34 帅胡 阅读(340) 评论(0) 推荐(0)
摘要: All GUI applications are event-driven. Events are generated mainly by the user of an application. But they can be generated by other means as well: e.... 阅读全文
posted @ 2015-04-17 17:33 帅胡 阅读(308) 评论(0) 推荐(0)
摘要: Widgets can span multiple columns or rows in a grid. In the next example we illustrate this.#!/usr/bin/python# -*- coding: utf-8 -*-"""ZetCode PyQt4 t... 阅读全文
posted @ 2015-04-17 17:23 帅胡 阅读(516) 评论(0) 推荐(0)
摘要: The most universal layout class is the grid layout. This layout divides the space into rows and columns. To create a grid layout, we use theQtGui.QGri... 阅读全文
posted @ 2015-04-17 17:22 帅胡 阅读(935) 评论(0) 推荐(0)
摘要: Layout management with layout classes is much more flexible and practical. It is the preferred way to place widgets on a window. TheQtGui.QHBoxLayouta... 阅读全文
posted @ 2015-04-17 17:21 帅胡 阅读(321) 评论(0) 推荐(0)
摘要: The programmer specifies the position and the size of each widget in pixels. When you use absolute positioning, we have to understand the following li... 阅读全文
posted @ 2015-04-17 17:20 帅胡 阅读(325) 评论(0) 推荐(0)
摘要: In the last example of this section, we create a menubar, a toolbar and a statusbar. We also create a central widget.#!/usr/bin/python# -*- coding: ut... 阅读全文
posted @ 2015-04-17 17:00 帅胡 阅读(613) 评论(0) 推荐(0)
摘要: Menus group all commands that we can use in an application. Toolbars provide a quick access to the most frequently used commands.#!/usr/bin/python# -*... 阅读全文
posted @ 2015-04-17 16:57 帅胡 阅读(392) 评论(0) 推荐(0)
摘要: A menubar is a common part of a GUI application. It is a group of commands located in various menus.#!/usr/bin/python# -*- coding: utf-8 -*-"""ZetCode... 阅读全文
posted @ 2015-04-17 16:55 帅胡 阅读(568) 评论(0) 推荐(0)
摘要: Main windowTheQtGui.QMainWindowclass provides a main application window. This enables to create a classic application skeleton with a statusbar, toolb... 阅读全文
posted @ 2015-04-17 16:52 帅胡 阅读(619) 评论(0) 推荐(0)
摘要: The following script shows how we can center a window on the desktop screen.#!/usr/bin/python# -*- coding: utf-8 -*-"""ZetCode PyQt4 tutorial This pro... 阅读全文
posted @ 2015-04-17 16:50 帅胡 阅读(303) 评论(0) 推荐(0)
摘要: By default, if we click on the x button on the titlebar, theQtGui.QWidgetis closed. Sometimes we want to modify this default behaviour. For example, i... 阅读全文
posted @ 2015-04-17 16:49 帅胡 阅读(415) 评论(0) 推荐(0)
摘要: The obvious way to how to close a window is to click on the x mark on the titlebar. In the next example, we will show how we can programatically close... 阅读全文
posted @ 2015-04-17 16:48 帅胡 阅读(365) 评论(0) 推荐(0)
摘要: import htmlhtml.escape(s, quote=True)对特殊字符进行转义Convert the characters &, in string s to HTML-safe sequences. Use this if you need to display text that... 阅读全文
posted @ 2015-04-17 14:46 帅胡 阅读(583) 评论(0) 推荐(0)
摘要: We can provide a balloon help for any of our widgets.#!/usr/bin/python# -*- coding: utf-8 -*-"""ZetCode PyQt4 tutorial This example shows a tooltip on... 阅读全文
posted @ 2015-04-17 12:32 帅胡 阅读(455) 评论(0) 推荐(0)
摘要: The application icon is a small image which is usually displayed in the top left corner of the titlebar. In the following example we will show how we ... 阅读全文
posted @ 2015-04-17 11:25 帅胡 阅读(323) 评论(0) 推荐(0)
摘要: This is a simple example showing a small window. Yet we can do a lot with this window. We can resize it, maximise it, or minimise it. This requires a ... 阅读全文
posted @ 2015-04-17 11:19 帅胡 阅读(494) 评论(0) 推荐(0)
摘要: Java™ Platform, Standard Edition 6 (Java SE) 专注于提升性能,提供的增强工具可以管理和监视应用程序以及诊断常见的问题。本文将介绍 Java SE 平台中监视和管理的基本知识,并提供 Java SE 6 中相关增强的详细信息。Java SE 6 对性能进行了... 阅读全文
posted @ 2015-04-17 11:07 帅胡 阅读(221) 评论(0) 推荐(0)
摘要: VisualVM 是一款免费的\集成了多个 JDK 命令行工具的可视化工具,它能为您提供强大的分析能力,对 Java 应用程序做性能分析和调优。这些功能包括生成和分析海量数据、跟踪内存泄漏、监控垃圾回收器、执行内存和 CPU 分析,同时它还支持在 MBeans 上进行浏览和操作。本文主要介绍如何使用... 阅读全文
posted @ 2015-04-17 10:49 帅胡 阅读(332) 评论(0) 推荐(0)

导航