当前位置: 首页>>代码示例>>C++>>正文


C++ cursorPositionChanged函数代码示例

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


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

示例1: connect

MibEditor::MibEditor(Snmpb *snmpb)
{
    s = snmpb;

    // Menu items
    connect( s->MainUI()->fileNewAction, SIGNAL( triggered() ),
             this, SLOT( MibFileNew() ) );
    connect( s->MainUI()->fileOpenAction, SIGNAL( triggered() ),
             this, SLOT( MibFileOpen() ) );
    connect( s->MainUI()->fileSaveAction, SIGNAL( triggered() ),
             this, SLOT( MibFileSave() ) );
    connect( s->MainUI()->fileSaveAsAction, SIGNAL( triggered() ),
             this, SLOT( MibFileSaveAs() ) );
    connect( s->MainUI()->actionVerifyMIB, SIGNAL( triggered() ),
             this, SLOT( VerifyMIB() ) );
    connect( s->MainUI()->actionExtractMIBfromRFC, SIGNAL( triggered() ),
             this, SLOT( ExtractMIBfromRFC() ) );
    connect( s->MainUI()->MIBLog, SIGNAL ( itemDoubleClicked ( QListWidgetItem* ) ),
             this, SLOT( SelectedLogEntry ( QListWidgetItem* ) ) );
    connect( s->MainUI()->MIBFile->document(), SIGNAL(modificationChanged(bool)),
             this, SLOT( MibFileModified(bool) ));
    connect( s->MainUI()->actionGotoLine, SIGNAL( triggered() ),
             this, SLOT( GotoLine() ) );
    connect( s->MainUI()->actionFind, SIGNAL( triggered() ),
             this, SLOT( Find() ) );
    connect( s->MainUI()->actionReplace, SIGNAL( triggered() ),
             this, SLOT( Replace() ) );
    connect( s->MainUI()->actionFindNext, SIGNAL( triggered() ),
             this, SLOT( ExecuteFindNext() ) );

    // Syntax highlighter
    highlighter = new MibHighlighter(s->MainUI()->MIBFile->document());

    // Marker widget
    s->MainUI()->MIBFileMarker->setTextEditor(s->MainUI()->MIBFile);

    // Line number statusbar widget
    lnum = new QLabel();
    s->MainUI()->MIBFileStatus->addPermanentWidget(lnum);

    // Filename statusbar widget
    lfn = new QLabel();
    s->MainUI()->MIBFileStatus->addWidget(lfn);

    SetCurrentFileName("");

    connect( s->MainUI()->MIBFile, SIGNAL( cursorPositionChanged() ),
             this, SLOT( SetLineNumStatus() ) );

    SetLineNumStatus();

    find_string = "";
    replace_string = "";
}
开发者ID:vertexclique,项目名称:travertine,代码行数:54,代码来源:mibeditor.cpp

示例2: 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,代码来源:CodeEditor.cpp

示例3: QPlainTextEdit

TextEdit::TextEdit(QWidget *parent) : QPlainTextEdit(parent), c(0)
{
    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)));
    connect(this, SIGNAL(cursorPositionChanged()), this, SLOT(highlightCurrentLine()));

    updateLineNumberAreaWidth(0);
    highlightCurrentLine();
}
开发者ID:KevinSupertramp,项目名称:Wakxy,代码行数:11,代码来源:completer.cpp

示例4: QPlainTextEdit

CodeEditor::CodeEditor(QWidget *parent) : QPlainTextEdit(parent)
{
    lineNumberArea = new LineNumberArea(this);
    this->parent = parent;
    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:aidint,项目名称:PyG,代码行数:11,代码来源:codeeditor.cpp

示例5: QPlainTextEdit

GenericCodeEditor::GenericCodeEditor( Document *doc, QWidget *parent ):
    QPlainTextEdit( parent ),
    mDoc(doc),
    mLastCursorBlock(-1)
{
    Q_ASSERT(mDoc != 0);

    setFrameShape( QFrame::NoFrame );

    viewport()->setAttribute( Qt::WA_MacNoClickThrough, true );

    mLineIndicator = new LineIndicator(this);
    mLineIndicator->move( contentsRect().topLeft() );

    mOverlay = new QGraphicsScene(this);

    QGraphicsView *overlayView = new QGraphicsView(mOverlay, this);
    overlayView->setFrameShape( QFrame::NoFrame );
    overlayView->setBackgroundBrush( Qt::NoBrush );
    overlayView->setStyleSheet("background: transparent");
    overlayView->setFocusPolicy( Qt::NoFocus );
    overlayView->setAttribute(Qt::WA_TransparentForMouseEvents, true);
    overlayView->setSceneRect(QRectF(0,0,1,1));
    overlayView->setAlignment(Qt::AlignLeft | Qt::AlignTop);

    mOverlayWidget = overlayView;

    connect( mDoc, SIGNAL(defaultFontChanged()), this, SLOT(onDocumentFontChanged()) );

    connect( this, SIGNAL(blockCountChanged(int)),
             mLineIndicator, SLOT(setLineCount(int)) );

    connect( mLineIndicator, SIGNAL( widthChanged() ),
             this, SLOT( updateLayout() ) );

    connect( this, SIGNAL(updateRequest(QRect,int)),
             this, SLOT(updateLineIndicator(QRect,int)) );

    connect( this, SIGNAL(selectionChanged()),
             mLineIndicator, SLOT(update()) );
    connect( this, SIGNAL(cursorPositionChanged()),
             this, SLOT(onCursorPositionChanged()) );

    connect( Main::instance(), SIGNAL(applySettingsRequest(Settings::Manager*)),
             this, SLOT(applySettings(Settings::Manager*)) );

    QTextDocument *tdoc = doc->textDocument();
    QPlainTextEdit::setDocument(tdoc);
    onDocumentFontChanged();
    mLineIndicator->setLineCount(blockCount());

    applySettings( Main::settings() );
}
开发者ID:brunoruviaro,项目名称:supercollider,代码行数:53,代码来源:editor.cpp

示例6: QPlainTextEdit

/* TextEdit widget */
TextEdit::TextEdit(QWidget *parent)
    : QPlainTextEdit(parent)
{
    gutter = new Gutter(this);

    connect(this, SIGNAL(blockCountChanged(int)), this, SLOT(updateGutterWidth(int)));
    connect(this, SIGNAL(updateRequest(QRect,int)), this, SLOT(updateGutter(QRect,int)));
    connect(this, SIGNAL(cursorPositionChanged()), this, SLOT(highlightCurrentLine()));

    updateGutterWidth(0);
    highlightCurrentLine();
}
开发者ID:johnwchadwick,项目名称:textaxe,代码行数:13,代码来源:textedit.cpp

示例7: switch

bool ViewManager::qt_invoke( int _id, QUObject* _o )
{
    switch ( _id - staticMetaObject()->slotOffset() ) {
    case 0: clearErrorMarker(); break;
    case 1: cursorPositionChanged((int)static_QUType_int.get(_o+1),(int)static_QUType_int.get(_o+2)); break;
    case 2: showMessage((const QString&)static_QUType_QString.get(_o+1)); break;
    case 3: clearStatusBar(); break;
    default:
	return QWidget::qt_invoke( _id, _o );
    }
    return TRUE;
}
开发者ID:OS2World,项目名称:LIB-QT3_Toolkit_Vbox,代码行数:12,代码来源:moc_viewmanager.cpp

示例8: QTextEdit

QSAEditor::QSAEditor(QWidget *parent)
    : QTextEdit(parent), qsInterp(0)
{
    setLineWrapMode(NoWrap);
    QSyntaxHighlighter *hl = new QSASyntaxHighlighter(this);
    hl->setDocument(document());
    matcher = new ParenMatcher;
    connect(this, SIGNAL(cursorPositionChanged()), matcher, SLOT(matchFromSender()));
    // #### add completion entries from highlighter

    readSettings();
}
开发者ID:aschet,项目名称:qsaqt5,代码行数:12,代码来源:qsaeditor.cpp

示例9: resetBinding

 void resetBinding(){
     if (!active) return;
     QToolTip::hideText();
     editor->setInputBinding(oldBinding);
     editor->setFocus();
     if (completer) {
         completer->list->hide();
         completer->disconnect(editor,SIGNAL(cursorPositionChanged()),completer,SLOT(cursorPositionChanged()));
     }
     active=false;
     curLine=QDocumentLine(); //prevent crash if the editor is destroyed
 }
开发者ID:svn2github,项目名称:texstudio,代码行数:12,代码来源:latexcompleter.cpp

示例10: QMainWindow

MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    isSaved = false;
    curFile = tr("未命名.txt");
    formTitle = curFile + tr(" - Lootepad 0.5");
    setWindowTitle(formTitle);
    init_statusBar();
    connect(ui->textEdit,SIGNAL(cursorPositionChanged()),this,SLOT(do_cursorChanged()));
}
开发者ID:flyi,项目名称:LDE,代码行数:12,代码来源:mainwindow.cpp

示例11: kdDebug

