《开始使用PyQT》 第01章 PyQT入门 03 用户界面介绍

03 用户界面介绍

《开始使用PyQT》 第01章 PyQT入门 03 用户界面介绍

The user interface (UI) has become a key part of our everyday lives, becoming the intermediary between us and our ever-growing number of machines. A UI is designed to facilitate in human-computer interaction. The human needs to operate and control the machine to serve some purpose; meanwhile, the machine needs to simultaneously provide feedback and a means to interact with it in order to aid the human's decisionmaking process. UIs are everywhere, from the mobile applications on our phones to web browsers, to heavy machinery controls, and even on the appliances in our kitchens. Of course, the ways in which we interact with technology is not merely limited to our hands, as many UIs also allow interaction with our other sensory organs.

用户界面(UI)已成为我们日常生活的重要组成部分,成为我们与日益增多的机器之间的中介。用户界面旨在促进人机交互。人类需要操作和控制机器,以达到某种目的;与此同时,机器需要同时提供反馈和与之互动的方式,以帮助人类做出决策。用户界面无处不在,从我们手机上的移动应用程序到网页浏览器,再到重型机械控制装置,甚至是我们厨房里的电器。当然,我们与技术互动的方式不仅仅局限于我们的双手,许多用户界面还可以与我们的其他感觉器官进行互动。

A good UI is tasked with helping a person produce a desired result while also allowing for easier, more efficient, and more friendly operation of a machine. Think about the photo editing apps on your phone. Editing the size, color, or exposure is practically effortless as you slide your fingers across the screen and watch the images change almost instantly. The user provides minimal input to achieve the desired output.

一个好的用户界面的任务是帮助用户获得理想的结果,同时还能让用户更轻松、更高效、更友好地操作机器。想想你手机上的照片编辑应用程序。编辑尺寸、颜色或曝光几乎不费吹灰之力,手指在屏幕上滑动,图像几乎瞬间就会发生变化。用户只需提供最少的输入,就能实现所需的输出。

什么是图形化用户界面?

For this book, we will be focusing on creating desktop graphical user interfaces (GUI) that take advantage of a computer's graphics capabilities to create visual applications. Decades ago, users would have to use the command line and text commands to interact with the computer. Tasks such as opening, deleting and moving files, and searching through directories were all done by typing in certain commands. However, these were not very user-friendly or simple-to-use interfaces for the general public. So GUIs were created to allow users to interact with electronic devices using graphical controls, rather than command-line interfaces.

本书的重点是创建桌面图形用户界面(GUI),利用计算机的图形功能创建可视化应用程序。几十年前,用户必须使用命令行和文本命令与计算机交互。打开、删除和移动文件以及搜索目录等任务都是通过输入特定命令来完成的。然而,对于普通大众来说,这些界面并不是非常友好或简单易用。因此,图形用户界面应运而生,允许用户使用图形控制而不是命令行界面与电子设备进行交互。

These graphical control elements, or widgets, such as buttons, menus, and windows, make such tasks effortless. Interaction now becomes as simple as moving your mouse or touching the screen depending upon your device and clicking on the widget.

按钮、菜单和窗口等这些图形控制元素或小工具让这些任务变得毫不费力。现在,交互变得非常简单,只需移动鼠标或触摸屏幕(视设备而定),然后点击部件即可。

创建良好界面设计的理念

This, first and foremost, is a technical book written to help those of you who want to learn how to create and code your own GUI with PyQt and Python. That being said, if you plan to design any kind of UI that other people will use, then you are no longer creating a UI just to solve your own problems. You must also begin to consider other users of the application as well. Think about what you want them to accomplish, or how the application can help them. Sometimes, when we are trying to solve a problem, we get so caught up in trying to create a product that we forget about the people who actually have to interact with them.

首先,这是一本技术书籍,旨在帮助那些想学习如何使用 PyQt 和 Python 创建和编写自己的图形用户界面的人。尽管如此,如果您打算设计任何类型的用户界面供他人使用,那么您就不再只是为了解决自己的问题而创建用户界面。您还必须开始考虑应用程序的其他用户。想想你想让他们完成什么,或者应用程序能如何帮助他们。有时,当我们试图解决一个问题时,我们会过于专注于创造一个产品,而忘记了真正需要与之交互的人。

The following is a list of concepts to consider when designing your own UI. They are not set rules and by no means a complete list, but rather ideas that you should consider when designing your own applications.

