本文整理汇总了C++中profile::Ptr::setHidden方法的典型用法代码示例。如果您正苦于以下问题:C++ Ptr::setHidden方法的具体用法?C++ Ptr::setHidden怎么用?C++ Ptr::setHidden使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类profile::Ptr
的用法示例。
在下文中一共展示了Ptr::setHidden方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: createTabFromArgs
void Application::createTabFromArgs(KCmdLineArgs* args, MainWindow* window,
const QHash<QString, QString>& tokens)
{
const QString& title = tokens["title"];
const QString& command = tokens["command"];
const QString& profile = tokens["profile"];
const QString& workdir = tokens["workdir"];
Profile::Ptr baseProfile;
if (!profile.isEmpty()) {
baseProfile = ProfileManager::instance()->loadProfile(profile);
}
if (!baseProfile) {
// fallback to default profile
baseProfile = ProfileManager::instance()->defaultProfile();
}
Profile::Ptr newProfile = Profile::Ptr(new Profile(baseProfile));
newProfile->setHidden(true);
// FIXME: the method of determining whethter to use newProfile does not
// scale well when we support more fields in the future
bool shouldUseNewProfile = false;
if (!command.isEmpty()) {
newProfile->setProperty(Profile::Command, command);
newProfile->setProperty(Profile::Arguments, command.split(' '));
shouldUseNewProfile = true;
}
if (!title.isEmpty()) {
newProfile->setProperty(Profile::LocalTabTitleFormat, title);
newProfile->setProperty(Profile::RemoteTabTitleFormat, title);
shouldUseNewProfile = true;
}
if (args->isSet("workdir")) {
newProfile->setProperty(Profile::Directory, args->getOption("workdir"));
shouldUseNewProfile = true;
}
if (!workdir.isEmpty()) {
newProfile->setProperty(Profile::Directory, workdir);
shouldUseNewProfile = true;
}
// Create the new session
Profile::Ptr theProfile = shouldUseNewProfile ? newProfile : baseProfile;
Session* session = window->createSession(theProfile, QString());
if (!args->isSet("close")) {
session->setAutoClose(false);
}
if (!window->testAttribute(Qt::WA_Resized)) {
window->resize(window->sizeHint());
}
// FIXME: this ugly hack here is to make the session start running, so that
// its tab title is displayed as expected.
//
// This is another side effect of the commit fixing BKO 176902.
window->show();
window->hide();
}