// Constructor. qtractorTempoSpinBox::qtractorTempoSpinBox ( QWidget *pParent ) : QAbstractSpinBox(pParent), m_fTempo(120.0f), m_iBeatsPerBar(4), m_iBeatDivisor(2), m_iValueChanged(0) { QAbstractSpinBox::setAccelerated(true); QObject::connect(this, SIGNAL(editingFinished()), SLOT(editingFinishedSlot())); QObject::connect(QAbstractSpinBox::lineEdit(), SIGNAL(textChanged(const QString&)), SLOT(valueChangedSlot(const QString&))); }
// Constructor. qtractorTimeSpinBox::qtractorTimeSpinBox ( QWidget *pParent ) : QAbstractSpinBox(pParent), m_pTimeScale(NULL), m_displayFormat(qtractorTimeScale::Frames), m_iValue(0), m_iMinimumValue(0), m_iMaximumValue(0), m_iDeltaValue(0), m_bDeltaValue(false), m_iValueChanged(0) { QAbstractSpinBox::setAccelerated(true); QObject::connect(this, SIGNAL(editingFinished()), SLOT(editingFinishedSlot())); QObject::connect(QAbstractSpinBox::lineEdit(), SIGNAL(textChanged(const QString&)), SLOT(valueChangedSlot(const QString&))); }
GLineEdit::GLineEdit(QWidget *parent,VM *pVM) : QLineEdit(parent) { this->pVM = pVM; strcpy(this->cTextChangedEvent,""); strcpy(this->ccursorPositionChangedEvent,""); strcpy(this->ceditingFinishedEvent,""); strcpy(this->creturnPressedEvent,""); strcpy(this->cselectionChangedEvent,""); strcpy(this->ctextEditedEvent,""); QObject::connect(this, SIGNAL(textChanged(QString)),this, SLOT(textChangedSlot())); QObject::connect(this, SIGNAL(cursorPositionChanged(int,int)),this, SLOT(cursorPositionChangedSlot())); QObject::connect(this, SIGNAL(editingFinished()),this, SLOT(editingFinishedSlot())); QObject::connect(this, SIGNAL(returnPressed()),this, SLOT(returnPressedSlot())); QObject::connect(this, SIGNAL(selectionChanged()),this, SLOT(selectionChangedSlot())); QObject::connect(this, SIGNAL(textEdited(QString)),this, SLOT(textEditedSlot())); }
DateFormWidget::DateFormWidget(QWidget *parent) : AbstractFormWidget(parent) { m_fieldNameLabel = new QLabel("Invalid Name", this); m_dateTimeEdit = new QDateTimeEdit(this); m_dateTimeEdit->setMinimumDate(QDate(100, 1, 1)); m_mainLayout = new QVBoxLayout(this); m_lastValidDateTime = new QDateTime(); //static styling m_fieldNameLabel->setStyleSheet("QLabel {color: gray;}"); QColor c = PlatformColorService::getHighlightColor(); QString style; //generate style style.append( "QDateTimeEdit {" "border-radius: 7px;" "padding: 5px;" "border: 2px solid lightgray;" "}" ); style.append(QString( "QDateTimeEdit:focus { " "border: 2px solid rgb(%1, %2, %3);}") .arg(c.red()).arg(c.green()).arg(c.blue())); m_dateTimeEdit->setStyleSheet(style); //on mac disable focus rect around rounded borders m_dateTimeEdit->setAttribute(Qt::WA_MacShowFocusRect, 0); m_mainLayout->addWidget(m_fieldNameLabel); m_mainLayout->addWidget(m_dateTimeEdit); m_mainLayout->addStretch(); this->heightUnits = 1; this->widthUnits = 1; //connections connect(m_dateTimeEdit, SIGNAL(editingFinished()), this, SLOT(editingFinishedSlot())); setupFocusPolicy(); }
FLineEdit::FLineEdit(QWidget * parent) : QLineEdit(parent) { editingFinishedSlot(); connect(this, SIGNAL(editingFinished()), this, SLOT(editingFinishedSlot())); }