mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2026-06-04 06:54:47 -04:00
Improvements to accessibiity
Where tool tips are defined in rich text, equivalent pain test accessible descriptions have been added so that screen readers do not announce HTML tags. Refactored date time delegates to use a simpler default editor via a default item editor factory for QDateTime values, the editor is a standard QDateTimeEdit with a format that includes seconds and renders assuming the time is UTC. Modified the Cabrillo log and Fox log database table models to provide QDateTime items for the edit role of date time fields, and formated date time strings including seconds and assumed as UTC for the display role.
This commit is contained in:
@@ -21,6 +21,23 @@ class FoxLog::impl final
|
||||
public:
|
||||
impl (Configuration const * configuration);
|
||||
|
||||
QVariant data (QModelIndex const& index, int role) const
|
||||
{
|
||||
auto value = QSqlTableModel::data (index, role);
|
||||
if (index.column () == fieldIndex ("when")
|
||||
&& (Qt::DisplayRole == role || Qt::EditRole == role))
|
||||
{
|
||||
auto t = QDateTime::fromMSecsSinceEpoch (value.toULongLong () * 1000ull, Qt::UTC);
|
||||
if (Qt::DisplayRole == role)
|
||||
{
|
||||
QLocale locale;
|
||||
return locale.toString (t, locale.dateFormat (QLocale::ShortFormat) + " hh:mm:ss");
|
||||
}
|
||||
value = t;
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
Configuration const * configuration_;
|
||||
QSqlQuery mutable dupe_query_;
|
||||
QSqlQuery mutable export_query_;
|
||||
|
||||
Reference in New Issue
Block a user