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

C++ q_func函数代码示例

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

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



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

示例1: QHttpConnectionPrivate

    explicit     QHttpConnectionPrivate(QHttpConnection* q) : HttpParser(HTTP_REQUEST), q_ptr(q) {

        QObject::connect(q_func(), &QHttpConnection::disconnected, [this](){
            // if socket drops and http_parser can not call messageComplete, dispatch the ilastRequest
            onDispatchRequest();
            isocket.release();

            if ( ilastRequest )
                ilastRequest->deleteLater();
            if ( ilastResponse )
                ilastResponse->deleteLater();

            q_func()->deleteLater();
        });

        QHTTP_LINE_DEEPLOG
    }
开发者ID:Diganth,项目名称:plex-media-player,代码行数:17,代码来源:qhttpserverconnection_private.hpp


示例2: SIGNAL

void QGraphicsSceneIndexPrivate::init()
{
    if (!scene)
        return;

    QObject::connect(scene, SIGNAL(sceneRectChanged(QRectF)),
                     q_func(), SLOT(updateSceneRect(QRectF)));
}
开发者ID:jbartolozzi,项目名称:CIS462_HW1,代码行数:8,代码来源:qgraphicssceneindex.cpp


示例3: switch

void QextSerialPortPrivate::setDataBits(DataBitsType dataBits, bool update)
{
    switch(dataBits) {

    case DATA_5:
        if (Settings.StopBits==STOP_2) {
            QESP_WARNING("QextSerialPort: 5 Data bits cannot be used with 2 stop bits.");
        }
        else {
            Settings.DataBits=dataBits;
            settingsDirtyFlags |= DFE_DataBits;
        }
        break;

    case DATA_6:
#ifdef Q_OS_WIN
        if (Settings.StopBits==STOP_1_5) {
            QESP_WARNING("QextSerialPort: 6 Data bits cannot be used with 1.5 stop bits.");
        }
        else
#endif
        {
            Settings.DataBits=dataBits;
            settingsDirtyFlags |= DFE_DataBits;
        }
        break;

    case DATA_7:
#ifdef Q_OS_WIN
        if (Settings.StopBits==STOP_1_5) {
            QESP_WARNING("QextSerialPort: 7 Data bits cannot be used with 1.5 stop bits.");
        }
        else
#endif
        {
            Settings.DataBits=dataBits;
            settingsDirtyFlags |= DFE_DataBits;
        }
        break;

    case DATA_8:
#ifdef Q_OS_WIN
        if (Settings.StopBits==STOP_1_5) {
            QESP_WARNING("QextSerialPort: 8 Data bits cannot be used with 1.5 stop bits.");
        }
        else
#endif
        {
            Settings.DataBits=dataBits;
            settingsDirtyFlags |= DFE_DataBits;
        }
        break;
    default:
        QESP_WARNING()<<"QextSerialPort does not support Data bits:"<<dataBits;
    }
    if (update && q_func()->isOpen())
        updatePortSettings();
}
开发者ID:PeterS242,项目名称:YARRH,代码行数:58,代码来源:qextserialport.cpp


示例4: CHECK_SIZE_LESS_THAN

QModbusResponse QModbusServerPrivate::processWriteMultipleRegistersRequest(
    const QModbusRequest &request)
{
    CHECK_SIZE_LESS_THAN(request);
    quint16 address, numberOfRegisters;
    quint8 byteCount;
    request.decodeData(&address, &numberOfRegisters, &byteCount);

    // byte count does not match number of data bytes following or register count
    if ((byteCount != (request.dataSize() - 5 )) || (byteCount != (numberOfRegisters * 2))) {
        return QModbusExceptionResponse(request.functionCode(),
                                        QModbusExceptionResponse::IllegalDataValue);
    }

    if ((numberOfRegisters < 0x0001) || (numberOfRegisters > 0x007B)) {
        return QModbusExceptionResponse(request.functionCode(),
                                        QModbusExceptionResponse::IllegalDataValue);
    }

    // Get the requested range out of the registers.
    QModbusDataUnit registers(QModbusDataUnit::HoldingRegisters, address, numberOfRegisters);
    if (!q_func()->data(&registers)) {
        return QModbusExceptionResponse(request.functionCode(),
                                        QModbusExceptionResponse::IllegalDataAddress);
    }

    const QByteArray pduData = request.data().remove(0,5);
    QDataStream stream(pduData);

    QVector<quint16> values;
    quint16 tmp;
    for (int i = 0; i < numberOfRegisters; i++) {
        stream >> tmp;
        values.append(tmp);
    }

    registers.setValues(values);

    if (!q_func()->setData(registers)) {
        return QModbusExceptionResponse(request.functionCode(),
                                        QModbusExceptionResponse::ServerDeviceFailure);
    }

    return QModbusResponse(request.functionCode(), address, numberOfRegisters);
}
开发者ID:2gis,项目名称:2gisqt5android,代码行数:45,代码来源:qmodbusserver.cpp


