Namespace for all functionality provided since v1.0.
More...
|
| template<typename T> |
| T * | find_qobject (const QString &strObjectName) |
| |
| QString | dump_tree (const QTreeWidgetItem *pNode, size_t nColumnCount, QString strPrefix="") |
| |
| tResult | compare_dump (const QString &strChecked, const QString &strExpected) |
| |
| tResult | wait_for_next_ui_timer (std::chrono::nanoseconds tmTimeout=std::chrono::nanoseconds{-1}) |
| |
| void | schedule_in_gui_thread (std::function< void()> fnFunction) |
| |
| tResult | execute_in_gui_thread (std::function< tResult()> fnFunction, std::chrono::milliseconds tmTimeout=std::chrono::milliseconds{0}) |
| |
| tResult | wait_for_next_idle (std::chrono::nanoseconds tmTimeout=std::chrono::nanoseconds{-1}) |
| |
| QAction * | find_action (QMenu *pMenu, const QString &strName, bool bThrow=true) |
| |
| void | trigger_action (QAction *pAction, Qt::ConnectionType eConnectionType=Qt::BlockingQueuedConnection) |
| |
| QString | dump_tree (const QAbstractItemModel *pTree, size_t nColumnCount, const QModelIndex oNode=QModelIndex(), QString strPrefix="") |
| |
Namespace for all functionality provided since v1.0.
◆ compare_dump()
| tResult adtf::ui::testing::hollow::compare_dump |
( |
const QString & | strChecked, |
|
|
const QString & | strExpected ) |
Compare to large strings.
- Parameters
-
| [in] | strChecked | The data. |
| [in] | strExpected | The expected data. |
- Returns
- Standard result.
◆ dump_tree() [1/2]
| QString adtf::ui::testing::nitro::dump_tree |
( |
const QAbstractItemModel * | pTree, |
|
|
size_t | nColumnCount, |
|
|
const QModelIndex | oNode = QModelIndex(), |
|
|
QString | strPrefix = "" ) |
Dumps the content of a QAbstractItemModel
- Parameters
-
| [in] | pTree | The tree widget of which the content should be dumped. |
| [in] | nColumnCount | The amout of columns to dump, >= 2 |
| [in] | oNode | The index from which to dump all data and children from |
| [in] | strPrefix | A prefix to all elements. |
- Returns
- A string containing all tree data.
◆ dump_tree() [2/2]
| QString adtf::ui::testing::hollow::dump_tree |
( |
const QTreeWidgetItem * | pNode, |
|
|
size_t | nColumnCount, |
|
|
QString | strPrefix = "" ) |
Dumps the content of a QTreeWidgetItem
- Parameters
-
| [in] | pNode | The node to dump all data and children from |
| [in] | nColumnCount | The amout of columns to dump, >= 2 |
| [in] | strPrefix | A prefix to all elements. |
- Returns
- A string containing all tree data.
◆ execute_in_gui_thread()
| tResult adtf::ui::testing::lucky::execute_in_gui_thread |
( |
std::function< tResult()> | fnFunction, |
|
|
std::chrono::milliseconds | tmTimeout = std::chrono::milliseconds{0} ) |
Execute the given function from within the GUI thread and wait until it has finished.
- Parameters
-
| [in] | fnFunction | The function that should be executed. |
| [in] | tmTimeout | A timeout, 0 => no timeout. |
- Return values
-
| ERR_TIMEOUT | The function has not been executed within the specified timeout. |
| tResult | The return value of the function. |
◆ find_action()
| QAction * adtf::ui::testing::mega::find_action |
( |
QMenu * | pMenu, |
|
|
const QString & | strName, |
|
|
bool | bThrow = true ) |
Finds an action within a menu
- Parameters
-
| [in] | pMenu | The menu to search in. |
| [in] | strName | The name of the action (without '&') |
| [in] | bThrow | Whether or not to throw an exception if the action was not found. |
- Returns
- The pointer to the action or nullptr if it was not found and bThrow is false.
◆ find_qobject()
template<typename T>
| T * adtf::ui::testing::hollow::find_qobject |
( |
const QString & | strObjectName | ) |
|
Utility that finds a widget/object by its object name.
Note that any QObject can have an object name. So to expose widgets to your tests give them an expressive unique name.
- Parameters
-
| [in] | strObjectName | The object name of the object/widget you're looking for. |
- Template Parameters
-
| T | The type of the widget you're looking for. |
◆ schedule_in_gui_thread()
| void adtf::ui::testing::lucky::schedule_in_gui_thread |
( |
std::function< void()> | fnFunction | ) |
|
Schedules the given function to be executed from within the GUI thread some time in the future.
- Parameters
-
| [in] | fnFunction | The function that should be executed. |
◆ trigger_action()
| void adtf::ui::testing::mega::trigger_action |
( |
QAction * | pAction, |
|
|
Qt::ConnectionType | eConnectionType = Qt::BlockingQueuedConnection ) |
Trigger an action within the Qt GUI thread.
- Parameters
-
| [in] | pAction | The action to trigger. |
| [in] | eConnectionType | The type of call. |
◆ wait_for_next_idle()
| tResult adtf::ui::testing::mega::wait_for_next_idle |
( |
std::chrono::nanoseconds | tmTimeout = std::chrono::nanoseconds{-1} | ) |
|
Wait until at least one more OnIdle() calls have been issued by the X system.
- Parameters
-
| [in] | tmTimeout | An optional timeout, -1 => no timeout. |
- Return values
-
| ERR_TIMEOUT | If no OnTimer call has been issued during the timeout period. |
◆ wait_for_next_ui_timer()
| tResult adtf::ui::testing::hollow::wait_for_next_ui_timer |
( |
std::chrono::nanoseconds | tmTimeout = std::chrono::nanoseconds{-1} | ) |
|
Wait until at least one more OnTimer() call have been issued by the X system.
- Parameters
-
| [in] | tmTimeout | An optional timeout, -1 => no timeout. |
- Return values
-
| ERR_TIMEOUT | If no OnTimer call has been issued during the timeout period. |