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


C++ setSerialNumber函数代码示例

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


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

示例1: setSerialNumber

void QDirectFBPixmapData::resize(int width, int height)
{
    if (width <= 0 || height <= 0) {
        setSerialNumber(0);
        return;
    }

    IDirectFB *dfb = QDirectFBScreen::instance()->dfb();
    if (!dfb)
        qFatal("QDirectFBPixmapData::resize(): "
               "Unable to get DirectFB handle!");

    DFBSurfaceDescription description;
    description.flags = DFBSurfaceDescriptionFlags(DSDESC_WIDTH |
                                                   DSDESC_HEIGHT);
    description.width = width;
    description.height = height;

    DFBResult result = dfb->CreateSurface(dfb, &description, &surface);
    if (result != DFB_OK) {
        DirectFBErrorFatal("QDirectFBPixmapData::resize(): "
                           "Unable to allocate surface", result);
    }

    setSerialNumber(++global_ser_no);
}
开发者ID:FilipBE,项目名称:qtextended,代码行数:26,代码来源:qdirectfbpixmap.cpp

示例2: defined

void QGLPixmapData::fromNativeType(void* pixmap, NativeType type)
{
    if (type == QPixmapData::SgImage && pixmap) {
#if defined(QT_SYMBIAN_SUPPORTS_SGIMAGE) && !defined(QT_NO_EGL)
        RSgImage *sgImage = reinterpret_cast<RSgImage*>(pixmap);

        m_sgImage = new RSgImage;
        m_sgImage->Open(sgImage->Id());

        TSgImageInfo info;
        sgImage->GetInfo(info);

        w = info.iSizeInPixels.iWidth;
        h = info.iSizeInPixels.iHeight;
        d = symbianPixeFormatBitsPerPixel((TUidPixelFormat)info.iPixelFormat);

        m_source = QVolatileImage();
        m_hasAlpha = true;
        m_hasFillColor = false;
        m_dirty = true;
        is_null = (w <= 0 || h <= 0);
#endif
    } else if (type == QPixmapData::FbsBitmap && pixmap) {
        CFbsBitmap *bitmap = reinterpret_cast<CFbsBitmap *>(pixmap);
        QSize size(bitmap->SizeInPixels().iWidth, bitmap->SizeInPixels().iHeight);
        if (size.width() == w && size.height() == h)
            setSerialNumber(++qt_gl_pixmap_serial);
        resize(size.width(), size.height());
        m_source = QVolatileImage(bitmap);
        if (pixelType() == BitmapType) {
            m_source.ensureFormat(QImage::Format_MonoLSB);
        } else if (!knownGoodFormat(m_source.format())) {
            m_source.beginDataAccess();
            QImage::Format format = idealFormat(m_source.imageRef(), Qt::AutoColor);
            m_source.endDataAccess(true);
            m_source.ensureFormat(format);
        }
        m_hasAlpha = m_source.hasAlphaChannel();
        m_hasFillColor = false;
        m_dirty = true;
        d = m_source.depth();
    } else if (type == QPixmapData::VolatileImage && pixmap) {
        // Support QS60Style in more efficient skin graphics retrieval.
        QVolatileImage *img = static_cast<QVolatileImage *>(pixmap);
        if (img->width() == w && img->height() == h)
            setSerialNumber(++qt_gl_pixmap_serial);
        resize(img->width(), img->height());
        m_source = *img;
        m_hasAlpha = m_source.hasAlphaChannel();
        m_hasFillColor = false;
        m_dirty = true;
        d = m_source.depth();
    } else if (type == QPixmapData::NativeImageHandleProvider && pixmap) {
        destroyTexture();
        nativeImageHandleProvider = static_cast<QNativeImageHandleProvider *>(pixmap);
        // Cannot defer the retrieval, we need at least the size right away.
        createFromNativeImageHandleProvider();
    }
}
开发者ID:NikhilNJ,项目名称:screenplay-dx,代码行数:59,代码来源:qpixmapdata_symbiangl.cpp

示例3: setSerialNumber

void QMacPixmapData::resize(int width, int height)
{
    setSerialNumber(++qt_pixmap_serial);

    w = width;
    h = height;
    is_null = (w <= 0 || h <= 0);
    d = (pixelType() == BitmapType ? 1 : 32);
    bool make_null = w <= 0 || h <= 0;                // create null pixmap
    if (make_null || d == 0) {
        w = 0;
        h = 0;
        is_null = true;
        d = 0;
        if (!make_null)
            qWarning("Qt: QPixmap: Invalid pixmap parameters");
        return;
    }

    if (w < 1 || h < 1)
        return;

    //create the pixels
    bytesPerRow = w * sizeof(quint32);  // Minimum bytes per row.

    // Quartz2D likes things as a multple of 16 (for now).
    bytesPerRow = COMPTUE_BEST_BYTES_PER_ROW(bytesPerRow);
    macCreatePixels();
}
开发者ID:jbartolozzi,项目名称:CIS462_HW1,代码行数:29,代码来源:qpixmap_mac.cpp