示例5: switch

void QMediaImageViewerPrivate::_q_mediaStatusChanged(QMediaImageViewer::MediaStatus status)
{
    switch (status) {
    case QMediaImageViewer::NoMedia:
    case QMediaImageViewer::LoadingMedia:
        emit q_func()->mediaStatusChanged(status);
        break;
    case QMediaImageViewer::LoadedMedia:
        if (state == QMediaImageViewer::PlayingState) {
            time.start();
            timer.start(qMax(0, timeout), q_func());
            q_func()->addPropertyWatch("elapsedTime");
        }
        emit q_func()->mediaStatusChanged(status);
        emit q_func()->elapsedTimeChanged(0);
        break;
    case QMediaImageViewer::InvalidMedia:
        emit q_func()->mediaStatusChanged(status);

        if (state == QMediaImageViewer::PlayingState) {
            playlist->next();
            if (playlist->currentIndex() < 0)
                emit q_func()->stateChanged(state = QMediaImageViewer::StoppedState);
        }
        break;
    }
}
开发者ID:KDE,项目名称:android-qt-mobility,代码行数:27,代码来源:qmediaimageviewer.cpp


示例6: q_func

void QGalleryTrackerResultSetPrivate::syncUpdate(
        const int rIndex, const int rCount, const int iIndex, const int iCount)
{
    bool itemChanged = false;

    if (currentIndex >= iCache.cutoff && currentIndex < iCache.cutoff + iCount) {
        currentRow = iCache.values.constBegin() + (currentIndex * tableWidth);

        itemChanged = true;
    }
    rCache.offset = rIndex + rCount;
    iCache.cutoff = iIndex + iCount;

    emit q_func()->metaDataChanged(iIndex, iCount, propertyKeys);

    if (itemChanged)
        emit q_func()->currentItemChanged();
}
开发者ID:bavanisp,项目名称:qtmobility-1.1.0,代码行数:18,代码来源:qgallerytrackerresultset.cpp


示例7: q_func

void QMediaImageViewerPrivate::_q_playlistMediaChanged(const QMediaContent &content)
{
    media = content;
    pauseTime = 0;

    viewerControl->showMedia(media);

    emit q_func()->mediaChanged(media);
}
开发者ID:KDE,项目名称:android-qt-mobility,代码行数:9,代码来源:qmediaimageviewer.cpp


示例8: q_func

void BLocalDocumentDriverPrivate::saveOperationFinished()
{
    SaveResultFutureWatcher *watcher = dynamic_cast<SaveResultFutureWatcher *>(sender());
    if (!watcher)
        return;
    SaveResult res = watcher->result();
    delete watcher;
    q_func()->emitSavingFinished(res.operation, res.success);
}
开发者ID:ololoepepe,项目名称:BeQt,代码行数:9,代码来源:blocaldocumentdriver.cpp


示例9: Q_ASSERT

void PlasmaShellSurfaceInterface::Private::panelAutoHideShowCallback(wl_client *client, wl_resource *resource)
{
    auto s = cast<Private>(resource);
    Q_ASSERT(client == *s->client);
    if (s->m_role != Role::Panel || s->m_panelBehavior != PanelBehavior::AutoHide) {
        wl_resource_post_error(s->resource, ORG_KDE_PLASMA_SURFACE_ERROR_PANEL_NOT_AUTO_HIDE, "Not an auto hide panel");
        return;
    }
    emit s->q_func()->panelAutoHideShowRequested();
}
开发者ID:KDE,项目名称:kwayland,代码行数:10,代码来源:plasmashell_interface.cpp


示例10: CHECK_SIZE_EQUALS

