• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ editor函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: editor

    void Notifier::onInsertDocument()
    {
        if (!_queryInfo._info.isValid())
            return;

        DocumentTextEditor editor(_queryInfo._info,
            "{\n    \n}", false, dynamic_cast<QWidget*>(_observer));

        editor.setCursorPosition(1, 4);
        editor.setWindowTitle("Insert Document");

        int result = editor.exec();
        if (result != QDialog::Accepted)
            return;

        DocumentTextEditor::ReturnType obj = editor.bsonObj();
        for (DocumentTextEditor::ReturnType::const_iterator it = obj.begin(); it != obj.end(); ++it) {
            _shell->server()->insertDocument(*it, _queryInfo._info._ns);
        }
    }
开发者ID:guoyu07,项目名称:robomongo,代码行数:20,代码来源:Notifier.cpp


示例2: editor

bool InputMethodController::confirmCompositionOrInsertText(const String& text, ConfirmCompositionBehavior confirmBehavior)
{
    if (!hasComposition()) {
        if (!text.length())
            return false;
        editor().insertText(text, 0);
        return true;
    }

    if (text.length()) {
        confirmComposition(text);
        return true;
    }

    if (confirmBehavior != KeepSelection)
        return confirmComposition();

    SelectionOffsetsScope selectionOffsetsScope(this);
    return confirmComposition();
}
开发者ID:coinpayee,项目名称:blink,代码行数:20,代码来源:InputMethodController.cpp


示例3: Highlighter

void PlainTextEditorWidget::configure(const MimeType &mimeType)
{
    Highlighter *highlighter = new Highlighter();
    baseTextDocument()->setSyntaxHighlighter(highlighter);

    setCodeFoldingSupported(false);

    if (!mimeType.isNull()) {
        m_isMissingSyntaxDefinition = true;

        setMimeTypeForHighlighter(highlighter, mimeType);
        const QString &type = mimeType.type();
        setMimeType(type);

        QString definitionId = Manager::instance()->definitionIdByMimeType(type);
        if (definitionId.isEmpty())
            definitionId = findDefinitionId(mimeType, true);

        if (!definitionId.isEmpty()) {
            m_isMissingSyntaxDefinition = false;
            const QSharedPointer<HighlightDefinition> &definition =
                Manager::instance()->definition(definitionId);
            if (!definition.isNull() && definition->isValid()) {
                m_commentDefinition.isAfterWhiteSpaces = definition->isCommentAfterWhiteSpaces();
                m_commentDefinition.singleLine = definition->singleLineComment();
                m_commentDefinition.multiLineStart = definition->multiLineCommentStart();
                m_commentDefinition.multiLineEnd = definition->multiLineCommentEnd();

                setCodeFoldingSupported(true);
            }
        } else if (editorDocument()) {
            const QString &fileName = editorDocument()->filePath();
            if (TextEditorSettings::highlighterSettings().isIgnoredFilePattern(fileName))
                m_isMissingSyntaxDefinition = false;
        }
    }

    setFontSettings(TextEditorSettings::fontSettings());

    emit configured(editor());
}
开发者ID:zhongxingzhi,项目名称:qtcreator,代码行数:41,代码来源:plaintexteditor.cpp


示例4: getTerrainDefitionForTexture

	void Terrain::showTerrainDefinitionForTexture ()
	{
		if (!GlobalSelectionSystem().areFacesSelected()) {
			gtkutil::infoDialog(_("No faces selected"));
			return;
		}

		const Face &face = g_SelectedFaceInstances.last().getFace();
		const std::string shader = face.GetShader();

		const DataBlock* blockData = getTerrainDefitionForTexture(shader);
		if (blockData) {
			// found it, now show it
			ui::UFOScriptEditor editor("ufos/" + blockData->getFilename());
			editor.goToLine(blockData->getLineNumber());
			editor.show();
			return;
		}

		gtkutil::infoDialog(_("Could not find any associated terrain definition"));
	}
开发者ID:chrisglass,项目名称:ufoai,代码行数:21,代码来源:Terrain.cpp


示例5: editor

    void BsonTableView::onInsertDocument()
    {
        if (_queryInfo.isNull)
            return;

        DocumentTextEditor editor(QtUtils::toQString(_queryInfo.serverAddress),
            QtUtils::toQString(_queryInfo.databaseName),
            QtUtils::toQString(_queryInfo.collectionName),
            "{\n    \n}");

        editor.setCursorPosition(1, 4);
        editor.setWindowTitle("Insert Document");
        int result = editor.exec();
        activateWindow();

        if (result == QDialog::Accepted) {
            mongo::BSONObj obj = editor.bsonObj();
            _shell->server()->insertDocument(obj, _queryInfo.databaseName, _queryInfo.collectionName);
            _shell->query(0, _queryInfo);
        }
    }
