本文整理汇总了C++中QListView::setDropIndicatorShown方法的典型用法代码示例。如果您正苦于以下问题:C++ QListView::setDropIndicatorShown方法的具体用法?C++ QListView::setDropIndicatorShown怎么用?C++ QListView::setDropIndicatorShown使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QListView
的用法示例。
在下文中一共展示了QListView::setDropIndicatorShown方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: QMenu
MainWindow::MainWindow()
{
QMenu *fileMenu = new QMenu(tr("&File"));
QAction *quitAction = fileMenu->addAction(tr("E&xit"));
quitAction->setShortcut(tr("Ctrl+Q"));
menuBar()->addMenu(fileMenu);
// For convenient quoting:
//! [0]
QListView *listView = new QListView(this);
listView->setSelectionMode(QAbstractItemView::ExtendedSelection);
listView->setDragEnabled(true);
listView->setAcceptDrops(true);
listView->setDropIndicatorShown(true);
//! [0]
this->listView = listView;
connect(quitAction, SIGNAL(triggered()), this, SLOT(close()));
setupListItems();
setCentralWidget(listView);
setWindowTitle(tr("List View"));
}
示例2: QWidget
//.........这里部分代码省略.........
m_highlighter = new SongEditorHighlighter(m_editor->document());
// Arrangement preview box
m_arrangementPreview = new MyQTextEdit;
m_arrangementPreview->setFont(font);
m_arrangementPreview->setReadOnly(true);
QPalette p2 = m_arrangementPreview->palette();
p2.setColor(QPalette::Base, Qt::lightGray);
m_arrangementPreview->setPalette(p2);
editorHBox->addWidget(m_arrangementPreview);
//m_editor->setAcceptRichText(false);
(void*)new SongEditorHighlighter(m_arrangementPreview->document());
// List view
m_arrModel = new ArrangementListModel();
connect(m_arrModel, SIGNAL(blockListChanged(QStringList)), this, SLOT(arrModelChange(QStringList)));
QListView *arrListView = new QListView();
arrListView->setSizePolicy(QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Expanding));
arrListView->setViewMode(QListView::ListMode);
arrListView->setWrapping(false);
arrListView->setFlow(QListView::TopToBottom);
arrListView->setMovement(QListView::Free);
arrListView->setWordWrap(true);
arrListView->setSelectionMode(QAbstractItemView::ExtendedSelection);
arrListView->setDragEnabled(true);
arrListView->setAcceptDrops(true);
arrListView->setDropIndicatorShown(true);
arrListView->setModel(m_arrModel);
m_arrListView = arrListView;
editorHBox->addWidget(arrListView);
editorHBox->setStretchFactor(0,10);
editorHBox->setStretchFactor(1,10);
editorHBox->setStretchFactor(2,1);
//vbox->addWidget(m_editor);
//vbox->addLayout(editorHBox);
vbox->addWidget(editorHBox);
QHBoxLayout * hboxBottom = new QHBoxLayout();
m_tmplEditButton = new QPushButton("Edit &Template...");
m_tmplEditButton->setIcon(QIcon(":data/stock-select-color.png"));
m_tmplEditButton->setToolTip("Edit the template associated with this song arrangement");
connect(m_tmplEditButton, SIGNAL(clicked()), this, SLOT(editSongTemplate()));
hboxBottom->addWidget(m_tmplEditButton);
QPushButton *tmplResetButton = new QPushButton("");
tmplResetButton->setIcon(QIcon(":data/stock-undo.png"));
tmplResetButton->setToolTip("Reset template on this song to use the current template set in the main Song Browser");
connect(tmplResetButton, SIGNAL(clicked()), this, SLOT(resetSongTemplate()));
hboxBottom->addWidget(tmplResetButton);
hboxBottom->addStretch();
m_syncBox = new QCheckBox("S&ync Changes to DB");
m_syncBox->setToolTip("If checked, saving changes will update the master song database as well as the copy of the song in this document");