QModbusResponse QModbusServerPrivate::processMaskWriteRegisterRequest(const QModbusRequest &request)
{
    CHECK_SIZE_EQUALS(request);
    quint16 address, andMask, orMask;
    request.decodeData(&address, &andMask, &orMask);

    quint16 reg;
    if (!q_func()->data(QModbusDataUnit::HoldingRegisters, address, &reg)) {
        return QModbusExceptionResponse(request.functionCode(),
                                        QModbusExceptionResponse::IllegalDataAddress);
    }

    const quint16 result = (reg & andMask) | (orMask & (~ andMask));
    if (!q_func()->setData(QModbusDataUnit::HoldingRegisters, address, result)) {
        return QModbusExceptionResponse(request.functionCode(),
                                        QModbusExceptionResponse::ServerDeviceFailure);
    }
    return QModbusResponse(request.functionCode(), request.data());
}
开发者ID:2gis,项目名称:2gisqt5android,代码行数:19,代码来源:qmodbusserver.cpp


示例11: prepareDeviceResource

 bool prepareDeviceResource() {
     gc = XCreateGC(display, q_func().winId(), 0, 0);
     if (!gc) {
         available = false;
         qCritical("Create GC failed!");
         return false;
     }
     XSetBackground(display, gc, BlackPixel(display, DefaultScreen(display)));
     return true;
 }
开发者ID:aichunyu,项目名称:QtAV,代码行数:10,代码来源:XVRenderer.cpp


示例12: Q_Q

void QKeySequenceWidgetPrivate::init(const QKeySequence keySeq, const QString noneStr)
{
    Q_Q(QKeySequenceWidget);
    Q_UNUSED(q);
    layout = new QHBoxLayout(q_func());
    layout->setMargin(0);
    layout->setSpacing(1);

    clearButton = new QToolButton(q_func());
    clearButton->setText("x");

    layout->addWidget(clearButton);

    shortcutButton = new QShortcutButton(this, q_func());

    if (noneStr.isNull() == true)
    {
        noneSequenceText = "...";
    }
    else
    {
        noneSequenceText = noneStr;
    }

    q_ptr->clearKeySequence();
    currentSequence = keySeq;

    shortcutButton->setFocusPolicy(Qt::StrongFocus);    

    layout->addWidget(shortcutButton);

    showClearButton = QKeySequenceWidget::ShowRight;

    clearButton->setIcon(QIcon::fromTheme("dialog-cancel", QIcon(":/icons/dialog-cancel.png")));

    // unfocused clear button  afyer created (small hack)
    clearButton->setFocusPolicy(Qt::NoFocus);

    // update ui
    updateDisplayShortcut();
    updateView();
}
开发者ID:ianorlin,项目名称:qlipper,代码行数:42,代码来源:qkeysequencewidget.cpp


示例13: ensureFlushed

inline bool QFilePrivate::ensureFlushed() const
{
    // This function ensures that the write buffer has been flushed (const
    // because certain const functions need to call it.
    if (lastWasWrite) {
        const_cast<QFilePrivate *>(this)->lastWasWrite = false;
        if (!const_cast<QFile *>(q_func())->flush())
            return false;
    }
    return true;
}
开发者ID:FilipBE,项目名称:qtextended,代码行数:11,代码来源:qfile.cpp


示例14: install

bool BTranslatorPrivate::install()
{
    if (installed)
        return true;
    if (!loaded && !q_func()->load())
        return false;
    foreach (QTranslator *t, translators)
        QCoreApplication::installTranslator(t);
    installed = true;
    return true;
}
开发者ID:ololoepepe,项目名称:BeQt,代码行数:11,代码来源:btranslator.cpp


示例15: setBaudRate

void QextSerialPortPrivate::setPortSettings(const PortSettings &settings, bool update)
{
    setBaudRate(settings.BaudRate, false);
    setDataBits(settings.DataBits, false);
    setStopBits(settings.StopBits, false);
    setParity(settings.Parity, false);
    setFlowControl(settings.FlowControl, false);
    setTimeout(settings.Timeout_Millisec, false);
    settingsDirtyFlags = DFE_ALL;
    if (update && q_func()->isOpen())
        updatePortSettings();
}
开发者ID:PeterS242,项目名称:YARRH,代码行数:12,代码来源:qextserialport.cpp


示例16: qWarning