示例4: fillString

int FRModel::setSerialNumber(const QString &number, QString password)
{
    fillString(password, getPasswordLength(password));

    int result = hw->hw()->ECR_SetMode(0);
    if (result == 0 || result == 157)
    {
        result = hw->hw()->ECR_SetMode(5, codec->fromUnicode(password));
        if (!result)
            result = hw->hw()->ECR_SetSerialNumber(codec->fromUnicode(number));
    }

    result = err->analizeError(result);
    switch (result)
    {
    case 0:
        updateInformation();
        break;

    case 1:
        waitForRelease();
        result = setSerialNumber(number, password);
        break;

    default:
        emit signalFail(generateErrorMessage(conv("Ошибка установки серийного номера."), result));
    }

    return result;
}
开发者ID:oldbay,项目名称:dnc_kassa,代码行数:30,代码来源:frmodel.cpp

示例5: LogRelFlow

STDMETHODIMP HostUSBDeviceFilterWrap::COMSETTER(SerialNumber)(IN_BSTR aSerialNumber)
{
    LogRelFlow(("{%p} %s: enter aSerialNumber=%ls\n", this, "HostUSBDeviceFilter::setSerialNumber", aSerialNumber));

    VirtualBoxBase::clearError();

    HRESULT hrc;

    try
    {
        AutoCaller autoCaller(this);
        if (FAILED(autoCaller.rc()))
            throw autoCaller.rc();

        hrc = setSerialNumber(BSTRInConverter(aSerialNumber).str());
    }
    catch (HRESULT hrc2)
    {
        hrc = hrc2;
    }
    catch (...)
    {
        hrc = VirtualBoxBase::handleUnexpectedExceptions(this, RT_SRC_POS);
    }

    LogRelFlow(("{%p} %s: leave hrc=%Rhrc\n", this, "HostUSBDeviceFilter::setSerialNumber", hrc));
    return hrc;
}
开发者ID:bayasist,项目名称:vbox,代码行数:28,代码来源:HostUSBDeviceFilterWrap.cpp

示例6: pixelType

void QGLPixmapData::resize(int width, int height)
{
    if (width == w && height == h)
        return;

    if (width <= 0 || height <= 0) {
        width = 0;
        height = 0;
    }

    w = width;
    h = height;
    is_null = (w <= 0 || h <= 0);
    d = pixelType() == QPixmapData::PixmapType ? 32 : 1;

    if (m_texture.id) {
        QGLShareContextScope ctx(qt_gl_share_context());
        glDeleteTextures(1, &m_texture.id);
        m_texture.id = 0;
    }

    m_source = QImage();
    m_dirty = isValid();
    setSerialNumber(++qt_gl_pixmap_serial);
}
开发者ID:RS102839,项目名称:qt,代码行数:25,代码来源:qpixmapdata_gl.cpp

示例7: Q_ASSERT

