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


C++ emitChanged函数代码示例

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


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

示例1: emitChanged

/******************************************************************************
*  Undo or redo a specified item.
*  Reply = true if success, or if the item no longer exists.
*/
bool Undo::undo(Undo::Iterator it, Undo::Type type, QWidget *parent, const QString &action)
{
    UndoItem::mRestoreError   = UndoItem::ERR_NONE;
    UndoItem::mRestoreWarning = UndoItem::WARN_NONE;
    UndoItem::mRestoreWarningCount = 0;
    if(it != mUndoList.end()  &&  it != mRedoList.end()  && (*it)->type() == type)
    {
        (*it)->restore();
        delete *it;    // N.B. 'delete' removes the object from its list
        emitChanged();
    }

    QString err;
    switch(UndoItem::mRestoreError)
    {
        case UndoItem::ERR_NONE:
        {
            KAlarm::KOrgUpdateError errcode;
            switch(UndoItem::mRestoreWarning)
            {
                case UndoItem::WARN_KORG_ADD:
                    errcode = KAlarm::KORG_ERR_ADD;
                    break;
                case UndoItem::WARN_KORG_MODIFY:
                    errcode = KAlarm::KORG_ERR_MODIFY;
                    break;
                case UndoItem::WARN_KORG_DELETE:
                    errcode = KAlarm::KORG_ERR_DELETE;
                    break;
                case UndoItem::WARN_NONE:
                default:
                    return true;
            }
            KAlarm::displayKOrgUpdateError(parent, errcode, UndoItem::mRestoreWarningCount);
            return true;
        }
        case UndoItem::ERR_NOT_FOUND:
            err = i18n("Alarm not found");
            break;
        case UndoItem::ERR_CREATE:
            err = i18n("Error recreating alarm");
            break;
        case UndoItem::ERR_TEMPLATE:
            err = i18n("Error recreating alarm template");
            break;
        case UndoItem::ERR_EXPIRED:
            err = i18n("Cannot reactivate expired alarm");
            break;
        case UndoItem::ERR_PROG:
            err = i18n("Program error");
            break;
        default:
            err = i18n("Unknown error");
            break;
    }
    KMessageBox::sorry(parent, i18n("Undo-action: message", "%1: %2").arg(action).arg(err));
    return false;
}
开发者ID:serghei,项目名称:kde3-kdepim,代码行数:62,代码来源:undo.cpp

示例2: emitChanged

void QClipboard::setMimeData(QMimeData* src, Mode mode)
{
    QPlatformClipboard *clipboard = QApplicationPrivate::platformIntegration()->clipboard();
    if (!clipboard->supportsMode(mode)) return;

    clipboard->setMimeData(src,mode);

    emitChanged(mode);
}
开发者ID:wpbest,项目名称:copperspice,代码行数:9,代码来源:qclipboard_qpa.cpp

示例3: saveReactivate

void Undo::saveReactivates(const QValueList<KAEvent> &events)
{
    int count = events.count();
    if(count == 1)
        saveReactivate(events.first());
    else if(count > 1)
    {
        new UndoReactivates(UNDO, events);
        emitChanged();
    }
}
开发者ID:serghei,项目名称:kde3-kdepim,代码行数:11,代码来源:undo.cpp

示例4: scanIntern

void KBookmarkManager::scan( const char * _path )
{
  m_Root.clear();
  
  // Do not emit 'changed' signals here.
  m_bAllowSignalChanged = false;
  scanIntern( &m_Root, _path );
  m_lstParsedDirs.clear();
  m_bAllowSignalChanged = true;
   
  emitChanged();
}
开发者ID:kthxbyte,项目名称:KDE1-Linaro,代码行数:12,代码来源:bookmark.cpp

示例5: saveDelete

void Undo::saveDeletes(const QValueList<KAEvent> &events)
{
    int count = events.count();
    if(count == 1)
        saveDelete(events.first());
    else if(count > 1)
    {
        new UndoDeletes(UNDO, events);
        for(QValueList<KAEvent>::ConstIterator it = events.begin();  it != events.end();  ++it)
            removeRedos((*it).id());    // remove any redos which are made invalid by these deletions
        emitChanged();
    }
}
开发者ID:serghei,项目名称:kde3-kdepim,代码行数:13,代码来源:undo.cpp

示例6: while

/******************************************************************************
*  Clear the lists of undo and redo items.
*/
void Undo::clear()
{
    if(!mUndoList.isEmpty()  ||  !mRedoList.isEmpty())
    {
        mInstance->blockSignals(true);
        while(mUndoList.count())
            delete mUndoList.first();    // N.B. 'delete' removes the object from the list
        while(mRedoList.count())
            delete mRedoList.first();    // N.B. 'delete' removes the object from the list
        mInstance->blockSignals(false);
        emitChanged();
    }
}
开发者ID:serghei,项目名称:kde3-kdepim,代码行数:16,代码来源:undo.cpp

