本文整理汇总了C++中shortcut函数的典型用法代码示例。如果您正苦于以下问题:C++ shortcut函数的具体用法?C++ shortcut怎么用?C++ shortcut使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了shortcut函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: setStartPosition
void PathInfo::Build()
{
float x, y, z;
// set start and a default next position
m_sourceObject->GetPosition(x, y, z);
setStartPosition(x, y, z);
setNextPosition(x, y, z);
// get nav mesh
m_navMesh = m_sourceObject->GetMap()->GetNavMesh();
if(!m_navMesh)
{
// if there is no navmesh, just move to destination
shortcut();
return;
}
float extents[3] = {2.0f, 4.0f, 2.0f}; // defines bounds of box for search area
dtQueryFilter filter = dtQueryFilter(); // use general filter so we know if we are near navmesh
// get start and end positions
getStartPosition(x, y, z);
float startPos[3] = {y, z, x};
getEndPosition(x, y, z);
float endPos[3] = {y, z, x};
// find start and end poly
dtPolyRef startPoly = m_navMesh->findNearestPoly(startPos, extents, &filter, 0);
dtPolyRef endPoly = m_navMesh->findNearestPoly(endPos, extents, &filter, 0);
Build(startPoly, endPoly);
}
开发者ID:klaas-netherstorm,项目名称:Mangos,代码行数:33,代码来源:PathFinder.cpp
示例2: pgassert
void
Pgr_linear<G>::add_shortcut(
G &graph, V vertex,
E incoming_edge,
E outgoing_edge) {
pgassert(incoming_edge != outgoing_edge);
auto a = graph.adjacent(vertex, incoming_edge);
auto c = graph.adjacent(vertex, outgoing_edge);
pgassert(a != vertex);
pgassert(a != c);
pgassert(vertex != c);
if (graph.is_undirected()) {
Identifiers<V> adjacent_vertices = graph.find_adjacent_vertices(vertex);
V vertex_1 = adjacent_vertices.front();
adjacent_vertices.pop_front();
V vertex_2 = adjacent_vertices.front();
adjacent_vertices.pop_front();
E shortcut_E;
CH_edge shortcut(get_next_id(), graph[vertex_1].id,
graph[vertex_2].id,
graph[incoming_edge].cost + graph[outgoing_edge].cost);
shortcut.add_contracted_vertex(graph[vertex], vertex);
shortcut.add_contracted_edge_vertices(graph[incoming_edge]);
shortcut.add_contracted_edge_vertices(graph[outgoing_edge]);
debug << "Adding shortcut\n";
debug << shortcut;
graph.add_shortcut(shortcut);
debug << "Added shortcut\n";
} else {
CH_edge shortcut(
get_next_id(),
graph[a].id,
graph[c].id,
graph[incoming_edge].cost + graph[outgoing_edge].cost);
shortcut.add_contracted_vertex(graph[vertex], vertex);
shortcut.add_contracted_edge_vertices(graph[incoming_edge]);
shortcut.add_contracted_edge_vertices(graph[outgoing_edge]);
debug << "Adding shortcut\n";
debug << shortcut;
graph.add_shortcut(shortcut);
debug << "Added shortcut\n";
}
}
开发者ID:chahidinho,项目名称:pgrouting,代码行数:47,代码来源:pgr_linearContraction.hpp
示例3: handle_key
bool Shortcut_trigger::handle_key(const KShortcut &shortcut_P)
{
if(shortcut() == shortcut_P)
{
windows_handler->set_action_window(0); // use active window
data->execute();
return true;
}
return false;
}
开发者ID:serghei,项目名称:kde3-kdebase,代码行数:10,代码来源:triggers.cpp
示例4: bootUpSettings
void ValueSetters::RunOnBootValueSetter(QString group, QString name, QVariant value)
{
bool runOnBoot = value.toBool();
#ifdef Q_WS_WIN
QSettings bootUpSettings(QString("HKEY_LOCAL_MACHINE\\SOFTWARE\\") + (StaticHelpers::IsWow64() ? "Wow6432Node\\" : "") + "Microsoft\\Windows\\CurrentVersion\\Run", QSettings::NativeFormat);
QString applicationFilePath = QDir::toNativeSeparators(QFileInfo(QApplication::applicationFilePath()).absoluteFilePath());
if (runOnBoot)
{
bootUpSettings.setValue("CuteTorrent", "\"" + applicationFilePath + "\"");
}
else
{
bootUpSettings.remove("CuteTorrent");
}
#elif Q_WS_X11
if (runOnBoot)
{
if (!QFile::exists(StaticHelpers::CombinePathes(QDir::homePath(), ".config/autostart/CuteTorrent.desktop")))
{
QFile shortcut("/usr/share/applications/CuteTorrent.desktop");
if (!shortcut.copy(StaticHelpers::CombinePathes(QDir::homePath(), ".config/autostart/CuteTorrent.desktop")))
{
qCritical() << "Unable to copy /usr/share/applications/CuteTorrent.desktop to ~/.config/autostart/CuteTorrent.desktop" << shortcut.errorString();
}
}
}
else
{
QFile shortcut(StaticHelpers::CombinePathes(QDir::homePath(), ".config/autostart/CuteTorrent.desktop"));
if (shortcut.exists())
{
if (!shortcut.remove())
{
qCritical() << "failed to remove ~/.config/autostart/CuteTorrent.desktop" << shortcut.errorString();
}
}
}
#endif
}
开发者ID:sunpeng196,项目名称:CuteTorrent,代码行数:41,代码来源:ValueSetters.cpp
示例5: shortcut
void QQuickMenuItem::updateShortcut()
{
if (platformItem()) {
QKeySequence sequence;
QVariant var = shortcut();
if (var.type() == QVariant::Int)
sequence = QKeySequence(static_cast<QKeySequence::StandardKey>(var.toInt()));
else
sequence = QKeySequence::fromString(var.toString(), QKeySequence::NativeText);
platformItem()->setShortcut(sequence);
syncWithPlatformMenu();
}
emit shortcutChanged();
}
开发者ID:xjohncz,项目名称:qt5,代码行数:14,代码来源:qquickmenuitem.cpp
示例6: retranslateUi
void retranslateUi()
{
switch (m_iState)
{
case 0:
{
setName(QApplication::translate("UIActionPool", "S&tart"));
setStatusTip(QApplication::translate("UIActionPool", "Start the selected virtual machines"));
setToolTip(text().remove('&').remove('.') +
(shortcut().toString().isEmpty() ? "" : QString(" (%1)").arg(shortcut().toString())));
break;
}
case 1:
{
setName(QApplication::translate("UIActionPool", "S&how"));
setStatusTip(QApplication::translate("UIActionPool", "Switch to the windows of the selected virtual machines"));
setToolTip(text().remove('&').remove('.') +
(shortcut().toString().isEmpty() ? "" : QString(" (%1)").arg(shortcut().toString())));
break;
}
default:
break;
}
}
开发者ID:mutoso-mirrors,项目名称:vbox,代码行数:24,代码来源:UIActionPoolSelector.cpp
示例7: shortcut
void ShortcutDialog::accept()
{
QKeySequence seq = shortcut();
if (!seq.isEmpty()) {
if (seq[0] == Qt::Key_Escape) {
reject();
return;
}
if (seq[0] == Qt::Key_Space
|| (seq[0] & Qt::KeyboardModifierMask) == 0) {
// clear
widget->clearKeySequence();
KDialog::accept();
return;
}
}
KDialog::accept();
}
开发者ID:mgottschlag,项目名称:kwin-tiling,代码行数:18,代码来源:utils.cpp
示例8: slotIdentitiesChanged
void KMFolder::readConfig( KConfigGroup & configGroup )
{
// KConfigGroup configGroup(config, "");
if ( !configGroup.readEntry( "SystemLabel" ).isEmpty() )
mSystemLabel = configGroup.readEntry( "SystemLabel" );
mExpireMessages = configGroup.readEntry( "ExpireMessages", false );
mReadExpireAge = configGroup.readEntry( "ReadExpireAge", 3 );
mReadExpireUnits = (ExpireUnits)configGroup.readEntry( "ReadExpireUnits", (int)expireMonths );
mUnreadExpireAge = configGroup.readEntry( "UnreadExpireAge", 12 );
mUnreadExpireUnits = (ExpireUnits)
configGroup.readEntry( "UnreadExpireUnits", (int)expireNever );
mExpireAction = configGroup.readEntry( "ExpireAction", "Delete") == "Move" ? ExpireMove : ExpireDelete;
mExpireToFolderId = configGroup.readEntry( "ExpireToFolder" );
mUseCustomIcons = configGroup.readEntry( "UseCustomIcons", false );
mNormalIconPath = configGroup.readEntry( "NormalIconPath" );
mUnreadIconPath = configGroup.readEntry( "UnreadIconPath" );
mMailingListEnabled = configGroup.readEntry( "MailingListEnabled", false );
mMailingList.readConfig( configGroup );
mUseDefaultIdentity = configGroup.readEntry( "UseDefaultIdentity", true );
uint defaultIdentity = kmkernel->identityManager()->defaultIdentity().uoid();
mIdentity = configGroup.readEntry("Identity", defaultIdentity );
slotIdentitiesChanged();
setUserWhoField( configGroup.readEntry( "WhoField" ), false );
uint savedId = configGroup.readEntry( "Id", 0 );
// make sure that we don't overwrite a valid id
if ( savedId != 0 && mId == 0 )
mId = savedId;
mPutRepliesInSameFolder = configGroup.readEntry( "PutRepliesInSameFolder", false );
mHideInSelectionDialog = configGroup.readEntry( "HideInSelectionDialog", false );
setIgnoreNewMail( configGroup.readEntry( "IgnoreNewMail", false ) );
if ( mUseCustomIcons )
emit iconsChanged();
QString shortcut( configGroup.readEntry( "Shortcut" ) );
if ( !shortcut.isEmpty() ) {
KShortcut sc( shortcut );
setShortcut( sc );
}
}
开发者ID:akhuettel,项目名称:kdepim-noakonadi,代码行数:44,代码来源:kmfolder.cpp
示例9: shortcut
void BtActionCollection::readSettings() {
QSettings* settings = CBTConfig::getConfig();
settings->beginGroup(m_groupName);
QStringList keyList = settings->childKeys();
for (int i = 0; i < keyList.size(); i++) {
QString key = keyList.at(i);
QVariant variant = settings->value(key);
QList<QKeySequence> shortcuts;
if ( variant != QVariant()) {
QList<QVariant> varShortcuts = variant.toList();
for (int i = 0; i < varShortcuts.count(); i++) {
QString keys = varShortcuts.at(i).toString();
QKeySequence shortcut(keys);
shortcuts.append(shortcut);
}
}
action(key)->setShortcuts(shortcuts);
}
settings->endGroup();
}
开发者ID:bibletime,项目名称:historic-bibletime-svn,代码行数:20,代码来源:btactioncollection.cpp
示例10: Get
bool MenuCommands::SetShortcuts(int ind, QString shorts)
{
QStringList list = shorts.split(QChar(' '));
QString key = Get(ind,Key);
int i = 0;
foreach(QString s, list)
{
if (!s.trimmed().isEmpty())
{
QKeySequence shortcut(s.trimmed());
if (shortcut.isEmpty())
return false;
m_data.setValue(key + QString("_%1").arg(++i), shortcut.toString() );
}
}
QString shortcut = m_data.value(key + QString("_%1").arg(++i) ).toString();
if (!shortcut.isEmpty())
m_data.setValue(key + QString("_%1").arg(i), "");
return true;
}
开发者ID:Akscan,项目名称:QtWeb,代码行数:22,代码来源:commands.cpp
示例11: QKeySequence
void QQuickAction::setShortcut(const QVariant &arg)
{
QKeySequence sequence;
if (arg.type() == QVariant::Int)
sequence = QKeySequence(static_cast<QKeySequence::StandardKey>(arg.toInt()));
else
sequence = QKeySequence::fromString(arg.toString());
if (sequence == m_shortcut)
return;
if (!m_shortcut.isEmpty())
QGuiApplicationPrivate::instance()->shortcutMap.removeShortcut(0, this, m_shortcut);
m_shortcut = sequence;
if (!m_shortcut.isEmpty()) {
Qt::ShortcutContext context = Qt::WindowShortcut;
QGuiApplicationPrivate::instance()->shortcutMap.addShortcut(this, m_shortcut, context, qShortcutContextMatcher);
}
emit shortcutChanged(shortcut());
}
开发者ID:Drakey83,项目名称:steamlink-sdk,代码行数:22,代码来源:qquickaction.cpp
示例12: forward
const KShortcut& forward() { return shortcut( Forward ); }
开发者ID:vasi,项目名称:kdelibs,代码行数:1,代码来源:kstandardshortcut.cpp
示例13: back
const KShortcut& back() { return shortcut( Back ); }
开发者ID:vasi,项目名称:kdelibs,代码行数:1,代码来源:kstandardshortcut.cpp
示例14: up
const KShortcut& up() { return shortcut( Up ); }
开发者ID:vasi,项目名称:kdelibs,代码行数:1,代码来源:kstandardshortcut.cpp
示例15: selectAll
const KShortcut& selectAll() { return shortcut( SelectAll ); }
开发者ID:vasi,项目名称:kdelibs,代码行数:1,代码来源:kstandardshortcut.cpp
示例16: reload
const KShortcut& reload() { return shortcut( Reload ); }
开发者ID:vasi,项目名称:kdelibs,代码行数:1,代码来源:kstandardshortcut.cpp
示例17: zoomIn
const KShortcut& zoomIn() { return shortcut( ZoomIn ); }
开发者ID:vasi,项目名称:kdelibs,代码行数:1,代码来源:kstandardshortcut.cpp
示例18: shortcut
void ShortcutButton::addShortcut(const QString &shortcutPortableText)
{
QKeySequence shortcut(shortcutPortableText, QKeySequence::PortableText);
if ( !shortcut.isEmpty() )
addShortcut(shortcut);
}
开发者ID:m4r71n,项目名称:CopyQ,代码行数:6,代码来源:shortcutbutton.cpp
示例19: rotateDown
const KShortcut& rotateDown() { return shortcut( RotateDown ); }
开发者ID:vasi,项目名称:kdelibs,代码行数:1,代码来源:kstandardshortcut.cpp
示例20: prevCompletion
const KShortcut& prevCompletion() { return shortcut( PrevCompletion ); }
开发者ID:vasi,项目名称:kdelibs,代码行数:1,代码来源:kstandardshortcut.cpp
注:本文中的shortcut函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论