本文整理汇总了C++中QListView::setResizeMode方法的典型用法代码示例。如果您正苦于以下问题:C++ QListView::setResizeMode方法的具体用法?C++ QListView::setResizeMode怎么用?C++ QListView::setResizeMode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QListView
的用法示例。
在下文中一共展示了QListView::setResizeMode方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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
QgsWelcomePage::QgsWelcomePage( bool skipVersionCheck, QWidget* parent )
: QWidget( parent )
{
QSettings settings;
QVBoxLayout* mainLayout = new QVBoxLayout;
mainLayout->setMargin( 0 );
setLayout( mainLayout );
QHBoxLayout* layout = new QHBoxLayout();
layout->setMargin( 9 );
mainLayout->addLayout( layout );
QWidget* recentProjctsContainer = new QWidget;
recentProjctsContainer->setLayout( new QVBoxLayout );
recentProjctsContainer->layout()->setContentsMargins( 3, 3, 3, 0 );
QLabel* recentProjectsTitle = new QLabel( QString( "<h1>%1</h1>" ).arg( tr( "Recent Projects" ) ) );
recentProjctsContainer->layout()->addWidget( recentProjectsTitle );
QListView* recentProjectsListView = new QListView();
recentProjectsListView->setResizeMode( QListView::Adjust );
mModel = new QgsWelcomePageItemsModel( recentProjectsListView );
recentProjectsListView->setModel( mModel );
recentProjectsListView->setItemDelegate( new QgsWelcomePageItemDelegate( recentProjectsListView ) );
recentProjctsContainer->layout()->addWidget( recentProjectsListView );
layout->addWidget( recentProjctsContainer );
mVersionInformation = new QLabel;
mainLayout->addWidget( mVersionInformation );
mVersionInformation->setVisible( false );
mVersionInfo = new QgsVersionInfo();
if ( !QgsApplication::isRunningFromBuildDir() && settings.value( "/qgis/checkVersion", true ).toBool() && !skipVersionCheck )
{
connect( mVersionInfo, SIGNAL( versionInfoAvailable() ), this, SLOT( versionInfoReceived() ) );
mVersionInfo->checkVersion();
}
connect( recentProjectsListView, SIGNAL( activated( QModelIndex ) ), this, SLOT( itemActivated( QModelIndex ) ) );
}
示例3: QWidget
LogBrowser::LogBrowser(QWidget *parent)
: QWidget(parent)
, m_nextID(0)
, m_actorFilterActive(false)
, m_actorFilterCheck(0)
{
m_log = new LogModel(this);
m_log->setResultType(Log::MostRecentSubjects);
QSortFilterProxyModel *filter = new QSortFilterProxyModel(this);
filter->setSourceModel(m_log);
filter->setSortCaseSensitivity(Qt::CaseInsensitive);
filter->setDynamicSortFilter(true);
filter->setFilterKeyColumn(0);
QLineEdit *searchBox = new QLineEdit(this);
searchBox->setPlaceholderText(tr("Search"));
connect(searchBox, SIGNAL(textEdited(QString)), filter, SLOT(setFilterFixedString(QString)));
QListView *view = new QListView(this);
view->setResizeMode(QListView::Adjust);
connect(view, SIGNAL(activated(QModelIndex)), this, SLOT(handleActivation(QModelIndex)));
m_logView = view;
m_logView->setModel(filter);
QVBoxLayout *layout = new QVBoxLayout(this);
m_filterLayout = new QHBoxLayout(this);
layout->addWidget(searchBox);
layout->addLayout(m_filterLayout);
layout->addWidget(m_logView);
m_actionMapper = new QSignalMapper(this);
connect(m_actionMapper, SIGNAL(mapped(int)), this, SLOT(applyFilter(int)));
DataModel::Event emptyEvent;
addEventFilter(DataModel::EventList() << emptyEvent, "All")->setChecked(true);
}