• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ setDragDropMode函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中setDragDropMode函数的典型用法代码示例。如果您正苦于以下问题:C++ setDragDropMode函数的具体用法?C++ setDragDropMode怎么用?C++ setDragDropMode使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了setDragDropMode函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: QTreeWidget

//----------------------------------------------------------------------------------------
OfsTreeWidget::OfsTreeWidget(QWidget *parent, unsigned int capabilities, QStringList initialSelection) : QTreeWidget(parent), mCapabilities(capabilities) 
{
    mSelectedItems = initialSelection;
    mRecycleBinParent = NULL;

    setColumnCount(1);
    setHeaderHidden(true);
    setSelectionMode(QAbstractItemView::ExtendedSelection);
    setSelectionBehavior(QAbstractItemView::SelectItems);
    setContextMenuPolicy(Qt::CustomContextMenu);
    setDragDropOverwriteMode(false);
    setAutoScroll(true);
    
    if(capabilities & CAP_ALLOW_DROPS)
        setDragDropMode(QAbstractItemView::DragDrop);

    mUnknownFileIcon = mOgitorMainWindow->mIconProvider.icon(QFileIconProvider::File);

    mFile = Ogitors::OgitorsRoot::getSingletonPtr()->GetProjectFile();
    mFile->addTrigger(this, OFS::_OfsBase::CLBK_CREATE, &triggerCallback);
    mFile->addTrigger(this, OFS::_OfsBase::CLBK_DELETE, &triggerCallback);

    refreshWidget();

    mAddFilesThread = new AddFilesThread();
    mExtractorThread = new ExtractorThread();
    connect(mAddFilesThread, SIGNAL(finished()), this, SLOT(threadFinished()));
    connect(mExtractorThread, SIGNAL(finished()), this, SLOT(threadFinished()));
}
开发者ID:jacmoe,项目名称:ogitor,代码行数:30,代码来源:ofstreewidget.cpp


示例2: QTreeWidget

ViewListTreeWidget::ViewListTreeWidget( QWidget *parent )
    : QTreeWidget( parent )
{
    setWhatsThis( i18nc( "@info:whatsthis",
        "<para>This is the list of available views and editors.</para>"
        "<para>You can configure the list by using the context menu:"
        "<list>"
        "<item>Rename categories or views</item>"
        "<item>Configure. Move, remove, rename or edit tool tip for categories or views</item>"
        "<item>Insert categories and views</item>"
        "</list></para>"
    ) );

    header() ->hide();
    setRootIsDecorated( false );
    setItemDelegate( new ViewCategoryDelegate( this, this ) );
    setItemsExpandable( true );
    setSelectionMode( QAbstractItemView::SingleSelection );

    setDragDropMode( QAbstractItemView::InternalMove );

    //setContextMenuPolicy( Qt::ActionsContextMenu );

    connect( this, SIGNAL( itemPressed( QTreeWidgetItem*, int ) ), SLOT( handleMousePress( QTreeWidgetItem* ) ) );
}
开发者ID:abhishekmurthy,项目名称:Calligra,代码行数:25,代码来源:kptviewlist.cpp


示例3: m_map

ObjectInspectorTable::ObjectInspectorTable(Map *map)
    : m_map(map), m_graphicsObjectEditor(0)
{

    QStringList tableHeadersLabel;
    tableHeadersLabel << "Nom" << "Type";
    setColumnCount(2);
    setHeaderLabels(tableHeadersLabel);

    setAlternatingRowColors(true);

    setAnimated(true);

    setSelectionMode(QAbstractItemView::ExtendedSelection);

    clear();
    addDefaultLayout();

    connect(this, SIGNAL(itemSelectionChanged()), SLOT(selectionUpdated()));
    connect(this, SIGNAL(itemDoubleClicked(QTreeWidgetItem*,int)), SLOT(itemWasDoubleClicked(QTreeWidgetItem*,int)));

    // connexion pour gérer les layouts
    connect(this, SIGNAL(itemChanged(QTreeWidgetItem*,int)), SLOT(LayoutItemModified(QTreeWidgetItem*,int)));

    setDragDropMode(QAbstractItemView::DragDrop);
}
开发者ID:BastienCramillet,项目名称:SGC,代码行数:26,代码来源:ObjectInspectorTable.cpp


示例4: WTrackTableView

