当前位置: 首页>>代码示例>>C++>>正文


C++ QStandardItemModel::dropMimeData方法代码示例

本文整理汇总了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();
    }
}
开发者ID:capeisti,项目名称:uistelupaivakirja-desktop,代码行数:11,代码来源:lureitem.cpp

示例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();
        }
    }
}
开发者ID:capeisti,项目名称:uistelupaivakirja-desktop,代码行数:12,代码来源:lureitem.cpp

示例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);
      }
   }
}
开发者ID:Heathcode,项目名称:nesicide,代码行数:52,代码来源:breakpointdockwidget.cpp

示例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();

}
开发者ID:shootingsoul,项目名称:terbit-connector,代码行数:15,代码来源:DataSetValuesView.cpp


注:本文中的QStandardItemModel::dropMimeData方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。