本文整理汇总了C++中QListView::setMovement方法的典型用法代码示例。如果您正苦于以下问题:C++ QListView::setMovement方法的具体用法?C++ QListView::setMovement怎么用?C++ QListView::setMovement使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QListView
的用法示例。
在下文中一共展示了QListView::setMovement方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: addPalette
void AnnotationImagePaletteWidget::addPalette(const QString& path)
{
QListView* pPalette = new QListView(this);
pPalette->setWrapping(true);
pPalette->setLayoutMode(QListView::Batched);
pPalette->setBatchSize(10);
pPalette->setMovement(QListView::Static);
pPalette->setFlow(QListView::LeftToRight);
pPalette->setIconSize(QSize(32, 32));
pPalette->setViewMode(QListView::IconMode);
pPalette->setDragEnabled(true);
pPalette->setDragDropMode(QAbstractItemView::DragOnly);
pPalette->setSelectionMode(QAbstractItemView::SingleSelection);
pPalette->setResizeMode(QListView::Adjust);
if (QFileInfo(path).isDir())
{
QDirModel* pModel = new PaletteModel(this);
pModel->setFilter(QDir::Files | QDir::Readable);
QStringList formats;
QList<QByteArray> rawFormats = QImageReader::supportedImageFormats();
foreach (const QByteArray& rawFormat, rawFormats)
{
formats << "*." + QString(rawFormat);
}
示例2: QWidget
//.........这里部分代码省略.........
m_editor = new MyQTextEdit;
m_editor->setFont(font);
editorHBox->addWidget(m_editor);
connect(m_editor, SIGNAL(textChanged()), this, SLOT(editTextChanged()));
//m_editor->setAcceptRichText(false);
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);