WAnalysisLibraryTableView::WAnalysisLibraryTableView(QWidget* parent,
                                                   ConfigObject<ConfigValue>* pConfig,
                                                   TrackCollection* pTrackCollection)
        : WTrackTableView(parent, pConfig, pTrackCollection) {
    setDragDropMode(QAbstractItemView::DragOnly);
    setDragEnabled(true); //Always enable drag for now (until we have a model that doesn't support this.)
}
开发者ID:Adna1206,项目名称:mixxx,代码行数:7,代码来源:wanalysislibrarytableview.cpp


示例5: currentSelectionAction

FileListView::FileListView()
    :  currentSelectionAction(QItemSelectionModel::NoUpdate), isSearchMode(false)
{
    searchEdit = new SearchLineEdit(this);
    searchEdit->setVisible(isSearchMode);
    searchEdit->setFocusPolicy(Qt::ClickFocus);
    setDragDropMode(QAbstractItemView::DragDrop);
    //setDropIndicatorShown(true);
    //setVerticalScrollMode(QAbstractItemView::ScrollPerPixel);
    //viewport()->setStyleSheet("background-color: white;");

    //setStyleSheet("QTreeView::item { padding: 6px 14px 0px 14px; }");

    // 	QPalette pal = palette();
    // 	pal.setColor(QPalette::AlternateBase, QColor(248, 248, 248));
    // 	setPalette(pal);

    setFrameStyle(QFrame::Plain);
    setHeader(new FileListHeader(Qt::Horizontal, this));


#ifdef DARK
    QPalette pal = palette();
    pal.setColor(QPalette::Base, QColor(33, 38, 38));
    setPalette(pal);
#endif
}
开发者ID:TeamKami,项目名称:KamiCmd,代码行数:27,代码来源:FileListView.cpp


示例6: QTableWidget

MovableTableWidget::MovableTableWidget(QWidget *parent) :
  QTableWidget(parent), m_lineRow(-1)
{
  setSelectionBehavior(QAbstractItemView::SelectRows);
  setDragDropMode(QAbstractItemView::InternalMove);
  setDragDropOverwriteMode(false);
}
开发者ID:gijskant,项目名称:mcrl2-pmc,代码行数:7,代码来源:movabletablewidget.cpp


示例7: QTreeView

FooPlaylistWidget::FooPlaylistWidget(const QString& name, const QUuid& uuid, QWidget *parent) : QTreeView(parent)
{
	playlistName = name;
	playlistUuid = uuid;

	setSelectionMode(QAbstractItemView::ExtendedSelection);
	setSelectionBehavior(QAbstractItemView::SelectRows);
	setSortingEnabled(false);
	setIndentation(0);
	setAlternatingRowColors(true);
	// For drag and drop files, QAbstractItemView::DragDrop doesn't work (why?)
	setAcceptDrops(true);
	setDragDropMode(QAbstractItemView::InternalMove);
	setDragEnabled(true);
	viewport()->setAcceptDrops(true);
	setDropIndicatorShown(true);
	// Context Menu
	setContextMenuPolicy(Qt::CustomContextMenu);
	setItemsExpandable(false);
	setRootIsDecorated(false);

	connect(this, SIGNAL (customContextMenuRequested (const QPoint &)), this, SLOT (contextMenuRequested (const QPoint &)));

// 	QStringList l;
// 	l << tr("File");
// 	setHeaderLabels(l);
//
// 	// TODO Remove and add something normal
// 	Filters << ".mp3"  << ".wma" << ".mp4" << ".mpg" << ".mpeg" << ".m4a";
// 	Filters << ".flac" << ".ogg" << ".wav" << ".3gp" << ".ac3" << ".aac";

	// TODO .m3u .m4u
}
开发者ID:matthewpl,项目名称:fooaudio,代码行数:33,代码来源:fooplaylistwidget.cpp


示例8: QTreeWidget

START_NS

ProposalTreeWidget::ProposalTreeWidget(QWidget * p)
	: QTreeWidget(p),
	mOverlay(new Overlay(this)),
	  mAddRemoveEnabled(false),
	  mSolutionSelectionMultiple(true)
	//mSolutionDelegate(new SolutionCheckDelegate(this) )
{
	setDragEnabled(true);
	setDragDropMode(InternalMove);
	viewport()->setAcceptDrops(true);
	setDropIndicatorShown(true);
	setSelectionMode(SingleSelection);
	setEditTriggers(AllEditTriggers);
	// maintain order accordingly to ColumnId, ColumnProposalText, etc.
	setHeaderLabels( QStringList() << tr("Id") << tr("Text") << tr("Solution") );
	setRootIsDecorated(false);
	setWordWrap(true);
	overlay()->setText( tr("Right click to add new proposal") );


	connect(this, SIGNAL(itemSelectionChanged()),this, SLOT(onSelectionChange()));
	connect(this, SIGNAL(itemChanged(QTreeWidgetItem*,int)), this, SLOT(onItemChange(QTreeWidgetItem*,int)));
	connect(this,SIGNAL(itemClicked(QTreeWidgetItem*,int)), this, SLOT(onClicked(QTreeWidgetItem*,int)));

}
开发者ID:ohager,项目名称:kantalupe,代码行数:27,代码来源:ProposalTreeWidget.cpp


