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

C++ dataSource函数代码示例

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

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



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

示例1: columnInfo

void KexiDBImageBox::updateActionStrings()
{
    if (!m_contextMenu)
        return;
    if (designMode()) {
        /*  QString titleString( i18n("Image Box") );
            if (!dataSource().isEmpty())
              titleString.prepend(dataSource() + " : ");
            m_contextMenu->changeTitle(m_contextMenu->idAt(0), m_contextMenu->titlePixmap(m_contextMenu->idAt(0)), titleString);*/
    } else {
        //update title in data view mode, based on the data source
        if (columnInfo()) {
            KexiImageContextMenu::updateTitle(m_contextMenu, columnInfo()->captionOrAliasOrName(),
                                              KexiFormManager::self()->library()->iconName(metaObject()->className()));
        }
    }

    if (m_chooser) {
        if (popupMenuAvailable() && dataSource().isEmpty()) { //this may work in the future (see @todo below)
            m_chooser->setToolTip(i18n("Click to show actions for this image box"));
        } else {
            QString beautifiedImageBoxName;
            if (designMode()) {
                beautifiedImageBoxName = dataSource();
            } else {
                beautifiedImageBoxName = columnInfo() ? columnInfo()->captionOrAliasOrName() : QString();
                /*! @todo look at makeFirstCharacterUpperCaseInCaptions setting [bool]
                 (see doc/dev/settings.txt) */
                beautifiedImageBoxName = beautifiedImageBoxName[0].toUpper() + beautifiedImageBoxName.mid(1);
            }
            m_chooser->setToolTip(
                i18n("Click to show actions for \"%1\" image box", beautifiedImageBoxName));
        }
    }
}
开发者ID:crayonink,项目名称:calligra-2,代码行数:35,代码来源:kexidbimagebox.cpp


示例2: pm

void KexiDBImageBox::handlePasteAction()
{
    if (isReadOnly() || (!designMode() && !hasFocus()))
        return;
    QPixmap pm(qApp->clipboard()->pixmap(QClipboard::Clipboard));
    if (dataSource().isEmpty()) {
        //static mode
        KexiBLOBBuffer::Handle h = KexiBLOBBuffer::self()->insertPixmap(pm);
        if (!h)
            return;
        setData(h);
    } else {
        //db-aware mode
        m_pixmap = pm;
        QByteArray ba;
        QBuffer buffer(&ba);
        buffer.open(IO_WriteOnly);
        if (m_pixmap.save(&buffer, "PNG")) {  // write pixmap into ba in PNG format
            setValueInternal(ba, true, false/* !loadPixmap */);
            m_currentScaledPixmap = QPixmap(); // clear cache
        } else {
            setValueInternal(QByteArray(), true);
        }
    }

    repaint();
    if (!dataSource().isEmpty()) {
//  emit pixmapChanged();
        signalValueChanged();
    }
}
开发者ID:crayonink,项目名称:calligra-2,代码行数:31,代码来源:kexidbimagebox.cpp


示例3: dataSource

bool DataMatrix::isValid() const {
  if (dataSource()) {
    dataSource()->readLock();
    bool fieldValid = dataSource()->matrix().isValid(_field);
    dataSource()->unlock();
    return fieldValid;
  }
  return false;
}
开发者ID:Kst-plot,项目名称:kst-subversion-archive,代码行数:9,代码来源:datamatrix.cpp


示例4: dataSource

/** return true if it has a valid file and field, or false otherwise */
bool VScalar::isValid() const {
  if (dataSource()) {
    dataSource()->readLock();
    bool rc = dataSource()->vector().isValid(_field);
    dataSource()->unlock();
    return rc;
  }
  return false;
}
开发者ID:KDE,项目名称:kst-plot,代码行数:10,代码来源:vscalar.cpp


示例5: Q_ASSERT

void DataMatrix::reload() {
  Q_ASSERT(myLockStatus() == KstRWLock::WRITELOCKED);

  if (dataSource()) {
    dataSource()->writeLock();
    dataSource()->reset();
    dataSource()->unlock();
    reset();
  }
}
开发者ID:Kst-plot,项目名称:kst-subversion-archive,代码行数:10,代码来源:datamatrix.cpp


示例6: dataSource

