Пример #1
0
bool Configuration::isHighlightCurrentLine()
{
    QVariant var = settings->value(HIGHLIGHT_CURRENT_LINE);
    if (var.isValid() && var.canConvert(QVariant::Bool))
    {
        return var.toBool();
    } else {
        setHighlightCurrentLine(false);
        return false;
    }
}
Пример #2
0
Editor::Editor ( QWidget * parent, cs8LoggerWidget *mainimpl, QString name )
//    : QWidget ( parent ), m_parent ( parent ), m_mainimpl ( cs8LoggerWidget )
{
  m_filename =  name;
  
  int vposLayout = 0;
  m_textEdit = new TextEdit ( this, mainimpl );
  m_backward = false;
  m_activeEditor = false;
  //
  QGridLayout *gridLayout = new QGridLayout ( this );
  gridLayout->setSpacing ( 0 );
  gridLayout->setMargin ( 0 );
  gridLayout->setObjectName ( QString::fromUtf8 ( "gridLayout" ) );
  //
  //
  //
  //
  connect ( m_textEdit, SIGNAL ( editorModified ( bool ) ), this, SLOT ( slotModifiedEditor ( bool ) ) );
  connect ( m_textEdit, SIGNAL ( cursorPositionChanged() ), this, SLOT ( slotCursorPositionChanged() ) );
  //
  m_findWidget = new QWidget;
  uiFind.setupUi ( m_findWidget );
  connect ( uiFind.toolClose, SIGNAL ( clicked() ), m_findWidget, SLOT ( hide() ) );
  connect ( uiFind.editFind, SIGNAL ( textChanged ( QString ) ), this, SLOT ( slotFindWidget_textChanged ( QString ) ) );
  connect ( uiFind.editFind, SIGNAL ( returnPressed() ), this, SLOT ( slotFindNext() ) );
  connect ( uiFind.toolPrevious, SIGNAL ( clicked() ), this, SLOT ( slotFindPrevious() ) );
  connect ( uiFind.toolNext, SIGNAL ( clicked() ), this, SLOT ( slotFindNext() ) );
  //
  autoHideTimer = new QTimer ( this );
  autoHideTimer->setInterval ( 5000 );
  autoHideTimer->setSingleShot ( true );
  connect ( autoHideTimer, SIGNAL ( timeout() ), m_findWidget, SLOT ( hide() ) );
  //
  gridLayout->addWidget ( m_textEdit, vposLayout++, 0, 1, 1 );
  gridLayout->addWidget ( m_findWidget, vposLayout++, 0, 1, 1 );
  uiFind.labelWrapped->setVisible ( false );
  m_findWidget->hide();
  //
  connect ( &m_timerCheckLastModified, SIGNAL ( timeout() ), this, SLOT ( slotTimerCheckIfModifiedOutside() ) );
  
  setLineNumbers ( true );
  setSyntaxHighlight ( true );
  setHighlightCurrentLine ( true );
}