本文整理汇总了C++中setDragDropMode函数的典型用法代码示例。如果您正苦于以下问题:C++ setDragDropMode函数的具体用法?C++ setDragDropMode怎么用?C++ setDragDropMode使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setDragDropMode函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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()));
}
示例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* ) ) );
}
示例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);
}
示例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.)
}
示例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
}
示例6: QTableWidget
MovableTableWidget::MovableTableWidget(QWidget *parent) :
QTableWidget(parent), m_lineRow(-1)
{
setSelectionBehavior(QAbstractItemView::SelectRows);
setDragDropMode(QAbstractItemView::InternalMove);
setDragDropOverwriteMode(false);
}
示例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
}
示例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)));
}
示例9: QTreeView
CCollectionView::CCollectionView(QWidget * parent) : QTreeView(parent){
setAcceptDrops(true);
viewport()->setAcceptDrops(true);
setDragDropMode(QAbstractItemView::DragDrop);
setDropIndicatorShown(true);
setSelectionMode(QAbstractItemView::ExtendedSelection);
}
示例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();
}
示例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)) );
}
示例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);
}
示例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()));
}
示例14: QTableView
TableView::TableView(QWidget* parent)
: QTableView(parent)
{
setAcceptDrops(true);
setDragDropMode(QAbstractItemView::DropOnly);
setDropIndicatorShown(true);
}
示例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 );
}