以下是在设计自己的用户界面时需要考虑的一些概念。它们不是固定的规则,也绝不是完整的列表,而是您在设计自己的应用程序时应该考虑的想法。

Clarity -- Using clear language, hierarchy, and flow with visualelements to avoid ambiguity. One of the ways this can be achieved is by considering visual importance to the human eye, laying out widgets with bigger sizes, darker colors, etc., in such a manner that we can visually understand the UI.

清晰度--使用清晰的语言、层次结构和视觉元素流程,避免含糊不清。实现这一点的方法之一是考虑视觉对人眼的重要性,用更大的尺寸、更深的颜色等布局部件,使我们能直观地理解用户界面。

Conciseness -- Simplifying the layout to include only what the userneeds to see or interact with at a given time in order to be brief,but also comprehensive. Adding more labels or buttons in yourwindow just to give the user more options is not always better.

简洁--简化布局,只包含用户在特定时间内需要查看或交互的内容,这样既简洁又全面。在窗口中添加更多标签或按钮,只是为了给用户提供更多选择,并不总是更好的做法。

Consistency -- Design the UI so that there is consistency across theapplication. This helps users to recognize patterns in the visualelements and layout and can be seen in typography that improvesthe navigation and readability of the application, image styles, oreven color schemes.

一致性--设计用户界面时要确保整个应用程序的一致性。这有助于用户识别视觉元素和布局中的模式,可体现在提高应用程序导航和可读性的排版、图像样式甚至配色方案中。

Efficiency -- Utilizing good design and shortcuts to help the userimprove productivity. If a task can be accomplished in two steps,why design your GUI so that the work has to be completed in five?

效率 - 利用良好的设计和快捷方式帮助用户提高工作效率。如果一项任务只需两步就能完成,为什么还要设计图形用户界面,让用户在五步内完成工作呢?

Familiarity -- Consider elements that users normally see inother UIs and how they would expect them to perform in yourapplications. For example, think about how weird it would be to have to enter your login information, only to find the password entry field is above the username. It is not wrong, but now you are unnecessarily making users think about their actions and slowing them down.

熟悉性--考虑用户通常在其他用户界面中看到的元素,以及他们希望这些元素在你的应用程序中如何执行。例如,如果要输入登录信息,却发现密码输入字段在用户名的上方,想想会有多奇怪。这并没有错,但现在您却不必要地让用户思考他们的操作,从而减慢了他们的速度。

Responsive -- Give the user feedback, for example, a toggle thatchanges color to "on" or "off," a small message to notify the user iftheir input is correct or incorrect, or even a sound effect to verify acompleted action. The user should never be left wondering if theiraction was successful or not.

响应式 - 给用户反馈,例如,将颜色切换为 "开 "或 "关 "的切换按钮、通知用户输入正确或错误的小信息,甚至是验证操作是否完成的声音效果。用户不应该怀疑自己的操作是否成功。

相关推荐
不秃头的UI设计师3 小时前
UI界面设计入门:打造卓越用户体验
ui·ux·ui设计
未来的嗒嘀嗒3 小时前
Axure是什么软件?全方位解读助力设计入门
ui·photoshop
wrx繁星点点5 小时前
状态模式(State Pattern)详解
java·开发语言·ui·设计模式·状态模式
王哈哈^_^5 小时前
【数据集】【YOLO】【VOC】目标检测数据集,查找数据集,yolo目标检测算法详细实战训练步骤!
人工智能·深度学习·算法·yolo·目标检测·计算机视觉·pyqt
SoraLuna14 小时前
「Mac畅玩鸿蒙与硬件28」UI互动应用篇5 - 滑动选择器实现
macos·ui·harmonyos
martian6651 天前
QT开发:掌握现代UI动画技术:深入解析QML和Qt Quick中的动画效果
开发语言·c++·qt·ui
初九之潜龙勿用1 天前
C#结合JS解决Word添加无效位图导致进程停滞的问题
javascript·ui·c#·word·asp.net
AI原吾1 天前
`psdparse`:解锁Photoshop PSD文件的Python密钥
python·ui·ai·photoshop·psdparse
赵锦川2 天前
nuiapp vue3 uni-ui uni.uploadFile 图片上传
javascript·vue.js·ui
dangoxiba2 天前
[Unity Demo]从零开始制作空洞骑士Hollow Knight第十八集:制作UI系统的主菜单界面和选择存档界面
ui