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

C++ Q_RETURN_ARG函数代码示例

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

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



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

示例1: TEST_FILE

void TestSimpleQmlLoad::loadSignal3()
{
    QQmlEngine *engine = new QQmlEngine;
    const QString TEST_FILE(":/testqml/testsignal3.qml");
    QQmlComponent* component = load(engine, TEST_FILE);
    QVERIFY(component);

    SignalTester st;

    engine->rootContext()->setContextProperty("st", &st);

    QObject *myObject = component->create();
    QVERIFY(myObject != NULL);

    st.sendSig();

    QVariant ret;
    QMetaObject::invokeMethod(myObject, "getSubWidth1", Q_RETURN_ARG(QVariant, ret));
    QVERIFY(ret.toInt() == 10);

    st.sendSig();

    QMetaObject::invokeMethod(myObject, "getSubWidth1", Q_RETURN_ARG(QVariant, ret));
    QVERIFY(ret.toInt() == 20);

    delete component;
    delete engine;
}
开发者ID:RichardsATcn,项目名称:qmlc,代码行数:28,代码来源:testsimpleqmlload.cpp


示例2: QObject

AudioLayer::AudioLayer(QQmlApplicationEngine *engine, QObject *parent):
    QObject(parent),
    m_engine(nullptr)
{
    this->m_inputState = AkElement::ElementStateNull;
    this->setQmlEngine(engine);
    this->m_pipeline = AkElement::create("Bin", "pipeline");

    if (this->m_pipeline) {
        QFile jsonFile(":/Webcamoid/share/audiopipeline.json");
        jsonFile.open(QFile::ReadOnly);
        QString description(jsonFile.readAll());
        jsonFile.close();

        this->m_pipeline->setProperty("description", description);

        QMetaObject::invokeMethod(this->m_pipeline.data(),
                                  "element",
                                  Q_RETURN_ARG(AkElementPtr, this->m_audioOut),
                                  Q_ARG(QString, "audioOut"));
        QMetaObject::invokeMethod(this->m_pipeline.data(),
                                  "element",
                                  Q_RETURN_ARG(AkElementPtr, this->m_audioIn),
                                  Q_ARG(QString, "audioIn"));
        QMetaObject::invokeMethod(this->m_pipeline.data(),
                                  "element",
                                  Q_RETURN_ARG(AkElementPtr, this->m_audioGenerator),
                                  Q_ARG(QString, "audioGenerator"));
        QMetaObject::invokeMethod(this->m_pipeline.data(),
                                  "element",
                                  Q_RETURN_ARG(AkElementPtr, this->m_audioSwitch),
                                  Q_ARG(QString, "audioSwitch"));
    }

    if (this->m_audioOut) {
        QString device = this->m_audioOut->property("defaultOutput").toString();
        this->m_audioOut->setProperty("device", device);
        this->m_outputDeviceCaps = this->m_audioOut->property("caps").value<AkCaps>();

        QObject::connect(this->m_audioOut.data(),
                         SIGNAL(deviceChanged(const QString &)),
                         this,
                         SIGNAL(audioOutputChanged(const QString &)));
        QObject::connect(this->m_audioOut.data(),
                         SIGNAL(capsChanged(const AkCaps &)),
                         this,
                         SLOT(setOutputDeviceCaps(const AkCaps &)));
        QObject::connect(this->m_audioOut.data(),
                         SIGNAL(outputsChanged(const QStringList &)),
                         this,
                         SIGNAL(outputsChanged(const QStringList &)));
        QObject::connect(this->m_audioOut.data(),
                         SIGNAL(stateChanged(AkElement::ElementState)),
                         this,
                         SIGNAL(outputStateChanged(AkElement::ElementState)));
    }
开发者ID:webcamoid,项目名称:webcamoid,代码行数:56,代码来源:audiolayer.cpp


示例3: error

void FileIO::read()
{
    if (m_source.isEmpty()){
        emit error("source is empty");
        return;
    } else if (m_target == 0){
        emit error("target is not set");
        return;
    }

    QFile file(m_source);
    if ( file.open(QIODevice::ReadOnly) ) {
        QString line;
        QTextStream t( &file );
        QVariant length = m_target->property("length");
        QVariant returnedValue;

        if(length>0){
            QMetaObject::invokeMethod(m_target, "remove",
                                      Q_RETURN_ARG(QVariant, returnedValue),
                                      Q_ARG(QVariant, QVariant(0)),
                                      Q_ARG(QVariant, length));
            m_lineOffsets.clear();
            m_lineOffsets.push_back(1);
        }
        do {
            line = t.readLine();
            line.replace("\t","        ");
            m_lineOffsets.push_back(line.length()+1);
            line.replace("<","&lt;").replace(">","&gt;").replace(" ","&nbsp;");
            QMetaObject::invokeMethod(m_target, "append",
                                      Q_RETURN_ARG(QVariant, returnedValue),
                                      Q_ARG(QVariant, QVariant(line)));
        } while (!t.atEnd());

        file.close();
        QVariant doc = m_target->property("textDocument");
        if (doc.canConvert<QQuickTextDocument*>()) {
            QQuickTextDocument *qqdoc = doc.value<QQuickTextDocument*>();
            if (qqdoc)
                m_doc = qqdoc->textDocument();
            m_highlighter = new Highlighter(m_doc);
            m_highlighter->setStyle(12);
        }
    } else {
        emit error("Unable to open the file");
        return;
    }
}
开发者ID:OgreTransporter,项目名称:libosmscout,代码行数:49,代码来源:FileIO.cpp


示例4: getParamInfo

void SocketController::getPortStatusCountersList()
{
    if (!connectionLost)
    {
        QMetaObject::invokeMethod(portStatusCountersModel, "clear");
        QVariant retValue;
        //QString data = "1        0              0               0            0              0               0 \n2        0              0               0            0              0               0 \n3        0              0               0            0              0               0 \n4         0              0               0            0              0               0  \n5         0              0               0            0              0               0  \n6         0              0               0            0              0               0  \n7         0              0               0            0              0               0  \n8         0              0               0            0              0               0  \n";
        QString data = getParamInfo("PortStatusCountersList");

        if(data == emptyString)
        {
            logOutSignal();
            return;
        }

        PortStatusCountersParser* parser = new PortStatusCountersParser();
        PortStatusCountParseResult result;
        result = parser->parsePortStatusCountData(data);
        int portsCount = result.params[0].length();

        for(int i = 0; i < portsCount; i++)
        {
            QMetaObject::invokeMethod(portStatusCountersModel, "addPortStatusCounter",
                                      Q_RETURN_ARG(QVariant, retValue),
                                      Q_ARG(QVariant, result.params[result.columnIndexes["port"]].at(i)),
                    Q_ARG(QVariant, result.params[result.columnIndexes["rx_packets_count"]].at(i)),
                    Q_ARG(QVariant, result.params[result.columnIndexes["rx_bytes_count"]].at(i)),
                    Q_ARG(QVariant, result.params[result.columnIndexes["error_count"]].at(i)),
                    Q_ARG(QVariant, result.params[result.columnIndexes["tx_packets_count"]].at(i)),
                    Q_ARG(QVariant, result.params[result.columnIndexes["tx_bytes_count"]].at(i)),
                    Q_ARG(QVariant, result.params[result.columnIndexes["collisions"]].at(i)));
        }
    }
}
开发者ID:DaryaKolyadko,项目名称:RouterClient_QML,代码行数:34,代码来源:socketcontroller.cpp


示例5: Q_RETURN_ARG

QScriptValue WindowScriptingInterface::s3Browse(const QString& nameFilter) {
    QScriptValue retVal;
    QMetaObject::invokeMethod(this, "showS3Browse", Qt::BlockingQueuedConnection,
                              Q_RETURN_ARG(QScriptValue, retVal),
                              Q_ARG(const QString&, nameFilter));
    return retVal;
}
开发者ID:noirsoft,项目名称:hifi,代码行数:7,代码来源:WindowScriptingInterface.cpp


示例6: Q_RETURN_ARG

QStringList SharingAdaptor::GetServicesForType(const QString &type)
{
    // handle method call com.meego.ux.sharing.GetServicesForType
    QStringList services;
    QMetaObject::invokeMethod(parent(), "GetServicesForType", Q_RETURN_ARG(QStringList, services), Q_ARG(QString, type));
    return services;
}
开发者ID:dudochkin-victor,项目名称:ux-sharing,代码行数:7,代码来源:meego-ux-sharing-daemon_adaptor.cpp


示例7: Q_RETURN_ARG

AnimationPointer AnimationCache::getAnimation(const QUrl& url) {
    if (QThread::currentThread() != thread()) {
        AnimationPointer result;
        QMetaObject::invokeMethod(this, "getAnimation", Qt::BlockingQueuedConnection,
            Q_RETURN_ARG(AnimationPointer, result), Q_ARG(const QUrl&, url));
        return result;
    }
开发者ID:rabedik,项目名称:hifi,代码行数:7,代码来源:AnimationCache.cpp


示例8: Q_ASSERT

void VrMenu::addMenu(QMenu* menu) {
    Q_ASSERT(!MenuUserData::hasData(menu->menuAction()));
    QObject* parent = menu->parent();
    QObject* qmlParent = nullptr;
    QMenu* parentMenu = dynamic_cast<QMenu*>(parent);
    if (parentMenu) {
        MenuUserData* userData = MenuUserData::forObject(parentMenu->menuAction());
        if (!userData) {
            return;
        }
        qmlParent = findMenuObject(userData->uuid.toString());
    } else if (dynamic_cast<QMenuBar*>(parent)) {
        qmlParent = _rootMenu;
    } else {
        Q_ASSERT(false);
    }
    QVariant returnedValue;
    bool invokeResult = QMetaObject::invokeMethod(qmlParent, "addMenu", Qt::DirectConnection,
                                                  Q_RETURN_ARG(QVariant, returnedValue),
                                                  Q_ARG(QVariant, QVariant::fromValue(menu->title())));
    Q_ASSERT(invokeResult);
    Q_UNUSED(invokeResult); // FIXME - apparently we haven't upgraded the Qt on our unix Jenkins environments to 5.5.x
    QObject* result = returnedValue.value<QObject*>();
    Q_ASSERT(result);
    if (!result) {
        qWarning() << "Unable to create QML menu for widget menu: " << menu->title();
        return;
    }

    // Bind the QML and Widget together
    new MenuUserData(menu->menuAction(), result);
}
开发者ID:kencooke,项目名称:hifi,代码行数:32,代码来源:VrMenu.cpp


示例9: Q_RETURN_ARG

QString DemoIfAdaptor::SayBye()
{
    // handle method call com.nokia.Demo.SayBye
    QString strret;
    QMetaObject::invokeMethod(parent(), "SayBye", Q_RETURN_ARG(QString, strret));
    return strret;
}
开发者ID:sumankumar,项目名称:dbus_tutorial,代码行数:7,代码来源:demoifadaptor.cpp


示例10: Q_RETURN_ARG

QDBusObjectPath IBusFactoryAdaptor::CreateEngine(const QString &engine_name)
{
    // handle method call org.freedesktop.IBus.EngineFactory.CreateEngine
    QDBusObjectPath out0;
    QMetaObject::invokeMethod(parent(), "CreateEngine", Q_RETURN_ARG(QDBusObjectPath, out0), Q_ARG(QString, engine_name));
    return out0;
}
开发者ID:ascetic85,项目名称:ibus-qt,代码行数:7,代码来源:qibusfactoryadaptor.cpp


示例11: Q_RETURN_ARG

QString EAPDaemonAdapter::LoginUser()
{
    // handle method call com.qh3client.EAPDaemon.LoginUser
    QString out0;
    QMetaObject::invokeMethod(parent(), "LoginUser", Q_RETURN_ARG(QString, out0));
    return out0;
}
开发者ID:kxion,项目名称:qh3clinet,代码行数:7,代码来源:eapdaemonadapter.cpp


示例12: Q_RETURN_ARG

int PresentationDisplayTask::getPanelHeight()
{
    QVariant ret_arg = QVariant::fromValue(0);
    QMetaObject::invokeMethod(m_panel, "getPresentationPanelHeight", Q_RETURN_ARG(QVariant, ret_arg));

    return ret_arg.toInt();
}
开发者ID:abom,项目名称:watchntouch,代码行数:7,代码来源:presentationdisplaytask.cpp


示例13: Q_RETURN_ARG

ConflictInfo ConflictAdaptor::AskRetry(const QString &in0, const QString &in1, const QString &in2)
{
    // handle method call com.deepin.dde.Desktop.conflict.AskRetry
    ConflictInfo out0;
    QMetaObject::invokeMethod(parent(), "AskRetry", Q_RETURN_ARG(ConflictInfo, out0), Q_ARG(QString, in0), Q_ARG(QString, in1), Q_ARG(QString, in2));
    return out0;
}
开发者ID:tsuibin,项目名称:dde-desktop,代码行数:7,代码来源:conflictdaptor.cpp


示例14: Q_RETURN_ARG

SharedSoundPointer SoundCache::getSound(const QUrl& url) {
    if (QThread::currentThread() != thread()) {
        SharedSoundPointer result;
        QMetaObject::invokeMethod(this, "getSound", Qt::BlockingQueuedConnection,
                                  Q_RETURN_ARG(SharedSoundPointer, result), Q_ARG(const QUrl&, url));
        return result;
    }
开发者ID:AlexanderOtavka,项目名称:hifi,代码行数:7,代码来源:SoundCache.cpp


示例15: endRecording

void Eyrie::process() {
	if(recbin == NULL) {
		return;
	}
	if(GST_BUFFER_SIZE(buf) == 0) {
		endRecording();
		QVariant ret;
		QMetaObject::invokeMethod(parent(), "setStatus", Q_RETURN_ARG(QVariant, ret), Q_ARG(QVariant, "Sorry, the recording failed."));
		return;
	}
	mutex->lock();
	const float *pcm = (const float *) GST_BUFFER_DATA(buf);
	Codegen *codegen = new Codegen(pcm, GST_BUFFER_SIZE(buf) / sizeof(float), 0);
	mutex->unlock();
	std::string code = codegen->getCodeString();
	QNetworkAccessManager *networkManager = new QNetworkAccessManager();
	QUrl url("http://developer.echonest.com/api/v4/song/identify");
	QByteArray params;
	params.append("api_key=RIUKSNTIPKUMPHPEO");
	params.append("&query=[{\"metadata\":{\"version\":4.12},\"code\":\""); params.append(code.c_str()); params.append("\"}]");
	QNetworkRequest request;
	request.setHeader(QNetworkRequest::ContentTypeHeader, "application/x-www-form-urlencoded;charset=UTF-8");
	request.setUrl(url);
	connect(networkManager, SIGNAL(finished(QNetworkReply *)), this, SLOT(parseResponse(QNetworkReply *)));
	networkManager->post(request, params);
}
开发者ID:Alex237,项目名称:eyrie,代码行数:26,代码来源:eyrie.cpp


示例16: qDebug

void
IrcAbstractChannel::UserSend ()
{
  qDebug () << " User sending " ;
  bool sendout (true);
  if (qmlItem) {
    QVariant userData;
    QMetaObject::invokeMethod (qmlItem, "userData",
        Q_RETURN_ARG (QVariant, userData));
    QString data = userData.toString();
    qDebug () << "   user data " << data;
    if (data.trimmed().length() > 0) {
      QMetaObject::invokeMethod (qmlItem, "clearUserData");
      if (raw) {
        AlmostRaw (data);
      } else if (data == "/part") {
        Part ();
        sendout = false;
      } else if (data.startsWith ("/whois")) {
        data.remove (0, 6);
        Whois (data.trimmed());
        sendout = false;
      }
      if (sendout) {
        emit Outgoing (chanName, data);
      }
      history.append (data);
      history.removeDuplicates ();
      historyIndex = history.size();
    }
  }
}
开发者ID:berndhs,项目名称:e6irc,代码行数:32,代码来源:irc-abstract-channel.cpp


示例17: qDebug

bool
Panto::event (QEvent *evt)
{
  //qDebug () << PANTO_PRETTY_FUNCTION << evt;
  if (evt) {
    QEvent::Type tipo = evt->type ();
    if (tipo ==QEvent::Gesture ) {
      qDebug () << "GESTURE event in " << this;
      QGestureEvent * gev = dynamic_cast <QGestureEvent*> (evt);
      if (gev) {
        qDebug () << " gev " << gev;
      }
      return true;
    } else if (tipo == QEvent::GestureOverride) {
      QGestureEvent * gev = dynamic_cast <QGestureEvent*> (evt);
      if (gev) {
        QDeclarativeItem * dItem = qobject_cast<QDeclarativeItem*>(gev->widget());
        qDebug () << " override what? gev " << gev << gev->widget() << dItem;
        if (dItem) {
          QVariant retVar;
          QMetaObject::invokeMethod (dItem,"handleLoopGesture",
             Q_RETURN_ARG(QVariant, retVar));
          if (retVar.isValid()) {
            return retVar.toBool();
          }
        }
      }
    }
  }
  bool handled = QDeclarativeView::event (evt);
  //qDebug () << PANTO_PRETTY_FUNCTION << " returning " << handled;
  return handled;
}
开发者ID:berndhs,项目名称:pantomime,代码行数:33,代码来源:panto.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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