NewDialog: Add option for wizard list

Change-Id: I2b1b09bd64507b9875f9770d20233b7ec936f075
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
Thomas Hartmann
2018-03-06 16:54:49 +01:00
parent cf82b8e685
commit a11d49efee

View File

@@ -53,6 +53,7 @@ const char LAST_PLATFORM_KEY[] = "Core/NewDialog/LastPlatform";
const char ALLOW_ALL_TEMPLATES[] = "Core/NewDialog/AllowAllTemplates";
const char SHOW_PLATOFORM_FILTER[] = "Core/NewDialog/ShowPlatformFilter";
const char BLACKLISTED_CATEGORIES_KEY[] = "Core/NewDialog/BlacklistedCategories";
const char ALTERNATIVE_WIZARD_STYLE[] = "Core/NewDialog/AlternativeWizardStyle";
using namespace Core;
using namespace Core::Internal;
@@ -205,6 +206,21 @@ NewDialog::NewDialog(QWidget *parent) :
m_ui->templatesView->setModel(m_filterProxyModel);
m_ui->templatesView->setIconSize(QSize(ICON_SIZE, ICON_SIZE));
const bool alternativeWizardStyle = ICore::settings()->value(ALTERNATIVE_WIZARD_STYLE, false).toBool();
if (alternativeWizardStyle) {
m_ui->templatesView->setGridSize(QSize(256, 128));
m_ui->templatesView->setIconSize(QSize(96, 96));
m_ui->templatesView->setSpacing(4);
m_ui->templatesView->setViewMode(QListView::IconMode);
m_ui->templatesView->setMovement(QListView::Static);
m_ui->templatesView->setResizeMode(QListView::Adjust);
m_ui->templatesView->setSelectionRectVisible(false);
m_ui->templatesView->setWrapping(true);
m_ui->templatesView->setWordWrap(true);
}
connect(m_ui->templateCategoryView->selectionModel(), &QItemSelectionModel::currentChanged,
this, &NewDialog::currentCategoryChanged);