开发者ID:rodrigok,项目名称:robomongo,代码行数:21,代码来源:BsonTableView.cpp


示例6: message_loop

void CRenderDevice::message_loop()
{
#ifdef INGAME_EDITOR
	if (editor()) {
		message_loop_editor	();
		return;
	}
#endif // #ifdef INGAME_EDITOR

	MSG						msg;
    PeekMessage				(&msg, NULL, 0U, 0U, PM_NOREMOVE );
	while (msg.message != WM_QUIT) {
		if (PeekMessage(&msg, NULL, 0U, 0U, PM_REMOVE)) {
			TranslateMessage(&msg);
			DispatchMessage	(&msg);
			continue;
		}

		on_idle				();
    }
}
开发者ID:Charsi82,项目名称:xray-1.5.10-2015-,代码行数:21,代码来源:device.cpp


示例7: visitBlock

    virtual void visitBlock(QTextBlock &block, const QTextCursor &caret)
    {
        for (QTextBlock::iterator it = block.begin(); it != block.end(); ++it) {
            QTextCursor fragmentSelection(caret);
            fragmentSelection.setPosition(it.fragment().position());
            fragmentSelection.setPosition(it.fragment().position() + it.fragment().length(), QTextCursor::KeepAnchor);

            if (fragmentSelection.anchor() >= fragmentSelection.position()) {
                continue;
            }

            visitFragmentSelection(fragmentSelection);
        }

        QList<QTextCharFormat>::Iterator it = m_formats.begin();
        Q_FOREACH (QTextCursor cursor, m_cursors) {
            QTextFormat prevFormat(cursor.charFormat());
            cursor.setCharFormat(*it);
            editor()->registerTrackedChange(cursor, KoGenChange::FormatChange, kundo2_i18n("Formatting"), *it, prevFormat, false);
            ++it;
        }
开发者ID:ChrisJong,项目名称:krita,代码行数:21,代码来源:ParagraphFormattingCommand.cpp


示例8: switch

QWidget *QueryConstraintsDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const
{
    switch (index.column())
    {
        case 0:
            break;

        case 1:
        {
            ::Tools::Memory::ScopedPointer<QComboBox> editor(new QComboBox(parent));

            editor->addItem(toUnicode(LiquidDb::GroupConstraint::operatorToString(LiquidDb::GroupConstraint::And)), LiquidDb::GroupConstraint::And);
            editor->addItem(toUnicode(LiquidDb::GroupConstraint::operatorToString(LiquidDb::GroupConstraint::Or)), LiquidDb::GroupConstraint::Or);
            editor->setCurrentIndex(0);

            return editor.take();
        }
    }

    return 0;
}
开发者ID:vilkov,项目名称:qfm,代码行数:21,代码来源:idm_queryconstraintsdelegate.cpp


示例9: qWarning

void PlayListHeaderModel::execEdit(int index, QWidget *parent)
{
    if(index < 0 || index >= m_columns.size())
    {
        qWarning("ColumnManager: index is out of range");
        return;
    }

    if(!parent)
        parent = qApp->activeWindow();

    ColumnEditor editor(m_columns[index].name, m_columns[index].pattern, parent);
    if(editor.exec() == QDialog::Accepted)
    {
        m_columns[index].name = editor.name();
        m_columns[index].pattern = editor.pattern();
        emit columnChanged(index);
        emit headerChanged();
        updatePlayLists();
    }
}
开发者ID:Greedysky,项目名称:qmmp,代码行数:21,代码来源:playlistheadermodel.cpp


示例10: value

void RKSpinBox::updateDisplay () {
	if (updating_b) return;
	updating_b = true;

	if (mode == Real) {
		if (value () != 0) {
			int change = value ();
			setValue (0);

			int power;
			if (real_value != 0) {
				power = (int) log10 (fabs (real_value)) - default_precision;
				if (power < (-default_precision)) power = -default_precision;
				if (power > 10) power = 10;
			} else {
				power = -default_precision;
			}
			double step = pow (10, power);

			real_value += change * step;
			if (real_value > real_max) real_value = real_max;
			if (real_value < real_min) real_value = real_min;
		}
		setUpdatesEnabled (false);
		QSpinBox::updateDisplay ();	// need this to enable/disable the button correctly
		editor ()->setText (QString ().setNum (real_value));
		setUpdatesEnabled (true);
	} else {
		QSpinBox::updateDisplay ();

		int power;
		if (value () != 0) power = (int) log10 (abs (value ()));
		else power = 1;
		int step = (int) pow (10, power-1);
		if (step < 1) step = 1;
		setSteps (step, 10*step);
	}

	updating_b = false;
}
开发者ID:svn2github,项目名称:rkward-svn-mirror,代码行数:40,代码来源:rkspinbox.cpp


示例11: confirmComposition

bool InputMethodController::confirmComposition(const String& text, ConfirmCompositionBehavior confirmBehavior)
{
    if (!hasComposition())
        return false;

    Optional<Editor::RevealSelectionScope> revealSelectionScope;
    if (confirmBehavior == KeepSelection)
        revealSelectionScope.emplace(&editor());

    // If the composition was set from existing text and didn't change, then
    // there's nothing to do here (and we should avoid doing anything as that
    // may clobber multi-node styled text).
    if (!m_isDirty && composingText() == text) {
        clear();
        return true;
    }

    // Select the text that will be deleted or replaced.
    selectComposition();

    if (frame().selection().isNone())
        return false;

    dispatchCompositionEndEvent(frame(), text);

    if (!frame().document())
        return false;

    // If text is empty, then delete the old composition here. If text is
    // non-empty, InsertTextCommand::input will delete the old composition with
    // an optimized replace operation.
    if (text.isEmpty())
        TypingCommand::deleteSelection(*frame().document(), 0);

    clear();

    insertTextForConfirmedComposition(text);

    return true;
}
开发者ID:aobzhirov,项目名称:ChromiumGStreamerBackend,代码行数:40,代码来源:InputMethodController.cpp


示例12: ASSERT

void InputMethodController::finishComposition(const String& text, FinishCompositionMode mode)
{
    ASSERT(mode == ConfirmComposition || mode == CancelComposition);
    UserTypingGestureIndicator typingGestureIndicator(m_frame);

    Editor::RevealSelectionScope revealSelectionScope(&editor());

    if (mode == CancelComposition)
        ASSERT(text == emptyString());
    else
        selectComposition();

    if (m_frame->selection().isNone())
        return;

    // Dispatch a compositionend event to the focused node.
    // We should send this event before sending a TextEvent as written in Section 6.2.2 and 6.2.3 of
    // the DOM Event specification.
    if (Element* target = m_frame->document()->focusedElement()) {
        RefPtr<CompositionEvent> event = CompositionEvent::create(eventNames().compositionendEvent, m_frame->domWindow(), text);
        target->dispatchEvent(event, IGNORE_EXCEPTION);
    }

    // If text is empty, then delete the old composition here. If text is non-empty, InsertTextCommand::input
    // will delete the old composition with an optimized replace operation.
    if (text.isEmpty() && mode != CancelComposition) {
        ASSERT(m_frame->document());
        TypingCommand::deleteSelection(*m_frame->document(), 0);
    }

    m_compositionNode = 0;
    m_customCompositionUnderlines.clear();

    insertTextForConfirmedComposition(text);

    if (mode == CancelComposition) {
        // An open typing command that disagrees about current selection would cause issues with typing later on.
        TypingCommand::closeTyping(m_frame);
    }
}
开发者ID:halton,项目名称:blink-crosswalk,代码行数:40,代码来源:InputMethodController.cpp


示例13: ResolveUrlName

OP_STATUS SpeedDialConfigController::ShowThumbnailPreview()
{
	OpString resolved_address;
	ResolveUrlName(m_address.Get(), resolved_address);
	if (resolved_address.IsEmpty())
		return OpStatus::OK;

	OpString resolved_title;
	RETURN_IF_ERROR(resolved_title.Set(m_title.Get()));
	if (resolved_title.IsEmpty())
	{
		OpString history_url;
		RETURN_IF_ERROR(GetUrlAndTitleFromHistory(m_address.Get(), history_url, resolved_title));
	}
	CleanUpTemporaryExtension();
	// Generate thumbnail
	EntryEditor editor(*this);
	editor.SetUrl(resolved_address);
	editor.SetTitle(resolved_title, FALSE);
	editor.SetExtensionId(NULL);
	return OpStatus::OK;
}
开发者ID:prestocore,项目名称:browser,代码行数:22,代码来源:SpeedDialConfigController.cpp


示例14: kDebug

void FacebookComposerWidget::slotPostMediaSubmitted(Choqok::Account* theAccount, Choqok::Post* post)
{
    kDebug();
    if( currentAccount() == theAccount && post == postToSubmit() ) {
        kDebug()<<"Accepted";
        disconnect(currentAccount()->microblog(), SIGNAL(postCreated(Choqok::Account*,Choqok::Post*)),
                   this, SLOT(slotPostMediaSubmitted(Choqok::Account*,Choqok::Post*)) );
        disconnect(currentAccount()->microblog(),
                    SIGNAL(errorPost(Choqok::Account*,Choqok::Post*,Choqok::MicroBlog::ErrorType,
                                    QString,Choqok::MicroBlog::ErrorLevel)),
                    this, SLOT(slotErrorPost(Choqok::Account*,Choqok::Post*)));
        if(btnAbort){
            btnAbort->deleteLater();
        }
        Choqok::NotifyManager::success(i18n("New post submitted successfully"));
        editor()->clear();
        replyToId.clear();
        editorContainer()->setEnabled(true);
        setPostToSubmit( 0L );
        cancelAttachMedium();
        currentAccount()->microblog()->updateTimelines(currentAccount());
    }
开发者ID:melandory,项目名称:choqok-facebook,代码行数:22,代码来源:facebookcomposerwidget.cpp


示例15: main

int main( int argc, char** argv )
{
    kvs::glut::Application app( argc, argv );

    kvs::StructuredVolumeObject* object = NULL;
    if ( argc > 1 ) object = new kvs::StructuredVolumeImporter( std::string( argv[1] ) );
    else            object = new kvs::HydrogenVolumeData( kvs::Vector3ui( 32, 32, 32 ) );

    kvs::RayCastingRenderer* renderer = new kvs::RayCastingRenderer();
    renderer->setShader( kvs::Shader::BlinnPhong() );
    renderer->enableLODControl();

    kvs::glut::Screen screen( &app );
    screen.registerObject( object, renderer );
    screen.show();

    TransferFunctionEditor editor( &screen );
    editor.setVolumeObject( object );
    editor.show();

    return( app.run() );
}
开发者ID:fudy1129,项目名称:kvs,代码行数:22,代码来源:main.cpp


示例16: rangeManager

void RdfTest::testCreateMarkers()
{
    QObject parent;

    // the rdf storage. In calligra, it's part of the KoDocument.
    KoDocumentRdf rdfDoc;

    // create a document
    QTextDocument doc;

    KoTextRangeManager rangeManager(&parent);
    KoTextDocument textDoc(&doc);
    textDoc.setTextRangeManager(&rangeManager);

    KoTextEditor editor(&doc);
    textDoc.setTextEditor(&editor);

    // insert some lorem ipsum
    editor.insertText(lorem);

    // insert a table and set a bookmark on it with semantics
    QString newId = insertTableWithSemItem(editor, rdfDoc, "test item1");

    // insert some more lorem before the table
    editor.insertText(lorem);

    // verify that the bookmark marks the table and only that
    QPair<int,int> position = rdfDoc.findExtent(newId);
    QCOMPARE(position.first, 2*(lorem.length()+1));
    QCOMPARE(position.second, 2*(lorem.length()+1)+TABLESIZE-1);

    editor.setPosition(position.first + 1);
    QPair<int,int> position2 = rdfDoc.findExtent(&editor);
    qDebug()<<position<<position2;
    QCOMPARE(position, position2);

    // check that the id is like we expext
    QCOMPARE(rdfDoc.findXmlId(&editor), newId);
}
开发者ID:KDE,项目名称:calligra,代码行数:39,代码来源:rdf_test.cpp


示例17: toText

void InputMethodController::setCompositionFromExistingText(const Vector<CompositionUnderline>& underlines, unsigned compositionStart, unsigned compositionEnd)
{
    Element* editable = m_frame.selection().rootEditableElement();
    Position base = m_frame.selection().base().downstream();
    Node* baseNode = base.anchorNode();
    if (editable->firstChild() == baseNode && editable->lastChild() == baseNode && baseNode->isTextNode()) {
        m_compositionNode = nullptr;
        m_customCompositionUnderlines.clear();

        if (base.anchorType() != Position::PositionIsOffsetInAnchor)
            return;
        if (!baseNode || baseNode != m_frame.selection().extent().anchorNode())
            return;

        m_compositionNode = toText(baseNode);
        RefPtr<Range> range = PlainTextRange(compositionStart, compositionEnd).createRange(*editable);
        m_compositionStart = range->startOffset();
        m_compositionEnd = range->endOffset();
        m_customCompositionUnderlines = underlines;
        size_t numUnderlines = m_customCompositionUnderlines.size();
        for (size_t i = 0; i < numUnderlines; ++i) {
            m_customCompositionUnderlines[i].startOffset += m_compositionStart;
            m_customCompositionUnderlines[i].endOffset += m_compositionStart;
        }

        // TODO(ojan): What was this for? Do we need it in sky since we
        // don't need to support legacy IMEs?
        if (baseNode->renderer())
            baseNode->document().scheduleVisualUpdate();

        return;
    }

    Editor::RevealSelectionScope revealSelectionScope(&editor());
    SelectionOffsetsScope selectionOffsetsScope(this);
    setSelectionOffsets(PlainTextRange(compositionStart, compositionEnd));
    setComposition(m_frame.selectedText(), underlines, 0, 0);
}
开发者ID:Jamesducque,项目名称:mojo,代码行数:38,代码来源:InputMethodController.cpp


示例18: editor

void ToolOptionWidget::onToolPropertyChanged( ToolType, ToolPropertyType ePropertyType )
{
    const Properties& p = editor()->tools()->currentTool()->properties;

    switch ( ePropertyType )
    {
        case WIDTH:
            setPenWidth( p.width );
            break;
        case FEATHER:
            setPenFeather( p.feather );
            break;
        case PRESSURE:
            setPressure( p.pressure );
            break;
        case INVISIBILITY:
            setPenInvisibility( p.invisibility );
            break;
        case PRESERVEALPHA:
            setPreserveAlpha( p.preserveAlpha );
            break;
    }
}
开发者ID:Forkhere,项目名称:pencil,代码行数:23,代码来源:tooloptiondockwidget.cpp


示例19: setEditorVisible

        void Dial::keyPressEvent(QKeyEvent* _event) {
            if (((_event->key() == Qt::Key_Enter) ||
                 (_event->key() == Qt::Key_Return)))
            {
                setEditorVisible(!editor()->hasFocus());
            }

            float _step = singleStep();

            if (_event->modifiers() & Qt::ShiftModifier) {
                _step = 1.0;
            }
            if (_event->modifiers() & Qt::ControlModifier) {
                _step = pageStep();
            }

            if (_event->key() == Qt::Key_Left) {
                setValue(value() - _step);
            }
            if (_event->key() == Qt::Key_Right) {
                setValue(value() + _step);
            }
        }
开发者ID:cr8tr,项目名称:omnidome,代码行数:23,代码来源:Dial.cpp


示例20: frame

void InputMethodController::setCompositionFromExistingText(const Vector<CompositionUnderline>& underlines, unsigned compositionStart, unsigned compositionEnd)
{
    Element* editable = frame().selection().rootEditableElement();
    Position base = frame().selection().base().downstream();
    Node* baseNode = base.anchorNode();
    if (baseNode && editable->firstChild() == baseNode && editable->lastChild() == baseNode && baseNode->isTextNode()) {
        m_compositionNode = nullptr;
        m_customCompositionUnderlines.clear();

        if (base.anchorType() != Position::PositionIsOffsetInAnchor)
            return;
        if (baseNode != frame().selection().extent().anchorNode())
            return;

        m_compositionNode = toText(baseNode);
        RefPtrWillBeRawPtr<Range> range = PlainTextRange(compositionStart, compositionEnd).createRange(*editable);
        if (!range)
            return;

        m_compositionStart = range->startOffset();
        m_compositionEnd = range->endOffset();
        m_customCompositionUnderlines = underlines;
        size_t numUnderlines = m_customCompositionUnderlines.size();
        for (size_t i = 0; i < numUnderlines; ++i) {
            m_customCompositionUnderlines[i].startOffset += m_compositionStart;
            m_customCompositionUnderlines[i].endOffset += m_compositionStart;
        }
        if (baseNode->layoutObject())
            baseNode->layoutObject()->setShouldDoFullPaintInvalidation();
        return;
    }

    Editor::RevealSelectionScope revealSelectionScope(&editor());
    SelectionOffsetsScope selectionOffsetsScope(this);
    setSelectionOffsets(PlainTextRange(compositionStart, compositionEnd));
    setComposition(frame().selectedText(), underlines, 0, 0);
}
开发者ID:joone,项目名称:blink-crosswalk,代码行数:37,代码来源:InputMethodController.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ edje_object_add函数代码示例发布时间:2022-05-30
下一篇:
C++ editingFinished函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap