本文整理汇总了C++中scrollToBottom函数的典型用法代码示例。如果您正苦于以下问题:C++ scrollToBottom函数的具体用法?C++ scrollToBottom怎么用?C++ scrollToBottom使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了scrollToBottom函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: connect
//Toggle to automatically scroll to bottom when new item added
void BC_Bulletin::autoScroll()
{
if (ui->pushButton_3->isChecked())
{
connect(this, SIGNAL(itemAdded()), ui->tx, SLOT(scrollToBottom()));
connect(this, SIGNAL(itemAdded()), ui->fsw, SLOT(scrollToBottom()));
}
else
{
disconnect(this, SIGNAL(itemAdded()), ui->tx, SLOT(scrollToBottom()));
disconnect(this, SIGNAL(itemAdded()), ui->fsw, SLOT(scrollToBottom()));
}
}
开发者ID:Rileybrains,项目名称:BARCoMmS,代码行数:14,代码来源:bc_bulletin_navigate.cpp
示例2: QWebView
DisplayWidget::DisplayWidget(QWidget* parent) : QWebView(parent) {
QWidget::setMinimumSize(0, 30);
// Sections Information
_currentSection = 0;
_maxSections = 1;
_currentCharacterCount = 0;
_maxCharacterCount = 300000000;
_scrollToBottom = true;
// Create WebKit Display
page()->mainFrame()->load(QUrl("qrc:/webkitdisplay/page.html"));
// Connect Signals/Slots
connect(this, SIGNAL(loadFinished(bool)), SLOT(finishLoading(bool)));
connect(page(), SIGNAL(contentsChanged()), SLOT(scrollToBottom()));
// TODO: Why aren't frames working?
connect(page(), SIGNAL(frameCreated(QWebFrame *frame)),
SLOT(loadFrame(QWebFrame *frame)));
page()->setLinkDelegationPolicy(QWebPage::DelegateAllLinks);
page()->setContentEditable(false);
/*
#ifdef USE_JQUERY
QFile file;
file.setFileName(":/webkitdisplay/jquery.min.js");
file.open(QIODevice::ReadOnly);
_jQuery = file.readAll();
file.close();
#endif
*/
}
开发者ID:alex-games,项目名称:a1,代码行数:34,代码来源:DisplayWidget.cpp
示例3: moveCursor
void ItemViewCategorized::toLastIndex()
{
QModelIndex index = moveCursor(MoveEnd, Qt::NoModifier);
clearSelection();
setCurrentIndex(index);
scrollToBottom();
}
开发者ID:KDE,项目名称:digikam,代码行数:7,代码来源:itemviewcategorized.cpp
示例4: QWidget
Dialog::Dialog(const Application* application, const QString& userId, QWidget* parent) :
QWidget(parent),
ui(new Ui::Dialog),
application(application),
userId(userId)
{
unreadInList = QStringList();
setupUi();
connect(ui->textEdit
, SIGNAL(focusIn())
, this
, SLOT(markInboxRead()));
connect(ui->webView->page()->mainFrame()
, SIGNAL(contentsSizeChanged(QSize))
, this
, SLOT(scrollToBottom(QSize)));
loadHistory(20);
connect(&application->getLongPollExecutor()
, SIGNAL(messageRecieved(QString,bool, bool,QString,uint,QString))
, this
, SLOT(insertMessage(QString,bool, bool,QString,uint,QString)));
connect(&application->getLongPollExecutor()
, SIGNAL(messageIsRead(QString))
, this
, SLOT(markMessageIsRead(QString)));
connect(ui->textEdit, SIGNAL(returnPressed()), this, SLOT(sendMessage()));
connect(ui->pushButton, SIGNAL(released()), this, SLOT(sendMessage()));
ui->webView->page()->setLinkDelegationPolicy(QWebPage::DelegateAllLinks);
connect(ui->webView, SIGNAL(linkClicked(QUrl)), this, SLOT(openAttachment(QUrl)));
}
开发者ID:galexcode,项目名称:VKReplica,代码行数:35,代码来源:dialog.cpp
示例5: parentWidget
void ChatWindow::notificationClicked() {
if (parentWidget()->isMinimized()) {
parentWidget()->showNormal();
}
if (isHidden()) {
show();
}
// find last mention
int messageCount = ui->messagesVBoxLayout->count();
for (unsigned int i = messageCount; i > 0; i--) {
ChatMessageArea* area = (ChatMessageArea*)ui->messagesVBoxLayout->itemAt(i - 1)->widget();
QRegularExpression usernameMention(mentionRegex.arg(AccountManager::getInstance().getAccountInfo().getUsername()));
if (area->toPlainText().contains(usernameMention)) {
int top = area->geometry().top();
int height = area->geometry().height();
QScrollBar* verticalScrollBar = ui->messagesScrollArea->verticalScrollBar();
verticalScrollBar->setSliderPosition(top - verticalScrollBar->size().height() + height);
return;
}
}
Application::processEvents();
scrollToBottom();
}
开发者ID:CoderPaulK,项目名称:hifi,代码行数:26,代码来源:ChatWindow.cpp
示例6: tr
void ChatWindow::addTimeStamp() {
QTimeSpan timePassed = QDateTime::currentDateTime() - lastMessageStamp;
int times[] = { timePassed.daysPart(), timePassed.hoursPart(), timePassed.minutesPart() };
QString strings[] = { tr("%n day(s)", 0, times[0]), tr("%n hour(s)", 0, times[1]), tr("%n minute(s)", 0, times[2]) };
QString timeString = "";
for (int i = 0; i < 3; i++) {
if (times[i] > 0) {
timeString += strings[i] + " ";
}
}
timeString.chop(1);
if (!timeString.isEmpty()) {
QLabel* timeLabel = new QLabel(timeString);
timeLabel->setStyleSheet("color: #333333;"
"background-color: white;"
"font-size: 14px;"
"padding: 4px;");
timeLabel->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
timeLabel->setAlignment(Qt::AlignLeft);
bool atBottom = isNearBottom();
ui->messagesVBoxLayout->addWidget(timeLabel);
ui->messagesVBoxLayout->parentWidget()->updateGeometry();
Application::processEvents();
numMessagesAfterLastTimeStamp = 0;
if (atBottom) {
scrollToBottom();
}
}
}
开发者ID:CoderPaulK,项目名称:hifi,代码行数:33,代码来源:ChatWindow.cpp
示例7: scrollToBottom
///// append /////////////////////////////////////////////////////////////////
void StatusText::append(const QString& text)
/// Overridden from QTextEdit::append in that it autoamtically positions itself
/// at the last line.
{
QTextEdit::append(text);
scrollToBottom();
}
开发者ID:steabert,项目名称:brabosphere,代码行数:8,代码来源:statustext.cpp
示例8: formatTimeStamp
void ChatView::renderMucMessage(const MessageView &mv)
{
const QString timestr = formatTimeStamp(mv.dateTime());
QString alerttagso, alerttagsc, nickcolor;
QString textcolor = palette().color(QPalette::Active, QPalette::Text).name();
QString icon = useMessageIcons_?
(QString("<img src=\"%1\" />").arg(mv.isLocal()?"icon:log_icon_delivered":"icon:log_icon_receive")):"";
if(mv.isAlert()) {
textcolor = "#FF0000";
alerttagso = "<b>";
alerttagsc = "</b>";
}
if(mv.isSpooled()) {
nickcolor = ColorOpt::instance()->color(infomrationalColorOpt).name();
} else {
nickcolor = getMucNickColor(mv.nick(), mv.isLocal());
}
if(mv.isEmote()) {
appendText(icon + QString("<font color=\"%1\">").arg(nickcolor) + QString("[%1]").arg(timestr) + QString(" *%1 ").arg(TextUtil::escape(mv.nick())) + alerttagso + mv.formattedText() + alerttagsc + "</font>");
}
else {
if(PsiOptions::instance()->getOption("options.ui.chat.use-chat-says-style").toBool()) {
appendText(icon + QString("<font color=\"%1\">").arg(nickcolor) + QString("[%1] ").arg(timestr) + QString("%1 says:").arg(TextUtil::escape(mv.nick())) + "</font><br>" + QString("<font color=\"%1\">").arg(textcolor) + alerttagso + mv.formattedText() + alerttagsc + "</font>");
}
else {
appendText(icon + QString("<font color=\"%1\">").arg(nickcolor) + QString("[%1] <").arg(timestr) + TextUtil::escape(mv.nick()) + QString("></font> ") + QString("<font color=\"%1\">").arg(textcolor) + alerttagso + mv.formattedText() + alerttagsc +"</font>");
}
}
if(mv.isLocal()) {
scrollToBottom();
}
}
开发者ID:ackbarr,项目名称:psi,代码行数:35,代码来源:chatview_te.cpp
示例9: QString
void MChatBrowser::appendHtml(const QString &pHtml)
{
QString jsHtml = pHtml;
jsHtml.replace("\'", "\\'");
QString js = QString("appendHtml('%1')").arg(jsHtml);
page()->mainFrame()->evaluateJavaScript(js);
scrollToBottom();
}
开发者ID:Darineth,项目名称:Mara-2,代码行数:8,代码来源:MChatBrowser.cpp
示例10: isScrollbarAtBottom
void OutputWindow::resizeEvent(QResizeEvent *e)
{
//Keep scrollbar at bottom of window while resizing, to ensure we keep scrolling
//This can happen if window is resized while building, or if the horizontal scrollbar appears
bool atBottom = isScrollbarAtBottom();
QPlainTextEdit::resizeEvent(e);
if (atBottom)
scrollToBottom();
}
开发者ID:alexey-zayats,项目名称:athletic,代码行数:9,代码来源:outputwindow.cpp
示例11: scrollToBottom
void LoggingTableWidget::ScrollToBottom()
{
if( RowsAdded == false )
{
return;
}
RowsAdded = false;
scrollToBottom();
}
开发者ID:raubwuerger,项目名称:StrategicGameProject,代码行数:9,代码来源:LoggingTableWidget.cpp
示例12: setMaximumBlockCount
void OutputWindow::appendMessage(const QString &output, OutputFormat format)
{
const QString out = SynchronousProcess::normalizeNewlines(output);
setMaximumBlockCount(d->maxLineCount);
const bool atBottom = isScrollbarAtBottom() || m_scrollTimer.isActive();
if (format == ErrorMessageFormat || format == NormalMessageFormat) {
d->formatter->appendMessage(doNewlineEnforcement(out), format);
} else {
bool sameLine = format == StdOutFormatSameLine
|| format == StdErrFormatSameLine;
if (sameLine) {
d->scrollToBottom = true;
int newline = -1;
bool enforceNewline = d->enforceNewline;
d->enforceNewline = false;
if (!enforceNewline) {
newline = out.indexOf(QLatin1Char('\n'));
moveCursor(QTextCursor::End);
if (newline != -1)
d->formatter->appendMessage(out.left(newline), format);// doesn't enforce new paragraph like appendPlainText
}
QString s = out.mid(newline+1);
if (s.isEmpty()) {
d->enforceNewline = true;
} else {
if (s.endsWith(QLatin1Char('\n'))) {
d->enforceNewline = true;
s.chop(1);
}
d->formatter->appendMessage(QLatin1Char('\n') + s, format);
}
} else {
d->formatter->appendMessage(doNewlineEnforcement(out), format);
}
}
if (atBottom) {
if (m_lastMessage.elapsed() < 5) {
m_scrollTimer.start();
} else {
m_scrollTimer.stop();
scrollToBottom();
}
}
m_lastMessage.start();
enableUndoRedo();
}
开发者ID:alexey-zayats,项目名称:athletic,代码行数:56,代码来源:outputwindow.cpp
示例13: generateHtml
void WX_HTML_REPORT_PANEL::Report( const wxString& aText, REPORTER::SEVERITY aSeverity )
{
REPORT_LINE line;
line.message = aText;
line.severity = aSeverity;
m_report.push_back( line );
m_htmlView->AppendToPage( generateHtml( line ) );
scrollToBottom();
}
开发者ID:nunb,项目名称:kicad-source-mirror,代码行数:10,代码来源:wx_html_report_panel.cpp
示例14: scrollToBottom
void QtMessageLogProxyModel::onRowsInserted(const QModelIndex &index, int start, int end)
{
int rowIndex = end;
do {
if (filterAcceptsRow(rowIndex, index)) {
emit scrollToBottom();
break;
}
} while (--rowIndex >= start);
}
开发者ID:KDE,项目名称:android-qt-creator,代码行数:10,代码来源:qtmessagelogproxymodel.cpp
示例15: scrollToTop
void NavigableTableView::keyPressEvent(QKeyEvent *event) {
if(event->key() == Qt::Key_Home) {
scrollToTop();
}
else if(event->key() == Qt::Key_End) {
scrollToBottom();
}
else {
QTableView::keyPressEvent(event);
}
}
开发者ID:mneumann,项目名称:tulip,代码行数:11,代码来源:navigabletableview.cpp
示例16: QDockWindow
COutputWindow::COutputWindow(QWidget *parent, const char *name)
: QDockWindow(parent, name)
{
// Create and set the main widget (a QTextEdit)
output = new QTextEdit(this);
output->setReadOnly(true);
setWidget(output);
compiler = 0;
connect(output, SIGNAL(textChanged()), output, SLOT(scrollToBottom()));
}
开发者ID:BackupTheBerlios,项目名称:caide-svn,代码行数:11,代码来源:outputwin.cpp
示例17: addLine
OutputStream::int_type OutputStream::overflow(OutputStream::int_type ch)
{
if(ch == '\n')
{
addLine(m_buffer);
scrollToBottom();
m_buffer.clear();
}
return ch;
}
开发者ID:Olybri,项目名称:RLCM,代码行数:11,代码来源:OutputStream.cpp
示例18: switch
bool CPetConversations::MouseButtonUpMsg(CMouseButtonUpMsg *msg) {
if (_scrollUp.MouseButtonUpMsg(msg->_mousePos) ||
_scrollDown.MouseButtonUpMsg(msg->_mousePos))
return true;
if (_doorBot.MouseButtonUpMsg(msg->_mousePos)) {
switch (canSummonBot("DoorBot")) {
case SUMMON_CANT:
_log.addLine(g_vm->_strings[CANT_SUMMON_DOORBOT], getColor(1));
break;
case SUMMON_CAN:
summonBot("DoorBot");
return true;
default:
break;
}
// Scroll to the bottom of the log
scrollToBottom();
return true;
}
if (_bellBot.MouseButtonUpMsg(msg->_mousePos)) {
switch (canSummonBot("BellBot")) {
case SUMMON_CANT:
_log.addLine(g_vm->_strings[CANT_SUMMON_BELLBOT], getColor(1));
break;
case SUMMON_CAN:
summonBot("BellBot");
return true;
default:
break;
}
// Scroll to the bottom of the log
scrollToBottom();
return true;
}
return false;
}
开发者ID:OmerMor,项目名称:scummvm,代码行数:41,代码来源:pet_conversations.cpp
示例19: switch
bool CPetConversations::MouseButtonUpMsg(CMouseButtonUpMsg *msg) {
if (_scrollUp.MouseButtonUpMsg(msg->_mousePos) ||
_scrollDown.MouseButtonUpMsg(msg->_mousePos))
return true;
if (_doorBot.MouseButtonUpMsg(msg->_mousePos)) {
switch (canSummonBot("DoorBot")) {
case SUMMON_CANT:
_log.addLine("Sadly, it is not possible to summon the DoorBot from this location.", getColor(1));
break;
case SUMMON_CAN:
summonBot("DoorBot");
return true;
default:
break;
}
// Scroll to the bottom of the log
scrollToBottom();
return true;
}
if (_bellBot.MouseButtonUpMsg(msg->_mousePos)) {
switch (canSummonBot("BellBot")) {
case SUMMON_CANT:
_log.addLine("Sadly, it is not possible to summon the BellBot from this location.", getColor(1));
break;
case SUMMON_CAN:
summonBot("BellBot");
return true;
default:
break;
}
// Scroll to the bottom of the log
scrollToBottom();
return true;
}
return false;
}
开发者ID:Tkachov,项目名称:scummvm,代码行数:41,代码来源:pet_conversations.cpp
示例20: generateHtml
void WX_HTML_REPORT_PANEL::refreshView()
{
wxString html;
for( const REPORT_LINE& l : m_report )
{
html += generateHtml( l );
}
m_htmlView->SetPage( addHeader( html ) );
scrollToBottom();
}
开发者ID:cpavlina,项目名称:kicad,代码行数:12,代码来源:wx_html_report_panel.cpp
注:本文中的scrollToBottom函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论