コード例 #1
0
ファイル: camera.cpp プロジェクト: dthul/capture-quick
void Camera::c_setName(const QString& name) {
    if (name == m_name)
        return;
    m_name = name;
    if (m_state == CAMERA_INIT) {
        startPreview();
    }
    emit nameChanged(m_name);
}
コード例 #2
0
/*!
    \qmlproperty string Plugin::name
    \since Mobility 1.2

    This property holds the name of the plugin.
*/
void QDeclarativeGeoServiceProvider::setName(const QString &name)
{
    if (name_ == name)
        return;

    name_ = name;

    emit nameChanged(name_);
}
コード例 #3
0
ファイル: yacontactlabel.cpp プロジェクト: AlekSi/Jabbin
void YaContactLabel::setProfile(const YaProfile* profile)
{
	if (profile_ != profile) {
		profile_ = (YaProfile*)profile;
		if (profile_)
			connect(profile_, SIGNAL(nameChanged()), SLOT(update()));
		update();
	}
}
コード例 #4
0
ファイル: roomclentry.cpp プロジェクト: zhao07/leechcraft
	void RoomCLEntry::handleBookmarks (const QXmppBookmarkSet& set)
	{
		for (const auto& bm : set.conferences ())
			if (bm.jid () == RH_->GetRoomJID () && !bm.name ().isEmpty ())
			{
				emit nameChanged (bm.name ());
				break;
			}
	}
コード例 #5
0
ファイル: SoilTypeOutput.cpp プロジェクト: arkottke/strata
SoilTypeOutput::SoilTypeOutput(SoilType* soilType, OutputCatalog* catalog) :
    QObject(soilType), m_soilType(soilType), m_enabled(false)
{
    m_modulus = new NonlinearPropertyOutput(soilType->modulusModel(), catalog);

    m_modulus->setSoilName(soilType->name());
    connect(m_soilType, SIGNAL(nameChanged(QString)),
            m_modulus, SLOT(setSoilName(QString)));
    connect(m_soilType, SIGNAL(modulusModelChanged(NonlinearProperty*)),
            m_modulus, SLOT(setNonlinearProperty(NonlinearProperty*)));

    m_damping = new NonlinearPropertyOutput(soilType->dampingModel(), catalog);
    m_damping->setSoilName(soilType->name());
    connect(m_soilType, SIGNAL(nameChanged(QString)),
            m_damping, SLOT(setSoilName(QString)));
    connect(m_soilType, SIGNAL(dampingModelChanged(NonlinearProperty*)),
            m_damping, SLOT(setNonlinearProperty(NonlinearProperty*)));
}
コード例 #6
0
ファイル: newproject.cpp プロジェクト: jmbp77umkc/propside
/*
 * Path is not saved in linux without installer - added workspace to properties dialog.
 */
