int CustomTimeCtrl::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QWidget::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: isAuto((*reinterpret_cast< bool(*)>(_a[1]))); break;
        case 1: isDateTime((*reinterpret_cast< bool(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2]))); break;
        case 2: dateTimeChanged((*reinterpret_cast< const QDateTime(*)>(_a[1]))); break;
        case 3: adjustDateTime((*reinterpret_cast< QModelIndex(*)>(_a[1])),(*reinterpret_cast< QVariant(*)>(_a[2]))); break;
        case 4: blockSignals((*reinterpret_cast< const bool(*)>(_a[1]))); break;
        case 5: setHasTime((*reinterpret_cast< bool(*)>(_a[1]))); break;
        case 6: onDateChanged((*reinterpret_cast< const QDate(*)>(_a[1]))); break;
        case 7: onTimeChanged((*reinterpret_cast< const QTime(*)>(_a[1]))); break;
        default: ;
        }
        _id -= 8;
    }
#ifndef QT_NO_PROPERTIES
      else if (_c == QMetaObject::ReadProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: *reinterpret_cast< QDateTime*>(_v) = dateTime(); break;
        }
        _id -= 1;
    } else if (_c == QMetaObject::WriteProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: setDateTime(*reinterpret_cast< QDateTime*>(_v)); break;
        }
        _id -= 1;
    } else if (_c == QMetaObject::ResetProperty) {
        _id -= 1;
    } else if (_c == QMetaObject::QueryPropertyDesignable) {
        _id -= 1;
    } else if (_c == QMetaObject::QueryPropertyScriptable) {
        _id -= 1;
    } else if (_c == QMetaObject::QueryPropertyStored) {
        _id -= 1;
    } else if (_c == QMetaObject::QueryPropertyEditable) {
        _id -= 1;
    } else if (_c == QMetaObject::QueryPropertyUser) {
        _id -= 1;
    }
#endif // QT_NO_PROPERTIES
    return _id;
}
void QgsDateTimeSearchWidgetWrapper::initWidget( QWidget* editor )
{
  mDateTimeEdit = qobject_cast<QgsDateTimeEdit*>( editor );

  if ( mDateTimeEdit )
  {
    mDateTimeEdit->setAllowNull( false );

    const QString displayFormat = config( QStringLiteral( "display_format" ), QgsDateTimeEditConfig::defaultFormat( layer()->fields().at( mFieldIdx ).type() ) ).toString();
    mDateTimeEdit->setDisplayFormat( displayFormat );

    const bool calendar = config( QStringLiteral( "calendar_popup" ), false ).toBool();
    mDateTimeEdit->setCalendarPopup( calendar );
    if ( calendar && mDateTimeEdit->calendarWidget() )
    {
      // highlight today's date
      QTextCharFormat todayFormat;
      todayFormat.setBackground( QColor( 160, 180, 200 ) );
      mDateTimeEdit->calendarWidget()->setDateTextFormat( QDate::currentDate(), todayFormat );
    }

    mDateTimeEdit->setEmpty();

    connect( mDateTimeEdit, SIGNAL( dateTimeChanged( QDateTime ) ), this, SLOT( dateTimeChanged( QDateTime ) ) );
  }
}
void QgsDateTimeEditWrapper::initWidget( QWidget *editor )
{
  QgsDateTimeEdit* qgsEditor = dynamic_cast<QgsDateTimeEdit*>( editor );
  if ( qgsEditor )
  {
    mQgsDateTimeEdit = qgsEditor;
  }
  // assign the Qt editor also if the QGIS editor has been previously assigned
  // this avoids testing each time which widget to use
  // the QGIS editor must be used for non-virtual methods (dateTime, setDateTime)
  QDateTimeEdit* qtEditor = dynamic_cast<QDateTimeEdit*>( editor );
  if ( qtEditor )
  {
    mQDateTimeEdit = qtEditor;
  }

  if ( !mQDateTimeEdit )
  {
    QgsDebugMsg( "Date/time edit widget could not be initialized because provided widget is not a QDateTimeEdit." );
    QgsMessageLog::logMessage( "Date/time edit widget could not be initialized because provided widget is not a QDateTimeEdit.", "UI forms", QgsMessageLog::WARNING );
    return;
  }

  const QString displayFormat = config( "display_format", QgsDateTimeEditConfig::defaultFormat( field().type() ) ).toString();
  mQDateTimeEdit->setDisplayFormat( displayFormat );

  const bool calendar = config( "calendar_popup", false ).toBool();
  mQDateTimeEdit->setCalendarPopup( calendar );
  if ( calendar && mQDateTimeEdit->calendarWidget() )
  {
    // highlight today's date
    QTextCharFormat todayFormat;
    todayFormat.setBackground( QColor( 160, 180, 200 ) );
    mQDateTimeEdit->calendarWidget()->setDateTextFormat( QDate::currentDate(), todayFormat );
  }

  const bool allowNull = config( "allow_null", true ).toBool();
  if ( mQgsDateTimeEdit )
  {
    mQgsDateTimeEdit->setAllowNull( allowNull );
  }
  else
  {
    QgsMessageLog::instance()->logMessage( tr( "The usual date/time widget QDateTimeEdit cannot be configured to allow NULL values. "
                                           "For that the QGIS custom widget QgsDateTimeEdit needs to be used." ),
                                           "field widgets" );
  }

  if ( mQgsDateTimeEdit )
  {
    connect( mQgsDateTimeEdit, SIGNAL( dateTimeChanged( QDateTime ) ), this, SLOT( dateTimeChanged( QDateTime ) ) );
  }
  else
  {
    connect( mQDateTimeEdit, SIGNAL( dateTimeChanged( QDateTime ) ), this,  SLOT( dateTimeChanged( QDateTime ) ) );
  }
}
KexiDBDateTimeEdit::KexiDBDateTimeEdit(const QDateTime &datetime, QWidget *parent)
        : QWidget(parent), KexiFormDataItemInterface()
{
    m_invalidState = false;
    m_cleared = false;
    m_readOnly = false;

    m_dateEdit = new Q3DateEdit(datetime.date(), this);
    m_dateEdit->setAutoAdvance(true);
    m_dateEdit->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::MinimumExpanding);
