您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ updateLineNumberAreaWidth函数代码示例

51自学网 2021-06-03 09:13:50
  C++
这篇教程C++ updateLineNumberAreaWidth函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中updateLineNumberAreaWidth函数的典型用法代码示例。如果您正苦于以下问题:C++ updateLineNumberAreaWidth函数的具体用法?C++ updateLineNumberAreaWidth怎么用?C++ updateLineNumberAreaWidth使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了updateLineNumberAreaWidth函数的29个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: OCamlSourceSearch

OCamlSource::OCamlSource(){    _from_user_loaded = true;    lineSearchArea = new OCamlSourceSearch( this );    lineSearchArea->hide();    lineSearchArea->setEnabled(false);    connect( lineSearchArea, SIGNAL( textChanged( const QString & ) ), this, SLOT( searchTextChanged( const QString & ) ) );    connect( lineSearchArea, SIGNAL( returnPressed() ), this, SLOT( nextTextSearch() ) );    lineNumberArea = new OCamlSourceLineNumberArea( this );    connect( this, SIGNAL( blockCountChanged( int ) ), this, SLOT( updateLineNumberAreaWidth( int ) ) );    connect( this, SIGNAL( updateRequest( QRect, int ) ), this, SLOT( updateLineNumberArea( QRect, int ) ) );    updateLineNumberAreaWidth( 0 );    setAttribute( Qt::WA_DeleteOnClose );    highlighter = new OCamlSourceHighlighter( this->document() );    _start_char = 0;    _end_char = 0;    _after = false;    setReadOnly( true );    QFont font( "Monospace" );    font.setStyleHint( QFont::TypeWriter );    setFont( font );    timer_index = 0;    markCurrentLocationTimer = new QTimer();    connect ( markCurrentLocationTimer , SIGNAL( timeout() ), this , SLOT( markCurrentLocation() ) );    markCurrentLocationTimer->setSingleShot( true );    file_watch_p = NULL;}
开发者ID:modlfo,项目名称:oqamldebug_qt5,代码行数:31,


示例2: QPlainTextEdit

