本文整理汇总了C++中TerminalDisplay类的典型用法代码示例。如果您正苦于以下问题:C++ TerminalDisplay类的具体用法?C++ TerminalDisplay怎么用?C++ TerminalDisplay使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了TerminalDisplay类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: detachView
void ViewManager::detachView(ViewContainer* container, QWidget* widgetView)
{
TerminalDisplay * viewToDetach =
dynamic_cast<TerminalDisplay*>(widgetView);
if (!viewToDetach)
return;
emit viewDetached(_sessionMap[viewToDetach]);
_sessionMap.remove(viewToDetach);
// remove the view from this window
container->removeView(viewToDetach);
viewToDetach->deleteLater();
// if the container from which the view was removed is now empty then it can be deleted,
// unless it is the only container in the window, in which case it is left empty
// so that there is always an active container
if (_viewSplitter->containers().count() > 1 &&
container->views().count() == 0) {
removeContainer(container);
}
}
开发者ID:spytheman,项目名称:konsole,代码行数:25,代码来源:ViewManager.cpp
示例2: detachActiveView
void ViewManager::detachActiveView()
{
// find the currently active view and remove it from its container
ViewContainer* container = _viewSplitter->activeContainer();
TerminalDisplay* activeView = dynamic_cast<TerminalDisplay*>(container->activeView());
if (!activeView)
return;
emit viewDetached(_sessionMap[activeView]);
_sessionMap.remove(activeView);
// remove the view from this window
container->removeView(activeView);
activeView->deleteLater();
// if the container from which the view was removed is now empty then it can be deleted,
// unless it is the only container in the window, in which case it is left empty
// so that there is always an active container
if ( _viewSplitter->containers().count() > 1 &&
container->views().count() == 0 )
{
removeContainer(container);
}
}
开发者ID:robertknight,项目名称:konsole,代码行数:27,代码来源:ViewManager.cpp
示例3: viewIter
void Session::updateTerminalSize()
{
QListIterator<TerminalDisplay*> viewIter( _views );
int minLines = -1;
int minColumns = -1;
// minimum number of lines and columns that views require for
// their size to be taken into consideration ( to avoid problems
// with new view widgets which haven't yet been set to their correct size )
const int VIEW_LINES_THRESHOLD = 2;
const int VIEW_COLUMNS_THRESHOLD = 2;
//select largest number of lines and columns that will fit in all visible views
while ( viewIter.hasNext() )
{
TerminalDisplay* view = viewIter.next();
if ( !view->isHidden() &&
view->lines() >= VIEW_LINES_THRESHOLD &&
view->columns() >= VIEW_COLUMNS_THRESHOLD )
{
minLines = ( minLines == -1 ) ? view->lines() : qMin( minLines , view->lines() );
minColumns = ( minColumns == -1 ) ? view->columns() : qMin( minColumns , view->columns() );
}
}
// backend emulation must have a _terminal of at least 1 column x 1 line in size
if ( minLines > 0 && minColumns > 0 )
{
_emulation->setImageSize( minLines , minColumns );
_shellProcess->setWindowSize( minLines , minColumns );
}
}
开发者ID:Ariki,项目名称:QGIS,代码行数:33,代码来源:Session.cpp
示例4: Profile
void MainWindow::showPreferences()
{
Session *sess = _Sessions.at(tabs->currentIndex());
Profile *prof = new Profile(sess->profileKey());
Preferences *pd = new Preferences(prof);
pd->setModal(true);
#ifdef QTOPIA_PHONE
if (Qtopia::mousePreferred)
QtopiaApplication::instance()->hideInputMethod();
#endif
pd->exec();
if (pd->result()==QDialog::Accepted) {
// apply the changes and update the current session settings
Profile *p = pd->profile();
TerminalDisplay *display = sess->views()[0];
display->setVTFont(QFont(p->fontName(), p->fontSize()));
const ColorScheme* colorScheme = ColorSchemeManager::instance()->findColorScheme(p->colorScheme());
ColorEntry table[TABLE_COLORS];
colorScheme->getColorTable(table, display->randomSeed());
display->setColorTable(table);
display->setOpacity(colorScheme->opacity());
display->setKeyboardCursorShape((TerminalDisplay::KeyboardCursorShape)p->cursorShape());
sess->setKeyBindings(p->keyboard());
sess->setHistoryType(HistoryTypeBuffer(p->historyLines()));
sess->setProfileKey(p->name());
p->saveProfile(p->name());
}
#ifdef QTOPIA_PHONE
if (Qtopia::mousePreferred)
QtopiaApplication::instance()->showInputMethod();
#endif
delete pd;
}
开发者ID:Fale,项目名称:qtmoko,代码行数:33,代码来源:MainWindow.cpp
示例5: TerminalDisplay
TerminalDisplay *TermWidgetImpl::createTerminalDisplay(Session *session, QWidget* parent)
{
// TerminalDisplay* display = new TerminalDisplay(this);
TerminalDisplay* display = new TerminalDisplay(parent);
display->setBellMode(TerminalDisplay::NotifyBell);
display->setTerminalSizeHint(true);
display->setTripleClickMode(TerminalDisplay::SelectWholeLine);
display->setTerminalSizeStartup(true);
display->setRandomSeed(session->sessionId() * 31);
return display;
}
开发者ID:sebastic,项目名称:qtermwidget,代码行数:14,代码来源:qtermwidget.cpp
示例6: TerminalDisplay
void MainWindow::addSession(const char *name)
{
TerminalDisplay *display = new TerminalDisplay();
Profile *profile = new Profile(name);
Session *session = new Session(*profile);
const ColorScheme* colorScheme = ColorSchemeManager::instance()->findColorScheme(profile->colorScheme());
//TODO Temporary settings used here
display->setBellMode(0);
display->setTerminalSizeHint(false);
display->setTripleClickMode(TerminalDisplay::SelectWholeLine);
display->setTerminalSizeStartup(false);
display->setScrollBarPosition(TerminalDisplay::ScrollBarRight);
display->setRandomSeed(session->sessionId() * 31);
display->setVTFont(QFont(profile->fontName(), profile->fontSize()));
//ColorSchemeManager::instance()->addColorScheme(new ColorScheme(*colorScheme));
ColorEntry table[TABLE_COLORS];
colorScheme->getColorTable(table, display->randomSeed());
display->setColorTable(table);
display->setOpacity(colorScheme->opacity());
display->setKeyboardCursorShape((TerminalDisplay::KeyboardCursorShape)profile->cursorShape());
session->addView(display);
int tabid = tabs->addTab(display,QIcon(":icon/konsole"), tr(name));
session->setTitle(Session::NameRole,name);
session->setProgram(profile->command());
session->setHistoryType( HistoryTypeBuffer(profile->historyLines()) );
session->setProfileKey(profile->name());
session->setInitialWorkingDirectory(QDir::homePath());
connect(session, SIGNAL(finished(QObject*)), this, SLOT(finished(QObject*)));
session->setKeyBindings(profile->keyboard());
_sessionCount++;
_Sessions.append(session);
session->run();
tabs->setCurrentIndex(tabid);
display->setFocus(Qt::OtherFocusReason);
}
开发者ID:Fale,项目名称:qtmoko,代码行数:40,代码来源:MainWindow.cpp
注:本文中的TerminalDisplay类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论