示例7: clipboardData

bool QClipboard::event(QEvent *e)
{
    if (e->type() != QEvent::Clipboard)
        return QObject::event(e);

    QClipboardData *d = clipboardData();

    MSG *m = (MSG *)((QClipboardEvent*)e)->data();
    if (!m) {
        // this is sent to render all formats at app shut down
        if (ownsClipboard()) {
            OleFlushClipboard();
            d->releaseIData();
        }
        return true;
    }

    bool propagate = false;

    if (m->message == WM_CHANGECBCHAIN) {
        if ((HWND)m->wParam == d->nextClipboardViewer)
            d->nextClipboardViewer = (HWND)m->lParam;
        else
            propagate = true;
    } else if (m->message == WM_DRAWCLIPBOARD) {
        emitChanged(QClipboard::Clipboard);
        if (!ownsClipboard() && d->iData)
            // clean up the clipboard object if we no longer own the clipboard
            d->releaseIData();
        propagate = true;
    }
    if (propagate && d->nextClipboardViewer) {
        if (ptrIsHungAppWindow == 0) {
            QSystemLibrary library(QLatin1String("User32"));
            ptrIsHungAppWindow = (PtrIsHungAppWindow)library.resolve("IsHungAppWindow");
        }
        if (ptrIsHungAppWindow && ptrIsHungAppWindow(d->nextClipboardViewer)) {
            qWarning("%s: Cowardly refusing to send clipboard message to hung application...", Q_FUNC_INFO);
        } else if (isProcessBeingDebugged(d->nextClipboardViewer)) {
            // Also refuse if the process is being debugged, specifically, if it is
            // displaying a runtime assert, which is not caught by isHungAppWindow().
            qWarning("%s: Cowardly refusing to send clipboard message to application under debugger...", Q_FUNC_INFO);
        } else {
            SendMessage(d->nextClipboardViewer, m->message, m->wParam, m->lParam);
        }
    }

    return true;
}
开发者ID:maxxant,项目名称:qt,代码行数:49,代码来源:qclipboard_win.cpp

示例8: deserializeMimeData

void QMirClientClipboard::updateMimeData(const QByteArray &serializedMimeData)
{
    if (mUpdatesDisabled)
        return;

    QMimeData *newMimeData = deserializeMimeData(serializedMimeData);
    if (newMimeData) {
        delete mMimeData;
        mMimeData = newMimeData;
        mIsOutdated = false;
        emitChanged(QClipboard::Clipboard);
    } else {
        qWarning("QMirClientClipboard - Got invalid serialized mime data. Ignoring it.");
    }
}
开发者ID:2gis,项目名称:2gisqt5android,代码行数:15,代码来源:qmirclientclipboard.cpp

示例9: emitChanged

void ComponentChooser::restoreDefault() {
    if (configWidget)
    {
        dynamic_cast<CfgPlugin*>(configWidget)->defaults();
        emitChanged(true);
    }

/*
	txtEMailClient->setText("kmail");
	chkRunTerminal->setChecked(false);

	// Check if -e is needed, I do not think so
	terminalLE->setText("xterm");  //No need for i18n
	terminalCB->setChecked(true);
	emitChanged(false);
*/
}
开发者ID:mafrez,项目名称:plasma-desktop,代码行数:17,代码来源:componentchooser.cpp

示例10: QListWidgetItem

void WindowDefinitionListWidget::doCopyFromObject()
    {
    // We are asked to copy again from object. Recreate our working copy
    if (_working) delete _working;
    _working = _windowdefs->copy();

    ui.comment->setText(_working->comment());

    for ( KHotKeys::Windowdef_list::ConstIterator it(_working->constBegin());
            it != _working->constEnd();
            ++it)
        {
        new QListWidgetItem((*it)->description(), ui.list);
        }

    emitChanged(false);
    }
开发者ID:KDE,项目名称:khotkeys,代码行数:17,代码来源:window_definition_list_widget.cpp

示例11: qDeleteAll

void WindowDefinitionListWidget::doCopyToObject()
    {
    // Delete the old content
    qDeleteAll(*_windowdefs);
    _windowdefs->clear();

    _windowdefs->set_comment(ui.comment->text());

    for (int i=0; i<_working->size(); ++i)
        {
        _windowdefs->append(_working->at(i)->copy());
        }

    // Reset our _changed state
    _changed = false;
    emitChanged(false);
    }
开发者ID:KDE,项目名称:khotkeys,代码行数:17,代码来源:window_definition_list_widget.cpp

示例12: qCDebug

