当前位置: 首页>>代码示例>>C++>>正文


C++ Ptr::name方法代码示例

本文整理汇总了C++中profile::Ptr::name方法的典型用法代码示例。如果您正苦于以下问题:C++ Ptr::name方法的具体用法?C++ Ptr::name怎么用?C++ Ptr::name使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在profile::Ptr的用法示例。


在下文中一共展示了Ptr::name方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: profileLabel

QString ProfilePlotView::profileLabel(Profile::Ptr profile)
{
	if (profile->name())
		return QString::fromStdString(profile->name().get());

	if (profile->computer())
	{
		if (profile->computer()->name())
			return QString::fromStdString(profile->computer()->name().get());

		if (profile->computer()->model())
		{
			if (profile->computer()->manufacturer())
			{
				return QString("%1 %2")
					.arg(QString::fromStdString(profile->computer()->manufacturer().get()))
					.arg(QString::fromStdString(profile->computer()->model().get()));
			}
			else
			{
				return QString::fromStdString(profile->computer()->model().get());
			}
		}
	}

	return "Unknown Profile";
}
开发者ID:asymworks,项目名称:benthos-app,代码行数:27,代码来源:profile_plot.cpp

示例2: updateAction

void ProfileList::updateAction(QAction* action , Profile::Ptr info)
{
    Q_ASSERT(action);
    Q_ASSERT(info);

    action->setText(info->name());
    action->setIcon(KIcon(info->icon()));
}
开发者ID:ktuan89,项目名称:konsole-4.8.5,代码行数:8,代码来源:ProfileList.cpp

示例3: setupGeneralPage

void EditProfileDialog::setupGeneralPage(const Profile::Ptr info)
{

    // basic profile options
    _ui->profileNameEdit->setText( info->name() );

    ShellCommand command( info->command() , info->arguments() );
    _ui->commandEdit->setText( command.fullCommand() );

    KUrlCompletion* exeCompletion = new KUrlCompletion(KUrlCompletion::ExeCompletion);
    exeCompletion->setParent(this);
    exeCompletion->setDir(QString());
    _ui->commandEdit->setCompletionObject( exeCompletion );
    _ui->initialDirEdit->setText( info->defaultWorkingDirectory() );

    KUrlCompletion* dirCompletion = new KUrlCompletion(KUrlCompletion::DirCompletion);
    dirCompletion->setParent(this);
    _ui->initialDirEdit->setCompletionObject( dirCompletion );
    _ui->initialDirEdit->setClearButtonShown(true);
    _ui->dirSelectButton->setIcon( KIcon("folder-open") );
    _ui->iconSelectButton->setIcon( KIcon(info->icon()) );
	_ui->startInSameDirButton->setChecked(info->property<bool>(Profile::StartInCurrentSessionDir));

    // window options
    _ui->showMenuBarButton->setChecked( info->property<bool>(Profile::ShowMenuBar) );

    // signals and slots
    connect( _ui->dirSelectButton , SIGNAL(clicked()) , this , SLOT(selectInitialDir()) );
    connect( _ui->iconSelectButton , SIGNAL(clicked()) , this , SLOT(selectIcon()) );
	connect( _ui->startInSameDirButton , SIGNAL(toggled(bool)) , this , 
			SLOT(startInSameDir(bool)));
    connect( _ui->profileNameEdit , SIGNAL(textChanged(const QString&)) , this ,
            SLOT(profileNameChanged(const QString&)) );
    connect( _ui->initialDirEdit , SIGNAL(textChanged(const QString&)) , this , 
            SLOT(initialDirChanged(const QString&)) );
    connect(_ui->commandEdit , SIGNAL(textChanged(const QString&)) , this ,
            SLOT(commandChanged(const QString&)) ); 
    
    connect(_ui->showMenuBarButton , SIGNAL(toggled(bool)) , this , 
            SLOT(showMenuBar(bool)) );

    connect(_ui->environmentEditButton , SIGNAL(clicked()) , this , 
            SLOT(showEnvironmentEditor()) );
}
开发者ID:Maijin,项目名称:konsole,代码行数:44,代码来源:EditProfileDialog.cpp

示例4: itemDataChanged

