Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

91
Views
registrar qscriptengine en qwebchannel

Quiero ejecutar un código JavaScript permanente que interactúe con QWebEngineView en qt. En el código, hemos registrado la WebClass en el canal. Pero estoy buscando una forma de registrar un código JavaScript permanente en el canal. e interactúe el código QWebEngineView html/javascript con el código JavaScript permanente.

¿Hay alguna manera de eso?

 class WebClass : public QObject { Q_OBJECT Q_PROPERTY(QString someattribute MEMBER m_someattribute) public slots: void jscallme() { QMessageBox::information(NULL,"jscallme","I'm called by js!"); } void setsomeattribute(QString attr) { m_someattribute=attr; emit someattributeChanged(m_someattribute); } signals: void someattributeChanged(QString & attr); private: QString m_someattribute; }; int main(int argc, char *argv[]) { QCoreApplication::setOrganizationName("MNC"); QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); QApplication app(argc, argv); QWebEngineView view; auto *channel = new QWebChannel(&view); WebClass webClass ; channel->registerObject("webclass", webClass); view.page()->setWebChannel(channel); view.setUrl(QUrl(QStringLiteral("http://127.0.0.1:8000"))); view.resize(1024, 750); view.show(); return app.exec(); }
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!