bool QWindowsClipboard::clipboardViewerWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam, LRESULT *result)
{
    enum { wMClipboardUpdate = 0x031D };

    *result = 0;
    if (QWindowsContext::verbose)
        qCDebug(lcQpaMime) << __FUNCTION__ << hwnd << message << QWindowsGuiEventDispatcher::windowsMessageName(message);

    switch (message) {
    case WM_CHANGECBCHAIN: {
        const HWND toBeRemoved = (HWND)wParam;
        if (toBeRemoved == m_nextClipboardViewer) {
            m_nextClipboardViewer = (HWND)lParam;
        } else {
            propagateClipboardMessage(message, wParam, lParam);
        }
    }
        return true;
    case wMClipboardUpdate:  // Clipboard Format listener (Vista onwards)
    case WM_DRAWCLIPBOARD: { // Clipboard Viewer Chain handling (up to XP)
        const bool owned = ownsClipboard();
        qCDebug(lcQpaMime) << "Clipboard changed owned " << owned;
        emitChanged(QClipboard::Clipboard);
        // clean up the clipboard object if we no longer own the clipboard
        if (!owned && m_data)
            releaseIData();
        if (!m_formatListenerRegistered)
            propagateClipboardMessage(message, wParam, lParam);
    }
        return true;
    case WM_DESTROY:
        // Recommended shutdown
        if (ownsClipboard()) {
            qCDebug(lcQpaMime) << "Clipboard owner on shutdown, releasing.";
            OleFlushClipboard();
            releaseIData();
        }
        return true;
    } // switch (message)
    return false;
}
开发者ID:venkatarajasekhar,项目名称:Qt,代码行数:41,代码来源:qwindowsclipboard.cpp

示例13: qDebug

bool QWindowsClipboard::clipboardViewerWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam, LRESULT *result)
{
    *result = 0;
    if (QWindowsContext::verboseOLE)
            qDebug("%s HWND=%p 0x%x %s", __FUNCTION__, hwnd, message,
                   QWindowsGuiEventDispatcher::windowsMessageName(message));

    switch (message) {
    case WM_CHANGECBCHAIN: {
        const HWND toBeRemoved = (HWND)wParam;
        if (toBeRemoved == m_nextClipboardViewer) {
            m_nextClipboardViewer = (HWND)lParam;
        } else {
            propagateClipboardMessage(message, wParam, lParam);
        }
    }
        return true;
    case WM_DRAWCLIPBOARD: {
        const bool owned = ownsClipboard();
        if (QWindowsContext::verboseOLE)
            qDebug("Clipboard changed owned %d", owned);
        emitChanged(QClipboard::Clipboard);
        // clean up the clipboard object if we no longer own the clipboard
        if (!owned && m_data)
            releaseIData();
        propagateClipboardMessage(message, wParam, lParam);
    }
        return true;
    case WM_DESTROY:
        // Recommended shutdown
        if (ownsClipboard()) {
            if (QWindowsContext::verboseOLE)
                qDebug("Clipboard owner on shutdown, releasing.");
            OleFlushClipboard();
            releaseIData();
        }
        return true;
    } // switch (message)
    return false;
}
开发者ID:CodeDJ,项目名称:qt5-hidpi,代码行数:40,代码来源:qwindowsclipboard.cpp

示例14: clipboardData

bool QClipboard::event(QEvent *e)
{
    static bool recursionWatch = false;
    if (e->type() != QEvent::Clipboard || recursionWatch)
        return QObject::event(e);

    recursionWatch = true;
    QWSPropertyNotifyEvent *event = (QWSPropertyNotifyEvent *)(((QClipboardEvent *)e)->data());
    if (event && event->simpleData.state == QWSPropertyNotifyEvent::PropertyNewValue) {
	QClipboardData *d = clipboardData();
	QString t = qwsClipboardText();
	if( (d->source() == 0 && !t.isEmpty()) || (d->source() != 0 && d->source()->text() != t) ) {
	    if( !d->source() )
		d->setSource(new QMimeData);
	    d->source()->setText( t );
	    emitChanged(QClipboard::Clipboard);
	}
    }

    recursionWatch = false;
    return true;
}
开发者ID:jbartolozzi,项目名称:CIS462_HW1,代码行数:22,代码来源:qclipboard_qws.cpp

示例15: Q_ASSERT

void WindowDefinitionListWidget::slotDelete(bool)
    {
    // TODO: Deactivate buttons if nothing is selected
    if (ui.list->currentRow() == -1)
        return;

    Q_ASSERT(ui.list->currentRow() < _working->count());

    KHotKeys::Windowdef *def = _working->at(ui.list->currentRow());
    KHotKeys::Windowdef_simple *sim = dynamic_cast<KHotKeys::Windowdef_simple*>(def);
    Q_ASSERT(sim);

    // Remove it from the list
    ui.list->takeItem(ui.list->currentRow());

    // delete it
    _working->removeAll(sim);
    delete sim;

    emitChanged(true);

    return;
    }
开发者ID:KDE,项目名称:khotkeys,代码行数:23,代码来源:window_definition_list_widget.cpp


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