示例9: QTreeView

CCollectionView::CCollectionView(QWidget * parent) : QTreeView(parent){
	setAcceptDrops(true);
	viewport()->setAcceptDrops(true);
	setDragDropMode(QAbstractItemView::DragDrop);
	setDropIndicatorShown(true);
	setSelectionMode(QAbstractItemView::ExtendedSelection);
}
开发者ID:BackupTheBerlios,项目名称:muroa-svn,代码行数:7,代码来源:CCollectionView.cpp


示例10: QTreeWidget

akuTreeWidget::akuTreeWidget(QWidget *parent) : QTreeWidget(parent)
{
  setDragEnabled(false);
  setDragDropOverwriteMode(false);
  setDragDropMode(QAbstractItemView::NoDragDrop);
  setAlternatingRowColors(true);
  setSelectionMode(QAbstractItemView::ExtendedSelection);
  setAutoExpandDelay(-1);
  setRootIsDecorated(true);
  setUniformRowHeights(false);
  setSortingEnabled(true);
  setAnimated(true);
  setAllColumnsShowFocus(true);
  headerItem()->setText(0, i18n("File Name", 0));
  headerItem()->setText(1, i18n("Size", 0));
  headerItem()->setText(2, i18n("Packed Size", 0));
  headerItem()->setText(3, i18n("Ratio", 0));
  headerItem()->setText(4, i18n("Modified", 0));
  headerItem()->setText(5, i18n("Attributes", 0));
  headerItem()->setText(6, i18n("CRC", 0));
  headerItem()->setText(7, i18n("Method", 0));
  headerItem()->setText(8, i18n("Version", 0));
  headerItem()->setText(9, i18n("MIME Type", 0));
  headerItem()->setText(10,"");
  headerItem()->setIcon(10,KIcon("document-properties"));
  headerItem()->setToolTip(10, i18n("Status: a key is shown if the file is crypted"));
  header() -> moveSection(10,0);
  header() -> setResizeMode(10,QHeaderView::ResizeToContents);
  header() -> setResizeMode(4,QHeaderView::ResizeToContents);
  setupActions();
}
开发者ID:alediaferia,项目名称:aku,代码行数:31,代码来源:akutreewidget.cpp


示例11: QTreeView

K3b::DataDirTreeView::DataDirTreeView( K3b::View* view, K3b::DataDoc* doc, QWidget* parent )
    : QTreeView( parent ), m_view(view)
{
    d = new Private();

    setSelectionMode(QAbstractItemView::SingleSelection);

//    setRootIsDecorated( false );
    setDragDropMode( QAbstractItemView::DragDrop );
    setDropIndicatorShown( true );
    setDragEnabled(true);
    setAcceptDrops( true );

    header()->hide();

    m_doc = doc;

    d->model = new K3b::DataProjectModel( doc, this );
    //d->model->setListOnlyDirs( true );
    setModel( d->model );

    for ( int i = K3b::DataProjectModel::TypeColumn; i < K3b::DataProjectModel::NumColumns; ++i ) {
        hideColumn( i );
    }

    connect( d->model, SIGNAL(addUrlsRequested(KUrl::List,K3b::DirItem*)),
                       SLOT(slotAddUrlsRequested(KUrl::List,K3b::DirItem*)) );
    connect( d->model, SIGNAL(moveItemsRequested(QList<K3b::DataItem*>,K3b::DirItem*)),
                       SLOT(slotMoveItemsRequested(QList<K3b::DataItem*>,K3b::DirItem*)) );
    connect( selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)),
                               SLOT(slotSelectionChanged(QItemSelection,QItemSelection)) );
}
开发者ID:franhaufer,项目名称:k3b,代码行数:32,代码来源:k3bdatadirtreeview.cpp


示例12: QTreeWidget