NewProject::NewProject(QWidget *parent) : QDialog(parent)
{
    mypath = getCurrentPath();
    path = new QLineEdit(mypath,this);
    path->setToolTip(tr("Directory for new project."));

    QPushButton *btnBrowsePath = new QPushButton(this);
    btnBrowsePath->setText(tr("Browse"));

    name = new QLineEdit(this);
    name->setToolTip(tr("New project name and sub-directory."));
    connect(name,SIGNAL(textChanged(QString)),this,SLOT(nameChanged()));

    path->setText(mypath+name->text());
    QLabel *pathLabel = new QLabel(tr("Workspace"));
    QLabel *nameLabel = new QLabel(tr("Project Name"));

    QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
    connect(btnBrowsePath, SIGNAL(clicked()), this, SLOT(browsePath()));
    connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
    connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));

    okButton = (QPushButton*) buttonBox->buttons().at(0);
    cancelButton = (QPushButton*) buttonBox->buttons().at(1);
    if(okButton->text().contains("cancel",Qt::CaseInsensitive)) {
        okButton = (QPushButton*) buttonBox->buttons().at(1);
        cancelButton = (QPushButton*) buttonBox->buttons().at(1);
    }

    QLabel *create = new QLabel(this);
    create->setText(tr("Creating a new project:"));
    create->setFont(QFont(this->font().family(),this->font().pointSize()*1.5,QFont::Bold));
    QLabel *inst = new QLabel(this);
    inst->setText(tr(" 1) Choose project workspace.\n 2) Set project name.\n\n" \
            "A project folder with project name will be created in the workspace.\n" \
            "The new folder will have a main .c file and a .side project file.\n"));

    QVBoxLayout *blay = new QVBoxLayout(this);
    QGridLayout *layout = new QGridLayout();
    layout->addWidget(path,0,1,1,1); // tab order for widgets is according to add order
    layout->addWidget(name,1,1,1,1);
    layout->addWidget(btnBrowsePath,0,2,1,1);
    layout->addWidget(nameLabel,1,0,1,1);
    layout->addWidget(pathLabel,0,0,1,1);

    blay->addWidget(create);
    blay->addWidget(inst);
    blay->addLayout(layout);
    blay->addWidget(new QLabel(this));
    blay->addWidget(buttonBox);
    setLayout(blay);
    buttonBox->setFocus();

    int fontSize = path->fontInfo().pixelSize();
    setMinimumWidth(mypath.length()*fontSize+100);
    setWindowFlags(Qt::Tool);
}
コード例 #7
0
ファイル: playerlistmodel.cpp プロジェクト: vos/planetattack
int PlayerListModel::addPlayer(Player *player)
{
    int index = m_playerList.count();
    beginInsertRows(QModelIndex(), index, index);
    m_playerList.append(player);
    endInsertRows();
    connect(player, SIGNAL(nameChanged(QString,QString)), SLOT(player_nameChanged(QString,QString)));
    return index;
}
コード例 #8
0
ファイル: pricelist.cpp プロジェクト: mickele77/qcost
void PriceList::setName(const QString &value) {
    if( m_d->name != value ){
        m_d->name = value;
        emit nameChanged( m_d->name );
        if( m_parentItem ){
            m_parentItem->setDataChanged( 0, this );
        }
    }
}
コード例 #9
0
ファイル: vcontact.cpp プロジェクト: dganic/qutim
void VContact::setContactName(const QString& name)
{
	Q_D(VContact);
	if (d->name != name) {
		QString previous = d->name;
		d->name = name;
		emit nameChanged(name, previous);
	}
}
コード例 #10
0
ファイル: FoursquareItem.cpp プロジェクト: ashish173/marble
void FoursquareItem::setName(const QString& name)
{
    if( name != m_name ) {
        m_name = name;
        QFontMetrics const fontMetrics( s_font );
        setSize( QSizeF( fontMetrics.width( m_name ) + 10, fontMetrics.height() + 10 ) );
        emit nameChanged();
    }
}
コード例 #11
0
QString CDoodUserDataManage::setName(const QString &data)
{
    if(mName == data) {
        return data;
    }
    mName = data;
    emit nameChanged();
    return mName;
}
コード例 #12
0
ファイル: jcontact.cpp プロジェクト: reindeer/qutim
void JContact::setContactName(const QString &name)
{
	Q_D(JContact);
	if (d->name == name)
		return;
	QString previous = d->name;
	d->name = name;
	emit nameChanged(name, previous);
}
コード例 #13
0
void IQGameObject::setName(const QString &name)
{
    if (_name != name)
    {
        _name = name;

        emit nameChanged();
    }
}
コード例 #14
0
ファイル: function.cpp プロジェクト: puryearn/qlcplus
void Function::setName(const QString& name)
{
    if (m_name == name)
        return;

    m_name = QString(name);

    emit nameChanged(m_id);
}
コード例 #15
0
void InstrumentTrackWindow::modelChanged()
{
	m_track = castModel<InstrumentTrack>();

	m_nameLineEdit->setText( m_track->name() );

	m_track->disconnect( SIGNAL( nameChanged() ), this );
	m_track->disconnect( SIGNAL( instrumentChanged() ), this );

	connect( m_track, SIGNAL( nameChanged() ),
			this, SLOT( updateName() ) );
	connect( m_track, SIGNAL( instrumentChanged() ),
			this, SLOT( updateInstrumentView() ) );

	m_volumeKnob->setModel( &m_track->m_volumeModel );
	m_panningKnob->setModel( &m_track->m_panningModel );
	m_effectChannelNumber->setModel( &m_track->m_effectChannelModel );
	m_pianoView->setModel( &m_track->m_piano );

	if( m_track->instrument() && m_track->instrument()->flags().testFlag( Instrument::IsNotBendable ) == false )
	{
		m_pitchKnob->setModel( &m_track->m_pitchModel );
		m_pitchRangeSpinBox->setModel( &m_track->m_pitchRangeModel );
		m_pitchKnob->show();
		m_pitchLabel->show();
		m_pitchRangeSpinBox->show();
		m_pitchRangeLabel->show();
	}
	else
	{
		m_pitchKnob->hide();
		m_pitchLabel->hide();
		m_pitchKnob->setModel( NULL );
		m_pitchRangeSpinBox->hide();
		m_pitchRangeLabel->hide();
	}

	m_ssView->setModel( &m_track->m_soundShaping );
	m_noteStackingView->setModel( &m_track->m_noteStacking );
	m_arpeggioView->setModel( &m_track->m_arpeggio );
	m_midiView->setModel( &m_track->m_midiPort );
	m_effectView->setModel( m_track->m_audioPort.effects() );
	updateName();
}
コード例 #16
0
ファイル: input_manager.cpp プロジェクト: Kubink/vlc
/* delete Input if it ever existed.
   Delete the callbacls on input
   p_input is released once here */
