void Event::setEndDate(const QDateTime &endDate)
{
    if (endDate != mEndDate) {
        mEndDate = endDate;
        emit endDateChanged(mEndDate);
    }
}
void ScheduleDialog::setDateRange( const QDate & start, const QDate & end )
{
	if( end < start ) return;
	startDateChanged( start );
	endDateChanged( end );
	mDateStartEdit->setDate( start );
	mDateEndEdit->setDate( end );
}
Example #3
0
EventEditor::EventEditor( const Event& event, QWidget* parent )
    : QDialog( parent )
    , m_ui( new Ui::EventEditor )
    , m_event( event )
{
    m_ui->setupUi( this );
    m_ui->dateEditEnd->calendarWidget()->setFirstDayOfWeek( Qt::Monday );
    m_ui->dateEditEnd->calendarWidget()->setVerticalHeaderFormat( QCalendarWidget::ISOWeekNumbers );
    m_ui->dateEditStart->calendarWidget()->setFirstDayOfWeek( Qt::Monday );
    m_ui->dateEditStart->calendarWidget()->setVerticalHeaderFormat( QCalendarWidget::ISOWeekNumbers );

    // Ctrl+Return for OK
    m_ui->buttonBox->button(QDialogButtonBox::Ok)->setShortcut(Qt::CTRL + Qt::Key_Return);

    // connect stuff:
    connect( m_ui->spinBoxHours, SIGNAL(valueChanged(int)),
             SLOT(durationHoursEdited(int)) );
    connect( m_ui->spinBoxMinutes, SIGNAL(valueChanged(int)),
             SLOT(durationMinutesEdited(int)) );
    connect( m_ui->dateEditStart, SIGNAL(dateChanged(QDate)),
             SLOT(startDateChanged(QDate)) );
    connect( m_ui->timeEditStart, SIGNAL(timeChanged(QTime)),
             SLOT(startTimeChanged(QTime)) );
    connect( m_ui->dateEditEnd, SIGNAL(dateChanged(QDate)),
             SLOT(endDateChanged(QDate)) );
    connect( m_ui->timeEditEnd, SIGNAL(timeChanged(QTime)),
             SLOT(endTimeChanged(QTime)) );
    connect( m_ui->pushButtonSelectTask, SIGNAL(clicked()),
             SLOT(selectTaskClicked()) );
    connect( m_ui->textEditComment, SIGNAL(textChanged()),
             SLOT(commentChanged()) );
    connect( m_ui->startToNowButton, SIGNAL(clicked()),
             SLOT(startToNowButtonClicked()) );
    connect( m_ui->endToNowButton, SIGNAL(clicked()),
             SLOT(endToNowButtonClicked()) );
    // what a fricking hack - but QDateTimeEdit does not seem to have
    // a simple function to toggle 12h and 24h mode:
    // yeah, I know, this will survive changes in the user prefs, but
    // only for this instance of the edit dialog
    QString originalDateTimeFormat = m_ui->timeEditStart->displayFormat();

    QString format = originalDateTimeFormat
                     .remove( QStringLiteral("ap") )
                     .remove( QStringLiteral("AP") )
                     .simplified();
    m_ui->timeEditStart->setDisplayFormat( format );
    m_ui->timeEditEnd->setDisplayFormat( format );

    // initialize to some sensible values, unless we got something valid passed in
    if ( !m_event.isValid() ) {
        QSettings settings;
        QDateTime start = settings.value( MetaKey_LastEventEditorDateTime, QDateTime::currentDateTime() ).toDateTime();
        m_event.setStartDateTime( start );
        m_event.setEndDateTime( start );
        m_endDateChanged = false;
    }
    updateValues( true );
}
void NemoCalendarAgendaModel::setEndDate(const QDate &endDate)
{
    if (mEndDate == endDate)
        return;

    mEndDate = endDate;
    emit endDateChanged();

    refresh();
}
Example #5
0
toAWR::toAWR(/*toTool *tool,*/ QWidget *parent, toConnection &_connection)
    : toToolWidget(AWRTool, "simplequery.html", parent, _connection, "toAWR")
{
    QToolBar *toolbar = Utils::toAllocBar(this, tr("AWR Tool"));
    layout()->addWidget(toolbar);

    toolbar->addWidget(new QLabel("Inst:", toolbar));
    dbid = new toResultCombo(toolbar, "AWR toolbar");
    dbid->setSQL(toSQL::sql("toAWR:DBInstances", connection()));
    fsnap = new toResultCombo(toolbar, "AWR toolbar");
    fsnap->setSelectionPolicy(toResultCombo::LastButOne);
    fsnap->setSQL(SQLSnaps);
    tsnap = new toResultCombo(toolbar, "AWR toolbar");
    tsnap->setSelectionPolicy(toResultCombo::Last);
    tsnap->setSQL(SQLSnaps);

    startdate = new QDateTimeEdit(QDate::currentDate());
    startdate->setCalendarPopup(true);
    enddate = new QDateTimeEdit(QDate::currentDate());
    enddate->setCalendarPopup(true);

    connect(dbid, SIGNAL(activated(int)), this, SLOT(instanceChanged(int)));
    connect(dbid, SIGNAL(done()), this, SLOT(instanceRead()));
    connect(startdate, SIGNAL(dateChanged(QDate)), this, SLOT(startDateChanged(QDate)));
    connect(enddate, SIGNAL(dateChanged(QDate)), this, SLOT(endDateChanged(QDate)));

    toolbar->addWidget(dbid);
    toolbar->addWidget(startdate);
    toolbar->addWidget(fsnap);
    toolbar->addWidget(enddate);
    toolbar->addWidget(tsnap);

    try
    {
        dbid->refresh();
    }
    TOCATCH;

    toolbar->addAction(QIcon(QPixmap(const_cast<const char**>(execute_xpm))),
                       tr("Generate report"),
                       this,
                       SLOT(execute()));
    toolbar->addWidget(new Utils::toSpacer());

    QAction *executeAct = new QAction(QPixmap(execute_xpm), tr("Execute_ current statement"), this);
    executeAct->setShortcut(QKeySequence::Refresh);
    connect(executeAct, SIGNAL(triggered()), this, SLOT(refresh(void)));

    new toChangeConnection(toolbar);

    Tabs = new QTabWidget(this);
    layout()->addWidget(Tabs);
}
DateFilterProxyModel::DateFilterProxyModel(int column, QObject *parent) :
    WidgetProxyModel(parent), column(column)
{
    widget = new DateFilterProxyModelWidget(0);

    connect(widget, SIGNAL(startDateChanged(QDate)),
            this, SLOT(setFilterMinimumDate(QDate)));
    connect(widget, SIGNAL(endDateChanged(QDate)),
            this, SLOT(setFilterMaximumDate(QDate)));

    widget->goToToday();
}
void
TestRecurrentTransaction::testSetEndDateNoSignal() {
    auto endDate = QDate::currentDate().addYears(1);
    auto amount = .45;
    auto account = std::make_shared<PublicAccount>("Test account", .0, "");
    auto category = std::make_shared<com::chancho::Category>("Sushi", com::chancho::Category::Type::EXPENSE);
    auto transactionPtr = std::make_shared<com::chancho::Transaction>(account, amount, category);
    auto recurrentPtr = std::make_shared<com::chancho::RecurrentTransaction>(transactionPtr,
        std::make_shared<com::chancho::RecurrentTransaction::Recurrence>(
                com::chancho::RecurrentTransaction::Recurrence::Defaults::DAILY, QDate::currentDate(), endDate));

    auto qmlTransaction = std::make_shared<com::chancho::tests::PublicRecurrentTransaction>(recurrentPtr);
    QSignalSpy spy(qmlTransaction.get(), SIGNAL(endDateChanged(QDate)));
    qmlTransaction->setEndDate(endDate);
    QCOMPARE(spy.count(), 0);
}
Example #8
0
void QtDcm::initConnections()
{
    // Initialize connections
    QObject::connect ( treeWidgetPatients, SIGNAL ( currentItemChanged ( QTreeWidgetItem*, QTreeWidgetItem* ) ), this, SLOT ( patientItemSelected ( QTreeWidgetItem*, QTreeWidgetItem* ) ) );
    QObject::connect ( treeWidgetStudies, SIGNAL ( currentItemChanged ( QTreeWidgetItem*, QTreeWidgetItem* ) ), this, SLOT ( studyItemSelected ( QTreeWidgetItem*, QTreeWidgetItem* ) ) );
    QObject::connect ( treeWidgetSeries, SIGNAL ( currentItemChanged ( QTreeWidgetItem*, QTreeWidgetItem* ) ), this, SLOT ( serieItemSelected ( QTreeWidgetItem*, QTreeWidgetItem* ) ) );
    QObject::connect ( treeWidgetSeries, SIGNAL ( itemClicked ( QTreeWidgetItem*, int ) ), this, SLOT ( serieItemClicked ( QTreeWidgetItem*, int ) ) );
    QObject::connect ( nameEdit, SIGNAL ( textChanged ( QString ) ), this, SLOT ( patientNameTextChanged ( QString ) ) );
    QObject::connect ( serieDescriptionEdit, SIGNAL ( textChanged ( QString ) ), this, SLOT ( serieDescriptionTextChanged ( QString ) ) );
    QObject::connect ( studyDescriptionEdit, SIGNAL ( textChanged ( QString ) ), this, SLOT ( studyDescriptionTextChanged ( QString ) ) );
    QObject::connect ( searchButton, SIGNAL ( clicked() ), this, SLOT ( findSCU() ) );
    QObject::connect ( cdromButton, SIGNAL ( clicked() ), this, SLOT ( openDicomdir() ) );
    QObject::connect ( patientSexComboBox, SIGNAL ( currentIndexChanged ( int ) ), this, SLOT ( updateSex ( int ) ) );
    QObject::connect ( serieModalityComboBox, SIGNAL ( currentIndexChanged ( int ) ), this, SLOT ( updateModality ( int ) ) );
    QObject::connect ( pacsComboBox, SIGNAL ( currentIndexChanged ( int ) ), this, SLOT ( updatePACS ( int ) ) );
    QObject::connect ( startDateEdit, SIGNAL ( dateChanged ( QDate ) ), this, SLOT ( startDateChanged ( QDate ) ) );
    QObject::connect ( endDateEdit, SIGNAL ( dateChanged ( QDate ) ), this, SLOT ( endDateChanged ( QDate ) ) );
}
Example #9
0
void TaskDialog::initProgressTab(QScrollArea *scrollArea)
{
    /* construct */
    QWidget *progressDetail = new QWidget(scrollArea);
    QFormLayout *fl = new QFormLayout;

    comboStatus = new QComboBox;
    comboStatus->addItem(tr("Not Started"));
    comboStatus->addItem(tr("In Progress"));
    comboStatus->addItem(tr("Completed"));
    comboStatus->addItem(tr("Waiting"));
    comboStatus->addItem(tr("Deferred"));

    spinComplete = new QSpinBox;
    spinComplete->setMinimum(0);
    spinComplete->setMaximum(100);
    spinComplete->setSuffix(tr("%"));

    startedCheck = new QGroupBox;
    startedCheck->setCheckable(true);
    startedCheck->setTitle(tr("Started:"));

    completedCheck = new QGroupBox;
    completedCheck->setCheckable(true);
    completedCheck->setTitle(tr("Completed:"));

    startedEdit = new QDateEdit;
    completedEdit = new QDateEdit;

    QVBoxLayout *vl = new QVBoxLayout();
    vl->addWidget(startedEdit);
    startedCheck->setLayout(vl);

    vl = new QVBoxLayout();
    vl->addWidget(completedEdit);
    completedCheck->setLayout(vl);

    fl->addRow(tr("Status"), comboStatus);
    fl->addRow(tr("Progress"), spinComplete);
    fl->addRow(startedCheck);
    fl->addRow(completedCheck);

    progressDetail->setLayout(fl);

    /* initialize */
    QDate current = QDate::currentDate();
    comboStatus->setCurrentIndex( todo.status() );

    spinComplete->setValue(todo.percentCompleted());

    if ( !todo.startedDate().isNull() ) {
        startedCheck->setChecked(true);
        startedEdit->setDate(todo.startedDate());
    } else {
        startedCheck->setChecked(false);
        startedEdit->setDate(current);
    }

    if ( todo.isCompleted() ) {
        completedCheck->setChecked(true);
        completedEdit->setDate(todo.completedDate());
    } else {
        completedCheck->setChecked(false);
        completedEdit->setDate(current);
    }

    /* connect */
    connect( startedEdit, SIGNAL(dateChanged(QDate)),
             this, SLOT(startDateChanged(QDate)) );
    connect( completedEdit, SIGNAL(dateChanged(QDate)),
             this, SLOT(endDateChanged(QDate)) );
    connect( comboStatus, SIGNAL(activated(int)),
            this, SLOT(statusChanged(int)) );
    connect( startedCheck, SIGNAL(toggled(bool)),
            this, SLOT(startDateChecked(bool)) );
    connect( completedCheck, SIGNAL(toggled(bool)),
            this, SLOT(endDateChecked(bool)) );
    connect( spinComplete, SIGNAL(valueChanged(int)),
            this, SLOT(percentChanged(int)) );

    scrollArea->setWidget(progressDetail);
    progressDetail->setFocusPolicy(Qt::NoFocus);
}
void QFacebookGraphCommonWorkModel::setEndDate(const QString &endDate) {
    if(m_endDate != endDate) {
        m_endDate = endDate;
        emit endDateChanged();
    }
}