|
@@ -54,11 +54,11 @@ void CreateProjWidget::setMode(CreateProjWidget::Mode mode)
|
|
|
|
|
|
m_task->setEnabled(cu);
|
|
|
m_time->setEnabled(c);
|
|
|
- m_purpose->setEnabled(cu);
|
|
|
+ m_purpose->setReadOnly(!cu);
|
|
|
m_unit->setEnabled(cu);
|
|
|
m_crew->setEnabled(cu);
|
|
|
m_rank->setEnabled(cu);
|
|
|
- m_note->setEnabled(cu);
|
|
|
+ m_note->setReadOnly(!cu);
|
|
|
m_proj->setEnabled(cu);
|
|
|
m_type1->setEnabled(c);
|
|
|
m_type2->setEnabled(c);
|
|
@@ -95,7 +95,7 @@ ProjectInfo CreateProjWidget::editedProjInfo() const
|
|
|
ProjectInfo proj;
|
|
|
proj.taskName = m_task->text();
|
|
|
proj.estimateTime = QString::number(m_time->dateTime().toTime_t());
|
|
|
- proj.estimateObjective = m_purpose->text();
|
|
|
+ proj.estimateObjective = m_purpose->toPlainText();
|
|
|
proj.estimateDept = m_unit->text();
|
|
|
proj.estimatePerson = m_crew->text();
|
|
|
proj.positionalTitles = m_rank->text();
|
|
@@ -124,7 +124,7 @@ void CreateProjWidget::setProjectInfo(ProjectInfo *info)
|
|
|
m_unit->setText(info->estimateDept);
|
|
|
m_crew->setText(info->estimatePerson);
|
|
|
m_rank->setText(info->positionalTitles);
|
|
|
- m_note->setPlainText(info->remark);
|
|
|
+ m_note->setText(info->remark);
|
|
|
m_proj->setText(info->projectName);
|
|
|
|
|
|
ProjectManager::EvalTypes types = ProjectManager::evalTypes(*info);
|
|
@@ -143,7 +143,7 @@ void CreateProjWidget::initWindow()
|
|
|
setModal(true);
|
|
|
setWindowFlags(Qt::Dialog);
|
|
|
setWindowFlag(Qt::WindowContextHelpButtonHint, false);
|
|
|
- setFixedSize(360, 600);
|
|
|
+ setFixedSize(460, 700);
|
|
|
}
|
|
|
|
|
|
void CreateProjWidget::initWidgets()
|
|
@@ -153,7 +153,7 @@ void CreateProjWidget::initWidgets()
|
|
|
m_task = new LineEdit(this);
|
|
|
m_task->setPlaceholderText("任务名称");
|
|
|
m_time = new DateTimeEdit(this);
|
|
|
- m_purpose = new LineEdit(this);
|
|
|
+ m_purpose = new TextEdit(this);
|
|
|
m_purpose->setPlaceholderText("评估目的");
|
|
|
m_unit = new LineEdit(this);
|
|
|
m_unit->setPlaceholderText("评估单位");
|
|
@@ -164,6 +164,8 @@ void CreateProjWidget::initWidgets()
|
|
|
m_note = new TextEdit(this);
|
|
|
m_note->setPlaceholderText("备注");
|
|
|
|
|
|
+ m_note->setFontPointSize(10);
|
|
|
+
|
|
|
m_taskLabel = new QLabel(this);
|
|
|
m_taskLabel->setText("任务名称:");
|
|
|
m_timeLabel = new QLabel(this);
|
|
@@ -200,7 +202,7 @@ void CreateProjWidget::initWidgets()
|
|
|
|
|
|
void CreateProjWidget::initLayout()
|
|
|
{
|
|
|
- int minEditWidth = 220;
|
|
|
+ int minEditWidth = 300;
|
|
|
|
|
|
// 总体布局
|
|
|
m_layout = new QVBoxLayout(this);
|
|
@@ -222,35 +224,36 @@ void CreateProjWidget::initLayout()
|
|
|
m_crew->setFixedWidth(minEditWidth);
|
|
|
m_rank->setFixedWidth(minEditWidth);
|
|
|
m_note->setFixedWidth(minEditWidth);
|
|
|
+ m_purposeLabel->setContentsMargins(0, 10, 0, 10);
|
|
|
m_noteLabel->setContentsMargins(0, 10, 0, 10);
|
|
|
|
|
|
m_summaryLayout->setMargin(10);
|
|
|
m_summaryLayout->addWidget(m_taskLabel, 1, 0, 1, 1, Qt::AlignRight);
|
|
|
m_summaryLayout->addWidget(m_timeLabel, 2, 0, 1, 1, Qt::AlignRight);
|
|
|
- m_summaryLayout->addWidget(m_purposeLabel, 3, 0, 1, 1, Qt::AlignRight);
|
|
|
- m_summaryLayout->addWidget(m_unitLabel, 4, 0, 1, 1, Qt::AlignRight);
|
|
|
- m_summaryLayout->addWidget(m_crewLabel, 5, 0, 1, 1, Qt::AlignRight);
|
|
|
- m_summaryLayout->addWidget(m_rankLabel, 6, 0, 1, 1, Qt::AlignRight);
|
|
|
+ m_summaryLayout->addWidget(m_unitLabel, 3, 0, 1, 1, Qt::AlignRight);
|
|
|
+ m_summaryLayout->addWidget(m_crewLabel, 4, 0, 1, 1, Qt::AlignRight);
|
|
|
+ m_summaryLayout->addWidget(m_rankLabel, 5, 0, 1, 1, Qt::AlignRight);
|
|
|
+ m_summaryLayout->addWidget(m_purposeLabel, 6, 0, 1, 1, Qt::AlignRight | Qt::AlignTop);
|
|
|
m_summaryLayout->addWidget(m_noteLabel, 7, 0, 1, 1, Qt::AlignRight | Qt::AlignTop);
|
|
|
|
|
|
m_summaryLayout->addWidget(m_task, 1, 1, 1, 1, Qt::AlignLeft);
|
|
|
m_summaryLayout->addWidget(m_time, 2, 1, 1, 1, Qt::AlignLeft);
|
|
|
- m_summaryLayout->addWidget(m_purpose, 3, 1, 1, 1, Qt::AlignLeft);
|
|
|
- m_summaryLayout->addWidget(m_unit, 4, 1, 1, 1, Qt::AlignLeft);
|
|
|
- m_summaryLayout->addWidget(m_crew, 5, 1, 1, 1, Qt::AlignLeft);
|
|
|
- m_summaryLayout->addWidget(m_rank, 6, 1, 1, 1, Qt::AlignLeft);
|
|
|
+ m_summaryLayout->addWidget(m_unit, 3, 1, 1, 1, Qt::AlignLeft);
|
|
|
+ m_summaryLayout->addWidget(m_crew, 4, 1, 1, 1, Qt::AlignLeft);
|
|
|
+ m_summaryLayout->addWidget(m_rank, 5, 1, 1, 1, Qt::AlignLeft);
|
|
|
+ m_summaryLayout->addWidget(m_purpose, 6, 1, 1, 1, Qt::AlignLeft);
|
|
|
m_summaryLayout->addWidget(m_note, 7, 1, 1, 1, Qt::AlignLeft);
|
|
|
|
|
|
// 项目信息布局
|
|
|
m_projLayout->setMargin(10);
|
|
|
m_proj->setFixedWidth(minEditWidth);
|
|
|
m_projLayout->addWidget(m_projLabel, 0, 0, 1, 1, Qt::AlignLeft);
|
|
|
- m_projLayout->addWidget(m_proj, 0, 1, 1, 5, Qt::AlignLeft);
|
|
|
- m_projLayout->addWidget(new QWidget(this), 1, 1, 4, 1, Qt::AlignLeft);
|
|
|
+ m_projLayout->addWidget(m_proj, 0, 1, 1, 1, Qt::AlignLeft);
|
|
|
+ m_projLayout->addWidget(new QWidget(this), 1, 1, 1, 1, Qt::AlignLeft);
|
|
|
m_projLayout->addWidget(m_typeLabel, 4, 0, 1, 1, Qt::AlignLeft);
|
|
|
- m_projLayout->addWidget(m_type1, 4, 1, 1, 5, Qt::AlignLeft);
|
|
|
- m_projLayout->addWidget(m_type2, 5, 1, 1, 5, Qt::AlignLeft);
|
|
|
- m_projLayout->addWidget(m_type3, 6, 1, 1, 5, Qt::AlignLeft);
|
|
|
+ m_projLayout->addWidget(m_type1, 4, 1, 1, 1, Qt::AlignLeft);
|
|
|
+ m_projLayout->addWidget(m_type2, 5, 1, 1, 1, Qt::AlignLeft);
|
|
|
+ m_projLayout->addWidget(m_type3, 6, 1, 1, 1, Qt::AlignLeft);
|
|
|
|
|
|
// 按钮布局
|
|
|
m_btnLayout->addStretch();
|
|
@@ -262,7 +265,7 @@ void CreateProjWidget::initLayout()
|
|
|
void CreateProjWidget::connectSignalsAndSlots()
|
|
|
{
|
|
|
connect(m_task, &LineEdit::textChanged, this, &CreateProjWidget::slotTextChanged);
|
|
|
- connect(m_purpose, &LineEdit::textChanged, this, &CreateProjWidget::slotTextChanged);
|
|
|
+ connect(m_purpose, &TextEdit::textChanged, this, &CreateProjWidget::slotTextChanged);
|
|
|
connect(m_unit, &LineEdit::textChanged, this, &CreateProjWidget::slotTextChanged);
|
|
|
connect(m_crew, &LineEdit::textChanged, this, &CreateProjWidget::slotTextChanged);
|
|
|
connect(m_rank, &LineEdit::textChanged, this, &CreateProjWidget::slotTextChanged);
|