void ClinicChargeStatisticForm::create() { m_nameLabel = new QLabel(strNameLabel); m_nameEdit = new QLineEdit; connect(m_nameEdit, SIGNAL(textChanged(QString)), this, SLOT(updateTable())); m_genderLabel = new QLabel(strGenderLabel); m_genderComboBox = new QComboBox; connect(m_genderComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(updateTable())); m_startDateLabel = new QLabel(strStartDateLabel); m_startDateEdit = new QDateEdit; m_startDateEdit->setCalendarPopup(true); m_startDateEdit->setMaximumDate(QDate::currentDate()); connect(m_startDateEdit, SIGNAL(dateChanged(QDate)), this, SLOT(updateTable())); m_endDateLabel = new QLabel(strEndDateLabel); m_endDateEdit = new QDateEdit; m_endDateEdit->setCalendarPopup(true); m_endDateEdit->setMaximumDate(QDate::currentDate()); connect(m_endDateEdit, SIGNAL(dateChanged(QDate)), this, SLOT(updateTable())); m_resultsView = new QTableView; m_resultsModel = new QStandardItemModel; m_resultsView->setModel(m_resultsModel); m_resultsView->setSelectionBehavior(QAbstractItemView::SelectRows); m_resultsView->setEditTriggers(QAbstractItemView::NoEditTriggers); }
QWidget *TransactionView::createDateRangeWidget() { dateRangeWidget = new QFrame(); dateRangeWidget->setFrameStyle(QFrame::Panel | QFrame::Raised); dateRangeWidget->setContentsMargins(1,1,1,1); QHBoxLayout *layout = new QHBoxLayout(dateRangeWidget); layout->setContentsMargins(0,0,0,0); layout->addSpacing(23); layout->addWidget(new QLabel(tr("Range:"))); dateFrom = new QDateTimeEdit(this); dateFrom->setDisplayFormat("dd/MM/yy"); dateFrom->setCalendarPopup(true); dateFrom->setMinimumWidth(100); dateFrom->setDate(QDate::currentDate().addDays(-7)); layout->addWidget(dateFrom); layout->addWidget(new QLabel(tr("to"))); dateTo = new QDateTimeEdit(this); dateTo->setDisplayFormat("dd/MM/yy"); dateTo->setCalendarPopup(true); dateTo->setMinimumWidth(100); dateTo->setDate(QDate::currentDate()); layout->addWidget(dateTo); layout->addStretch(); // Hide by default dateRangeWidget->setVisible(false); // Notify on change connect(dateFrom, SIGNAL(dateChanged(QDate)), this, SLOT(dateRangeChanged())); connect(dateTo, SIGNAL(dateChanged(QDate)), this, SLOT(dateRangeChanged())); return dateRangeWidget; }
GUI::MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); ui->date_from->setDate(QDate::currentDate().addMonths(-1)); ui->date_to->setDate(QDate::currentDate()); household = new logic::Household(); QString ColumnName[] = {"Reason", "Comment", "Date", "Category", "Payment_Method", "Value"}; ui->tbl_Overview->setColumnCount(6); ui->tbl_Overview->setRowCount(0); ui->tbl_Overview->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch); for(int i = 0; i < 6; i++) { ui->tbl_Overview->setHorizontalHeaderItem(i, new QTableWidgetItem(ColumnName[i])); } QStringList list=(QStringList()<<"10"<<"20"<<"50"); ui->cmb_DataCount->addItems(list); refreshui(); connect(ui->cmb_Cat, SIGNAL(currentIndexChanged(int)), this, SLOT(slotFilter())); connect(ui->cmb_DataCount, SIGNAL(currentIndexChanged(int)), this, SLOT(slotFilter())); connect(ui->date_from, SIGNAL(dateChanged(QDate)), this, SLOT(slotFilter())); connect(ui->date_to, SIGNAL(dateChanged(QDate)), this, SLOT(slotFilter())); }
EffectiveDateWizardPage::EffectiveDateWizardPage(QWidget *parent) : EffectiveDateWizardPageDecl(parent) { // Register the fields with the QWizard and connect the // appropriate signals to update the "Next" button correctly registerField("effectiveChangeDateEdit", m_effectiveChangeDateEdit, "date", SIGNAL(dateChanged(QDate))); connect(m_effectiveChangeDateEdit, SIGNAL(dateChanged(QDate)), this, SIGNAL(completeChanged())); }
void AnnotationDialog::KDateEdit::dateEntered(QDate newDate) { if ((mHandleInvalid || newDate.isValid()) && validate(newDate)) { setDate(newDate); emit dateChanged(newDate); emit dateChanged( DB::ImageDate( QDateTime(newDate), QDateTime(newDate) ) ); } }
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 ); }
//! [13] void Window::createDatesGroupBox() { datesGroupBox = new QGroupBox(tr("Dates")); minimumDateEdit = new QDateEdit; minimumDateEdit->setDisplayFormat("MMM d yyyy"); minimumDateEdit->setDateRange(calendar->minimumDate(), calendar->maximumDate()); minimumDateEdit->setDate(calendar->minimumDate()); minimumDateLabel = new QLabel(tr("&Minimum Date:")); minimumDateLabel->setBuddy(minimumDateEdit); currentDateEdit = new QDateEdit; currentDateEdit->setDisplayFormat("MMM d yyyy"); currentDateEdit->setDate(calendar->selectedDate()); currentDateEdit->setDateRange(calendar->minimumDate(), calendar->maximumDate()); currentDateLabel = new QLabel(tr("&Current Date:")); currentDateLabel->setBuddy(currentDateEdit); maximumDateEdit = new QDateEdit; maximumDateEdit->setDisplayFormat("MMM d yyyy"); maximumDateEdit->setDateRange(calendar->minimumDate(), calendar->maximumDate()); maximumDateEdit->setDate(calendar->maximumDate()); maximumDateLabel = new QLabel(tr("Ma&ximum Date:")); maximumDateLabel->setBuddy(maximumDateEdit); //! [13] //! [14] connect(currentDateEdit, SIGNAL(dateChanged(QDate)), calendar, SLOT(setSelectedDate(QDate))); connect(calendar, SIGNAL(selectionChanged()), this, SLOT(selectedDateChanged())); connect(minimumDateEdit, SIGNAL(dateChanged(QDate)), this, SLOT(minimumDateChanged(QDate))); connect(maximumDateEdit, SIGNAL(dateChanged(QDate)), this, SLOT(maximumDateChanged(QDate))); //! [14] QGridLayout *dateBoxLayout = new QGridLayout; dateBoxLayout->addWidget(currentDateLabel, 1, 0); dateBoxLayout->addWidget(currentDateEdit, 1, 1); dateBoxLayout->addWidget(minimumDateLabel, 0, 0); dateBoxLayout->addWidget(minimumDateEdit, 0, 1); dateBoxLayout->addWidget(maximumDateLabel, 2, 0); dateBoxLayout->addWidget(maximumDateEdit, 2, 1); dateBoxLayout->setRowStretch(3, 1); datesGroupBox->setLayout(dateBoxLayout); //! [15] }
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); }
void SQueryEditor::stopping() { SLM_TRACE_FUNC(); // Disconnect the signals QObject::disconnect(m_patientNameLineEdit, SIGNAL(returnPressed()), this, SLOT(queryPatientName())); QObject::disconnect(m_patientNameQueryButton, SIGNAL(clicked()), this, SLOT(queryPatientName())); QObject::disconnect(m_studyDateQueryButton, SIGNAL(clicked()), this, SLOT(queryStudyDate())); QObject::disconnect(m_beginStudyDateEdit, SIGNAL(dateChanged(QDate)), this, SLOT(queryStudyDate())); QObject::disconnect(m_endStudyDateEdit, SIGNAL(dateChanged(QDate)), this, SLOT(queryStudyDate())); this->destroy(); }
TopGoodsDialogView::TopGoodsDialogView(QWidget *parent, TopGoodsDialogController *controller) : ReportDialogView(parent) { this->controller = controller; this->setWindowTitle("Najlepiej sprzedające się towary"); this->addComponents(); connect(buttonBox, SIGNAL(accepted()), controller, SLOT(saveReport())); connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject())); connect(spinBoxListLimit, SIGNAL(valueChanged(int)), controller, SLOT(setListLimitFilter(int))); connect(dateEditFrom, SIGNAL(dateChanged(QDate)), controller, SLOT(setDateFromFilter(QDate))); connect(dateEditTo, SIGNAL(dateChanged(QDate)), controller, SLOT(setDateToFilter(QDate))); }
void QWidgetBusinessTrip::doToolBar() { toolBar_ = new QToolBar(this); QList<QAction*> listActions; QAction *act; act = new QAction(this); act->setIcon(QIcon(":/CTRL/refresh")); act->setToolTip("Обновить"); listActions.push_back(act); connect(act, SIGNAL(triggered(bool)), SLOT(slotRefresh())); toolBar_->addActions(listActions); QWidget *widget; QDateEdit *dateEdit; widget = new QWidget(toolBar_); widget->setLayout(new QVBoxLayout()); widget->layout()->addWidget(new QLabel("Дата с")); dateEdit = new QDateEdit(this); dateEdit->setCalendarPopup(true); dateEdit->setDate(dateStart_); connect(dateEdit, SIGNAL(dateChanged(QDate)), SLOT(slotChangeDateStart(QDate))); widget->layout()->addWidget(dateEdit); toolBar_->addWidget(widget); widget = new QWidget(toolBar_); widget->setLayout(new QVBoxLayout()); widget->layout()->addWidget(new QLabel("Дата по")); dateEdit = new QDateEdit(this); dateEdit->setCalendarPopup(true); dateEdit->setDate(dateEnd_); connect(dateEdit, SIGNAL(dateChanged(QDate)), SLOT(slotChangeDateEnd(QDate))); widget->layout()->addWidget(dateEdit); toolBar_->addWidget(widget); widget = new QWidget(toolBar_); widget->setLayout(new QVBoxLayout()); widget->layout()->addWidget(new QLabel("Сотрудник")); editEmployee_ = new QLineEdit(toolBar_); connect(editEmployee_, SIGNAL(editingFinished()), SLOT(slotRefresh())); widget->layout()->addWidget(editEmployee_); toolBar_->addWidget(widget); toolBar_->setIconSize(QSize(40,40)); layout_->addWidget(toolBar_); }
DAgregarGarantia::DAgregarGarantia( QWidget *parent ) : QDialog( parent ), _proxima_garantia( this, -1, -1 ) { setupUi(this); setWindowTitle( QString::fromUtf8( "Agegar nueva garantía" ) ); setWindowIcon( QIcon( ":/imagenes/garantia_agregar.png" ) ); _id_cliente = -1; _id_comprobante = -1; _id_producto = -1; _nombre_producto = QString(); connect( CBCliente, SIGNAL( cambioIdCliente( int ) ), this, SLOT( buscarEquipamientos( int ) ) ); connect( CBEquipamiento, SIGNAL( cambioId( int ) ), this, SLOT( buscarFactura( int ) ) ); connect( DECompra, SIGNAL( dateChanged( QDate ) ), this, SLOT( actualizarFechaFinGarantia( QDate ) ) ); DECompra->setDate( QDate::currentDate() ); CkBImprimir->setChecked( true ); CkBAvisarEmail->setEnabled( false ); /// @TODO: Habilitar esto cuando se genere el sistema de alertas automaticas LECodigoGarantia->setReadOnly( true ); LECodigoGarantia->setText( MGarantias::obtenerProximoComprobante().aCadena() ); this->adjustSize(); }
void CheckableEditableDate::buttonPressed() { if (m_editMode) { emit dateChanged(KDateTime(m_dateTimeWidget->date())); } EditableDate::buttonPressed(); }
void EditableDate::buttonPressed() { if (m_editMode) { emit dateChanged(KDateTime(m_dateTimeWidget->date())); } AbstractEditableWidget::buttonPressed(); }
LogViewer::LogViewer(QWidget *parent) : QWidget(parent), ui(new Ui::LogViewer) { ui->setupUi(this); Tp::registerTypes(); g_type_init(); QGlib::init(); //are these 4 really needed? Tpl::init(); m_accountManager = Tp::AccountManager::create(); m_entityModel = new EntityModel(this); m_filterModel = new QSortFilterProxyModel(this); m_filterModel->setSourceModel(m_entityModel); ui->entityList->setModel(m_filterModel); ui->entityFilter->setProxy(m_filterModel); //TODO parse command line args and update all views as appropriate connect(m_accountManager->becomeReady(), SIGNAL(finished(Tp::PendingOperation*)), SLOT(onAccountManagerReady())); connect(ui->entityList, SIGNAL(activated(QModelIndex)), SLOT(onEntitySelected(QModelIndex))); connect(ui->datePicker, SIGNAL(dateChanged(QDate)), SLOT(onDateSelected())); }
DivePlannerWidget::DivePlannerWidget(QWidget *parent, Qt::WindowFlags f) : QWidget(parent, f) { ui.setupUi(this); ui.dateEdit->setDisplayFormat(getDateFormat()); ui.tableWidget->setTitle(tr("Dive planner points")); ui.tableWidget->setModel(DivePlannerPointsModel::instance()); DivePlannerPointsModel::instance()->setRecalc(true); ui.tableWidget->view()->setItemDelegateForColumn(DivePlannerPointsModel::GAS, new AirTypesDelegate(this)); ui.cylinderTableWidget->setTitle(tr("Available gases")); ui.cylinderTableWidget->setModel(CylindersModel::instance()); QTableView *view = ui.cylinderTableWidget->view(); view->setColumnHidden(CylindersModel::START, true); view->setColumnHidden(CylindersModel::END, true); view->setColumnHidden(CylindersModel::DEPTH, false); view->setItemDelegateForColumn(CylindersModel::TYPE, new TankInfoDelegate(this)); connect(ui.cylinderTableWidget, SIGNAL(addButtonClicked()), DivePlannerPointsModel::instance(), SLOT(addCylinder_clicked())); connect(ui.tableWidget, SIGNAL(addButtonClicked()), DivePlannerPointsModel::instance(), SLOT(addStop())); connect(CylindersModel::instance(), SIGNAL(dataChanged(QModelIndex, QModelIndex)), GasSelectionModel::instance(), SLOT(repopulate())); connect(CylindersModel::instance(), SIGNAL(rowsInserted(QModelIndex, int, int)), GasSelectionModel::instance(), SLOT(repopulate())); connect(CylindersModel::instance(), SIGNAL(rowsRemoved(QModelIndex, int, int)), GasSelectionModel::instance(), SLOT(repopulate())); connect(CylindersModel::instance(), SIGNAL(dataChanged(QModelIndex, QModelIndex)), plannerModel, SIGNAL(cylinderModelEdited())); connect(CylindersModel::instance(), SIGNAL(rowsInserted(QModelIndex, int, int)), plannerModel, SIGNAL(cylinderModelEdited())); connect(CylindersModel::instance(), SIGNAL(rowsRemoved(QModelIndex, int, int)), plannerModel, SIGNAL(cylinderModelEdited())); ui.tableWidget->setBtnToolTip(tr("Add dive data point")); connect(ui.startTime, SIGNAL(timeChanged(QTime)), plannerModel, SLOT(setStartTime(QTime))); connect(ui.dateEdit, SIGNAL(dateChanged(QDate)), plannerModel, SLOT(setStartDate(QDate))); connect(ui.ATMPressure, SIGNAL(valueChanged(int)), this, SLOT(atmPressureChanged(int))); connect(ui.atmHeight, SIGNAL(valueChanged(int)), this, SLOT(heightChanged(int))); connect(ui.salinity, SIGNAL(valueChanged(double)), this, SLOT(salinityChanged(double))); connect(DivePlannerPointsModel::instance(), SIGNAL(startTimeChanged(QDateTime)), this, SLOT(setupStartTime(QDateTime))); // Creating (and canceling) the plan replanButton = ui.buttonBox->addButton(tr("Save new"), QDialogButtonBox::ActionRole); connect(replanButton, SIGNAL(clicked()), plannerModel, SLOT(saveDuplicatePlan())); connect(ui.buttonBox, SIGNAL(accepted()), plannerModel, SLOT(savePlan())); connect(ui.buttonBox, SIGNAL(rejected()), plannerModel, SLOT(cancelPlan())); QShortcut *closeKey = new QShortcut(QKeySequence(Qt::Key_Escape), this); connect(closeKey, SIGNAL(activated()), plannerModel, SLOT(cancelPlan())); // This makes shure the spinbox gets a setMinimum(0) on it so we can't have negative time or depth. ui.tableWidget->view()->setItemDelegateForColumn(DivePlannerPointsModel::DEPTH, new SpinBoxDelegate(0, INT_MAX, 1, this)); ui.tableWidget->view()->setItemDelegateForColumn(DivePlannerPointsModel::RUNTIME, new SpinBoxDelegate(0, INT_MAX, 1, this)); ui.tableWidget->view()->setItemDelegateForColumn(DivePlannerPointsModel::DURATION, new SpinBoxDelegate(0, INT_MAX, 1, this)); ui.tableWidget->view()->setItemDelegateForColumn(DivePlannerPointsModel::CCSETPOINT, new DoubleSpinBoxDelegate(0, 2, 0.1, this)); /* set defaults. */ ui.ATMPressure->setValue(1013); ui.atmHeight->setValue(0); setMinimumWidth(0); setMinimumHeight(0); }
bool KDateTable::setDate(const QDate& date_) { bool changed=false; QDate temp; // ----- if(!date_.isValid()) { kdDebug() << "KDateTable::setDate: refusing to set invalid date." << endl; return false; } if(date!=date_) { date=date_; changed=true; } temp.setYMD(date.year(), date.month(), 1); firstday=temp.dayOfWeek(); if(firstday==1) firstday=8; numdays=date.daysInMonth(); if(date.month()==1) { // set to december of previous year temp.setYMD(date.year()-1, 12, 1); } else { // set to previous month temp.setYMD(date.year(), date.month()-1, 1); } numDaysPrevMonth=temp.daysInMonth(); if(changed) { repaintContents(false); } emit(dateChanged(date)); return true; }
TaskEditor::TaskEditor( QWidget* parent ) : QDialog( parent ) , m_ui( new Ui::TaskEditor() ) { m_ui->setupUi( this ); connect( m_ui->pushButtonParent, SIGNAL( clicked() ), SLOT( slotSelectParent() ) ); connect( m_ui->dateEditFrom, SIGNAL( dateChanged( QDate ) ), SLOT( slotDateChanged( QDate ) ) ); connect( m_ui->dateEditTo, SIGNAL( dateChanged( QDate ) ), SLOT( slotDateChanged( QDate ) ) ); connect( m_ui->checkBoxFrom, SIGNAL( clicked( bool ) ), SLOT( slotCheckBoxChecked( bool ) ) ); connect( m_ui->checkBoxUntil, SIGNAL( clicked( bool ) ), SLOT( slotCheckBoxChecked( bool ) ) ); }
void DateWidget::slotDatePickerModified(const QDate& date) { d->mDatePicker->hide(); d->mDate = date; emit dateChanged(date); d->updateButton(); }
void CommentBlockModel::setDate(const TimeValue& date) { if(date != m_date) { m_date = date; emit dateChanged(m_date); } }
void View::Report::VolumeReportDialog::createConnections() { connect(_anyRadioButton, SIGNAL(toggled(bool)), this, SLOT(toggledOnRadioButton())); connect(_rangeRadioButton, SIGNAL(toggled(bool)), this, SLOT(toggledOnRadioButton())); connect(_rangeRadioButton, SIGNAL(toggled(bool)), this, SLOT(verifyRange())); connect(_beginDateDateEdit, SIGNAL(dateChanged(QDate)), this, SLOT(verifyRange())); connect(_endDateDateEdit, SIGNAL(dateChanged(QDate)), this, SLOT(verifyRange())); connect(_okPushButton, SIGNAL(clicked()), this, SLOT(accept())); connect(_cancelPushButton, SIGNAL(clicked()), this, SLOT(reject())); }
KexiDBDatePicker::KexiDBDatePicker(QWidget *parent) : KDatePicker(parent) , KexiFormDataItemInterface() , m_dateEditFocused(false) { connect(this, SIGNAL(dateChanged(QDate)), this, SLOT(slotValueChanged())); connect(this, SIGNAL(dateEntered(QDate)), this, SLOT(slotValueChanged())); }
void DDateEdit::dateEntered( const QDate& date ) { if (assignDate( date ) ) { updateView(); emit dateChanged( date ); } }
void ActivityReportConfigurationDialog::slotDelayedInitialization() { slotStandardTimeSpansChanged(); connect( Application::instance().dateChangeWatcher(), SIGNAL( dateChanged() ), SLOT( slotStandardTimeSpansChanged() ) ); // FIXME load settings }
NewSalary::NewSalary(QWidget *parent) : QDialog(parent), ui(new Ui::NewSalary) { ui->setupUi(this); connect(ui->dFromDate,SIGNAL(dateChanged(QDate)),this,SLOT(dateChanged())); connect(ui->dToDate,SIGNAL(dateChanged(QDate)),this,SLOT(dateChanged())); connect(ui->tableWidget,SIGNAL(clicked(QModelIndex)),this,SLOT(showDetailedUserDialog(QModelIndex))); ui->tableWidget->setColumnCount(4); QStringList headers; headers.append(tr("ID")); headers.append(tr("Name")); headers.append(tr("Number of Hours")); headers.append(tr("Salary")); ui->tableWidget->setHorizontalHeaderLabels(headers); ui->tableWidget->setEditTriggers(QAbstractItemView::NoEditTriggers); }
void EventView::delayedInitialization() { timeSpansChanged(); connect( Application::instance().dateChangeWatcher(), SIGNAL( dateChanged() ), SLOT( timeSpansChanged() ) ); }
void KConfigDialogManager::initMaps() { if (s_propertyMap()->isEmpty()) { s_propertyMap()->insert(QStringLiteral("KButtonGroup"), "current"); s_propertyMap()->insert(QStringLiteral("KColorButton"), "color"); s_propertyMap()->insert(QStringLiteral("KColorCombo"), "color"); //s_propertyMap()->insert( "KUrlRequester", "url" ); //s_propertyMap()->insert( "KUrlComboRequester", "url" ); } if (s_changedMap()->isEmpty()) { // QT s_changedMap()->insert(QStringLiteral("QCheckBox"), SIGNAL(stateChanged(int))); s_changedMap()->insert(QStringLiteral("QPushButton"), SIGNAL(clicked(bool))); s_changedMap()->insert(QStringLiteral("QRadioButton"), SIGNAL(toggled(bool))); // We can only store one thing, so you can't have // a ButtonGroup that is checkable. // s_changedMap()->insert("QButtonGroup", SIGNAL(buttonClicked(int))); s_changedMap()->insert(QStringLiteral("QGroupBox"), SIGNAL(toggled(bool))); s_changedMap()->insert(QStringLiteral("QComboBox"), SIGNAL(activated(int))); //qsqlproperty map doesn't store the text, but the value! //s_changedMap()->insert("QComboBox", SIGNAL(textChanged(QString))); s_changedMap()->insert(QStringLiteral("QDateEdit"), SIGNAL(dateChanged(QDate))); s_changedMap()->insert(QStringLiteral("QTimeEdit"), SIGNAL(timeChanged(QTime))); s_changedMap()->insert(QStringLiteral("QDateTimeEdit"), SIGNAL(dateTimeChanged(QDateTime))); s_changedMap()->insert(QStringLiteral("QDial"), SIGNAL(valueChanged(int))); s_changedMap()->insert(QStringLiteral("QDoubleSpinBox"), SIGNAL(valueChanged(double))); s_changedMap()->insert(QStringLiteral("QLineEdit"), SIGNAL(textChanged(QString))); s_changedMap()->insert(QStringLiteral("QSlider"), SIGNAL(valueChanged(int))); s_changedMap()->insert(QStringLiteral("QSpinBox"), SIGNAL(valueChanged(int))); s_changedMap()->insert(QStringLiteral("QTextEdit"), SIGNAL(textChanged())); s_changedMap()->insert(QStringLiteral("QTextBrowser"), SIGNAL(sourceChanged(QString))); s_changedMap()->insert(QStringLiteral("QPlainTextEdit"), SIGNAL(textChanged())); s_changedMap()->insert(QStringLiteral("QTabWidget"), SIGNAL(currentChanged(int))); // KDE s_changedMap()->insert(QStringLiteral("KComboBox"), SIGNAL(activated(int))); s_changedMap()->insert(QStringLiteral("KFontComboBox"), SIGNAL(activated(int))); s_changedMap()->insert(QStringLiteral("KFontRequester"), SIGNAL(fontSelected(QFont))); s_changedMap()->insert(QStringLiteral("KFontChooser"), SIGNAL(fontSelected(QFont))); s_changedMap()->insert(QStringLiteral("KHistoryCombo"), SIGNAL(activated(int))); s_changedMap()->insert(QStringLiteral("KColorCombo"), SIGNAL(activated(QColor))); s_changedMap()->insert(QStringLiteral("KColorButton"), SIGNAL(changed(QColor))); s_changedMap()->insert(QStringLiteral("KDatePicker"), SIGNAL(dateSelected(QDate))); s_changedMap()->insert(QStringLiteral("KDateWidget"), SIGNAL(changed(QDate))); s_changedMap()->insert(QStringLiteral("KDateTimeWidget"), SIGNAL(valueChanged(QDateTime))); s_changedMap()->insert(QStringLiteral("KEditListWidget"), SIGNAL(changed())); s_changedMap()->insert(QStringLiteral("KListWidget"), SIGNAL(itemSelectionChanged())); s_changedMap()->insert(QStringLiteral("KLineEdit"), SIGNAL(textChanged(QString))); s_changedMap()->insert(QStringLiteral("KPasswordEdit"), SIGNAL(textChanged(QString))); s_changedMap()->insert(QStringLiteral("KRestrictedLine"), SIGNAL(textChanged(QString))); s_changedMap()->insert(QStringLiteral("KTextEdit"), SIGNAL(textChanged())); s_changedMap()->insert(QStringLiteral("KUrlRequester"), SIGNAL(textChanged(QString))); s_changedMap()->insert(QStringLiteral("KUrlComboRequester"), SIGNAL(textChanged(QString))); s_changedMap()->insert(QStringLiteral("KUrlComboBox"), SIGNAL(urlActivated(QUrl))); s_changedMap()->insert(QStringLiteral("KButtonGroup"), SIGNAL(changed(int))); }
Alert::Alert(QWidget *parent) : QWidget(parent) { // Set an alert? enableAlert = new QCheckBox("Enable Alert"); connect(enableAlert, SIGNAL(toggled(bool)), this, SLOT(enabledToggle(bool))); editDate = new DateEdit(140,"ddd, dd MMM yyyy"); editDate->setEnabled(false); editDate->setMinimumDate(QDate::currentDate()); editTime = new Clock; editTime->setTime(QTime::currentTime()); editTime->setEnabled(false); QHBoxLayout *editTimeLay = new QHBoxLayout; editTimeLay->addWidget(editDate); editTimeLay->addWidget(editTime); // Edit the text to be displayed textEdit = new QPlainTextEdit; textEdit->setEnabled(false); textEdit->setFixedSize(250,100); // Some labels date = new QLabel("Date:"); date->setEnabled(false); time = new QLabel("Time:"); time->setEnabled(false); text = new QLabel("Text:"); text->setEnabled(false); // Option to mark an alert as completed (only shown when editing a booking) completedText = new QPlainTextEdit; completedText->setEnabled(false); completedText->setFixedSize(250,75); completedText->hide(); completed = new QCheckBox("Completed"); completed->setEnabled(false); completed->hide(); connect(completed, SIGNAL(toggled(bool)), completedText, SLOT(setEnabled(bool))); QFormLayout *lay = new QFormLayout; lay->addWidget(enableAlert); lay->addRow(time,editTimeLay); lay->addRow(text,textEdit); lay->addRow("",completed); lay->addRow("",completedText); this->setLayout(lay); this->setSizePolicy(QSizePolicy::Maximum,QSizePolicy::Expanding); connect(enableAlert, SIGNAL(clicked()), this, SLOT(sendDataChanged())); connect(editDate, SIGNAL(dateChanged(QDate)), this, SLOT(sendDataChanged())); connect(editTime, SIGNAL(timeChanged(QTime)), this, SLOT(sendDataChanged())); connect(textEdit, SIGNAL(textChanged()), this, SLOT(sendDataChanged())); connect(completedText, SIGNAL(textChanged()), this, SLOT(sendDataChanged())); }
//! [0] MainWindow::MainWindow() { selectedDate = QDate::currentDate(); fontSize = 10; QWidget *centralWidget = new QWidget; //! [0] //! [1] QLabel *dateLabel = new QLabel(tr("Date:")); QComboBox *monthCombo = new QComboBox; for (int month = 1; month <= 12; ++month) monthCombo->addItem(QDate::longMonthName(month)); QDateTimeEdit *yearEdit = new QDateTimeEdit; yearEdit->setDisplayFormat("yyyy"); yearEdit->setDateRange(QDate(1753, 1, 1), QDate(8000, 1, 1)); //! [1] monthCombo->setCurrentIndex(selectedDate.month() - 1); yearEdit->setDate(selectedDate); //! [2] QLabel *fontSizeLabel = new QLabel(tr("Font size:")); QSpinBox *fontSizeSpinBox = new QSpinBox; fontSizeSpinBox->setRange(1, 64); fontSizeSpinBox->setValue(10); editor = new QTextBrowser; insertCalendar(); //! [2] //! [3] connect(monthCombo, SIGNAL(activated(int)), this, SLOT(setMonth(int))); connect(yearEdit, SIGNAL(dateChanged(QDate)), this, SLOT(setYear(QDate))); connect(fontSizeSpinBox, SIGNAL(valueChanged(int)), this, SLOT(setFontSize(int))); //! [3] //! [4] QHBoxLayout *controlsLayout = new QHBoxLayout; controlsLayout->addWidget(dateLabel); controlsLayout->addWidget(monthCombo); controlsLayout->addWidget(yearEdit); controlsLayout->addSpacing(24); controlsLayout->addWidget(fontSizeLabel); controlsLayout->addWidget(fontSizeSpinBox); controlsLayout->addStretch(1); QVBoxLayout *centralLayout = new QVBoxLayout; centralLayout->addLayout(controlsLayout); centralLayout->addWidget(editor, 1); centralWidget->setLayout(centralLayout); setCentralWidget(centralWidget); //! [4] }
QWidget *TransactionView::createDateRangeWidget() { dateRangeWidget = new QFrame(); dateRangeWidget->setObjectName("rangeFrame"); dateRangeWidget->setFrameStyle(QFrame::Panel | QFrame::Raised); dateRangeWidget->setContentsMargins(1,1,1,1); QHBoxLayout *layout = new QHBoxLayout(dateRangeWidget); layout->setContentsMargins(0,0,0,0); layout->addSpacing(23); range = new QLabel(tr("Range:")); layout->addWidget(range); dateFrom = new QDateTimeEdit(this); dateFrom->setDisplayFormat("dd/MM/yy"); dateFrom->setCalendarPopup(true); dateFrom->setMinimumWidth(100); dateFrom->setDate(QDate::currentDate().addDays(-7)); layout->addWidget(dateFrom); to = new QLabel(tr("to")); layout->addWidget(to); dateTo = new QDateTimeEdit(this); dateTo->setDisplayFormat("dd/MM/yy"); dateTo->setCalendarPopup(true); dateTo->setMinimumWidth(100); dateTo->setDate(QDate::currentDate()); layout->addWidget(dateTo); layout->addStretch(); layout->addWidget(new QLabel(tr("Total:"))); totalAmountWidget = new QLabel(this); totalAmountWidget->setText("0"); totalAmountWidget->setFixedWidth(120); totalAmountWidget->setTextInteractionFlags(Qt::TextSelectableByMouse | Qt::TextSelectableByKeyboard); layout->addWidget(totalAmountWidget); // Hide by default enableDateRangeWidget(false); // Notify on change connect(dateFrom, SIGNAL(dateChanged(QDate)), this, SLOT(dateRangeChanged())); connect(dateTo, SIGNAL(dateChanged(QDate)), this, SLOT(dateRangeChanged())); return dateRangeWidget; }