// m_dateEdit->setFixedWidth( QFontMetrics(m_dateEdit->font()).width("8888-88-88___") );
    connect(m_dateEdit, SIGNAL(valueChanged(QDate)), this, SLOT(slotValueChanged()));
    connect(m_dateEdit, SIGNAL(valueChanged(QDate)), this, SIGNAL(dateTimeChanged()));

    QToolButton* btn = new QToolButton(this);
    btn->setText("...");
    btn->setFixedWidth(QFontMetrics(btn->font()).width(" ... "));
    btn->setPopupDelay(1); //1 ms

    m_timeEdit = new Q3TimeEdit(datetime.time(), this);
    m_timeEdit->setAutoAdvance(true);
    m_timeEdit->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::MinimumExpanding);
    connect(m_timeEdit, SIGNAL(valueChanged(QTime)), this, SLOT(slotValueChanged()));
    connect(m_timeEdit, SIGNAL(valueChanged(QTime)), this, SIGNAL(dateTimeChanged()));

#ifdef QDateTimeEditor_HACK
    m_dte_date = KexiUtils::findFirstChild<QDateTimeEditor>(m_dateEdit, "QDateTimeEditor");
    m_dte_time = KexiUtils::findFirstChild<QDateTimeEditor>(m_timeEdit, "QDateTimeEditor");
#else
    m_dte_date = 0;
