本文整理汇总了C++中MirallConfigFile::maxLogLines方法的典型用法代码示例。如果您正苦于以下问题:C++ MirallConfigFile::maxLogLines方法的具体用法?C++ MirallConfigFile::maxLogLines怎么用?C++ MirallConfigFile::maxLogLines使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MirallConfigFile
的用法示例。
在下文中一共展示了MirallConfigFile::maxLogLines方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setReadOnly
LogWidget::LogWidget(QWidget *parent)
:QPlainTextEdit(parent)
{
setReadOnly( true );
QFont font;
font.setFamily(QLatin1String("Courier New"));
font.setFixedPitch(true);
document()->setDefaultFont( font );
MirallConfigFile cfg;
int lines = cfg.maxLogLines();
// qDebug() << "# ## Have " << lines << " Loglines!";
document()->setMaximumBlockCount( lines );
}
示例2: QDialog
LogBrowser::LogBrowser(QWidget *parent) :
QDialog(parent),
_logWidget( new LogWidget(parent) ),
_doFileFlush(false)
{
setObjectName("LogBrowser"); // for save/restoreGeometry()
setWindowTitle(tr("Log Output"));
setMinimumWidth(600);
QVBoxLayout *mainLayout = new QVBoxLayout;
// mainLayout->setMargin(0);
mainLayout->addWidget( _logWidget );
QHBoxLayout *toolLayout = new QHBoxLayout;
mainLayout->addLayout( toolLayout );
// Search input field
QLabel *lab = new QLabel(tr("&Search: "));
_findTermEdit = new QLineEdit;
lab->setBuddy( _findTermEdit );
toolLayout->addWidget(lab);
toolLayout->addWidget( _findTermEdit );
// find button
QPushButton *findBtn = new QPushButton;
findBtn->setText( tr("&Find") );
connect( findBtn, SIGNAL(clicked()), this, SLOT(slotFind()));
toolLayout->addWidget( findBtn );
// stretch
toolLayout->addStretch(1);
_statusLabel = new QLabel;
toolLayout->addWidget( _statusLabel );
toolLayout->addStretch(5);
QDialogButtonBox *btnbox = new QDialogButtonBox;
QPushButton *closeBtn = btnbox->addButton( QDialogButtonBox::Close );
connect(closeBtn,SIGNAL(clicked()),this,SLOT(close()));
mainLayout->addWidget( btnbox );
// clear button
_clearBtn = new QPushButton;
_clearBtn->setText( tr("Clear") );
_clearBtn->setToolTip( tr("Clear the log display.") );
btnbox->addButton(_clearBtn, QDialogButtonBox::ActionRole);
connect( _clearBtn, SIGNAL(clicked()), this, SLOT(slotClearLog()));
// save Button
_saveBtn = new QPushButton;
_saveBtn->setText( tr("S&ave") );
_saveBtn->setToolTip(tr("Save the log file to a file on disk for debugging."));
btnbox->addButton(_saveBtn, QDialogButtonBox::ActionRole);
connect( _saveBtn, SIGNAL(clicked()),this, SLOT(slotSave()));
setLayout( mainLayout );
setModal(false);
// Direct connection for log comming from this thread, and queued for the one in a different thread
connect(Logger::instance(), SIGNAL(newLog(QString)),this,SLOT(slotNewLog(QString)), Qt::AutoConnection);
QAction *showLogWindow = new QAction(this);
showLogWindow->setShortcut(QKeySequence("F12"));
connect(showLogWindow, SIGNAL(triggered()), SLOT(close()));
addAction(showLogWindow);
MirallConfigFile cfg;
cfg.restoreGeometry(this);
int lines = cfg.maxLogLines();
// qDebug() << "# ## Have " << lines << " Loglines!";
_logWidget->document()->setMaximumBlockCount( lines );
}