void KexiDBImageBox::slotUpdateActionsAvailabilityRequested(bool& valueIsNull, bool& valueIsReadOnly)
{
    valueIsNull = !(
                         (dataSource().isEmpty() && !pixmap().isNull()) /*static pixmap available*/
                      || (!dataSource().isEmpty() && !this->valueIsNull())  /*db-aware pixmap available*/
                  );
    // read-only if static pixmap or db-aware pixmap for read-only widget:
    valueIsReadOnly =
           (!designMode() && dataSource().isEmpty())
        || (!dataSource().isEmpty() && isReadOnly())
        || (designMode() && !dataSource().isEmpty());
}
开发者ID:crayonink,项目名称:calligra-2,代码行数:12,代码来源:kexidbimagebox.cpp


示例7: dataSource

QVariant StudentsModel::data(const QModelIndex &index, int role) const
{
    if (role == Qt::DisplayRole)
    if (source){
        if (source->open(QIODevice::ReadOnly)){
            Student st;

            QDataStream dataSource(source);
            source->seek(index.row()*sizeof(Student));
            dataSource.readRawData(reinterpret_cast<char *>(&st), sizeof(Student));
            source->close();
            // если файл заполнялся с консоли
            // понадобится смена кодировки
            QTextCodec *codec = QTextCodec::codecForName("IBM866");

            switch(index.column()){
            case Student::Name:
                return codec->toUnicode(QByteArray(st.name));
            case Student::Course:
                return QString::number(st.cource);
            case Student::Group:
                return QString::number(st.group);
            default:
                return QVariant();
            }
        }
    }
    return QVariant();

}
开发者ID:xivol,项目名称:Qt-2015,代码行数:30,代码来源:studentsmodel.cpp


示例8: handleCutAction

void KexiDBImageBox::handleCutAction()
{
    if (!dataSource().isEmpty() && isReadOnly())
        return;
    handleCopyAction();
    clear();
}
开发者ID:crayonink,项目名称:calligra-2,代码行数:7,代码来源:kexidbimagebox.cpp


示例9: dataSource

	bool SingleLayerPluginContent::init()
	{
		CCDictionary* dataSource(NetworkState::sharedInstance()->getSubDictionary(SL_SERIALIZEKEY_PLUGIN_GLOBAL_SETTINGS));

		// plugin information
		dataSource->setObject(CCString::create(
			"sample of a single layer implementation"
			),SL_SERIALIZEKEY_PLUGIN_INFO_BRIEF);

		dataSource->setObject(CCString::create(
			"Nothing special\n"
			),SL_SERIALIZEKEY_PLUGIN_INFO_DETAIL);

		// task information
		dataSource->setObject(CCString::create(
			"Nothing special\n"
			),SL_SERIALIZEKEY_PLUGIN_TASKS);

		dataSource->setObject(CCString::create(
			"Nothing special\n"
			),SL_SERIALIZEKEY_PLUGIN_TASK_HINTS);


		return SLBaseClass::init();
	}
开发者ID:Mobiletainment,项目名称:Multiplayer-Network-Conecpts,代码行数:25,代码来源:nlSingleLayerPluginContent.cpp


示例10: setData

void KexiDBImageBox::setDataSource(const QString &ds)
{
    KexiFormDataItemInterface::setDataSource(ds);
    setData(KexiBLOBBuffer::Handle());
    updateActionStrings();
    KexiFrame::setFocusPolicy(focusPolicy());   //set modified policy

    if (m_chooser) {
        m_chooser->setEnabled(popupMenuAvailable());
        if (m_dropDownButtonVisible && popupMenuAvailable()) {
            m_chooser->show();
        } else {
            m_chooser->hide();
        }
    }

    // update some properties not changed by user
// //! @todo get default line width from global style settings
//    if (!m_lineWidthChanged) {
//        KexiFrame::setLineWidth(ds.isEmpty() ? 0 : 1);
//    }
    if (!m_paletteBackgroundColorChanged && parentWidget()) {
        KexiFrame::setPaletteBackgroundColor(
            dataSource().isEmpty() ? parentWidget()->paletteBackgroundColor() : palette().active().base());
    }
}
开发者ID:crayonink,项目名称:calligra-2,代码行数:26,代码来源:kexidbimagebox.cpp


示例11: Q_FOREACH