void InputManager::delInput()
{
    if( !p_input ) return;
    msg_Dbg( p_intf, "IM: Deleting the input" );

    /* Save time / position */
    float f_pos = var_GetFloat( p_input , "position" );
    int64_t i_time = var_GetTime( p_input, "time");
    int i_length = var_GetTime( p_input , "length" ) / CLOCK_FREQ;
    if( f_pos < 0.05 || f_pos > 0.95 || i_length < 60) {
        i_time = -1;
    }
    RecentsMRL::getInstance( p_intf )->setTime( p_item->psz_uri, i_time );

    delCallbacks();
    i_old_playing_status = END_S;
    p_item               = NULL;
    oldName              = "";
    artUrl               = "";
    b_video              = false;
    timeA                = 0;
    timeB                = 0;
    f_rate               = 0. ;

    if( p_input_vbi )
    {
        vlc_object_release( p_input_vbi );
        p_input_vbi = NULL;
    }

    vlc_object_release( p_input );
    p_input = NULL;

    emit positionUpdated( -1.0, 0 ,0 );
    emit rateChanged( var_InheritFloat( p_intf, "rate" ) );
    emit nameChanged( "" );
    emit chapterChanged( 0 );
    emit titleChanged( 0 );
    emit playingStatusChanged( END_S );

    emit teletextPossible( false );
    emit AtoBchanged( false, false );
    emit voutChanged( false );
    emit voutListChanged( NULL, 0 );

    /* Reset all InfoPanels but stats */
    emit artChanged( NULL );
    emit artChanged( "" );
    emit infoChanged( NULL );
    emit currentMetaChanged( (input_item_t *)NULL );

    emit encryptionChanged( false );
    emit recordingStateChanged( false );

    emit cachingChanged( 1 );
}
コード例 #17
0
ファイル: qgsnewnamedialog.cpp プロジェクト: CS-SI/QGIS
QgsNewNameDialog::QgsNewNameDialog( const QString &source, const QString &initial,
                                    const QStringList &extensions, const QStringList &existing,
                                    const QRegExp &regexp, Qt::CaseSensitivity cs,
                                    QWidget *parent, Qt::WindowFlags flags )
  : QgsDialog( parent, flags, QDialogButtonBox::Ok | QDialogButtonBox::Cancel )
  , mExiting( existing )
  , mExtensions( extensions )
  , mCaseSensitivity( cs )
  , mRegexp( regexp )
{
  setWindowTitle( tr( "New Name" ) );
  QgsDialog::layout()->setSizeConstraint( QLayout::SetMinimumSize );
  layout()->setSizeConstraint( QLayout::SetMinimumSize );
  layout()->setSpacing( 6 );
  mOkString = buttonBox()->button( QDialogButtonBox::Ok )->text();
  QString hintString;
  QString nameDesc = mExtensions.isEmpty() ? tr( "name" ) : tr( "base name" );
  if ( source.isEmpty() )
  {
    hintString = tr( "Enter new %1" ).arg( nameDesc );
  }
  else
  {
    hintString = tr( "Enter new %1 for %2" ).arg( nameDesc, source );
  }
  mHintLabel = new QLabel( hintString, this );
  layout()->addWidget( mHintLabel );

  mLineEdit = new QLineEdit( initial, this );
  if ( !regexp.isEmpty() )
  {
    QRegExpValidator *validator = new QRegExpValidator( regexp, this );
    mLineEdit->setValidator( validator );
  }
  mLineEdit->setMinimumWidth( mLineEdit->fontMetrics().width( QStringLiteral( "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" ) ) );
  connect( mLineEdit, &QLineEdit::textChanged, this, &QgsNewNameDialog::nameChanged );
  layout()->addWidget( mLineEdit );

  mNamesLabel = new QLabel( QStringLiteral( " " ), this );
  mNamesLabel->setSizePolicy( QSizePolicy::Minimum, QSizePolicy::Minimum );
  if ( !mExtensions.isEmpty() )
  {
    mNamesLabel->setWordWrap( true );
    layout()->addWidget( mNamesLabel );
  }

  mErrorLabel = new QLabel( QStringLiteral( " " ), this );
  mErrorLabel->setSizePolicy( QSizePolicy::Minimum, QSizePolicy::Minimum );
  mErrorLabel->setWordWrap( true );
  layout()->addWidget( mErrorLabel );

  mLineEdit->setFocus();
  mLineEdit->selectAll();

  nameChanged();
}
コード例 #18
0
    void testQOfonoVoiceCall()
    {
        QSignalSpy dialreg(m,SIGNAL(dialComplete(bool)));
        QSignalSpy dspy(m, SIGNAL(callAdded(QString)));

        // Dial and hangup
        m->dial("123","");
        QTest::qWait(1000);

        QCOMPARE(dialreg.count(), 1);
        QCOMPARE(dialreg.takeFirst().at(0).toBool(),true);
        QCOMPARE(dspy.count(), 1);
        QString callid = dspy.takeFirst().at(0).toString();

        QOfonoVoiceCall* call = new QOfonoVoiceCall(this);
        call->setVoiceCallPath(callid);
        QTRY_VERIFY(call->isValid());

        QSignalSpy state(call, SIGNAL(stateChanged(QString)));
        QSignalSpy discreason(call,SIGNAL(disconnectReason(QString)));
        QSignalSpy hspy(call, SIGNAL(hangupComplete(bool)));
        QSignalSpy li (call, SIGNAL(lineIdentificationChanged(QString)));
        QSignalSpy name (call, SIGNAL(nameChanged(QString)));
        QSignalSpy info (call, SIGNAL(informationChanged(QString)));
        QSignalSpy mp (call, SIGNAL(multipartyChanged(bool)));
        QSignalSpy em (call, SIGNAL(emergencyChanged(bool)));
        QSignalSpy st (call, SIGNAL(startTimeChanged(QString)));
        QSignalSpy ic (call, SIGNAL(iconChanged(quint8)));

        qDebug() << "Please find a call in 'Dialing' state in phonesim window and press 'Active' button";
        QTest::qWait(15000);

        QVERIFY(state.count()>0);
        QVERIFY(st.count()>0);
        QVERIFY(ic.count()==0);
        QVERIFY(em.count()==0);
        QVERIFY(mp.count()==0);
        QVERIFY(info.count()==0);
        QVERIFY(name.count()==0);
        QVERIFY(li.count()==0);

        QCOMPARE(call->state(),QString("active"));
        QCOMPARE(call->lineIdentification(),QString("123"));
        QCOMPARE(call->emergency(),false);
        QCOMPARE(call->multiparty(),false);
        QCOMPARE(call->name(),QString(""));
        QCOMPARE(call->information(),QString(""));

        call->hangup();
        QTest::qWait(5000);
        QCOMPARE(hspy.count(), 1);
        QCOMPARE(hspy.takeFirst().at(0).toBool(),true);
        QCOMPARE(discreason.count(), 1);
        QCOMPARE(discreason.takeFirst().at(0).toString(), QString("local"));
        delete call;
    }
