本文整理汇总了C++中QStandardItemModel::dropMimeData方法的典型用法代码示例。如果您正苦于以下问题:C++ QStandardItemModel::dropMimeData方法的具体用法?C++ QStandardItemModel::dropMimeData怎么用?C++ QStandardItemModel::dropMimeData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QStandardItemModel
的用法示例。
在下文中一共展示了QStandardItemModel::dropMimeData方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: dropEvent
void LureItem::dropEvent ( QDropEvent * event )
{
if(event->mimeData()->hasFormat("application/x-qabstractitemmodeldatalist"))
{
QStandardItemModel model;
model.dropMimeData(event->mimeData(), Qt::CopyAction, 0,0, QModelIndex());
int lureindex = model.item(0,0)->data().toInt();
Singletons::tripController()->intEvent(eSelectLure, lureindex);
event->acceptProposedAction();
}
}
示例2: dragEnterEvent
void LureItem::dragEnterEvent ( QDragEnterEvent * event )
{
if(event->mimeData()->hasFormat("application/x-qabstractitemmodeldatalist"))
{
QStandardItemModel model;
model.dropMimeData(event->mimeData(), Qt::CopyAction, 0,0, QModelIndex());
if(!model.item(0,0)->data().isNull())
{
event->acceptProposedAction();
}
}
}
示例3: dropEvent
void BreakpointDockWidget::dropEvent(QDropEvent *event)
{
QString text;
int addr;
int bpIdx;
if ( event->mimeData()->hasFormat("application/x-qabstractitemmodeldatalist") )
{
QStandardItemModel model;
model.dropMimeData(event->mimeData(), Qt::CopyAction, 0,0, QModelIndex());
text = model.item(0,0)->data(Qt::DisplayRole).toString();
event->acceptProposedAction();
}
else if ( event->mimeData()->hasText() )
{
text = event->mimeData()->text();
event->acceptProposedAction();
}
if ( event->isAccepted() )
{
addr = CCC65Interface::getSymbolAddress(text);
if ( addr != 0xFFFFFFFF )
{
bpIdx = m_pBreakpoints->AddBreakpoint ( eBreakOnCPUMemoryAccess,
eBreakpointItemAddress,
0,
addr,
addr,
addr,
0xFFFF,
false,
eBreakpointConditionTest,
eBreakIfAnything,
eBreakpointDataPure,
0,
true );
if ( bpIdx < 0 )
{
QString str;
str.sprintf("Cannot add breakpoint, maximum of %d already used.", NUM_BREAKPOINTS);
QMessageBox::information(0, "Error", str);
}
emit breakpointsChanged();
emit markProjectDirty(true);
}
}
}
示例4: dropEvent
void DataSetValuesView::dropEvent(QDropEvent *event)
{
QStandardItemModel model;
model.dropMimeData(event->mimeData(), Qt::CopyAction, 0,0, QModelIndex());
int numRows = model.rowCount();
for (int row = 0; row < numRows; ++row)
{
QModelIndex index = model.index(row, 0);
DataClassAutoId_t id = model.data(index, Qt::UserRole).toUInt();
m_bufferValues->ApplyInput(id);
}
event->acceptProposedAction();
}