forked from mail-ru-im/im-desktop
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTestingTools.cpp
More file actions
45 lines (39 loc) · 890 Bytes
/
Copy pathTestingTools.cpp
File metadata and controls
45 lines (39 loc) · 890 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#include "stdafx.h"
#ifdef IM_AUTO_TESTING
#include "app_config.h"
#endif
namespace Testing
{
void setAccessibleName(QWidget* target, const QString& name)
{
if constexpr (isEnabled())
{
//assert(!!target);
if (target)
{
target->setAccessibleName(name);
target->setAccessibleDescription(name);
}
}
}
bool isAccessibleRole(const int _role)
{
return isEnabled() && (_role == Qt::AccessibleDescriptionRole || _role == Qt::AccessibleTextRole);
}
bool isAutoTestsMode()
{
#ifdef IM_AUTO_TESTING
return Ui::GetAppConfig().IsTestingEnable();
#else
return false;
#endif
}
QSize getComboboxItemSize()
{
#ifdef IM_AUTO_TESTING
return Utils::scale_value(QSize(140, 50));
#else
return QSize();
#endif
}
}