void ManageProfilesDialog::itemDataChanged(QStandardItem* item)
{
    if (item->column() == ShortcutColumn) {
        QKeySequence sequence = QKeySequence::fromString(item->text());
        ProfileManager::instance()->setShortcut(item->data(ShortcutRole).value<Profile::Ptr>(),
                                                sequence);
    } else if (item->column() == ProfileNameColumn) {
        QString newName = item->text();
        Profile::Ptr profile = item->data(ProfileKeyRole).value<Profile::Ptr>();
        QString oldName = profile->name();

        if (newName != oldName) {
            QHash<Profile::Property, QVariant> properties;
            properties.insert(Profile::Name, newName);
            properties.insert(Profile::UntranslatedName, newName);

            ProfileManager::instance()->changeProfile(profile, properties);
        }
    }
}
开发者ID:kitech,项目名称:konsole,代码行数:20,代码来源:ManageProfilesDialog.cpp

示例5: setProfile

void EditProfileDialog::setProfile(Profile::Ptr profile)
{
    _profileKey = profile;

    Q_ASSERT( profile );

    // update caption
    updateCaption(profile->name());

    // mark each page of the dialog as out of date
    // and force an update of the currently visible page
    //
    // the other pages will be updated as necessary
    _pageNeedsUpdate.fill(true);
    preparePage( _ui->tabWidget->currentIndex() );

    if ( _tempProfile )
    {
        _tempProfile = new Profile;
    }
}
开发者ID:Maijin,项目名称:konsole,代码行数:21,代码来源:EditProfileDialog.cpp

示例6: updateItemsForProfile

void ManageProfilesDialog::updateItemsForProfile(const Profile::Ptr profile, QList<QStandardItem*>& items) const
{
    // Profile Name
    items[ProfileNameColumn]->setText(profile->name());
    if (!profile->icon().isEmpty())
        items[ProfileNameColumn]->setIcon(KIcon(profile->icon()));
    items[ProfileNameColumn]->setData(QVariant::fromValue(profile), ProfileKeyRole);
    items[ProfileNameColumn]->setToolTip(i18nc("@info:tooltip", "Click to rename profile"));

    // Favorite Status
    const bool isFavorite = ProfileManager::instance()->findFavorites().contains(profile);
    if (isFavorite)
        items[FavoriteStatusColumn]->setData(KIcon("dialog-ok-apply"), Qt::DecorationRole);
    else
        items[FavoriteStatusColumn]->setData(KIcon(), Qt::DecorationRole);
    items[FavoriteStatusColumn]->setData(QVariant::fromValue(profile), ProfileKeyRole);
    items[FavoriteStatusColumn]->setToolTip(i18nc("@info:tooltip", "Click to toggle status"));

    // Shortcut
    QString shortcut = ProfileManager::instance()->shortcut(profile).toString();
    items[ShortcutColumn]->setText(shortcut);
    items[ShortcutColumn]->setData(QVariant::fromValue(profile), ShortcutRole);
    items[ShortcutColumn]->setToolTip(i18nc("@info:tooltip", "Double click to change shortcut"));
}
开发者ID:kitech,项目名称:konsole,代码行数:24,代码来源:ManageProfilesDialog.cpp

示例7: bindUpdate

void ProfileMapper::bindUpdate(statement::ptr s, Persistent::Ptr p) const
{
	Profile::Ptr o = downcast(p);

	if (o->dive())
		s->bind(2, o->dive()->id());
	else
		s->bind(2);

	if (o->computer())
		s->bind(3, o->computer()->id());
	else
		s->bind(3);

	if (o->profile().empty())
		s->bind(5);
	else
		s->bind(5, profileToJSON(o->profile()));

	s->bind(4, o->name());
	s->bind(6, o->vendor());
	s->bind(7, o->imported());
	s->bind(8, o->raw_profile());
}
开发者ID:asymworks,项目名称:benthos-logbook,代码行数:24,代码来源:profile_mapper.cpp

示例8: profileNameLessThan

static bool profileNameLessThan(const Profile::Ptr& p1, const Profile::Ptr& p2)
{
    return QString::localeAwareCompare(p1->name(), p2->name()) <= 0;
}
开发者ID:Tasssadar,项目名称:konsole,代码行数:4,代码来源:ProfileManager.cpp


注:本文中的profile::Ptr::name方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。