//открыть плана
void MainForm::openPlanActivated()
{
	OpenPlanDialog openPlanDialog(this, 0, false, Qt::WStyle_Customize | Qt::WStyle_Title);
	
	if(openPlanDialog.exec())
	{
		currentPlanList.clear();
		for(int row = 0; row < openPlanDialog.planTable->numRows(); row++)
			if(((QCheckTableItem*)openPlanDialog.planTable->item(row, 0))->isChecked())
				currentPlanList += openPlanDialog.planTable->text(row, 0);
		refreshPlanTable(currentPlanList);
		setCaption(tr("Контроль исполнения"));
		if(currentPlanList.count() == 1)
			setCaption(tr("Контроль исполнения") + tr(" - ") + currentPlanList[0]);			//заголовок окна
		enableActActivated();
	}
}
示例#2
0
BasicUserViewer::BasicUserViewer(const LinQedInUser& user,QWidget* parent):QFrame(parent){
    setAttribute(Qt::WA_DeleteOnClose);
    mainHorizontalLayout=new QHBoxLayout;

    image=new QLabel;
    image->setPixmap(QPixmap(user.getImagePath()));
    image->setScaledContents(true);
    image->setMaximumSize(130,100);
    mainHorizontalLayout->addWidget(image);

    infosLayout=new QVBoxLayout;
    username=new QLabel(user.getLoginInfo().getEmailAddress());
    username->setStyleSheet("font-weight:bold;");
    infosLayout->addWidget(username);

    name=new QLabel(user.getProfile().getPersonalInformations().getName()+" "+
                    user.getProfile().getPersonalInformations().getSurname());
    infosLayout->addWidget(name);

    plan=new QLabel(user.getUserPlan());
    infosLayout->addWidget(plan);

    QDate ed=user.getEspireDate();
    espireDate=new QLabel("In scadenza il: "+((ed.isValid())?ed.toString("d/M/yyyy"):tr("mai")));
    infosLayout->addWidget(espireDate);

    deleteUser=new QPushButton(tr("Elimina Utente"));
    deleteUser->setCursor(QCursor(Qt::PointingHandCursor));
    infosLayout->addWidget(deleteUser);
    connect(deleteUser,SIGNAL(clicked()),this,SLOT(emitDeleteRequest()));
    changePlan=new QPushButton(tr("Cambia Piano"));
    changePlan->setCursor(QCursor(Qt::PointingHandCursor));
    infosLayout->addWidget(changePlan);
    connect(changePlan,SIGNAL(clicked()),this,SLOT(openPlanDialog()));

    mainHorizontalLayout->addLayout(infosLayout);
    setLayout(mainHorizontalLayout);
    setMinimumSize(270,200);
    setMaximumSize(370,200);
}//BasicUserViewer