#endif

    m_datePickerPopupMenu = new QMenu(0, "date_popup");
    connect(m_datePickerPopupMenu, SIGNAL(aboutToShow()), this, SLOT(slotShowDatePicker()));
    m_datePicker = new KDatePicker(m_datePickerPopupMenu, QDate::currentDate(), 0);

    KDateTable *dt = KexiUtils::findFirstChild<KDateTable>(m_datePicker, "KDateTable");
    if (dt)
        connect(dt, SIGNAL(tableClicked()), this, SLOT(acceptDate()));
    m_datePicker->setCloseButton(true);
    m_datePicker->installEventFilter(this);
    m_datePickerPopupMenu->insertItem(m_datePicker);
    btn->setPopup(m_datePickerPopupMenu);

    QHBoxLayout* layout = new QHBoxLayout(this);
    layout->addWidget(m_dateEdit, 0);
    layout->addWidget(btn, 0);
    layout->addWidget(m_timeEdit, 0);
    //layout->addStretch(1);

    setFocusProxy(m_dateEdit);
}
QWidget * ExtArgTimestamp::createEditor(QWidget * parent)
{
    QDateTimeEdit * tsBox;
    QString text = defaultValue();

    if ( _argument->pref_valptr && *_argument->pref_valptr)
    {
        QString storeValue(*_argument->pref_valptr);

        if ( storeValue.length() > 0 && storeValue.compare(text) != 0 )
            text = storeValue.trimmed();
    }

    ts = QDateTime::fromTime_t(text.toInt());
    tsBox = new QDateTimeEdit(ts, parent);
    tsBox->setDisplayFormat(QLocale::system().dateTimeFormat());
    tsBox->setCalendarPopup(true);

    if ( _argument->tooltip != NULL )
        tsBox->setToolTip(QString().fromUtf8(_argument->tooltip));

    connect(tsBox, SIGNAL(dateTimeChanged(QDateTime)), SLOT(onDateTimeChanged(QDateTime)));

    return tsBox;
}
Beispiel #6
0
TestDateTimeEdit::TestDateTimeEdit(QObject* _q)
    : TestGenericTextWidget(_q), q(qobject_cast<QDateTimeEdit*>(_q))
{
    TestWidgetsLog();
    connect(q,    SIGNAL(dateTimeChanged(QDateTime)),
            this, SLOT(onDateTimeChanged(QDateTime)));
}
/******************************************************************************
* Set the date/time.
*/
void AlarmTimeWidget::setDateTime(const DateTime& dt)
{
	// Set the time zone first so that the call to dateTimeChanged() works correctly.
	if (mDeferring)
		mTimeSpec = dt.timeSpec().isValid() ? dt.timeSpec() : KDateTime::LocalZone;
	else
	{
		KTimeZone tz = dt.timeZone();
		mNoTimeZone->setChecked(!tz.isValid());
		mTimeZone->setTimeZone(tz.isValid() ? tz : Preferences::timeZone());
		slotTimeZoneChanged();
	}

	if (dt.date().isValid())
	{
		mTimeEdit->setValue(dt.effectiveTime());
		mDateEdit->setDate(dt.date());
		dateTimeChanged();     // update the delay time edit box
	}
	else
	{
		mTimeEdit->setValid(false);
		mDateEdit->setInvalid();
		mDelayTimeEdit->setValid(false);
	}
	if (mAnyTimeCheckBox)
	{
		bool dateOnly = dt.isDateOnly();
		if (dateOnly)
			mAnyTimeAllowed = true;
		mAnyTimeCheckBox->setChecked(dateOnly);
		setAnyTime();
	}
}
Beispiel #8
0
QDialog *EarthquakePlugin::configDialog()
{
    if ( !m_configDialog ) {
        // Initializing configuration dialog
        m_configDialog = new QDialog();
        m_ui = new Ui::EarthquakeConfigWidget;
        m_ui->setupUi( m_configDialog );
        m_ui->m_numResults->setRange( 1, m_maximumNumberOfItems );
        readSettings();
        connect( m_ui->m_buttonBox, SIGNAL(accepted()),
                 SLOT(writeSettings()) );
        connect( m_ui->m_buttonBox, SIGNAL(rejected()),
                 SLOT(readSettings()) );
        connect( m_ui->m_buttonBox->button( QDialogButtonBox::Reset ), SIGNAL(clicked()),
                 SLOT(restoreDefaultSettings()) );
        QPushButton *applyButton = m_ui->m_buttonBox->button( QDialogButtonBox::Apply );
        connect( applyButton, SIGNAL(clicked()),
                 SLOT(writeSettings()) );
        connect( m_ui->m_endDate, SIGNAL(dateTimeChanged(QDateTime)),
                 SLOT(validateDateRange()) );
        connect( this, SIGNAL(settingsChanged(QString)),
                 this, SLOT(readSettings()) );
    }
    return m_configDialog;
}
Beispiel #9
0
QgsDateTimeEdit::QgsDateTimeEdit( QWidget *parent )
    : QDateTimeEdit( parent )
    , mAllowNull( true )
    , mIsNull( true )
{
    mClearButton = new QToolButton( this );
    mClearButton->setIcon( QgsApplication::getThemeIcon( "/mIconClear.svg" ) );
    mClearButton->setCursor( Qt::ArrowCursor );
    mClearButton->setStyleSheet( "position: absolute; border: none; padding: 0px;" );
    mClearButton->hide();
    connect( mClearButton, SIGNAL( clicked() ), this, SLOT( clear() ) );

    mNullLabel = new QLineEdit( QSettings().value( "qgis/nullValue", "NULL" ).toString(), this );
    mNullLabel->setReadOnly( true );
    mNullLabel->setStyleSheet( "position: absolute; border: none; font-style: italic; color: grey;" );
    mNullLabel->hide();

    setStyleSheet( QString( "padding-right: %1px;" ).arg( mClearButton->sizeHint().width() + spinButtonWidth() + frameWidth() + 1 ) );

    QSize msz = minimumSizeHint();
    setMinimumSize( qMax( msz.width(), mClearButton->sizeHint().height() + frameWidth() * 2 + 2 ),
                    qMax( msz.height(), mClearButton->sizeHint().height() + frameWidth() * 2 + 2 ) );

    connect( this, SIGNAL( dateTimeChanged( QDateTime ) ), this, SLOT( changed( QDateTime ) ) );

    // init with current time so mIsNull is properly initialized
    QDateTimeEdit::setDateTime( QDateTime::currentDateTime() );
}
void QDateTimeModel::setDate(const QDate &date)
{
    Q_D(QDateTimeModel);
    if (date.isValid() && date > d->minimum.date() && date < d->maximum.date()) {
        d->value.setDate(date);
        emit dateTimeChanged(d->value);
    }
}
Beispiel #11
0
void Forecast::setDate(QDateTime date)
{
    if(this->_date != date)
    {
        this->_date = date;
        emit dateTimeChanged();
    }
}
void QDateTimeModel::setTime(const QTime &time)
{
    Q_D(QDateTimeModel);
    if (time.isValid() && time > d->minimum.time() && time < d->maximum.time()) {
        d->value.setTime(time);
        emit dateTimeChanged(d->value);
    }
}
Beispiel #13
0
void AMScan::setDateTime(const QDateTime& dt)
{
    if(dateTime_ != dt) {
        dateTime_ = dt;
        setModified(true);
        emit dateTimeChanged(dateTime_);
    }
}
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)));
    }