MenuBarTree::MenuBarTree(TFilePath & path, QWidget* parent)
	: QTreeWidget(parent)
	, m_path(path)
{
	setObjectName("SolidLineFrame");
	setAlternatingRowColors(true);
	setDragEnabled(true);
	setDropIndicatorShown(true);
	setDefaultDropAction(Qt::MoveAction);
	setDragDropMode(QAbstractItemView::DragDrop);

	setColumnCount(1);
	header()->close();

	/*- m_pathが存在するならファイルから読み込む。無ければテンプレートを読み込む -*/
	TFilePath fp;
	if (TFileStatus(path).isWritable())
		fp = m_path;
	else
	{
		fp = m_path.withParentDir(ToonzFolder::getTemplateModuleDir());
		if (!TFileStatus(path).isReadable())
			fp = ToonzFolder::getTemplateModuleDir() + "menubar_template.xml";
	}

	loadMenuTree(fp);
}
开发者ID:CroW-CZ,项目名称:opentoonz,代码行数:27,代码来源:menubarpopup.cpp


示例13: QListView

ComposerAttachmentsList::ComposerAttachmentsList(QWidget *parent):
    QListView(parent), m_dragging(false), m_dragInside(false), m_composer(0)
{
    setMouseTracking( true );
    setAcceptDrops(true);
    setDragDropMode( DragDrop );
    setDragDropOverwriteMode( false );
    setDragEnabled(true);
    setDropIndicatorShown(false);
    setContextMenuPolicy(Qt::CustomContextMenu);
    connect(this, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(showContextMenu(QPoint)));

    m_actionSendInline = new QAction(tr("Send Inline"), this);
    m_actionSendInline->setCheckable(true);
    connect(m_actionSendInline, SIGNAL(triggered(bool)), this, SLOT(slotToggledContentDispositionInline(bool)));
    addAction(m_actionSendInline);

    m_actionRename = new QAction(tr("Rename..."), this);
    connect(m_actionRename, SIGNAL(triggered()), this, SLOT(slotRenameAttachment()));
    addAction(m_actionRename);

    m_actionRemoveAttachment = new QAction(tr("Remove"), this);
    connect(m_actionRemoveAttachment, SIGNAL(triggered()), this, SLOT(slotRemoveAttachment()));
    addAction(m_actionRemoveAttachment);

    connect(this, SIGNAL(itemDroppedOut()), this, SLOT(slotRemoveAttachment()));
    connect(this, SIGNAL(clicked(QModelIndex)), this, SLOT(onCurrentChanged()));
    connect(this, SIGNAL(activated(QModelIndex)), this, SLOT(onCurrentChanged()));
}
开发者ID:G-shadow,项目名称:trojita,代码行数:29,代码来源:ComposerAttachmentsList.cpp


示例14: QTableView

TableView::TableView(QWidget* parent) 
	: QTableView(parent)
{
    setAcceptDrops(true);
    setDragDropMode(QAbstractItemView::DropOnly);
    setDropIndicatorShown(true);
}
开发者ID:BackupTheBerlios,项目名称:annual,代码行数:7,代码来源:tableview.cpp


示例15: QTreeView

ProgressTreeView::ProgressTreeView( QWidget* parent )
    : QTreeView( parent )
{
    s_instance = this; //FIXME: should assert when s_instance gets written and it wasn't nullptr

    setFrameShape( QFrame::NoFrame );
    setContentsMargins( 0, 0, 0, 0 );

    setHeaderHidden( true );
    setRootIsDecorated( true );
    setExpandsOnDoubleClick( true );

    setSelectionMode( QAbstractItemView::NoSelection );
    setDragDropMode( QAbstractItemView::NoDragDrop );
    setAcceptDrops( false );
    setUniformRowHeights( false );

    setIndentation( 0 );
    setSortingEnabled( false );

    m_delegate = new ProgressTreeDelegate( this );
    setItemDelegate( m_delegate );

    QPalette plt = palette();
    plt.setColor( QPalette::Base, Calamares::Branding::instance()->
        styleString( Calamares::Branding::SidebarBackground ) );
    setPalette( plt );
}
开发者ID:AOSC-Dev,项目名称:calamares,代码行数:28,代码来源:ProgressTreeView.cpp


示例16: viewport

void ThumbnailsView::setDragDrop()
{
    viewport()->setAcceptDrops(true);;
    setDragEnabled(true);
    setDropIndicatorShown(true);
    setDragDropMode(QAbstractItemView::DragDrop);
}
开发者ID:vwarship,项目名称:MyHouse,代码行数:7,代码来源:ThumbnailsView.cpp