/*!
    \internal
*/
bool QFileDevicePrivate::putCharHelper(char c)
{
#ifdef QT_NO_QOBJECT
    return QIODevicePrivate::putCharHelper(c);
#else

    // Cutoff for code that doesn't only touch the buffer.
    int writeBufferSize = writeBuffer.size();
    if ((openMode & QIODevice::Unbuffered) || writeBufferSize + 1 >= QFILE_WRITEBUFFER_SIZE
#ifdef Q_OS_WIN
        || ((openMode & QIODevice::Text) && c == '\n' && writeBufferSize + 2 >= QFILE_WRITEBUFFER_SIZE)
#endif
        ) {
        return QIODevicePrivate::putCharHelper(c);
    }

    if (!(openMode & QIODevice::WriteOnly)) {
        if (openMode == QIODevice::NotOpen)
            qWarning("QIODevice::putChar: Closed device");
        else
            qWarning("QIODevice::putChar: ReadOnly device");
        return false;
    }

    // Make sure the device is positioned correctly.
    const bool sequential = isSequential();
    if (pos != devicePos && !sequential && !q_func()->seek(pos))
        return false;

    lastWasWrite = true;

    int len = 1;
#ifdef Q_OS_WIN
    if ((openMode & QIODevice::Text) && c == '\n') {
        ++len;
        *writeBuffer.reserve(1) = '\r';
    }
#endif

    // Write to buffer.
    *writeBuffer.reserve(1) = c;

    if (!sequential) {
        pos += len;
        devicePos += len;
        if (!buffer.isEmpty())
            buffer.skip(len);
    }

    return true;
#endif
}
开发者ID:EnterraAlex,项目名称:qt5,代码行数:55,代码来源:qfiledevice.cpp


示例17: updateDefaultSize

 inline void updateDefaultSize()
 {
     QRectF bounds;
     if (elemId.isEmpty()) {
         bounds = QRectF(QPointF(0, 0), renderer->defaultSize());
     } else {
         bounds = renderer->boundsOnElement(elemId);
     }
     if (boundingRect.size() != bounds.size()) {
         q_func()->prepareGeometryChange();
         boundingRect.setSize(bounds.size());
     }
 }
开发者ID:dewhisna,项目名称:emscripten-qt,代码行数:13,代码来源:qgraphicssvgitem.cpp


示例18: QQmlPropertyCache

QQmlPropertyCache *QJSEnginePrivate::createCache(const QMetaObject *mo)
{
    if (!mo->superClass()) {
        QQmlPropertyCache *rv = new QQmlPropertyCache(QV8Engine::getV4(q_func()), mo);
        propertyCache.insert(mo, rv);
        return rv;
    } else {
        QQmlPropertyCache *super = cache(mo->superClass());
        QQmlPropertyCache *rv = super->copyAndAppend(mo);
        propertyCache.insert(mo, rv);
        return rv;
    }
}
开发者ID:2gis,项目名称:2gisqt5android,代码行数:13,代码来源:qjsengine.cpp


示例19: Q_ASSERT

/*!
 * \internal
 *
 * Called by _q_setParentHelper on the main thread.
 */
void QNodePrivate::_q_removeChild(QNode *childNode)
{
    Q_ASSERT(childNode);
    Q_ASSERT_X(childNode->parent() == q_func(), Q_FUNC_INFO, "not a child of this node");

    QNodePrivate::get(childNode)->m_parentId = QNodeId();

    // We notify the backend that we lost a child
    if (m_changeArbiter != nullptr) {
        const auto change = QPropertyNodeRemovedChangePtr::create(m_id, childNode);
        change->setPropertyName("children");
        notifyObservers(change);
    }
}
开发者ID:RSATom,项目名称:Qt,代码行数:19,代码来源:qnode.cpp


示例20: q_func

QList<QtHistoryState*> QtStatePrivate::historyStates() const
{
    QList<QtHistoryState*> result;
    QList<QObject*>::const_iterator it;
#ifdef QT_STATEMACHINE_SOLUTION
    const QObjectList &children = q_func()->children();
#endif
    for (it = children.constBegin(); it != children.constEnd(); ++it) {
        QtHistoryState *h = qobject_cast<QtHistoryState*>(*it);
        if (h)
            result.append(h);
    }
    return result;
}
开发者ID:donaloconnor,项目名称:automon,代码行数:14,代码来源:qtstate.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ q_init函数代码示例发布时间:2022-05-30
下一篇:
C++ qWarning函数代码示例发布时间: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