bool QDirectFBPixmapData::fromDataBufferDescription(const DFBDataBufferDescription &dataBufferDescription)
{
    IDirectFB *dfb = screen->dfb();
    Q_ASSERT(dfb);
    DFBResult result = DFB_OK;
    IDirectFBDataBuffer *dataBufferPtr;
    if ((result = dfb->CreateDataBuffer(dfb, &dataBufferDescription, &dataBufferPtr)) != DFB_OK) {
        DirectFBError("QDirectFBPixmapData::fromDataBufferDescription()", result);
        return false;
    }
    QDirectFBPointer<IDirectFBDataBuffer> dataBuffer(dataBufferPtr);

    IDirectFBImageProvider *providerPtr;
    if ((result = dataBuffer->CreateImageProvider(dataBuffer.data(), &providerPtr)) != DFB_OK)
        return false;

    QDirectFBPointer<IDirectFBImageProvider> provider(providerPtr);

    DFBImageDescription imageDescription;
    result = provider->GetImageDescription(provider.data(), &imageDescription);
    if (result != DFB_OK) {
        DirectFBError("QDirectFBPixmapData::fromSurfaceDescription(): Can't get image description", result);
        return false;
    }

    if (imageDescription.caps & DICAPS_COLORKEY) {
        return false;
    }

    DFBSurfaceDescription surfaceDescription;
    if ((result = provider->GetSurfaceDescription(provider.data(), &surfaceDescription)) != DFB_OK) {
        DirectFBError("QDirectFBPixmapData::fromDataBufferDescription(): Can't get surface description", result);
        return false;
    }

    alpha = imageDescription.caps & DICAPS_ALPHACHANNEL;
    imageFormat = alpha ? screen->alphaPixmapFormat() : screen->pixelFormat();

    dfbSurface = screen->createDFBSurface(QSize(surfaceDescription.width, surfaceDescription.height),
                                          imageFormat, QDirectFBScreen::TrackSurface);

    result = provider->RenderTo(provider.data(), dfbSurface, 0);
    if (result != DFB_OK) {
        DirectFBError("QDirectFBPixmapData::fromSurfaceDescription(): Can't render to surface", result);
        return false;
    }

    w = surfaceDescription.width;
    h = surfaceDescription.height;
    is_null = (w <= 0 || h <= 0);
    d = QDirectFBScreen::depth(imageFormat);
    setSerialNumber(++global_ser_no);

#if defined QT_DIRECTFB_IMAGEPROVIDER_KEEPALIVE
    screen->setDirectFBImageProvider(providerPtr);
    provider.take();
#endif

    return true;
}
开发者ID:stephaneAG,项目名称:PengPod700,代码行数:60,代码来源:qdirectfbpixmap.cpp

示例8: if

void QDirectFBPixmapData::fromImage(const QImage &img, Qt::ImageConversionFlags flags)
{
    alpha = QDirectFBPixmapData::hasAlphaChannel(img, flags);
    imageFormat = alpha ? screen->alphaPixmapFormat() : screen->pixelFormat();

    QImage image;
    if ((flags & ~Qt::NoOpaqueDetection) != Qt::AutoColor) {
        image = img.convertToFormat(imageFormat, flags);
        flags = Qt::AutoColor;
    } else if (img.format() == QImage::Format_RGB32 || img.depth() == 1) {
        image = img.convertToFormat(imageFormat, flags);
    } else if (img.format() != imageFormat) {
        image = img.convertToFormat(imageFormat, flags);
    } else {
        image = img;
    }

    dfbSurface = screen->createDFBSurface(image, image.format(), QDirectFBScreen::NoPreallocated | QDirectFBScreen::TrackSurface);
    if (!dfbSurface) {
        qWarning("QDirectFBPixmapData::fromImage()");
        invalidate();
        return;
    }

    w = image.width();
    h = image.height();
    is_null = (w <= 0 || h <= 0);
    d = QDirectFBScreen::depth(imageFormat);
    setSerialNumber(++global_ser_no);
#ifdef QT_NO_DIRECTFB_OPAQUE_DETECTION
    Q_UNUSED(flags);
#endif
}
开发者ID:stephaneAG,项目名称:PengPod700,代码行数:33,代码来源:qdirectfbpixmap.cpp

示例9: udev_device_get_sysattr_value

  LinuxDevice::LinuxDevice(struct udev_device* dev)
  {
    log->debug("Creating a new LinuxDevice instance");
    const char *name = udev_device_get_sysattr_value(dev, "product");
    if (name) {
      log->debug("DeviceName={}", name);
      setDeviceName(name);
    }
    
    const char *id_vendor = udev_device_get_sysattr_value(dev, "idVendor");
    if (id_vendor) {
      log->debug("VendorID={}", id_vendor);
      setVendorID(id_vendor);
    }

    const char *id_product = udev_device_get_sysattr_value(dev, "idProduct");
    if (id_product) {
      log->debug("ProductID={}", id_product);
      setProductID(id_product);
    }

    const char *serial = udev_device_get_sysattr_value(dev, "serial");
    if (serial) {
      log->debug("Serial={}", serial);
      setSerialNumber(serial);
    }

    const char *syspath = udev_device_get_syspath(dev);
    if (syspath) {
      log->debug("Syspath={}", syspath);
      _syspath = syspath;
    } else {
      throw std::runtime_error("device wihtout syspath");
    }

    const char *sysname = udev_device_get_sysname(dev);
    if (sysname) {
      log->debug("Sysname={}", sysname);
      setDevicePort(sysname);
    } else {
      throw std::runtime_error("device wihtout sysname");
    }

    log->debug("DeviceHash={}", getDeviceHash());

    setTarget(Rule::Target::Unknown);

    std::ifstream descriptor_stream(_syspath + "/descriptors", std::ifstream::binary);
    if (!descriptor_stream.good()) {
      throw std::runtime_error("cannot load USB descriptors");
    }
    else {
      readDescriptors(descriptor_stream);
    }

    return;
  }
开发者ID:cmotc,项目名称:usbguard,代码行数:57,代码来源:LinuxDeviceManager.cpp

示例10: QPixmapData

QBlittablePixmapData::QBlittablePixmapData()
    : QPixmapData(QPixmapData::PixmapType,BlitterClass)
    , m_alpha(false)
#ifdef QT_BLITTER_RASTEROVERLAY
    ,m_rasterOverlay(0), m_unmergedCopy(0)
#endif //QT_BLITTER_RASTEROVERLAY
{
    setSerialNumber(++global_ser_no);
}
开发者ID:AlekSi,项目名称:phantomjs,代码行数:9,代码来源:qpixmap_blitter.cpp

示例11: setDeadline

Task::Task(time_t deadline, int priority, string description, int cronFreq, bool isFinished, int serialNumber, string group, time_t ft){
//    cout<<"newing task"<<endl;
  setDeadline(deadline);
  setPriority(priority);
  setDescription(description);
  setIsFinished(isFinished);
  setSerialNumber(serialNumber);
  setGroup(group);
  setFinishTime(ft);
}
开发者ID:jialongl,项目名称:taskManager,代码行数:10,代码来源:Task.cpp

示例12: setSerialNumber

void QBlittablePlatformPixmap::resize(int width, int height)
{
    m_blittable.reset(0);
    m_engine.reset(0);
    d = QGuiApplication::primaryScreen()->depth();
    w = width;
    h = height;
    is_null = (w <= 0 || h <= 0);
    setSerialNumber(++global_ser_no);
}
开发者ID:CodeDJ,项目名称:qt5-hidpi,代码行数:10,代码来源:qpixmap_blitter.cpp

示例13: DFBSurfaceDescriptionFlags

void QDirectFBPixmapData::copy(const QPixmapData *data, const QRect &rect)
{
    if (data->classId() != DirectFBClass) {
        QPixmapData::copy(data, rect);
        return;
    }

    IDirectFBSurface *src = static_cast<const QDirectFBPixmapData*>(data)->surface;

    DFBSurfaceDescription description;
    description.flags = DFBSurfaceDescriptionFlags(DSDESC_WIDTH |
                                                   DSDESC_HEIGHT |
                                                   DSDESC_PIXELFORMAT);
    description.width = rect.width();
    description.height = rect.height();
    src->GetPixelFormat(src, &description.pixelformat);

    IDirectFB *fb = QDirectFBScreen::instance()->dfb();

    DFBResult result = fb->CreateSurface(fb, &description, &surface);
    if (result != DFB_OK) {
        DirectFBError("QDirectFBPixmapData::copy()", result);
        setSerialNumber(0);
        return;
    }

#ifndef QT_NO_DIRECTFB_PALETTE
    IDirectFBPalette *palette;
    src->GetPalette(src, &palette);
    surface->SetPalette(surface, palette);
#endif

    surface->SetBlittingFlags(surface, DSBLIT_NOFX);
    const DFBRectangle blitRect = { rect.x(), rect.y(),
                                    rect.width(), rect.height() };
    result = surface->Blit(surface, src, &blitRect, 0, 0);
    if (result != DFB_OK)
        DirectFBError("QDirectFBPixmapData::copy()", result);

    setSerialNumber(++global_ser_no);
}
开发者ID:FilipBE,项目名称:qtextended,代码行数:41,代码来源:qdirectfbpixmap.cpp

示例14: QPixmapData

QGLPixmapData::QGLPixmapData(PixelType type)
    : QPixmapData(type, OpenGLClass)
    , m_renderFbo(0)
    , m_engine(0)
    , m_ctx(0)
    , m_dirty(false)
    , m_hasFillColor(false)
    , m_hasAlpha(false)
{
    setSerialNumber(++qt_gl_pixmap_serial);
    m_glDevice.setPixmapData(this);
}
开发者ID:RS102839,项目名称:qt,代码行数:12,代码来源:qpixmapdata_gl.cpp

示例15: setSerialNumber

void QDirectFBPixmapData::invalidate()
{
    if (dfbSurface) {
        screen->releaseDFBSurface(dfbSurface);
        dfbSurface = 0;
    }
    setSerialNumber(0);
    alpha = false;
    d = w = h = 0;
    is_null = true;
    imageFormat = QImage::Format_Invalid;
}
开发者ID:stephaneAG,项目名称:PengPod700,代码行数:12,代码来源:qdirectfbpixmap.cpp


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