问题标签 [qdate]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
3 回答
509 浏览

c++ - 从 Qtablewidget 读取 QDate 并将其存储在 QDate

我对 qdate 和 qtablewidget 有疑问。

当我通过连接更新 qtablewdiget 上的项目时,我调用了一个函数“updateProdotto”。我在读取插入的新 qdate 并将其存储在新的 qdate 变量中时遇到问题。

我已经在网上搜索过,但没有结果,因为没有人使用 qdate 类型执行我需要的操作。

我怎样才能做到这一点?

0 投票
2 回答
369 浏览

qt - 如何将存储在 QString 中的 QDateEdit 再次填充到 QDateEdit 中

我有 2 个 QDateEdit,它们是 Date_dob 和 Date_doj。我使用如下所示的 Qstring 存储值。

现在我想将相同的内容填充到 ui->Date_dob 和 ui->Date_doj 中(在发生一些编辑事件之后)。我用过 ,

但数据不会填充。

任何形式的建议将不胜感激。提前致谢

0 投票
1 回答
663 浏览

python-2.7 - Python QDateEdit 增量

我在 Python 的 GUI 中使用 QDateEdit 控件。我想只使用键盘来控制它,所以当我按下向上箭头键时,它会从 2000 年 1 月 31 日变为 2000 年 2 月 1 日。

目前,它只是独立地改变年、月和日,但我想像一个块一样改变它,增加日历天数。

在 gif 中,您可以看到控件的行为,我独立更改了日、月和年,但我无法将其更改为“整个日期”。

提前致谢。

在此处输入图像描述

0 投票
1 回答
804 浏览

qt - Qml Locale 对于 ShortFormat 和 NarrowFormat 具有相同的格式

我正在尝试使用在 Qml 中的 Date 类型上实现的 toLocaleDateString / toLocateTimeString 方法显示日期(和时间)(此处的文档)。它可以工作,除了与 NarrowFormat 相同的 ShortFormat。

这是一个例子:

显示的内容:

我期待 ShotFormat 给我的日期是 2017 年 9 月 27 日或类似的日期,时间是上午 11:46:42。

我在文档(here)中找到了关于 NarrowFormat 的内容,即

此外,对于系统语言环境,此格式与 ShortFormat 相同。

我不确定这是否与我的问题有关,因为我在 toLocaleDateMethod 中明确给出了语言环境。即使那样,NarrowFormat 应该更详细,而不是 ShortFormat 更短......

谢谢你的帮助 !

0 投票
1 回答
1648 浏览

c++ - 如何显示与系统不同区域设置的 QDate-month?

该功能QDate::toString(const QString &format)允许显示月份名称MMM(例如“Jan”到“Dec”)或MMMM(例如“January”到“December”)。

但是这个函数使用来自QLocale::system()源代码)的系统语言环境。

QDate对于特定的 QLocale ,显示带有月份名称的最简单方法是什么?

0 投票
1 回答
430 浏览

c++ - Forward declaration of QDate class gives errors

I'm developing an application using Qt Widgets.

In my header files, I like to forward declare classes instead of including them. At the beginning of a header file I put forward declarations as follows:

And, there is a function declaration in the class as the following:

When I try to compile, it gives an error like the following:

There is no error for forward declarations of other Qt-related classes.

Including the QDate header file solves the issue but I wonder:

  1. Why does the compiler complain only about QDate class while it doesn't complain about other classes? Is there anything special with QDate class related to this issue?
  2. How can I forward declare QDate class?
0 投票
1 回答
1083 浏览

c++ - 错误:“operator+”不匹配(操作数类型为“const QString”和“QDate”)

我在声明 QDate 时确实遇到了问题,当我在 DB 插入函数中使用声明的单词(值)和该相关值时,它会继续提示错误。请指导和纠正我。我已经尽了自己的一份力量,但仍然存在问题;那时我不知道:(

我的代码:

错误:

截屏:

错误代码的屏幕截图 - 在此处查看

0 投票
2 回答
205 浏览

qt - 如何从给定的 QDate 获得第一个星期五?

考虑一个Qdate

例如,假设我们选择2018/07/14(今天)。

如何获取所选月份(在本例中为 7 月)的第一个星期五(本例中为 6)的日期?

我怀疑我们必须使用Mydate.dayOfWeek()计算。

0 投票
1 回答
347 浏览

python - QDateEdit - calendarPopup 的绘制单元格

我使用 Qt Designer 创建自定义表单和用户界面组件,并使用 Qt 的集成构建工具 uic,在构建应用程序时为它们生成代码。生成的代码包含表单的用户界面对象。

我有带有 QDateEdit 的 QDockWidget,我想绘制某个日期的单元格:

在此处输入图像描述

我想做这样的事情:

在这种情况下如何使用paintCell

虚函数:

def paintCell(画家,矩形,日期)

0 投票
1 回答
723 浏览

python - Full name month format in QCalendar sample

I need a calendar widget for the app I am writing in PyQt5 and I found this sample source code:

and In the result should be like as this pic as the developer says:

the month format is full name

but When i run this code in my system i get everything write except month format, how can I have full name month format like May,June,... and not M01,M02,... this is result i get when i run the code in my system:

enter image description here