##// END OF EJS Templates
Implements test execute() method...
Implements test execute() method For each iteration of the test, this method generates available operations according to states of the variables, and execute an operation that has been chosen randomly.

File last commit:

r1110:029fbf916457
r1205:0c07405da56c
Show More
DataSourceTreeWidget.cpp
47 lines | 1.5 KiB | text/x-c | CppLexer
/ gui / src / DataSource / DataSourceTreeWidget.cpp
Drag of product
r876 #include "DataSource/DataSourceTreeWidget.h"
#include "Common/MimeTypesDef.h"
#include "DataSource/DataSourceController.h"
#include "DataSource/DataSourceItem.h"
#include "DataSource/DataSourceTreeWidgetItem.h"
Rename "DragDropHelper" in "DragDropGuiController"
r1110 #include "DragAndDrop/DragDropGuiController.h"
Drag of product
r876 #include "SqpApplication.h"
#include <QMimeData>
Fix format for linux
r913 DataSourceTreeWidget::DataSourceTreeWidget(QWidget *parent) : QTreeWidget(parent)
{
}
Drag of product
r876
QMimeData *DataSourceTreeWidget::mimeData(const QList<QTreeWidgetItem *> items) const
{
auto mimeData = new QMimeData;
// Basic check to ensure the item are correctly typed
Q_ASSERT(items.isEmpty() || dynamic_cast<DataSourceTreeWidgetItem *>(items.first()) != nullptr);
QVariantList productData;
for (auto item : items) {
auto dataSourceTreeItem = static_cast<DataSourceTreeWidgetItem *>(item);
auto dataSource = dataSourceTreeItem->data();
if (dataSource->type() == DataSourceItemType::COMPONENT
|| dataSource->type() == DataSourceItemType::PRODUCT) {
auto metaData = dataSource->data();
productData << metaData;
}
}
auto encodedData = sqpApp->dataSourceController().mimeDataForProductsData(productData);
mimeData->setData(MIME_TYPE_PRODUCT_LIST, encodedData);
return mimeData;
}
Reset of the drag&drop operations when a drag is started from the datasource or from the variables
r883
void DataSourceTreeWidget::startDrag(Qt::DropActions supportedActions)
{
// Resets the drag&drop operations before it's starting
Rename "DragDropHelper" in "DragDropGuiController"
r1110 sqpApp->dragDropGuiController().resetDragAndDrop();
Reset of the drag&drop operations when a drag is started from the datasource or from the variables
r883 QTreeWidget::startDrag(supportedActions);
}