void QDateTimeModel::setDateTime(const QDateTime &datetime)
{
    Q_D(QDateTimeModel);
    if (datetime.isValid() && datetime > d->minimum && datetime < d->maximum) {
        d->value.setDate(datetime.date());
        d->value.setTime(datetime.time());
        emit dateTimeChanged(d->value);
    }
}
StorySplitDialog::StorySplitDialog(ItfDocument * _xemlDoc, QVariant  _element_selected,QWidget * parent)
	: QDialog(parent)
{
	this->current_doc=_xemlDoc;
	//std::cerr << _element_selected->toString().toStdString() << std::endl;
	this->element_selected=_element_selected,
	//std::cerr << "in constructor (storysplitdialog) " << this->element_selected.toString().toStdString() << std::endl;
	this->label = new QLabel(tr("Label :"));
	this->timepoint =new QLabel(tr("Timepoint :"));
	lineEdit = new QLineEdit;
	this->daytimeedit=new QDateTimeEdit(static_cast<XemlDocument*>(_xemlDoc)->get_startdate());
	this->timepoint->setBuddy(this->daytimeedit);
	//StoryItem tmp=element_selected.value<StoryItem>();
	this->daytimeedit->setMinimumDateTime(static_cast<XemlDocument*>(_xemlDoc)->get_startdate());
	this->daytimeedit->setMaximumDateTime(static_cast<XemlDocument*>(_xemlDoc)->get_enddate());

	connect(this->daytimeedit,SIGNAL(dateTimeChanged(QDateTime)),this,SLOT(valid_date_time(QDateTime)));
	//this->daytimeedit->setDisplayFormat("dd.hh:mm:ss");
	this->lineEditTimePoint = new QLineEdit;
	this->label->setBuddy(lineEdit);
	this->timepoint->setBuddy(lineEditTimePoint);
	this->okButton =new QPushButton(tr("OK"));
	this->okButton->setDefault(true);
	this->okButton->setEnabled(false);
	this->cancelButton = new QPushButton(tr("Cancel"));
	//connect(this->daytimeedit,SIGNAL(dateTimeChanged(QDateTime)),this,SLOT(enabledOkButton(QDateTime)));
	connect(lineEdit,SIGNAL(textChanged(const QString &)),this,SLOT(enabledOkButton(const QString &)));
	//connect(lineEditTimePoint,SIGNAL(textChanged(const QString &)),this,SLOT(enabledOkButton(const QString &)));
	connect(okButton,SIGNAL(clicked()),this,SLOT(OkClicked()));


	QHBoxLayout * topleftLayout = new QHBoxLayout;
	topleftLayout->addWidget(label);
	topleftLayout->addWidget(lineEdit);
	topleftLayout->addWidget(timepoint);
	topleftLayout->addWidget(this->daytimeedit);

	QVBoxLayout * leftLayout = new QVBoxLayout;
	leftLayout->addLayout(topleftLayout);

	QVBoxLayout * rightLayout = new QVBoxLayout;
	rightLayout->addWidget(this->cancelButton);
	rightLayout->addWidget(this->okButton);
	rightLayout->addStretch();

	QHBoxLayout * mainLayout = new QHBoxLayout;
	mainLayout->addLayout(leftLayout);
	mainLayout->addLayout(rightLayout);
	setLayout(mainLayout);
	setWindowTitle(tr("story split informations"));
	setFixedHeight((sizeHint().height()));



}
bool QDateTimeModel::addYears(int nyears)
{
    Q_D(QDateTimeModel);
    QDateTime ndate(d->value.addYears(nyears));
    if (ndate > d->minimum && ndate < d->maximum) {
        d->value.setDate(ndate.date());
        emit dateTimeChanged(d->value);
        return true;
    }
    return false;
}
bool QDateTimeModel::addSecs(int s)
{
    Q_D(QDateTimeModel);
    QDateTime ndate(d->value.addSecs(s));
    if (ndate > d->minimum && ndate < d->maximum) {
        d->value.setTime(ndate.time());
        emit dateTimeChanged(d->value);
        return true;
    }
    return false;
}
AdminWindow::AdminWindow(QWidget *parent) :
    QMainWindow(parent),
    rowCount(0),
    userSelectedForTransaction("ALL"),
    ui(new Ui::AdminWindow)
{
    ui->setupUi(this);

    util.ConnectDatabase(PATH_TO_DB);

    listWidget = new QListWidget();
    connect(listWidget, SIGNAL(itemClicked(QListWidgetItem*)),this, SLOT(onListFoodCatagoryItemClicked(QListWidgetItem*)));
    populateCatagoryList();
    populateTableList();
    populateBoyList();
    populateFoodList();

    addCustomPlot(ui->widget_Graph);

    connect(ui->dateTimeEdit_Start, SIGNAL(dateTimeChanged(QDateTime)), this, SLOT(onDateTimeFromChanged(QDateTime)));
    connect(ui->dateTimeEdit_End, SIGNAL(dateTimeChanged(QDateTime)), this, SLOT(onDateTimeToChanged(QDateTime)));
}
Beispiel #20
0
// Add a scan to this model.  The AMScan must exist elsewhere, for the lifetime that it is added to the model.  Model does not take ownership of the scan.
void AMScanSetModel::addScan(AMScan* newScan) {

	newScan->retain(this); // declare our interest in this scan.

	emit layoutAboutToBeChanged();

	beginInsertRows(QModelIndex(), scans_.count(), scans_.count());

	scans_.append(newScan);
	connect(newScan, SIGNAL(modifiedChanged(bool)), this, SLOT(onScanModifiedChanged(bool)));
	connect(newScan, SIGNAL(nameChanged(QString)), this, SLOT(onMetaDataChanged()));
	connect(newScan, SIGNAL(numberChanged(int)), this, SLOT(onMetaDataChanged()));
	connect(newScan, SIGNAL(dateTimeChanged(QDateTime)), this, SLOT(onMetaDataChanged()));
	connect(newScan, SIGNAL(sampleIdChanged(int)), this, SLOT(onMetaDataChanged()));

	QList<AMDataSourcePlotSettings> plotSettings;
	for(int i=0; i<newScan->dataSourceCount(); i++) {
		AMDataSourcePlotSettings ps; /// \todo set up nicer default colors (related within scans)
		ps.visible = newScan->dataSourceAt(i)->visibleInPlots(); // Initial visibility is now controlled in AMDataSource::visibleInPlots().  Scan controllers can initialize this, and it will be saved in the database.

		// Hack for Darren's 2D XRF maps and Mark's XES scans.
		if (newScan->scanRank() == 0){

			ps.colorMap.setContrast(2.1);
			ps.colorMap.setBrightness(0.08);
			ps.colorMap.setGamma(1);
		}

		else if (newScan->scanRank() == 2 || newScan->scanRank() == 3){

			ps.colorMap.setContrast(1);
			ps.colorMap.setBrightness(0);
			ps.colorMap.setGamma(1);
		}

		plotSettings.append(ps);
	}
	sourcePlotSettings_.append(plotSettings);

	// hook up signals from newScan to catch data source addition and removal
	connect(newScan, SIGNAL(dataSourceAdded(int)), this, SLOT(onDataSourceAdded(int)));
	connect(newScan, SIGNAL(dataSourceAboutToBeAdded(int)), this, SLOT(onDataSourceAboutToBeAdded(int)));
	connect(newScan, SIGNAL(dataSourceAboutToBeRemoved(int)), this, SLOT(onDataSourceAboutToBeRemoved(int)));
	connect(newScan, SIGNAL(dataSourceRemoved(int)), this, SLOT(onDataSourceRemoved(int)));

	endInsertRows();

	emit scanAdded(newScan);
	/// \todo this is a hack; should not be needed... But we do need it to keep QTreeViews from getting messed up. Why?
	emit layoutChanged();
}
void EventsWindow::createDateFilter(QBoxLayout *layout)
{
    QCheckBox *title = new QCheckBox(tr("Date after..."));
    title->setStyleSheet(QLatin1String("font-weight:bold;"));
    layout->addWidget(title);
    connect(title, SIGNAL(clicked(bool)), SLOT(setStartDateEnabled(bool)));

    m_startDate = new QDateEdit(QDate::currentDate());
    m_startDate->setCalendarPopup(true);
    m_startDate->setMaximumDate(QDate::currentDate());
    m_startDate->setDisplayFormat(QLatin1String("dddd, MMM dd, yyyy"));
    m_startDate->setVisible(false);
    layout->addWidget(m_startDate);

    connect(m_startDate, SIGNAL(dateTimeChanged(QDateTime)), m_resultsView->eventsModel(),
            SLOT(setFilterBeginDate(QDateTime)));
    connect(m_startDate, SIGNAL(dateTimeChanged(QDateTime)), SLOT(setEndDateMinimum(QDateTime)));
    title->setChecked(false);

    /* Start date disabled in favor of setFilterDay for now. */
    title->hide();
    m_startDate->hide();

    QLabel *title2 = new QLabel(tr("Date"));
    title2->setStyleSheet(QLatin1String("font-weight:bold;"));
    layout->addWidget(title2);

    m_endDate = new QDateEdit(QDate::currentDate());
    m_endDate->setCalendarPopup(true);
    m_endDate->setMaximumDate(QDate::currentDate());
    m_endDate->setDisplayFormat(QLatin1String("ddd, MMM dd, yyyy"));
    m_endDate->setTime(QTime(23, 59, 59, 999));
    m_endDate->setFixedWidth(m_sourcesView->width());
    layout->addWidget(m_endDate);

    connect(m_endDate, SIGNAL(dateTimeChanged(QDateTime)), m_resultsView->eventsModel(),
            SLOT(setFilterDay(QDateTime)));
}
Beispiel #22
0
AMScanDictionary::AMScanDictionary(AMScan *scan, QObject *parent) :
	AMOldScanParametersDictionary(parent)
{
	scan_ = scan;
	if(scan_){
		connect(scan_, SIGNAL(nameChanged(QString)), this, SLOT(reoperate()));
		connect(scan_, SIGNAL(numberChanged(int)), this, SLOT(reoperate()));
		connect(scan_, SIGNAL(dateTimeChanged(QDateTime)), this, SLOT(reoperate()));
		connect(scan_, SIGNAL(sampleIdChanged(int)), this, SLOT(reoperate()));
		connect(scan_, SIGNAL(scanConfigurationChanged()), this, SLOT(reoperate()));
		connect(scan_, SIGNAL(loadedFromDb()), this, SLOT(reoperate()));
	}
	loadKeywordReplacementDictionary();
}
Beispiel #23
0
void TodoNote::taskChanged(const QModelIndex& proxy_index)
{
	extra_widget->setVisible(proxy_index.isValid());
	if(!proxy_index.isValid()) return;
	mapper->setRootIndex(proxy_index.parent());
	mapper->setCurrentModelIndex(proxy_index);
	QModelIndex index = proxy_model->mapToSource(proxy_index);
	Task* task = static_cast<Task*>(index.internalPointer());
	//
	disconnect(dt_date_limit, SIGNAL(dateTimeChanged(QDateTime)), this, SLOT(noteDateLimitChanged(QDateTime)));
	disconnect(cb_date_limit, SIGNAL(toggled(bool)), this, SLOT(noteLimitChanged(bool)));
	dt_date_limit->setDateTime(task->dateLimit());
	cb_date_limit->setChecked(task->limited());
	connect(dt_date_limit, SIGNAL(dateTimeChanged(QDateTime)), this, SLOT(noteDateLimitChanged(QDateTime)));
	connect(cb_date_limit, SIGNAL(toggled(bool)), this, SLOT(noteLimitChanged(bool)));
	//
	bool task_done = task->done();
	lb_date_1->setVisible(task_done);
	lb_date_stop->setVisible(task_done);
	cb_date_limit->setHidden(task_done);
	dt_date_limit->setHidden(task_done);
	dt_date_limit->setEnabled(task->limited());

}
void EditGroupWidget::setupModifiedTracking()
{
    // Group tab
    connect(m_mainUi->editName, SIGNAL(textChanged(QString)), SLOT(setModified()));
    connect(m_mainUi->editNotes, SIGNAL(textChanged()), SLOT(setModified()));
    connect(m_mainUi->expireCheck, SIGNAL(stateChanged(int)), SLOT(setModified()));
    connect(m_mainUi->expireDatePicker, SIGNAL(dateTimeChanged(QDateTime)), SLOT(setModified()));
    connect(m_mainUi->searchComboBox, SIGNAL(currentIndexChanged(int)), SLOT(setModified()));
    connect(m_mainUi->autotypeComboBox, SIGNAL(currentIndexChanged(int)), SLOT(setModified()));
    connect(m_mainUi->autoTypeSequenceInherit, SIGNAL(toggled(bool)), SLOT(setModified()));
    connect(m_mainUi->autoTypeSequenceCustomRadio, SIGNAL(toggled(bool)), SLOT(setModified()));
    connect(m_mainUi->autoTypeSequenceCustomEdit, SIGNAL(textChanged(QString)), SLOT(setModified()));

    // Icon tab
    connect(m_editGroupWidgetIcons, SIGNAL(widgetUpdated()), SLOT(setModified()));
}
Beispiel #25
0
KPropertyDateTimeEditor::KPropertyDateTimeEditor(const KProperty* prop, QWidget* parent)
    : QDateTimeEdit(parent)
{
    setFrame(false);
    setCalendarPopup(true);

    const QDateTime minDateTime = prop->option("min").toDateTime();
    if (minDateTime.isValid()) {
        setMinimumDateTime(minDateTime);
    }
    const QDateTime maxDateTime = prop->option("max").toDateTime();
    if (maxDateTime.isValid()) {
        setMaximumDateTime(maxDateTime);
    }

    connect(this, SIGNAL(dateTimeChanged(QDateTime)), this, SLOT(onDateTimeChanged()));
}
Beispiel #26
0
void EventsWindow::createDateFilter(QBoxLayout *layout)
{
	m_dateLabel = new QLabel;
	m_dateLabel->setStyleSheet(QLatin1String("font-weight:bold;"));
	layout->addWidget(m_dateLabel);

    QDateEdit *dateEdit = new QDateEdit(QDate::currentDate());
    dateEdit->setCalendarPopup(true);
    dateEdit->setMaximumDate(QDate::currentDate());
    dateEdit->setDisplayFormat(QLatin1String("ddd, MMM dd, yyyy"));
    dateEdit->setTime(QTime(23, 59, 59, 999));
    dateEdit->setFixedWidth(m_sourcesView->width());
    layout->addWidget(dateEdit);

    setFilterDay(dateEdit->dateTime());

    connect(dateEdit, SIGNAL(dateTimeChanged(QDateTime)), this,
            SLOT(setFilterDay(QDateTime)));
}
Beispiel #27
0
dtInspectorQt::EnvironmentView::EnvironmentView(Ui::InspectorWidget& ui)
:mUI(&ui)
{
   mFilterName = QString("dtCore::Environment");

   connect(mUI->envFogToggle, SIGNAL(stateChanged(int)), this, SLOT(OnFogToggled(int)));
   connect(mUI->envFogVisibilityEdit, SIGNAL(valueChanged(double)), this, SLOT(OnVisibilityChanged(double)));
   connect(mUI->envFogRedEdit, SIGNAL(valueChanged(double)), this, SLOT(OnFogColorChanged(double)));
   connect(mUI->envFogGreenEdit, SIGNAL(valueChanged(double)), this, SLOT(OnFogColorChanged(double)));
   connect(mUI->envFogBlueEdit, SIGNAL(valueChanged(double)), this, SLOT(OnFogColorChanged(double)));
   connect(mUI->envFogColorButton, SIGNAL(clicked()), this, SLOT(OnFogColorPickerClicked()));
   connect(mUI->envSkyRedEdit, SIGNAL(valueChanged(double)), this, SLOT(OnSkyColorChanged(double)));
   connect(mUI->envSkyGreenEdit, SIGNAL(valueChanged(double)), this, SLOT(OnSkyColorChanged(double)));
   connect(mUI->envSkyBlueEdit, SIGNAL(valueChanged(double)), this, SLOT(OnSkyColorChanged(double)));
   connect(mUI->envSkyColorButton, SIGNAL(clicked()), this, SLOT(OnSkyColorPickerClicked()));
   connect(mUI->envDateTimeEdit, SIGNAL(dateTimeChanged(QDateTime)), this, SLOT(OnDateTimeChanged(QDateTime)));
   connect(mUI->envRefLatEdit, SIGNAL(valueChanged(double)), this, SLOT(OnRefPositionChanged(double)));
   connect(mUI->envRefLongEdit, SIGNAL(valueChanged(double)), this, SLOT(OnRefPositionChanged(double)));
}
/******************************************************************************
* Called every minute to update the alarm time data entry fields.
* If the maximum date/time has been reached, a 'pastMax()' signal is emitted.
*/
void AlarmTimeWidget::updateTimes()
{
	KDateTime now;
	if (mMinDateTimeIsNow)
	{
		// Make sure that the minimum date is updated when the day changes
		now = KDateTime::currentDateTime(mTimeSpec);
		mDateEdit->setMinDate(now.date());
	}
	if (mMaxDateTime.isValid())
	{
		if (!now.isValid())
			now = KDateTime::currentDateTime(mTimeSpec);
		if (!mPastMax)
		{
			// Check whether the maximum date/time has now been reached
			if (now.date() >= mMaxDateTime.date())
			{
				// The current date has reached or has passed the maximum date
				if (now.date() > mMaxDateTime.date()
				||  (!mAnyTime && now.time() > mTimeEdit->maxTime()))
				{
					mPastMax = true;
					emit pastMax();
				}
				else if (mMinDateTimeIsNow  &&  !mMinMaxTimeSet)
				{
					// The minimum date/time tracks the clock, so set the minimum
					// and maximum times
					setMaxMinTimeIf(now);
				}
			}
		}
		setMaxDelayTime(now);
	}

	if (mAtTimeRadio->isChecked())
		dateTimeChanged();
	else
		delayTimeChanged(mDelayTimeEdit->value());
}
Beispiel #29
0
QDialog *OpenCachingPlugin::configDialog()
{
    if ( !m_configDialog ) {
        // Initializing configuration dialog
        m_configDialog = new QDialog();
        m_ui = new Ui::OpenCachingConfigWidget;
        m_ui->setupUi( m_configDialog );
        readSettings();
        connect( m_ui->m_buttonBox, SIGNAL(accepted()),
                 SLOT(writeSettings()) );
        connect( m_ui->m_buttonBox, SIGNAL(rejected()),
                 SLOT(readSettings()) );
        connect( m_ui->m_buttonBox->button( QDialogButtonBox::Reset ), SIGNAL(clicked()),
                 SLOT(restoreDefaultSettings()) );
        QPushButton *applyButton = m_ui->m_buttonBox->button( QDialogButtonBox::Apply );
        connect( applyButton, SIGNAL(clicked()),
                 SLOT(writeSettings()) );
        connect( m_ui->m_endDate, SIGNAL(dateTimeChanged(QDateTime)),
                 SLOT(validateDateRange()) );
        connect( m_ui->m_maxDifficulty, SIGNAL(valueChanged(double)),
                 SLOT(validateDifficultyRange()) );
    }
void QgsDateTimeEdit::clear()
{
  if ( mAllowNull )
  {
    displayNull();

    changed( QDateTime() );

    // emit signal of QDateTime::dateTimeChanged with an invalid date
    // anyway, using parent's signal should be avoided
    // If you consequently connect parent's dateTimeChanged signal
    // and call dateTime() afterwards there is no warranty to
    // have a proper NULL value handling
    disconnect( this, &QDateTimeEdit::dateTimeChanged, this, &QgsDateTimeEdit::changed );
    emit dateTimeChanged( QDateTime() );
    connect( this, &QDateTimeEdit::dateTimeChanged, this, &QgsDateTimeEdit::changed );

    // otherwise, NULL is not displayed in the line edit
    // this might not be the right way to do it
    clearFocus();
  }
}