示例17: QTreeWidget

FeedListWidget::FeedListWidget(QWidget *parent)
    : QTreeWidget(parent)
{
    setContextMenuPolicy(Qt::CustomContextMenu);
    setDragDropMode(QAbstractItemView::InternalMove);
    setSelectionMode(QAbstractItemView::ExtendedSelection);
    setColumnCount(1);
    headerItem()->setText(0, tr("RSS feeds"));

    connect(RSS::Session::instance(), &RSS::Session::itemAdded, this, &FeedListWidget::handleItemAdded);
    connect(RSS::Session::instance(), &RSS::Session::feedStateChanged, this, &FeedListWidget::handleFeedStateChanged);
    connect(RSS::Session::instance(), &RSS::Session::feedIconLoaded, this, &FeedListWidget::handleFeedIconLoaded);
    connect(RSS::Session::instance(), &RSS::Session::itemPathChanged, this, &FeedListWidget::handleItemPathChanged);
    connect(RSS::Session::instance(), &RSS::Session::itemAboutToBeRemoved, this, &FeedListWidget::handleItemAboutToBeRemoved);

    m_rssToTreeItemMapping[RSS::Session::instance()->rootFolder()] = invisibleRootItem();

    m_unreadStickyItem = new QTreeWidgetItem(this);
    m_unreadStickyItem->setData(0, Qt::UserRole, reinterpret_cast<quintptr>(RSS::Session::instance()->rootFolder()));
    m_unreadStickyItem->setText(0, tr("Unread  (%1)").arg(RSS::Session::instance()->rootFolder()->unreadCount()));
    m_unreadStickyItem->setData(0, Qt::DecorationRole, GuiIconProvider::instance()->getIcon("mail-folder-inbox"));

    connect(RSS::Session::instance()->rootFolder(), &RSS::Item::unreadCountChanged, this, &FeedListWidget::handleItemUnreadCountChanged);

    setSortingEnabled(false);
    fill(nullptr, RSS::Session::instance()->rootFolder());
    setSortingEnabled(true);

//    setCurrentItem(m_unreadStickyItem);
}
开发者ID:paolo-sz,项目名称:qBittorrent,代码行数:30,代码来源:feedlistwidget.cpp


示例18: setSelectionMode

void Pageview::allowMove (bool allow)
   {
   setSelectionMode (ExtendedSelection);
   setDropIndicatorShown (false);
   setDragDropMode (allow ? InternalMove : NoDragDrop);
   setDragEnabled (allow);
   }
开发者ID:arunjalota,项目名称:paperman,代码行数:7,代码来源:pageview.cpp


示例19: setDragDropMode

 ConnectionsTreeWidget::ConnectionsTreeWidget()
 {
     setDragDropMode(QAbstractItemView::InternalMove);
     setSelectionMode(QAbstractItemView::SingleSelection);
     setDragEnabled(true);
     setAcceptDrops(true);
 }
开发者ID:2812140729,项目名称:robomongo,代码行数:7,代码来源:ConnectionsDialog.cpp


示例20: QTreeView

DeviceExplorerView::DeviceExplorerView(QWidget* parent)
    : QTreeView(parent), m_hasProxy(false)
{
  setAllColumnsShowFocus(true);

  setSelectionBehavior(QAbstractItemView::SelectRows);
  setSelectionMode(QAbstractItemView::ExtendedSelection);


  header()->setContextMenuPolicy(Qt::CustomContextMenu);
  connect(
      header(),
      &QWidget::customContextMenuRequested,
      this,
      &DeviceExplorerView::headerMenuRequested);

  header()->setMaximumHeight(20);
  //- Drag'n Drop.

  setDragEnabled(true);
  setAcceptDrops(true);
  setUniformRowHeights(true);

  setDragDropMode(QAbstractItemView::DragDrop);
  setDropIndicatorShown(true);

  setDefaultDropAction(Qt::MoveAction);

  setDragDropOverwriteMode(false);

  QFile f(":/DeviceExplorer.qss");
  if (f.open(QFile::ReadOnly))
    setStyleSheet(f.readAll());
}
开发者ID:OSSIA,项目名称:Score,代码行数:34,代码来源:DeviceExplorerView.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ setDragEnabled函数代码示例发布时间:2022-05-30
下一篇:
C++ setDown函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap