CustomWidgetEditor::CustomWidgetEditor( QWidget *parent, MainWindow *mw )
    : CustomWidgetEditorBase( parent, 0, TRUE ), mainWindow( mw )
{
    connect( helpButton, SIGNAL( clicked() ), MainWindow::self, SLOT( showDialogHelp() ) );
    checkTimer = new QTimer( this );
    connect( checkTimer, SIGNAL( timeout() ),
	     this, SLOT( checkWidgetName() ) );

    editClass->setEnabled( FALSE );
    editHeader->setEnabled( FALSE );
    buttonChooseHeader->setEnabled( FALSE );
    buttonChoosePixmap->setEnabled( FALSE );
    spinWidth->setEnabled( FALSE );
    spinHeight->setEnabled( FALSE );
    sizeHor->setEnabled( FALSE );
    sizeVer->setEnabled( FALSE );
    checkContainer->setEnabled( FALSE );
    localGlobalCombo->setEnabled( FALSE );
    editClass->setValidator( new AsciiValidator( QString(":"), editClass ) );
    editSignal->setValidator( new AsciiValidator( TRUE, editSignal ) );
    editSlot->setValidator( new AsciiValidator( TRUE, editSignal ) );
    editProperty->setValidator( new AsciiValidator( editSignal ) );
    editSignal->setEnabled( FALSE );
    buttonRemoveSignal->setEnabled( FALSE );

    setupDefinition();
    setupSignals();
    setupSlots();
    setupProperties();
}
void CustomWidgetEditor::loadDescription()
{
    QString fn = KFileDialog::getOpenFileName( QString::null, i18n( "*.cw|Custom-Widget Description\n*|All Files" ), this );
    if ( fn.isEmpty() )
	return;

    QFile f( fn );
    if ( !f.open( IO_ReadOnly ) )
	return;

    QDomDocument doc;
    QString errMsg;
    int errLine;
    if ( !doc.setContent( &f, &errMsg, &errLine ) ) {
	qDebug( QString("Parse error: ") + errMsg + QString(" in line %d"), errLine );
	return;
    }

    QDomElement firstWidget = doc.firstChild().toElement().firstChild().toElement();

    while ( firstWidget.tagName() != "customwidgets" )
	firstWidget = firstWidget.nextSibling().toElement();

    Resource::loadCustomWidgets( firstWidget, 0 );
    boxWidgets->clear();
    setupDefinition();
    setupSignals();
    setupSlots();
    setupProperties();
}
LabelItemDialog::LabelItemDialog(LabelItem *item, QWidget *parent)
    : ViewItemDialog(item, parent), _labelItem(item) {

  _propertiesTab = new LabelPropertiesTab(this);
  DialogPage *propertiesPage = new DialogPage(this);
  propertiesPage->setPageTitle(tr("Properties"));
  propertiesPage->addDialogTab(_propertiesTab);
  addDialogPage(propertiesPage);
  selectDialogPage(propertiesPage);
  connect(_propertiesTab, SIGNAL(apply()), this, SLOT(propertiesChanged()));

  setupProperties();
  _saveAsDefault->show();

  _labelDimensionsTab = new LabelDimensionsTab(item, this);

  DialogPage *labelDimensionsPage = new DialogPage(this);
  labelDimensionsPage->setPageTitle(tr("Size/Position"));
  labelDimensionsPage->addDialogTab(_labelDimensionsTab);
  addDialogPage(labelDimensionsPage);
  selectDialogPage(labelDimensionsPage);

  connect(_labelDimensionsTab, SIGNAL(apply()), this, SLOT(dimensionsChanged()));

  setupDimensions();

  connect(_labelDimensionsTab, SIGNAL(tabModified()), this, SLOT(modified()));
  connect(_saveAsDefault, SIGNAL(clicked()), this, SLOT(modified()));

}
void QtMaterialTextFieldStateMachine::setLabel(QtMaterialTextFieldLabel *label)
{
    if (m_label) {
        delete m_label;
    }

    if (m_offsetAnimation) {
        removeDefaultAnimation(m_offsetAnimation);
        delete m_offsetAnimation;
    }

    if (m_colorAnimation) {
        removeDefaultAnimation(m_colorAnimation);
        delete m_colorAnimation;
    }

    m_label = label;

    if (m_label)
    {
        m_offsetAnimation = new QPropertyAnimation(m_label, "offset", this);
        m_offsetAnimation->setDuration(210);
        m_offsetAnimation->setEasingCurve(QEasingCurve::OutCubic);
        addDefaultAnimation(m_offsetAnimation);

        m_colorAnimation = new QPropertyAnimation(m_label, "color", this);
        m_colorAnimation->setDuration(210);
        addDefaultAnimation(m_colorAnimation);
    }

    setupProperties();
}
Пример #5
0
EditEntryWidget::EditEntryWidget(QWidget* parent)
    : EditWidget(parent)
    , m_entry(Q_NULLPTR)
    , m_mainUi(new Ui::EditEntryWidgetMain())
    , m_advancedUi(new Ui::EditEntryWidgetAdvanced())
    , m_autoTypeUi(new Ui::EditEntryWidgetAutoType())
    , m_historyUi(new Ui::EditEntryWidgetHistory())
    , m_mainWidget(new QWidget())
    , m_advancedWidget(new QWidget())
    , m_iconsWidget(new EditWidgetIcons())
    , m_autoTypeWidget(new QWidget())
    , m_editWidgetProperties(new EditWidgetProperties())
    , m_historyWidget(new QWidget())
    , m_entryAttachments(new EntryAttachments(this))
    , m_attachmentsModel(new EntryAttachmentsModel(m_advancedWidget))
    , m_entryAttributes(new EntryAttributes(this))
    , m_attributesModel(new EntryAttributesModel(m_advancedWidget))
    , m_historyModel(new EntryHistoryModel(this))
    , m_sortModel(new QSortFilterProxyModel(this))
    , m_autoTypeAssoc(new AutoTypeAssociations(this))
    , m_autoTypeAssocModel(new AutoTypeAssociationsModel(this))
    , m_autoTypeDefaultSequenceGroup(new QButtonGroup(this))
    , m_autoTypeWindowSequenceGroup(new QButtonGroup(this))
{
    setupMain();
    setupAdvanced();
    setupIcon();
    setupAutoType();
    setupProperties();
    setupHistory();

    connect(this, SIGNAL(accepted()), SLOT(saveEntry()));
    connect(this, SIGNAL(rejected()), SLOT(cancel()));
}
Пример #6
0
void KileWidgetPreviewConfig::readConfig(void)
{
	setupSeparateWindow();
	setupBottomBar();
	setupProperties();

	updateConversionTools();
}
QtMaterialTextFieldStateMachine::QtMaterialTextFieldStateMachine(QtMaterialTextField *parent)
    : QStateMachine(parent),
      m_textField(parent),
      m_normalState(new QState),
      m_focusedState(new QState),
      m_label(0),
      m_offsetAnimation(0),
      m_colorAnimation(0),
      m_progress(0.0)
{
    Q_ASSERT(parent);

    addState(m_normalState);
    addState(m_focusedState);

    setInitialState(m_normalState);

    QEventTransition *transition;
    QPropertyAnimation *animation;

    transition = new QEventTransition(parent, QEvent::FocusIn);
    transition->setTargetState(m_focusedState);
    m_normalState->addTransition(transition);

    animation = new QPropertyAnimation(this, "progress", this);
    animation->setEasingCurve(QEasingCurve::InCubic);
    animation->setDuration(310);
    transition->addAnimation(animation);

    transition = new QEventTransition(parent, QEvent::FocusOut);
    transition->setTargetState(m_normalState);
    m_focusedState->addTransition(transition);

    animation = new QPropertyAnimation(this, "progress", this);
    animation->setEasingCurve(QEasingCurve::OutCubic);
    animation->setDuration(310);
    transition->addAnimation(animation);

    m_normalState->assignProperty(this, "progress", 0);
    m_focusedState->assignProperty(this, "progress", 1);

    setupProperties();

    connect(m_textField, SIGNAL(textChanged(QString)), this, SLOT(setupProperties()));
}
Пример #8
0
QtVariantProperty *TreeWidgetEditor::setupPropertyGroup(const QString &title, PropertyDefinition *propDefs)
{
    setupProperties(propDefs);
    QtVariantProperty *groupProp = m_propertyManager->addProperty(QtVariantPropertyManager::groupTypeId(), title);
    foreach (QtVariantProperty *prop, m_rootProperties)
        groupProp->addSubProperty(prop);
    m_rootProperties.clear();
    return groupProp;
}
TTKStyleSlider::TTKStyleSlider(QWidget *parent)
    : QSlider(parent)
{
    m_handleColor = QColor("#FFFEA1");
    m_backgroundColor = QColor("#4E4F4F");
    m_foregroundColor = QColor("#FFFEA1;");

    setupProperties();
}
void CustomWidgetEditor::currentWidgetChanged( QListBoxItem *i )
{
    checkTimer->stop();
    checkWidgetName();

    MetaDataBase::CustomWidget *w = findWidget( i );
    if ( !i || !w ) {
	buttonChooseHeader->setEnabled( FALSE );
	editClass->setEnabled( FALSE );
	editHeader->setEnabled( FALSE );
	buttonChoosePixmap->setEnabled( FALSE );
	spinWidth->setEnabled( FALSE );
	spinHeight->setEnabled( FALSE );
	localGlobalCombo->setEnabled( FALSE );
	sizeHor->setEnabled( FALSE );
	sizeVer->setEnabled( FALSE );
	checkContainer->setEnabled( FALSE );
	return;
    }

    buttonChooseHeader->setEnabled( TRUE );
    editClass->setEnabled( TRUE );
    editHeader->setEnabled( TRUE );
    buttonChoosePixmap->setEnabled( TRUE );
    spinWidth->setEnabled( TRUE );
    spinHeight->setEnabled( TRUE );
    localGlobalCombo->setEnabled( TRUE );
    sizeHor->setEnabled( TRUE );
    sizeVer->setEnabled( TRUE );
    checkContainer->setEnabled( TRUE );

    editClass->blockSignals( TRUE );
    editClass->setText( w->className );
    editClass->blockSignals( FALSE );
    editHeader->setText( w->includeFile );
    localGlobalCombo->setCurrentItem( (int)w->includePolicy );
    if ( w->pixmap )
	previewPixmap->setPixmap( *w->pixmap );
    else
	previewPixmap->setText( "" );
    spinWidth->setValue( w->sizeHint.width() );
    spinHeight->setValue( w->sizeHint.height() );
    sizeHor->setCurrentItem( size_type_to_int( w->sizePolicy.horData() ) );
    sizeVer->setCurrentItem( size_type_to_int( w->sizePolicy.verData() ) );
    checkContainer->setChecked( w->isContainer );

    setupSignals();
    setupSlots();
    setupProperties();
}
Пример #11
0
	void CPropBrowserCtrl::onSelectionChanged( std::string &id )
	{
		if( browser == NULL )
			return;

		disconnect( propertyMgr, SIGNAL( propertyChanged( QtProperty* ) ),
			this, SLOT( onPropertyChanged( QtProperty* ) ) );

		browser->clear();

		CInterfaceElement *e = CWidgetManager::getInstance()->getElementFromId( id );
		if( e == NULL )
			return;

		currentElement = id;

        std::string n = e->getClassName();

        setupProperties( n, e );
		connect( propertyMgr, SIGNAL( propertyChanged( QtProperty* ) ),
			this, SLOT( onPropertyChanged( QtProperty* ) ) );
	}
void TTKStyleSlider::setOrientation(Qt::Orientation orientation)
{
    QSlider::setOrientation(orientation);
    setupProperties();
}
void TTKStyleSlider::setForegroundColor(const QColor &color)
{
    m_foregroundColor = color;
    setupProperties();
}
void TTKStyleSlider::setHandleColor(const QColor &color)
{
    m_handleColor = color;
    setupProperties();
}
Пример #15
0
 Send::Send()
   : OperatorKernel(TYPE, PACKAGE, VERSION, setupParameters(), setupProperties()),
     m_port(MIN_PORT),
     m_server(0)
 {
 }
void TTKStyleSlider::setBackgroundColor(const QColor &color)
{
    m_backgroundColor = color;
    setupProperties();
}
Пример #17
0
void AbstractItemEditor::setupEditor(QWidget *object, PropertyDefinition *propList)
{
    setupProperties(propList);
    setupObject(object);
}
Пример #18
0
 WriteGpio::WriteGpio()
 : OperatorKernel(TYPE, PACKAGE, VERSION, setupInputs(), setupOutputs(),
                  setupParameters(), setupProperties())
 {
 }