SqlTextEdit::SqlTextEdit(QWidget* parent) :    QPlainTextEdit(parent), m_defaultCompleterModel(0){    // basic auto completer for sqliteedit    m_Completer = new QCompleter(this);    m_Completer->setCaseSensitivity(Qt::CaseInsensitive);    m_Completer->setCompletionMode(QCompleter::PopupCompletion);    m_Completer->setWrapAround(false);    m_Completer->setWidget(this);    // Set font    QFont font("Monospace");    font.setStyleHint(QFont::TypeWriter);    font.setPointSize(PreferencesDialog::getSettingsValue("editor", "fontsize").toInt());    setFont(font);    QFontMetrics fm(font);    setTabStopWidth(fm.width(" ") * PreferencesDialog::getSettingsValue("editor", "tabsize").toInt());    // Create syntax highlighter    m_syntaxHighlighter = new SQLiteSyntaxHighlighter(document());    // Create line number area    lineNumberArea = new LineNumberArea(this);    connect(this, SIGNAL(blockCountChanged(int)), this, SLOT(updateLineNumberAreaWidth()));    connect(this, SIGNAL(updateRequest(QRect,int)), this, SLOT(updateLineNumberArea(QRect,int)));    connect(m_Completer, SIGNAL(activated(QString)), this, SLOT(insertCompletion(QString)));    connect(this, SIGNAL(cursorPositionChanged()), this, SLOT(highlightCurrentLine()));    highlightCurrentLine();    updateLineNumberAreaWidth();}
开发者ID:eyohansa,项目名称:sqlitebrowser,代码行数:33,


示例3: verticalScrollBar

//-----------------------------------------------------------------------------void TextEdit::updateLineNumberArea(){	/* When the signal is emitted, the sliderPosition has been adjusted according to the action,	 * but the value has not yet been propagated (meaning the valueChanged() signal was not yet emitted),	 * and the visual display has not been updated. In slots connected to this signal you can thus safely	 * adjust any action by calling setSliderPosition() yourself, based on both the action and the	 * slider's value. */	// Make sure the sliderPosition triggers one last time the valueChanged() signal with the actual value !!!!	verticalScrollBar()->setSliderPosition(verticalScrollBar()->sliderPosition());	// Since "QTextEdit" does not have an "updateRequest(...)" signal, we chose	// to grab the imformations from "sliderPosition()" and "contentsRect()".	// See the necessary connections used (Class constructor implementation part).	QRect rect =  contentsRect();	lineNumberArea->update(0, rect.y(), lineNumberArea->width(), rect.height());	updateLineNumberAreaWidth(0);	//----------	int dy = verticalScrollBar()->sliderPosition();	if (dy > -1) {		lineNumberArea->scroll(0, dy);	}	// Addjust slider to alway see the number of the currently being edited line...	int first_block_id = getFirstVisibleBlockId();	if (first_block_id == 0 || textCursor().block().blockNumber() == first_block_id-1)		verticalScrollBar()->setSliderPosition(dy-document()->documentMargin());}
开发者ID:ClinicalGraphics,项目名称:MathGL,代码行数:29,


示例4: QPlainTextEdit

GenericTextEditorDocument::GenericTextEditorDocument(QWidget *parent) : QPlainTextEdit(parent), mCodec(0), mCompleter(0), mDocName(""), mFilePath(""), mTextModified(false), mFile(0), mIsOfsFile(false),mInitialDisplay(true), mCloseEvtAlreadyProcessed(false){    QSettings settings;    QFont fnt = font();    fnt.setFamily("Courier New");    fnt.setPointSize(settings.value("preferences/fontSize").toUInt());    setFont(fnt);       QPlainTextEdit::LineWrapMode mode;    if(settings.value("preferences/lineWrapping").toBool())        mode = QPlainTextEdit::WidgetWidth;    else        mode = QPlainTextEdit::NoWrap;    setLineWrapMode(mode);    setAttribute(Qt::WA_DeleteOnClose);    QFontMetrics fm(fnt);    setTabStopWidth(fm.width("abcd"));    mLineNumberArea = new LineNumberArea(this);    connect(this,       SIGNAL(blockCountChanged(int)),             this, SLOT(updateLineNumberAreaWidth(int)));    connect(this,       SIGNAL(updateRequest(const QRect &, int)),  this, SLOT(updateLineNumberArea(const QRect &, int)));    connect(this,       SIGNAL(cursorPositionChanged()),            this, SLOT(highlightCurrentLine()));    updateLineNumberAreaWidth(0);    highlightCurrentLine();}
开发者ID:jacmoe,项目名称:ogitor,代码行数:32,


示例5: setFont

CodeArea::CodeArea(QWidget *parent)    :QPlainTextEdit(parent)    ,highlighter(this->document()){    QFont font;    font.setFamily("Courier");    font.setFixedPitch(true);    font.setPointSize(10);    font.insertSubstitution("	","    ");    setFont(font);    setWordWrapMode(QTextOption::NoWrap);    lineNumberArea = new LineNumberArea(this);    connect(this, SIGNAL(blockCountChanged(int)), this, SLOT(updateLineNumberAreaWidth(int)));    connect(this, SIGNAL(updateRequest(QRect,int)), this, SLOT(updateLineNumberArea(QRect,int)));    connect(this, SIGNAL(cursorPositionChanged()), this, SLOT(highlightCurrentLine()));    updateLineNumberAreaWidth(0);    highlightCurrentLine();    mCompleter = new QCompleter(this);    mCompleter->setModel(new QStringListModel(mWordList, mCompleter));    mCompleter->setModelSorting(QCompleter::CaseSensitivelySortedModel);    mCompleter->setCaseSensitivity(Qt::CaseSensitive);    mCompleter->setWrapAround(false);    mCompleter->setWidget(this);    mCompleter->setCompletionMode(QCompleter::PopupCompletion);    mCompleter->setCaseSensitivity(Qt::CaseInsensitive);    QObject::connect(mCompleter, SIGNAL(activated(QString)),                  this, SLOT(insertCompletion(QString)));    connect(this,SIGNAL(textChanged()), this, SLOT(onTextChange()));}
开发者ID:greeduomacro,项目名称:HardUO,代码行数:33,


示例6: QPlainTextEdit

/** * @brief CodeEditor::CodeEditor Create empty code editor. * @param parent Get parent of this object. * @param path Path of opened file. * @param type Type of opened shader. */CodeEditor::CodeEditor(QWidget *parent, QString path, InfoManager::SHADERTYPE type) :    QPlainTextEdit(parent){    lineNumberArea = new LineNumberArea(this);    oldBlockNumber = 0;    customConnect();    updateLineNumberAreaWidth(0);    highlightCurrentLine();    pathSet = true;    filePath = path;    //textModif = false;    // set shader type    sType = type;    // set syntax highlighter    highlight = new Highlighter(this);    highlight->setDocument(document());    // read the file    readFile();    setDefaultSettings();    createRegExps();}
开发者ID:jkonecny12,项目名称:ShaderMan,代码行数:34,


示例7: QPlainTextEdit

TextEditor::TextEditor(QWidget *parent) : QPlainTextEdit(parent){    lineNumberArea = new LineNumberArea(this);    connect(this, SIGNAL(blockCountChanged(int)), this, SLOT(updateLineNumberAreaWidth(int)));    connect(this, SIGNAL(updateRequest(QRect,int)), this, SLOT(updateLineNumberArea(QRect,int)));    connect(this, SIGNAL(cursorPositionChanged()), this, SLOT(highlightCurrentLine()));    updateLineNumberAreaWidth(0);    highlightCurrentLine();    QFont font("consolas",9);    const int tabStop = 4;  // 4 characters    QFontMetrics metrics(font);    setTabStopWidth(tabStop * metrics.width(' '));    setFont(font);    setLineWrapMode(QPlainTextEdit::NoWrap);    m_highlighter = new Highlighter(document());    m_autoUpdate = false;    m_timer = new QTimer();    m_timer->setSingleShot(true);    m_timer->setInterval(1000);    connect(m_timer, SIGNAL(timeout()), this, SLOT(updateShader()));    connect(this, SIGNAL(textChanged()), this, SLOT(resetTimer()));}
开发者ID:XT95,项目名称:VisualLiveSystem,代码行数:27,


示例8: QPlainTextEdit

CCodeEditor::CCodeEditor(QWidget *parent)	: QPlainTextEdit(parent) {	lineNumberArea = new CCodeEditor_LineNumberArea(this);	m_foldArea = new CCodeEditor_FoldArea( this );	connect(this, SIGNAL(blockCountChanged(int)), this, SLOT(updateLineNumberAreaWidth(int)));	connect(this, SIGNAL(updateRequest(const QRect &, int)), this, SLOT(updateLineNumberArea(const QRect &, int)));	connect(this, SIGNAL(cursorPositionChanged()), this, SLOT(highlightCurrentLine()));	updateLineNumberAreaWidth(0);	highlightCurrentLine();	setFont( QFont( "Courier New" , 11 ) );	CFileSyntaxHighlighter* s = new CFileSyntaxHighlighter( this->document() );        s->loadFromFile( "kuka_syntax.xml" );        // This second loading fail and cause to lost of first        // syntax file ( TODO )        /*s = new CFileSyntaxHighlighter( this->document() );        s->loadFromFile( SYNTAX_SYSTEMFILE );*/	m_ownerDocument = NULL;        m_oldBlockCount = 0;}
开发者ID:cyberpro4,项目名称:magnum,代码行数:27,


示例9: setAcceptDrops

void LogViewer::init(){    setAcceptDrops(true);    setReadOnly(true);    setTabWidth(4);    setLineWrapMode(QPlainTextEdit::NoWrap);    setTextInteractionFlags(Qt::TextSelectableByKeyboard | Qt::TextSelectableByMouse);    QPalette palette;    palette.setColor(QPalette::Inactive, QPalette::Highlight, palette.color(QPalette::Active, QPalette::Highlight));    palette.setColor(QPalette::Inactive, QPalette::HighlightedText, palette.color(QPalette::Active, QPalette::HighlightedText));    setPalette(palette);    // Read settings.    setFont(INIMANAGER()->font());    setForegroundColor(INIMANAGER()->foregroundColor());    setBackgroundColor(INIMANAGER()->backgroundColor());    setCustomBackgroundColor(INIMANAGER()->customBackgroundColor());    setCurrentLineFgColor(INIMANAGER()->currentLineFgColor());    setCurrentLineBgColor(INIMANAGER()->currentLineBgColor());    connect(this, SIGNAL(cursorPositionChanged()), this, SLOT(drawCurrentLine()));    connect(this, SIGNAL(blockCountChanged(int)), this, SLOT(blockCountChanged(int)));    connect(this, SIGNAL(selectionChanged()), this, SLOT(selectionChanged()));    // Line Number.    updateLineNumberAreaWidth(0);    connect(this, SIGNAL(blockCountChanged(int)), this, SLOT(updateLineNumberAreaWidth(int)));    connect(this, SIGNAL(updateRequest(QRect,int)), this, SLOT(updateLineNumberArea(QRect,int)));    // Keyword Highlighter.    connect(m_keywordHighlighter, SIGNAL(modelCreated(QStandardItemModel*)), this, SLOT(modelCreated(QStandardItemModel*)));    connect(m_keywordHighlighter, SIGNAL(chartLoaded(QPixmap*)), this, SLOT(chartLoaded(QPixmap*)));}
开发者ID:joonhwan,项目名称:monkeylogviewer,代码行数:34,


示例10: updateLineNumberAreaWidth

void CSVWorld::ScriptEdit::showLineNum(bool show){    if(show!=mShowLineNum)    {        mShowLineNum = show;        updateLineNumberAreaWidth(0);    }}
开发者ID:logorrhea,项目名称:openmw,代码行数:8,


示例11: updateLineNumberAreaWidth

//! Reimplementation of QPlainTextEdit::setPlainText method.//! Makes sure we dont update if the passed text is same.//! @param text the string to set.void ModelicaEditor::setPlainText(const QString &text){    if (text != toPlainText())    {        QPlainTextEdit::setPlainText(text);        updateLineNumberAreaWidth(0);    }}
开发者ID:world2005,项目名称:OpenModelica,代码行数:11,


示例12: QPlainTextEdit

//! ConstructorModelicaEditor::ModelicaEditor(ProjectTab *pParent)    : QPlainTextEdit(pParent){    mpParentProjectTab = pParent;    setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOn);    setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);    setTabStopWidth(Helper::tabWidth);    setObjectName("ModelicaEditor");    document()->setDocumentMargin(2);    setLineWrapMode(QPlainTextEdit::NoWrap);    // depending on the project tab readonly state set the text view readonly state    setReadOnly(mpParentProjectTab->isReadOnly());    connect(this, SIGNAL(focusOut()), mpParentProjectTab, SLOT(modelicaEditorTextChanged()));    connect(this, SIGNAL(textChanged()), SLOT(hasChanged()));    mpFindWidget = new QWidget;    mpFindWidget->setContentsMargins(0, 0, 0, 0);    mpFindWidget->hide();    mpSearchLabelImage = new QLabel;    mpSearchLabelImage->setPixmap(QPixmap(":/Resources/icons/search.png"));    mpSearchLabel = new QLabel(Helper::search);    mpSearchTextBox = new QLineEdit;    connect(mpSearchTextBox, SIGNAL(textChanged(QString)), SLOT(updateButtons()));    connect(mpSearchTextBox, SIGNAL(returnPressed()), SLOT(findNextText()));    mpPreviuosButton = new QToolButton;    mpPreviuosButton->setAutoRaise(true);    mpPreviuosButton->setText(tr("Previous"));    mpPreviuosButton->setIcon(QIcon(":/Resources/icons/previous.png"));    mpPreviuosButton->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);    connect(mpPreviuosButton, SIGNAL(clicked()), SLOT(findPreviuosText()));    mpNextButton = new QToolButton;    mpNextButton->setAutoRaise(true);    mpNextButton->setText(tr("Next"));    mpNextButton->setIcon(QIcon(":/Resources/icons/next.png"));    mpNextButton->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);    connect(mpNextButton, SIGNAL(clicked()), SLOT(findNextText()));    mpMatchCaseCheckBox = new QCheckBox(tr("Match case"));    mpMatchWholeWordCheckBox = new QCheckBox(tr("Match whole word"));    mpCloseButton = new QToolButton;    mpCloseButton->setAutoRaise(true);    mpCloseButton->setIcon(QIcon(":/Resources/icons/exit.png"));    connect(mpCloseButton, SIGNAL(clicked()), SLOT(hideFindWidget()));    mpLineNumberArea = new LineNumberArea(this);    connect(this, SIGNAL(blockCountChanged(int)), this, SLOT(updateLineNumberAreaWidth(int)));    connect(this, SIGNAL(updateRequest(QRect,int)), this, SLOT(updateLineNumberArea(QRect,int)));    connect(this, SIGNAL(cursorPositionChanged()), this, SLOT(highlightCurrentLine()));    updateLineNumberAreaWidth(0);    highlightCurrentLine();    // make previous and next buttons disabled for first time    updateButtons();}
开发者ID:world2005,项目名称:OpenModelica,代码行数:59,


示例13: QPlainTextEdit

CCodeEditor::CCodeEditor(QWidget *parent) : QPlainTextEdit(parent){	m_lineNumberArea = new CLineNumberArea(this);	connect(this, SIGNAL(blockCountChanged(int)), this, SLOT(updateLineNumberAreaWidth(int)));	connect(this, SIGNAL(updateRequest(QRect,int)), this, SLOT(updateLineNumberArea(QRect,int)));	updateLineNumberAreaWidth(0);}
开发者ID:creepydragon,项目名称:revision1,代码行数:9,


示例14: QPlainTextEdit

//![constructor]//class constructor which also connects functions to buttons and instantiates the lineNumberArea classCodeEditor::CodeEditor(QWidget *parent) : QPlainTextEdit(parent){    lineNumberArea = new LineNumberArea(this);    connect(this, SIGNAL(blockCountChanged(int)), this, SLOT(updateLineNumberAreaWidth(int)));    connect(this, SIGNAL(updateRequest(QRect,int)), this, SLOT(updateLineNumberArea(QRect,int)));    connect(this, SIGNAL(cursorPositionChanged()), this, SLOT(highlightCurrentLine()));    updateLineNumberAreaWidth(0);    highlightCurrentLine();}
开发者ID:mukolatte,项目名称:CSE20212-FinalProj-QT,代码行数:11,


示例15: createActions

PgxEditor::PgxEditor(Database *database, QString editor_name){    ++editor_widow_id;    this->database = database;    this->editor_name = editor_name;    createActions();    breakpointArea = new BreakPointArea(this);    lineNumberArea = new LineNumberArea(this);    setStyleSheet("QPlainTextEdit{background-color: white; font: bold 14px 'Courier New';}");    highlighter = new Highlighter(document());    toolbar = new QToolBar;    toolbar->setIconSize(QSize(36,36));    toolbar->setObjectName("pgxeditor");    toolbar->setMovable(false);    toolbar->addAction(newpgxeditor_action);    toolbar->addAction(cut_action);    toolbar->addAction(copy_action);    toolbar->addAction(paste_action);    if(!editor_name.isEmpty()) {        toolbar->addSeparator();        toolbar->addAction(save_action);        toolbar->addSeparator();        toolbar->addAction(execute_action);    }    toolbar->addSeparator();    toolbar->addAction(selected_execute_action);    toolbar->addAction(wrap_action);    toolbar->addAction(find_action);    pgxeditor_mainwin = new PgxEditorMainWindow;    pgxeditor_mainwin->addToolBar(toolbar);    pgxeditor_mainwin->setCentralWidget(this);    pgxeditor_mainwin->setAttribute(Qt::WA_DeleteOnClose);    find_bar = new QLineEdit;    find_bar->setPlaceholderText(tr("Find"));    find_bar->setVisible(false);    pgxeditor_mainwin->statusBar()->setSizeGripEnabled(false);    pgxeditor_mainwin->statusBar()->addPermanentWidget(casesensitivity_button, 0);    pgxeditor_mainwin->statusBar()->addPermanentWidget(wholeword_button, 0);    pgxeditor_mainwin->statusBar()->addPermanentWidget(backwards_button, 0);    pgxeditor_mainwin->statusBar()->addPermanentWidget(find_bar);    replace_bar = new QLineEdit;    replace_bar->setPlaceholderText(tr("Replace"));    replace_bar->setVisible(false);    pgxeditor_mainwin->statusBar()->addPermanentWidget(replace_bar);    connect(find_bar, SIGNAL(returnPressed()), this, SLOT(findText()));    connect(replace_bar, SIGNAL(returnPressed()), this, SLOT(replaceText()));    connect(this, SIGNAL(blockCountChanged(int)), this, SLOT(updateLineNumberAreaWidth(int)));    connect(this, SIGNAL(updateRequest(QRect,int)), this, SLOT(updateLineNumberArea(QRect,int)));    connect(this, SIGNAL(selectionChanged()), this, SLOT(selectionChangedSlot()));    connect(this, SIGNAL(textChanged()), this, SLOT(textChangedSlot()));    connect(pgxeditor_mainwin, SIGNAL(pgxeditorClosing()), this, SLOT(pgxeditorClosing()));    updateLineNumberAreaWidth(0);}
开发者ID:ssundar81,项目名称:pgXplorer,代码行数:57,


示例16: updateLineNumberAreaWidth

 void CodeEditor::updateLineNumberArea(const QRect &rect, int dy) {     if (dy)         lineNumberArea->scroll(0, dy);     else         lineNumberArea->update(0, rect.y(), lineNumberArea->width(), rect.height());     if (rect.contains(viewport()->rect()))         updateLineNumberAreaWidth(0); }
开发者ID:BigBlackBug,项目名称:SppoHorkov,代码行数:9,


示例17: disconnect

void BaseEditor::disableDisplayLineNumber(){    displayLineNumber = false;    disconnect(this, SIGNAL(updateRequest(QRect,int)),               this, SLOT(updateLineNumberArea(QRect,int)));    disconnect(this, SIGNAL(blockCountChanged(int)),               this, SLOT(updateLineNumberAreaWidth(int)));    updateLineNumberAreaWidth(0);    lineNumberArea->setVisible(false);}
开发者ID:3rdpaw,项目名称:MdCharm,代码行数:10,


示例18: updateLineNumberAreaWidth

void MyTextEdit::updateLineNumberArea(const QRect &rect, int dy){	if (dy)		m_lineNumbers->scroll(0, dy);	else		m_lineNumbers->update(0, rect.y(), m_lineNumbers->width(), rect.height());	if (rect.contains(viewport()->rect()))		updateLineNumberAreaWidth(0);}
开发者ID:vojtad,项目名称:rd2prog,代码行数:10,


示例19: updateLineNumberAreaWidth

//-----------------------------------------------------------------------------------------void GenericTextEditorDocument::updateLineNumberArea(const QRect &rect, int dy){    if(dy)        mLineNumberArea->scroll(0, dy);    else        mLineNumberArea->update(0, rect.y(), mLineNumberArea->width(), rect.height());    if (rect.contains(viewport()->rect()))        updateLineNumberAreaWidth(0);}
开发者ID:jacmoe,项目名称:ogitor,代码行数:11,


示例20: updateLineNumberAreaWidth

void MLScriptEditor::updateLineNumberArea( const QRect & r, int dy){	if (dy)		narea->scroll(0, dy);	else		narea->update(0, r.y(), narea->width(), r.height());	if (r.contains(viewport()->rect()))		updateLineNumberAreaWidth(0);}
开发者ID:quxiaofeng,项目名称:python-stl,代码行数:10,


示例21: QPlainTextEdit

//-------------------------------------------------------------------------CodeEditor::CodeEditor(QWidget *parent) : QPlainTextEdit(parent){    lineNumberArea = new LineNumberArea(this);    connect(this, SIGNAL(blockCountChanged(int)), this, SLOT(updateLineNumberAreaWidth(int)));    connect(this, SIGNAL(updateRequest(const QRect &, int)), this, SLOT(updateLineNumberArea(const QRect &, int)));    updateLineNumberAreaWidth(0);	setTabStopWidth (20);}
开发者ID:anttirt,项目名称:guidolib,代码行数:11,


示例22: QPlainTextEdit

CodeEditor::CodeEditor(QWidget *parent) : QPlainTextEdit(parent){    lineNumberArea = new LineNumberArea(this);    findDialog_ = new FindDialog(this);    findDialog_->setModal(false);    findDialog_->setTextEdit(this);    findReplaceDialog_ = new FindReplaceDialog(this);    findReplaceDialog_->setModal(false);    findReplaceDialog_->setTextEdit(this);    qtScriptReservedWords_<<"break"<<"case"<<"catch"<<"continue"<<"debugger"<<"default"<<"delete"<<"do"<<"else"<<"finally"<</    "for"<<"function"<<"if"<<"in"<<"instanceof"<<"new"<<"return"<<"switch"<<"this"<<"throw"<<"try"<</    "typeof"<<"var"<<"void"<<"while"<<"with";    syntaxHighlighter_ = new ScriptSyntaxHighlighter(this->document());    s = Global::guiSettings(this);    s->beginGroup("CodeEditor");    QFont font = s->value("font",this->font()).value<QFont>();    this->setFont(font);    s->endGroup();    findAction = new QAction("Find...",this);    connect(findAction, SIGNAL(triggered()), this, SLOT(findDialog()));    findAction->setShortcut(tr("Ctrl+F"));    addAction(findAction);    findReplaceAction = new QAction("Replace...",this);    connect(findReplaceAction, SIGNAL(triggered()), this, SLOT(findReplaceDialog()));    findReplaceAction->setShortcut(tr("Ctrl+R"));    addAction(findReplaceAction);    beautifyAction = new QAction("Beautify javascript code",this);    connect(beautifyAction, SIGNAL(triggered()), this, SLOT(beautify()));    beautifyAction->setShortcut(tr("Ctrl+B"));    addAction(beautifyAction);    connect(this, SIGNAL(blockCountChanged(int)), this, SLOT(updateLineNumberAreaWidth(int)));    connect(this, SIGNAL(updateRequest(QRect,int)), this, SLOT(updateLineNumberArea(QRect,int)));    connect(this, SIGNAL(cursorPositionChanged()), this, SLOT(highlightCurrentLine()));    updateLineNumberAreaWidth(0);    highlightCurrentLine();    completer_ = new QCompleter(this);    completer_->setModel(modelFromStringList(qtScriptReservedWords_));    completer_->setModelSorting(QCompleter::CaseInsensitivelySortedModel);    completer_->setCaseSensitivity(Qt::CaseInsensitive);    completer_->setWrapAround(false);    this->setCompleter(completer_);}
开发者ID:ivareske,项目名称:Playlist-Generator,代码行数:54,


示例23: updateLineNumberAreaWidth

void ScriptEditBox::updateLineNumberArea(const QRect& rect, int deltaY) {    if (deltaY) {        _scriptLineNumberArea->scroll(0, deltaY);    } else {        _scriptLineNumberArea->update(0, rect.y(), _scriptLineNumberArea->width(), rect.height());    }    if (rect.contains(viewport()->rect())) {        updateLineNumberAreaWidth(0);    }}
开发者ID:AlphaStaxLLC,项目名称:hifi,代码行数:11,


示例24: updateLineNumberAreaWidth

void CodeEditor::updateLineNumberArea(const QRect &rect, int dy){    if (dy)        lineNumberArea->scroll(0, dy);    else        lineNumberArea->update(0, rect.y(), lineNumberArea->width(), rect.height());        //indirectly invokes CodeEditor::lineNumberAreaPaintEvent() throw virtual LineNumberArea::paintEvent()    if (rect.contains(viewport()->rect())) //viewport - visible part of widget        updateLineNumberAreaWidth(0);}
开发者ID:Megaxela,项目名称:SASM,代码行数:11,


示例25: QPlainTextEdit

CodeEditor::CodeEditor(QWidget *parent) : QPlainTextEdit(parent),    defaultSelectionColor(QColor(240,230,140).lighter(130)),backGroundColor(Qt::white),lineAreaBGColor(240,248,255) {     lineNumberArea = new LineNumberArea(this);     connect(this, SIGNAL(blockCountChanged(int)), this, SLOT(updateLineNumberAreaWidth(int)));     connect(this, SIGNAL(updateRequest(QRect,int)), this, SLOT(updateLineNumberArea(QRect,int)));     connect(this, SIGNAL(cursorPositionChanged()), this, SLOT(highlightCurrentLine()));     updateLineNumberAreaWidth(0);     highlightCurrentLine(); }
开发者ID:BigBlackBug,项目名称:SppoHorkov,代码行数:11,


示例26: QPlainTextEdit

ScriptEditBox::ScriptEditBox(QWidget* parent) :    QPlainTextEdit(parent){    _scriptLineNumberArea = new ScriptLineNumberArea(this);    connect(this, &ScriptEditBox::blockCountChanged, this, &ScriptEditBox::updateLineNumberAreaWidth);    connect(this, &ScriptEditBox::updateRequest, this, &ScriptEditBox::updateLineNumberArea);    connect(this, &ScriptEditBox::cursorPositionChanged, this, &ScriptEditBox::highlightCurrentLine);    updateLineNumberAreaWidth(0);    highlightCurrentLine();}
开发者ID:AlphaStaxLLC,项目名称:hifi,代码行数:12,


示例27: QTextEdit

//-----------------------------------------------------------------------------TextEdit::TextEdit(QWidget *parent) : QTextEdit(parent){	c=0;	connect(this, SIGNAL(cursorPositionChanged()), this, SLOT(highlight()));	// Line numbers	lineNumberArea = new LineNumberArea(this);	connect(document(), SIGNAL(blockCountChanged(int)), this, SLOT(updateLineNumberAreaWidth(int)));	connect(document(), SIGNAL(blockCountChanged(int)), this, SLOT(updateLineNumberArea(int)));	connect(verticalScrollBar(), SIGNAL(valueChanged(int)), this, SLOT(updateLineNumberArea(int)));	connect(this, SIGNAL(textChanged()), this, SLOT(updateLineNumberArea()));	connect(this, SIGNAL(cursorPositionChanged()), this, SLOT(updateLineNumberArea()));	updateLineNumberAreaWidth(0);}
开发者ID:ClinicalGraphics,项目名称:MathGL,代码行数:14,


示例28: QPlainTextEdit

CodeEditor::CodeEditor(QWidget *parent) : QPlainTextEdit(parent){    lineNumberArea = new LineNumberArea(this);    setFont(QFont("Ubuntu Mono"));    connect(this, SIGNAL(blockCountChanged(int)), this, SLOT(updateLineNumberAreaWidth(int)));    connect(this, SIGNAL(updateRequest(QRect,int)), this, SLOT(updateLineNumberArea(QRect,int)));    connect(this, SIGNAL(cursorPositionChanged()), this, SLOT(highlightCurrentLine()));    updateLineNumberAreaWidth(0);    highlightCurrentLine();    sh = new SLHSyntaxHighlighter(this->document());}
开发者ID:f0ma,项目名称:hardwareexpert,代码行数:13,


示例29: QPlainTextEdit

CodeEditor::CodeEditor(QWidget *parent) : QPlainTextEdit(parent){    this->setWordWrapMode(QTextOption::WrapAtWordBoundaryOrAnywhere);    lineNumberArea = new LineNumberArea(this);    connect(this, SIGNAL(blockCountChanged(int)), this, SLOT(updateLineNumberAreaWidth(int)));    connect(this, SIGNAL(updateRequest(QRect,int)), this, SLOT(updateLineNumberArea(QRect,int)));    connect(this, SIGNAL(cursorPositionChanged()), this, SLOT(highlightCurrentLine()));    updateLineNumberAreaWidth(0);    highlightCurrentLine();}
开发者ID:EQ4,项目名称:libaudiotool,代码行数:13,



注:本文中的updateLineNumberAreaWidth函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ updateList函数代码示例
C++ updateLayout函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。