void QgsProjectBadLayerHandler::handleBadLayers( const QList<QDomNode> &layers )
{
  QgsApplication::messageLog()->logMessage( QObject::tr( "%1 bad layers dismissed:" ).arg( layers.size() ) );
  Q_FOREACH ( const QDomNode &layer, layers )
  {
    QgsApplication::messageLog()->logMessage( QObject::tr( " * %1" ).arg( dataSource( layer ) ) );
  }
开发者ID:phborba,项目名称:QGIS,代码行数:7,代码来源:qgsprojectbadlayerhandler.cpp


示例12: isTristateInternal

bool KexiDBCheckBox::isTristateInternal() const
{
    if (m_tristate == TristateDefault)
        return !dataSource().isEmpty();

    return m_tristate == TristateOn;
}
开发者ID:JeremiasE,项目名称:KFormula,代码行数:7,代码来源:kexidbcheckbox.cpp


示例13: error

void QgsAmsLegendFetcher::handleFinished()
{
  // Parse result
  QJson::Parser parser;
  bool ok = false;
  QVariantMap queryResults = parser.parse( mQueryReply, &ok ).toMap();
  if ( !ok )
  {
    emit error( QString( "Parsing error at line %1: %2" ).arg( parser.errorLine() ).arg( parser.errorString() ) );
  }
  QgsDataSourceURI dataSource( mProvider->dataSourceUri() );
  QList< QPair<QString, QImage> > legendEntries;
  foreach ( const QVariant& result, queryResults["layers"].toList() )
  {
    QVariantMap queryResultMap = result.toMap();
    QString layerId = queryResultMap["layerId"].toString();
    if ( layerId != dataSource.param( "layer" ) && !mProvider->subLayers().contains( layerId ) )
    {
      continue;
    }
    QVariantList legendSymbols = queryResultMap["legend"].toList();
    foreach ( const QVariant& legendEntry, legendSymbols )
    {
      QVariantMap legendEntryMap = legendEntry.toMap();
      QString label = legendEntryMap["label"].toString();
      if ( label.isEmpty() && legendSymbols.size() == 1 )
        label = queryResultMap["layerName"].toString();
      QByteArray imageData = QByteArray::fromBase64( legendEntryMap["imageData"].toByteArray() );
      legendEntries.append( qMakePair( label, QImage::fromData( imageData ) ) );
    }
  }
开发者ID:kukupigs,项目名称:QGIS,代码行数:31,代码来源:qgsamsprovider.cpp


示例14: QgsRasterDataProvider

QgsAmsProvider::QgsAmsProvider( const QString &uri, const ProviderOptions &options )
  : QgsRasterDataProvider( uri, options )
{
  mLegendFetcher = new QgsAmsLegendFetcher( this );

  QgsDataSourceUri dataSource( dataSourceUri() );
  const QString authcfg = dataSource.authConfigId();

  mServiceInfo = QgsArcGisRestUtils::getServiceInfo( dataSource.param( QStringLiteral( "url" ) ), authcfg, mErrorTitle, mError );
  mLayerInfo = QgsArcGisRestUtils::getLayerInfo( dataSource.param( QStringLiteral( "url" ) ) + "/" + dataSource.param( QStringLiteral( "layer" ) ), authcfg, mErrorTitle, mError );

  const QVariantMap extentData = mLayerInfo.value( QStringLiteral( "extent" ) ).toMap();
  mExtent.setXMinimum( extentData[QStringLiteral( "xmin" )].toDouble() );
  mExtent.setYMinimum( extentData[QStringLiteral( "ymin" )].toDouble() );
  mExtent.setXMaximum( extentData[QStringLiteral( "xmax" )].toDouble() );
  mExtent.setYMaximum( extentData[QStringLiteral( "ymax" )].toDouble() );
  mCrs = QgsArcGisRestUtils::parseSpatialReference( extentData[QStringLiteral( "spatialReference" )].toMap() );
  if ( !mCrs.isValid() )
  {
    appendError( QgsErrorMessage( tr( "Could not parse spatial reference" ), QStringLiteral( "AMSProvider" ) ) );
    return;
  }
  const QVariantList subLayersList = mLayerInfo.value( QStringLiteral( "subLayers" ) ).toList();
  mSubLayers.reserve( subLayersList.size() );
  for ( const QVariant &sublayer : subLayersList )
  {
    mSubLayers.append( sublayer.toMap()[QStringLiteral( "id" )].toString() );
    mSubLayerVisibilities.append( true );
  }

  mTimestamp = QDateTime::currentDateTime();
  mValid = true;
}
开发者ID:dmarteau,项目名称:QGIS,代码行数:33,代码来源:qgsamsprovider.cpp


示例15: popupMenuAvailable

bool KexiDBImageBox::popupMenuAvailable()
{
    /*! @todo add kexi-global setting which anyway, allows to show this button
              (read-only actions like copy/save as/print can be available) */
    //chooser button can be only visible when data source is specified
    return !dataSource().isEmpty();
}
开发者ID:crayonink,项目名称:calligra-2,代码行数:7,代码来源:kexidbimagebox.cpp


示例16: error

void QgsAmsLegendFetcher::handleFinished()
{
  // Parse result
  QJsonParseError err;
  QJsonDocument doc = QJsonDocument::fromJson( mQueryReply, &err );
  if ( doc.isNull() )
  {
    emit error( QStringLiteral( "Parsing error:" ).arg( err.errorString() ) );
  }
  QVariantMap queryResults = doc.object().toVariantMap();
  QgsDataSourceUri dataSource( mProvider->dataSourceUri() );
  QVector< QPair<QString, QImage> > legendEntries;
  foreach ( const QVariant &result, queryResults["layers"].toList() )
  {
    QVariantMap queryResultMap = result.toMap();
    QString layerId = queryResultMap[QStringLiteral( "layerId" )].toString();
    if ( layerId != dataSource.param( QStringLiteral( "layer" ) ) && !mProvider->subLayers().contains( layerId ) )
    {
      continue;
    }
    QVariantList legendSymbols = queryResultMap[QStringLiteral( "legend" )].toList();
    foreach ( const QVariant &legendEntry, legendSymbols )
    {
      QVariantMap legendEntryMap = legendEntry.toMap();
      QString label = legendEntryMap[QStringLiteral( "label" )].toString();
      if ( label.isEmpty() && legendSymbols.size() == 1 )
        label = queryResultMap[QStringLiteral( "layerName" )].toString();
      QByteArray imageData = QByteArray::fromBase64( legendEntryMap[QStringLiteral( "imageData" )].toByteArray() );
      legendEntries.append( qMakePair( label, QImage::fromData( imageData ) ) );
    }
  }
开发者ID:cz172638,项目名称:QGIS,代码行数:31,代码来源:qgsamsprovider.cpp


示例17: l

void DataMatrix::changeFrames(int xStart, int yStart,
                        int xNumSteps, int yNumSteps,
                        bool doAve, bool doSkip, int skip, double minX, double minY,
                        double stepX, double stepY) {
  KstWriteLocker l(this);

  commonConstructor(dataSource(), _field, xStart, yStart, xNumSteps, yNumSteps, doAve, doSkip, skip, minX, minY, stepX, stepY);
}
开发者ID:Kst-plot,项目名称:kst-subversion-archive,代码行数:8,代码来源:datamatrix.cpp


示例18: objectName

void
KexiDBAutoField::updateInformationAboutUnboundField()
{
    if ((d->autoCaption && (dataSource().isEmpty() || dataSourcePluginId().isEmpty()))
            || (!d->autoCaption && d->caption.isEmpty())) {
        d->label->setText(futureI18nc2("Unbound Auto Field", "%1 (unbound)", objectName()));
    }
}
开发者ID:TheTypoMaster,项目名称:calligra,代码行数:8,代码来源:kexidbautofield.cpp


示例19: i18n

QString DataMatrix::descriptionTip() const {
  return i18n(
      "Data Matrix: %1\n"
      "  %2\n"
      "  Field: %3\n"
      "  %4 x %5"
      ).arg(Name()).arg(dataSource()->fileName()).arg(field()).arg(_nX).arg(_nY);
}
开发者ID:Kst-plot,项目名称:kst-subversion-archive,代码行数:8,代码来源:datamatrix.cpp


示例20: ClockWidget

Clock::Clock(QObject *parent) : PlexyDesk::ControllerInterface (parent)
{
    clock = new ClockWidget(QRectF(0, 0, 210, 210));

    if (connectToDataSource("timerengine")) {
        connect(dataSource(), SIGNAL(sourceUpdated(QVariantMap)), this, SLOT(onDataUpdated(QVariantMap)));
    }
}
开发者ID:rumza,项目名称:plexydesk,代码行数:8,代码来源:clock.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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