本文整理汇总了C++中editor函数的典型用法代码示例。如果您正苦于以下问题:C++ editor函数的具体用法?C++ editor怎么用?C++ editor使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了editor函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
}
示例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();
}
示例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());
}
示例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"));
}
示例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);
}
}
示例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 ();
}
}
示例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;
}
示例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;
}
示例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();
}
}
示例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;
}
示例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;
}
示例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);
}
}
示例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;
}
示例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());
}
示例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() );
}