示例#1
0
void EventView::slotCreateTimeSheet()
{
    const int index = m_comboBox->currentIndex();
    const TimeSpan span = m_timeSpans[index].timespan;
    WeeklyTimeSheetReport *timeSheet = new WeeklyTimeSheetReport( this );
    timeSheet->setReportProperties( span.first, span.second, 0, true );
    timeSheet->exec();
    // Deletes itself on close.
}
示例#2
0
void WeeklyTimesheetConfigurationDialog::showReportPreviewDialog( QWidget* parent )
{
    QDate start, end;
    int index = m_ui->comboBoxWeek->currentIndex();
    if ( index == m_weekInfo.size() -1 ) {
        // manual selection
        QDate selectedDate = m_ui->dateEditDay->date();
        start = selectedDate.addDays( - selectedDate.dayOfWeek() + 1 );
        end = start.addDays( 7 );
    } else {
        start = m_weekInfo[index].timespan.first;
        end = m_weekInfo[index].timespan.second;
    }
    bool activeOnly = m_ui->checkBoxActiveOnly->isChecked();
    WeeklyTimeSheetReport* report = new WeeklyTimeSheetReport( parent );
    report->setReportProperties( start, end, m_rootTask, activeOnly );
    report->show();
}