本文整理汇总了C++中contentsChanged函数的典型用法代码示例。如果您正苦于以下问题:C++ contentsChanged函数的具体用法?C++ contentsChanged怎么用?C++ contentsChanged使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了contentsChanged函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: connect
void MaxQTextDocument::doConnections() {
connect(document, SIGNAL(blockCountChanged(int)), SLOT(onBlockCountChanged(int)));
connect(document, SIGNAL(contentsChange(int, int, int)), SLOT(onContentsChange(int, int, int)));
connect(document, SIGNAL(contentsChanged()), SLOT(onContentsChanged()));
connect(document, SIGNAL(cursorPositionChanged(const QTextCursor &)), SLOT(onCursorPositionChanged(const QTextCursor &)));
connect(document, SIGNAL(documentLayoutChanged()), SLOT(onDocumentLayoutChanged()));
connect(document, SIGNAL(modificationChanged(bool)), SLOT(onModificationChanged(bool)));
connect(document, SIGNAL(redoAvailable(bool)), SLOT(onRedoAvailable(bool)));
connect(document, SIGNAL(undoAvailable(bool)), SLOT(onUndoAvailable(bool)));
connect(document, SIGNAL(undoCommandAdded()), SLOT(onUndoCommandAdded()));
}
示例2: QGraphicsTextItem
AMGraphicsTextItem::AMGraphicsTextItem(QGraphicsItem* parent, QGraphicsScene* scene) :
QGraphicsTextItem(parent,scene)
{
document_ = document();
connect(document_, SIGNAL(contentsChanged()), SLOT(changingText()));
QFont font;
font.setFamily("Helvitica");
setFont(font);
dontChangeSelection_ = false;
selectAll_ = false;
}
示例3: QTextDocument
TextModelLavaan::TextModelLavaan(QObject *parent)
: QTextDocument(parent)
{
_boundTo = NULL;
_currentBlock = 0;
_changed = false;
this->setDocumentMargin(12);
connect(this, SIGNAL(contentsChanged()), this, SLOT(contentChangedHandler()));
}
示例4: CQTOpenGLLuaEditor
void CQTOpenGLLuaMainWindow::CreateCodeEditor() {
/* Create code editor */
m_pcCodeEditor = new CQTOpenGLLuaEditor(this);
setCentralWidget(m_pcCodeEditor);
m_pcCodeEditor->setPlainText(SCRIPT_TEMPLATE);
/* Connect stuff */
connect(m_pcCodeEditor->document(), SIGNAL(contentsChanged()),
this, SLOT(CodeModified()));
connect(&(m_pcMainWindow->GetOpenGLWidget()), SIGNAL(StepDone(int)),
this, SLOT(CheckLuaStatus(int)));
}
示例5: QDialog
VolumeDialogImpl::VolumeDialogImpl( QWidget* parent, Qt::WFlags fl )
: QDialog( parent, fl ), m_tid(0), m_oldValue(0), m_d(new VolumeDialogImplPrivate)
{
screenUpdate();
QColor c(Qt::black);
c.setAlpha(255); //XXX: Make fully opaque for now, for DirectPainter widgets in the background
setAttribute(Qt::WA_SetPalette, true);
QPalette p = palette();
p.setBrush(QPalette::Window, c);
setPalette(p);
QVBoxLayout *vBox = new QVBoxLayout(this);
QHBoxLayout *hBox = new QHBoxLayout;
volumeWidget = new VolumeWidget(this);
QIcon icon(":icon/sound");
QIcon mute(":icon/mute");
QLabel* volumeLevel = new QLabel(this);
volumeLevel->setAlignment(Qt::AlignRight | Qt::AlignCenter);
volumeLevel->setMinimumWidth( fontMetrics().width("100%") );
volumeLevel->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Maximum);
connect(this, SIGNAL(setText(QString)), volumeLevel, SLOT(setText(QString)));
volumeWidget->l = new QLabel(this);
volumeWidget->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Preferred);
volumeWidget->l->setPixmap(icon.pixmap(64, 64));
volumeWidget->m = new QLabel(this);
volumeWidget->m->hide();
volumeWidget->m->setPixmap(mute.pixmap(64, 64));
hBox->addStretch();
hBox->addWidget(volumeWidget->l);
hBox->addWidget(volumeWidget->m);
hBox->addStretch();
QHBoxLayout *wp = new QHBoxLayout;
wp->addWidget(volumeWidget);
wp->addWidget(volumeLevel);
vBox->addLayout(hBox);
vBox->addLayout(wp);
connect(m_d->m_vsVolume, SIGNAL(contentsChanged()), this, SLOT(valueSpaceVolumeChanged()));
initialized = 0;
old_slot = 0;
resetTimer();
}
示例6: tr
void MdiChild::newFile()
{
static int sequenceNumber = 1;
isUntitled = true;
curFile = tr("document%1.txt").arg(sequenceNumber++);
setWindowTitle(curFile + "[*]");
connect(document(), SIGNAL(contentsChanged()),
this, SLOT(documentWasModified()));
}
示例7: QGraphicsTextItem
UBGraphicsTextItem::UBGraphicsTextItem(QGraphicsItem * parent)
: QGraphicsTextItem(parent)
, mDelegate(0)
, mMultiClickState(0)
, mLastMousePressTime(QTime::currentTime())
{
mDelegate = new UBGraphicsTextItemDelegate(this, 0);
mDelegate->init();
mDelegate->frame()->setOperationMode(UBGraphicsDelegateFrame::Resizing);
mTypeTextHereLabel = tr("<Type Text Here>");
if (lastUsedTextColor.isValid())
{
setDefaultTextColor(lastUsedTextColor);
setColorOnDarkBackground(lastUsedTextColor);
setColorOnLightBackground(lastUsedTextColor);
}
else
{
QColor colorOnDarkBG = UBApplication::boardController->penColorOnDarkBackground();
QColor colorOnLightBG = UBApplication::boardController->penColorOnLightBackground();
setColorOnDarkBackground(colorOnDarkBG);
setColorOnLightBackground(colorOnLightBG);
}
setData(UBGraphicsItemData::ItemLayerType, UBItemLayerType::Object);
setFlag(QGraphicsItem::ItemIsSelectable, true);
setFlag(QGraphicsItem::ItemSendsGeometryChanges, true);
setTextInteractionFlags(Qt::TextEditorInteraction);
connect(document(), SIGNAL(contentsChanged()), mDelegate, SLOT(contentsChanged()));
connect(document(), SIGNAL(undoCommandAdded()), this, SLOT(undoCommandAdded()));
connect(document()->documentLayout(), SIGNAL(documentSizeChanged(const QSizeF &)), this, SLOT(documentSizeChanged(const QSizeF &)));
}
示例8: Q_UNUSED
bool
AmazonShoppingCartModel::removeRows( int row, int count, const QModelIndex &parent )
{
Q_UNUSED( count )
beginRemoveRows( parent, row, 1 ); // we can only select one item
AmazonShoppingCart::instance()->remove( row );
endRemoveRows();
emit contentsChanged();
return true;
}
示例9: QgsComposerItem
QgsComposerFrame::QgsComposerFrame( QgsComposition* c, QgsComposerMultiFrame* mf, qreal x, qreal y, qreal width, qreal height )
: QgsComposerItem( x, y, width, height, c )
, mMultiFrame( mf )
{
//repaint frame when multiframe content changes
connect( mf, SIGNAL( contentsChanged() ), this, SLOT( repaint() ) );
if ( mf )
{
//force recalculation of rect, so that multiframe specified sizes can be applied
setSceneRect( QRectF( pos().x(), pos().y(), rect().width(), rect().height() ) );
}
}
示例10: QMainWindow
JsonEditorMain::JsonEditorMain(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::JsonEditorMain),
newInsertText(tr("Insert new data")),
treeViewColumnKey(tr("Node")),
treeViewColumnValue(tr("Value")),
treeViewColumnType(tr("Type"))
{
ui->setupUi(this);
connect(ui->menuCodeTools, SIGNAL(toggled(bool)), this, SLOT(toggleCodeToolbar(bool)));
connect(ui->menuFindTools, SIGNAL(toggled(bool)), this, SLOT(toggleFindToolbar(bool)));
connect(ui->menuFileTools, SIGNAL(toggled(bool)), this, SLOT(toggleFileToolbar(bool)));
connect(ui->menuEditTools, SIGNAL(toggled(bool)), this, SLOT(toggleEditToolbar(bool)));
connect(ui->menuRefresh, SIGNAL(triggered()), this, SLOT(refreshJsonTree()));
connect(ui->menuInsertNode, SIGNAL(triggered()), this, SLOT(insertTreeNode()));
connect(ui->menuInsertChild, SIGNAL(triggered()), this, SLOT(insertTreeChild()));
connect(ui->menuDeleteNode, SIGNAL(triggered()), this, SLOT(deleteTreeNode()));
connect(ui->jsonTree, SIGNAL(clicked(QModelIndex)), this, SLOT(updateActions()));
connect(ui->menuFormat, SIGNAL(triggered()), this, SLOT(formatCode()));
connect(ui->menuHelp, SIGNAL(triggered()), this, SLOT(showHelp()));
connect(ui->jsonTree, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(dataEdit(QModelIndex)));
// connect(ui->menuNewFile, SIGNAL(triggered()), this, SLOT(newFile()));
connect(ui->menuOpenFile, SIGNAL(triggered()), this, SLOT(open()));
connect(ui->menuSaveFile, SIGNAL(triggered()), this, SLOT(save()));
connect(ui->menuSaveAs, SIGNAL(triggered()), this, SLOT(saveAs()));
JSHighlighter * highlight = new JSHighlighter(ui->jsonCode->document());
setCurrentFile("");
textEdit = ui->jsonCode;
connect(textEdit->document(), SIGNAL(contentsChanged()),
this, SLOT(documentWasModified()));
setUnifiedTitleAndToolBarOnMac(true);
m_findDialog = new FindDialog(this);
m_findDialog->setModal(false);
m_findDialog->setTextEdit(textEdit);
m_findReplaceDialog = new FindReplaceDialog(this);
m_findReplaceDialog->setModal(false);
m_findReplaceDialog->setTextEdit(textEdit);
connect(ui->menuFind, SIGNAL(triggered()), m_findDialog, SLOT(show()));
connect(ui->menuReplace, SIGNAL(triggered()), m_findReplaceDialog, SLOT(show()));
// connect(ui->actionFindNext, SIGNAL(triggered()), m_findDialog, SLOT(findNext()));
// connect(ui->actionFindPrevious, SIGNAL(triggered()), m_findDialog, SLOT(findPrev()));
readSettings();
}
示例11: QDockWidget
void MainWindow::createDockWindows()
{
QDockWidget *dock = new QDockWidget(tr("Text Editor"), this);
m_editor = new TextEdit(dock);
connect(m_editor->document(), SIGNAL(contentsChanged()), this, SLOT(onEditorChanged()));
dock->setWidget(m_editor);
dock->setObjectName("text_editor");
addDockWidget(Qt::RightDockWidgetArea, dock);
m_showEditorDockAction = dock->toggleViewAction();
m_showEditorDockAction->setIconVisibleInMenu(false);
m_showEditorDockAction->setStatusTip(tr("Show or hide the document editor dock"));
m_showEditorDockAction->setIcon(QIcon::fromTheme("accessories-text-editor"));
m_showEditorDockAction->setShortcut(QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_0));
dock = new QDockWidget(tr("Assistant"), this);
m_assistantToolBox = new QToolBox(dock);
dock->setWidget(m_assistantToolBox);
dock->setObjectName("assistant");
addDockWidget(Qt::LeftDockWidgetArea, dock);
connect(m_assistantToolBox, SIGNAL(currentChanged(int)),
this, SLOT(onCurrentAssistantChanged(int)));
m_showAssistantDockAction = dock->toggleViewAction();
m_showAssistantDockAction->setIconVisibleInMenu(false);
m_showAssistantDockAction->setStatusTip(tr("Show or hide the assistant dock"));
#if !defined(Q_WS_WIN) // BUG: icons are not displayed when cross-linking
m_showAssistantDockAction->setIcon(QIcon(":/assistant.svg"));
#endif
m_showAssistantDockAction->setShortcut(QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_1));
dock = new QDockWidget(tr("Assistant Info"), this);
QWidget* widget = new QWidget(dock);
m_assistantPreviewNotes = new QLabel(widget);
m_assistantPreviewNotes->setText(tr("Code:"));
m_assistantCodePreview = new QTextEdit(widget);
m_assistantCodePreview->setReadOnly(true);
QBoxLayout* assistant_info_layout = new QBoxLayout(QBoxLayout::TopToBottom, widget);
assistant_info_layout->addWidget(m_assistantPreviewNotes);
assistant_info_layout->addWidget(m_assistantCodePreview);
widget->setLayout(assistant_info_layout);
dock->setWidget(widget);
dock->setObjectName("assistant_info");
addDockWidget(Qt::LeftDockWidgetArea, dock);
m_showAssistantInfoDockAction = dock->toggleViewAction();
m_showAssistantInfoDockAction->setIconVisibleInMenu(false);
m_showAssistantInfoDockAction->setStatusTip(tr("Show or hide the assistant info dock"));
#if !defined(Q_WS_WIN) // BUG: icons are not displayed when cross-linking
m_showAssistantInfoDockAction->setIcon(QIcon(":/assistant-info.svg"));
#endif
m_showAssistantInfoDockAction->setShortcut(QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_2));
}
示例12: QTextEdit
FlatTextarea::FlatTextarea(QWidget *parent, const style::flatTextarea &st, const QString &pholder, const QString &v) : QTextEdit(parent),
_minHeight(-1), _maxHeight(-1), _maxLength(-1), _ctrlEnterSubmit(true),
_oldtext(v), _phVisible(!v.length()),
a_phLeft(_phVisible ? 0 : st.phShift), a_phAlpha(_phVisible ? 1 : 0), a_phColor(st.phColor->c),
_st(st), _undoAvailable(false), _redoAvailable(false), _inDrop(false), _inHeightCheck(false), _fakeMargin(0),
_touchPress(false), _touchRightButton(false), _touchMove(false), _correcting(false) {
setAcceptRichText(false);
resize(_st.width, _st.font->height);
setFont(_st.font->f);
setAlignment(_st.align);
setPlaceholder(pholder);
QPalette p(palette());
p.setColor(QPalette::Text, _st.textColor->c);
setPalette(p);
setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
setFrameStyle(QFrame::NoFrame | QFrame::Plain);
viewport()->setAutoFillBackground(false);
setContentsMargins(0, 0, 0, 0);
switch (cScale()) {
case dbisOneAndQuarter:
_fakeMargin = 1;
break;
case dbisOneAndHalf:
_fakeMargin = 2;
break;
case dbisTwo:
_fakeMargin = 4;
break;
}
setStyleSheet(qsl("QTextEdit { margin: %1px; }").arg(_fakeMargin));
viewport()->setAttribute(Qt::WA_AcceptTouchEvents);
_touchTimer.setSingleShot(true);
connect(&_touchTimer, SIGNAL(timeout()), this, SLOT(onTouchTimer()));
connect(document(), SIGNAL(contentsChange(int, int, int)), this, SLOT(onDocumentContentsChange(int, int, int)));
connect(document(), SIGNAL(contentsChanged()), this, SLOT(onDocumentContentsChanged()));
connect(this, SIGNAL(undoAvailable(bool)), this, SLOT(onUndoAvailable(bool)));
connect(this, SIGNAL(redoAvailable(bool)), this, SLOT(onRedoAvailable(bool)));
if (App::wnd()) connect(this, SIGNAL(selectionChanged()), App::wnd(), SLOT(updateGlobalMenu()));
if (!v.isEmpty()) {
setPlainText(v);
}
}
示例13: QThread
SiteResponseModel::SiteResponseModel(QObject * parent)
: QThread(parent), m_calculator(0)
{
m_modified = false;
m_hasResults = false;
m_method = EquivalentLinear;
m_okToContinue = true;
m_isLoaded = false;
connect(Units::instance(), SIGNAL(systemChanged(int)),
this, SLOT(setModified()));
m_randNumGen = new MyRandomNumGenerator(this);
connect(m_randNumGen, SIGNAL(wasModified()),
this, SLOT(setModified()));
m_motionLibrary = new MotionLibrary(this);
m_motionLibrary->setReadOnly(m_hasResults);
connect(m_motionLibrary, SIGNAL(wasModified()),
this, SLOT(setModified()));
connect(this, SIGNAL(hasResultsChanged(bool)),
m_motionLibrary, SLOT(setReadOnly(bool)));
m_siteProfile = new SoilProfile(this);
m_siteProfile->setReadOnly(m_hasResults);
connect( m_siteProfile, SIGNAL(wasModified()),
this, SLOT(setModified()));
connect(this, SIGNAL(hasResultsChanged(bool)),
m_siteProfile, SLOT(setReadOnly(bool)));
m_outputCatalog = new OutputCatalog(this);
m_outputCatalog->setReadOnly(m_hasResults);
connect(m_motionLibrary, SIGNAL(wasModified()),
this, SLOT(setModified()));
connect(this, SIGNAL(hasResultsChanged(bool)),
m_outputCatalog, SLOT(setReadOnly(bool)));
connect(m_outputCatalog, SIGNAL(wasModified()),
this, SLOT(setModified()));
connect(this->motionLibrary(), SIGNAL(approachChanged(int)),
m_outputCatalog->profilesCatalog(), SLOT(setApproach(int)));
// Associate the output soil types catalog with the input soil types catalog
// Should these have a stronger link? As in be the same object?
m_outputCatalog->soilTypesCatalog()->setSoilTypeCatalog(m_siteProfile->soilTypeCatalog());
setCalculator(new EquivalentLinearCalculator(this));
m_notes = new QTextDocument(this);
connect(m_notes, SIGNAL(contentsChanged()), this, SLOT(setModified()));
Units::instance()->reset();
}
示例14: disconnect
void
ControlRulerWidget::setSegment(Segment *segment)
{
if (m_segment) {
disconnect(m_segment, SIGNAL(contentsChanged(timeT, timeT)),
this, SLOT(slotUpdateRulers(timeT, timeT)));
}
m_segment = segment;
RG_DEBUG << "ControlRulerWidget::setSegments Widget contains" << m_controlRulerList.size() << "rulers.";
if (m_controlRulerList.size()) {
std::list<ControlRuler *>::iterator it;
for (it = m_controlRulerList.begin(); it != m_controlRulerList.end(); ++it) {
(*it)->setSegment(m_segment);
}
}
if (m_segment) {
connect(m_segment, SIGNAL(contentsChanged(timeT, timeT)),
this, SLOT(slotUpdateRulers(timeT, timeT)));
}
}
示例15: Q_UNUSED
void CppEditorDocument::onFilePathChanged(const Utils::FileName &oldPath,
const Utils::FileName &newPath)
{
Q_UNUSED(oldPath);
if (!newPath.isEmpty()) {
Utils::MimeDatabase mdb;
setMimeType(mdb.mimeTypeForFile(newPath.toFileInfo()).name());
disconnect(this, SIGNAL(contentsChanged()), this, SLOT(scheduleProcessDocument()));
connect(this, SIGNAL(contentsChanged()), this, SLOT(scheduleProcessDocument()));
// Un-Register/Register in ModelManager
m_editorDocumentHandle.reset();
m_editorDocumentHandle.reset(new CppEditorDocumentHandleImpl(this));
resetProcessor();
updatePreprocessorSettings();
m_processorRevision = document()->revision();
processDocument();
}
}