void BashCodeCompletion::setActiveEditorPart(KParts::Part *part)
{
	if (!part || !part->widget())
		return;

	kdDebug() << "BashCodeCompletion::setActiveEditorPart"  << endl;

// We need to think about this
//	if(!(m_config->getCodeCompletion() || m_config->getCodeHinting())){
//		return; // no help
//	}

	m_editInterface = dynamic_cast<KTextEditor::EditInterface*>(part);
	if (!m_editInterface)
	{
		kdDebug() << "editor doesn't support the EditDocumentIface" << endl;
		return;
	}

	m_cursorInterface = dynamic_cast<KTextEditor::ViewCursorInterface*>(part->widget());
	if (!m_cursorInterface)
	{
		kdDebug() << "editor does not support the ViewCursorInterface" << endl;
		return;
	}

	m_codeInterface = dynamic_cast<KTextEditor::CodeCompletionInterface*>(part->widget());
	if (!m_codeInterface) { // no CodeCompletionDocument available
		kdDebug() << "editor doesn't support the CodeCompletionDocumentIface" << endl;
		return;
	}

	disconnect(part->widget(), 0, this, 0 ); // to make sure that it is't connected twice
	connect(part->widget(), SIGNAL(cursorPositionChanged()),
		this, SLOT(cursorPositionChanged()));
	connect(part->widget(), SIGNAL(argHintHidden()), this, SLOT(argHintHidden()));
	connect(part->widget(), SIGNAL(completionAborted()), this, SLOT(completionBoxAbort()));
	connect(part->widget(), SIGNAL(completionDone()), this, SLOT(completionBoxHidden()));

}
开发者ID:serghei,项目名称:kde3-kdevelop,代码行数:40,代码来源:bashsupport_part.cpp

示例12: QFrame

// Qt::SubWindow is needed to make QSizeGrip work
AnnotWindow::AnnotWindow( QWidget * parent, Okular::Annotation * annot, Okular::Document *document, int page )
    : QFrame( parent, Qt::SubWindow ), m_annot( annot ), m_document( document ), m_page( page )
{
    setAutoFillBackground( true );
    setFrameStyle( Panel | Raised );
    setAttribute( Qt::WA_DeleteOnClose );

    const bool canEditAnnotation = m_document->canModifyPageAnnotation( annot );

    textEdit = new KTextEdit( this );
    textEdit->setAcceptRichText( false );
    textEdit->setPlainText( m_annot->contents() );
    textEdit->installEventFilter( this );
    textEdit->setUndoRedoEnabled( false );

    m_prevCursorPos = textEdit->textCursor().position();
    m_prevAnchorPos = textEdit->textCursor().anchor();

    connect(textEdit, SIGNAL(textChanged()),
            this,SLOT(slotsaveWindowText()));
    connect(textEdit, SIGNAL(cursorPositionChanged()),
            this,SLOT(slotsaveWindowText()));
    connect(textEdit, SIGNAL(aboutToShowContextMenu(QMenu*)),
            this,SLOT(slotUpdateUndoAndRedoInContextMenu(QMenu*)));
    connect(m_document, SIGNAL(annotationContentsChangedByUndoRedo(Okular::Annotation*,QString,int,int)),
            this, SLOT(slotHandleContentsChangedByUndoRedo(Okular::Annotation*,QString,int,int)));

    if (!canEditAnnotation)
        textEdit->setReadOnly(true);

    QVBoxLayout * mainlay = new QVBoxLayout( this );
    mainlay->setMargin( 2 );
    mainlay->setSpacing( 0 );
    m_title = new MovableTitle( this );
    mainlay->addWidget( m_title );
    mainlay->addWidget( textEdit );
    QHBoxLayout * lowerlay = new QHBoxLayout();
    mainlay->addLayout( lowerlay );
    lowerlay->addItem( new QSpacerItem( 5, 5, QSizePolicy::Expanding, QSizePolicy::Fixed ) );
    QSizeGrip * sb = new QSizeGrip( this );
    lowerlay->addWidget( sb );

    m_latexRenderer = new GuiUtils::LatexRenderer();
    emit containsLatex( GuiUtils::LatexRenderer::mightContainLatex( m_annot->contents() ) );

    m_title->setTitle( m_annot->window().summary() );
    m_title->connectOptionButton( this, SLOT(slotOptionBtn()) );

    setGeometry(10,10,300,300 );

    reloadInfo();
}
开发者ID:Axure,项目名称:okular,代码行数:53,代码来源:annotwindow.cpp

示例13: 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,代码来源:codeeditor.cpp

示例14: QObject

SemanticMarkupEdition::SemanticMarkupEdition(
                                QTextEdit* textEdit): //krazy:exclude=qclasses
        QObject(textEdit),
    mTextEdit(textEdit) {
    Q_ASSERT(textEdit);

    connect(mTextEdit, SIGNAL(cursorPositionChanged()),
            this, SLOT(updateActionStates()));
    //TODO Needed to update the action states when the user deletes a character;
    //look how to do that without updating twice in any other text change.
    connect(mTextEdit, SIGNAL(textChanged()),
            this, SLOT(updateActionStates()));
}
开发者ID:KDE,项目名称:ktutorial,代码行数:13,代码来源:SemanticMarkupEdition.cpp

示例15: QPlainTextEdit

CodeEditor::CodeEditor(QWidget *parent)
    : QPlainTextEdit(parent)
 {
     m_countCache=QPair<int,int>(-1,-1);
     lineNumberArea = new LineNumberArea((CodeEditor*)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:nikhilgv9,项目名称:specRTLViz,代码行数:13,代码来源:codeeditor.cpp


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