コード例 #19
0
ファイル: editor.cpp プロジェクト: Guiguiprim/SvgCompositor
Editor::Editor(QWidget *parent)
  :  QWidget(parent)
  , _view(NULL)
  , _buttonBar(NULL)
  , _xmlPreview(NULL)
  , _assembly(NULL)
  , _viewController(NULL)
  , _editorController(NULL)
  , _buttonBarController(NULL)
{
  qRegisterMetaType<ItemMove>("ItemMove");
  qRegisterMetaType<ItemsMove>("ItemsMove");

  // Widgets
  _view = new GraphicsView;

  _buttonBar = new ButtonBar;
  _buttonBar->setEnabled(false);

  _xmlPreview = new QTextEdit;
  _xmlPreview->setReadOnly(true);

  QVBoxLayout* vLyt = new QVBoxLayout(this);
  vLyt->setMargin(0);
  vLyt->setSpacing(1);
  vLyt->addWidget(_view, 4);
  vLyt->addWidget(_buttonBar);
  vLyt->addWidget(_xmlPreview, 1);

  // Controllers
  _viewController = new ViewController(_view, this);

  _buttonBarController = new ButtonBarController(_buttonBar, this);
  connect(_viewController, SIGNAL(selectionChanged(int)),
          _buttonBarController, SLOT(onSelectionChanged(int)));

  _editorController = new EditorController(this);
  connect(_viewController, SIGNAL(elementsMoved(ItemsMove)),
          _editorController, SLOT(onElementsMoved(ItemsMove)));
  connect(_buttonBarController, SIGNAL(actionTriggered(int,Action)),
          _editorController, SLOT(onAction(int,Action)));
  connect(_buttonBarController, SIGNAL(actionValueTriggered(int,Action,qreal)),
          _editorController, SLOT(onActionValue(int,Action,qreal)));
  connect(_buttonBarController, SIGNAL(nameChanged(QString)),
          _editorController, SLOT(onNameEdited(QString)));

  QAction* redoAction = _editorController->undoStack()->createRedoAction(this);
  redoAction->setShortcut(QKeySequence::Redo);
  redoAction->setShortcutContext(Qt::WidgetWithChildrenShortcut);
  this->addAction(redoAction);

  QAction* undoAction = _editorController->undoStack()->createUndoAction(this);
  undoAction->setShortcut(QKeySequence::Undo);
  undoAction->setShortcutContext(Qt::WidgetWithChildrenShortcut);
  this->addAction(undoAction);
}
コード例 #20
0
void TourDuMondeDocument::setName(const QString &name)
{
    if (m_name == name)
    {
        return;
    }

    m_name = name;
    emit nameChanged(name);
}
コード例 #21
0
// --- Events ---------------------------------------------------- //
void MoleculeWatcher::moleculeChanged(const Molecule *molecule, Molecule::ChangeType changeType)
{
    switch(changeType){
        case Molecule::NameChanged:
            Q_EMIT nameChanged(molecule);
            break;
        default:
            break;
    }
}
コード例 #22
0
ファイル: netsignal.cpp プロジェクト: LibrePCB/LibrePCB
void NetSignal::setName(const CircuitIdentifier& name,
                        bool                     isAutoName) noexcept {
  if ((name == mName) && (isAutoName == mHasAutoName)) {
    return;
  }
  mName        = name;
  mHasAutoName = isAutoName;
  updateErcMessages();
  emit nameChanged(mName);
}
コード例 #23
0
void CoverConnector::setName(const QString &nName)
{
    if (nName != m_name) {
        m_name = nName;
#ifdef QT_DEBUG
        qDebug() << "Changed name to" << m_name;
#endif
        emit nameChanged(name());
    }
}
コード例 #24
0
void TechnologyModel::setName(const QString &name)
{
    if (m_techname == name || name.isEmpty()) {
        return;
    }
    m_techname = name;
    Q_EMIT nameChanged(m_techname);

    updateTechnologies();
}
コード例 #25
0
AbstractXmlItemObject * FilesModel::newItem()
{
    File *newItem = new File(this);
    connect(newItem, SIGNAL(idChanged()), this, SLOT(itemDataChanged()));
    connect(newItem, SIGNAL(additionalDataChanged()), this, SLOT(itemDataChanged()));

    connect(newItem, SIGNAL(pathChanged()), this, SLOT(itemDataChanged()));
    connect(newItem, SIGNAL(nameChanged()), this, SLOT(itemDataChanged()));
    return newItem;
}
コード例 #26
0
void SingleRole::setName(const QString& name)
{
    if (m_name == name)
        return;

    Q_EMIT namesAboutToBeChanged();
    m_name = name;
    Q_EMIT nameChanged();
    Q_EMIT namesChanged();
}
コード例 #27
0
void Container::setName(QString n)
{
    if(n != name())
    {
        _items[this] = n;
        if(_acums.contains(this))
            _acums[this] = n;
        emit nameChanged(this);
    }
}
コード例 #28
0
AbstractXmlItemObject * FoldersModel::newItem()
{
    Folder *newItem = new Folder(this);
    connect(newItem, SIGNAL(idChanged()), this, SLOT(itemDataChanged()));
    connect(newItem, SIGNAL(additionalDataChanged()), this, SLOT(itemDataChanged()));

    connect(newItem, SIGNAL(nameChanged()), this, SLOT(itemDataChanged()));
    newItem->filesModel()->setItemAdditionalData(m_fileAdditionalData);
    return newItem;
}
コード例 #29
0
void QDeclarativeFontLoader::setName(const QString &name)
{
    Q_D(QDeclarativeFontLoader);
    if (d->name == name )
        return;
    d->name = name;
    emit nameChanged();
    d->status = Ready;
    emit statusChanged();
}
コード例 #30
0
ファイル: tag.cpp プロジェクト: dfaure/flow-pomodoro
void Tag::setName(const QString &name)
{
    Q_ASSERT(!m_isFake);
    if (name.trimmed().toLower() != m_name.toLower() && !name.isEmpty()) {
        m_name = name.trimmed(); // We preserve original case
        if (!m_dontUpdateRevision)
            m_revision++;
        emit nameChanged();
    }
}