QHBoxLayout* ProjectWindow::setupTitleContainer() { QHBoxLayout* mainLayout = new QHBoxLayout; mainLayout->setMargin(5); mainLayout->setSpacing(10); mainLayout->addStretch(0); GraphicalButton* modeIcon = new GraphicalButton(projectData.projectMode().getIconWithLogo()); modeIcon->setFixedSize(78, 78); mainLayout->addWidget(modeIcon, 0); QVBoxLayout* titleLayout = new QVBoxLayout(); titleLayout->setMargin(0); titleLayout->setSpacing(5); titleLayout->addStretch(0); projectNameLabel_ = new QLabel; QFont nameFont = projectNameLabel_->font(); nameFont.setPointSize(16); projectNameLabel_->setFont(nameFont); setProjectTitle(projectData.projectName()); titleLayout->addWidget(projectNameLabel_, 0); projectPathLabel_ = new QLabel; projectPathLabel_->setTextInteractionFlags(Qt::TextSelectableByMouse); setProjectPath(projectData.projectDir().canonicalPath()); titleLayout->addWidget(projectPathLabel_, 0); QHBoxLayout* titleButtonsLayout = new QHBoxLayout; titleButtonsLayout->addStretch(0); QPushButton* changeNameButton = new QPushButton(ApplicationData::icon("rename"), "Rename Project"); connect(changeNameButton, &QPushButton::clicked, &projectData, &ProjectData::changeProjectName); titleButtonsLayout->addWidget(changeNameButton, 0); QPushButton* changeModeButton = new QPushButton(ApplicationData::icon("change_mode"), "Change Project Mode"); connect(changeModeButton, &QPushButton::clicked, &projectData, &ProjectData::changeProjectMode); titleButtonsLayout->addWidget(changeModeButton, 0); QPushButton* repiarLinksButton = new QPushButton(ApplicationData::icon("repair"), "Repair Project Links"); connect(repiarLinksButton, &QPushButton::clicked, &projectData, &ProjectData::repairLinks); titleButtonsLayout->addWidget(repiarLinksButton, 0); titleButtonsLayout->addStretch(1); titleLayout->addLayout(titleButtonsLayout, 0); titleLayout->addStretch(1); QVBoxLayout* imagesLayout = new QVBoxLayout(); imagesLayout->setMargin(5); imagesLayout->setSpacing(5); imagesLayout->addStretch(0); imagesCountLabel_ = new QLabel; imagesLayout->setAlignment(Qt::AlignRight); setImagesCount(projectData.projectImageList().count()); imagesLayout->addWidget(imagesCountLabel_, 0, Qt::AlignRight); imagesLayout->addLayout(setupImageActions()); imagesLayout->addStretch(1); QFrame* imagesFrame = new QFrame; imagesFrame->setFrameShadow(QFrame::Raised); imagesFrame->setFrameShape(QFrame::StyledPanel); imagesFrame->setLayout(imagesLayout); mainLayout->addLayout(titleLayout); mainLayout->addStretch(1); mainLayout->addWidget(imagesFrame); return mainLayout; }
void RuntimeEngine::setProjectConfig(const ProjectConfig &config) { _project = config; setProjectPath(_project.getProjectDir()); }