如何设计一个线性图形用户界面程序 [英] How to design a linear GUI program

查看:29
本文介绍了如何设计一个线性图形用户界面程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在制作一个简单的 Qt 应用程序.它有 4 个屏幕/页面:

I'm making a simple Qt application. It has 4 screens/pages:

  1. 开始导入
  2. 选择要导入图像的文件夹
  3. 接受或拒绝文件夹中的每个图像,以及当没有图像时:
  4. 没有剩余图像"和确定"按钮.

我想不出实现这一点的最佳方法.我从 QWidget 开始,但很快就变得难以管理.

I can't figure out the best way to implement this. I started off with a QWidget, but this quickly got unmanageable.

QWizard 是否过于受限?

Is a QWizard too constrained?

QWizard 的部分问题是它似乎总是有返回"和下一步"按钮.我不希望在这个程序中使用这些选项,所以这让我相信巫师并不是我所追求的.

Part of the problem with QWizard is it seems to always have "Back" and "Next" buttons. I don't want those as options in this program, so this leads me to believe that a wizard isn't exactly what I'm after.

推荐答案

我有点不同意在这里使用 QWizard.这样做相当容易,但在这种情况下,我认为仅使用 QStackedWidget 并根据您希望用户能够执行的操作交换显示的小部件可能会更容易.无论如何,这很可能是在 QWizard 内部完成的,没有运行按钮和来回移动的一些复杂性.您可能还想看看他们即将添加的状态机内容,因为您的应用程序很容易被拆分为多个状态.

I'm going to disagree slightly on using a QWizard here. It would be fairly easy to do, but in this case I think it might be easier to just use a QStackedWidget and swap the widget shown based on what you want the user to be able to do. This is likely what is done inside QWizard anyway, without some of the complication for running the buttons and moving back and forth. You also might want to take a look at the state machine stuff they're looking at adding soon, since you're application could so easily be split into states.

这篇关于如何设计一个线性图形用户界面程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