Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QJniObject::construct -> how to use?
Forum Updated to NodeBB v4.3 + New Features

QJniObject::construct -> how to use?

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 312 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Flaming MoeF Offline
    Flaming MoeF Offline
    Flaming Moe
    wrote on last edited by
    #1

    I´m trying to build an object from a java class via
    https://doc.qt.io/qt-6/qjniobject.html#construct

    Thing is, I don´t understand the notation

    template <typename Class, typename Args> 
    QJniObject QJniObject::construct(Args &&... args)
    

    Also not with the supplied explanation beneath it.

    I also get a complaint, when pasting the example (is it even an example?) in my file
    QJniObject javaString = QJniObject::construct<jstring>();

    Does someone know how it has to look, if there is a "MyJavaClass" with no arguments for the constructor?

    best regards :)

    A lovely day for a ̶g̶̶u̶̶i̶̶n̶̶n̶̶e̶̶s̶ DUFF^^

    JonBJ 1 Reply Last reply
    0
    • Flaming MoeF Flaming Moe

      I´m trying to build an object from a java class via
      https://doc.qt.io/qt-6/qjniobject.html#construct

      Thing is, I don´t understand the notation

      template <typename Class, typename Args> 
      QJniObject QJniObject::construct(Args &&... args)
      

      Also not with the supplied explanation beneath it.

      I also get a complaint, when pasting the example (is it even an example?) in my file
      QJniObject javaString = QJniObject::construct<jstring>();

      Does someone know how it has to look, if there is a "MyJavaClass" with no arguments for the constructor?

      best regards :)

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by
      #2

      @Flaming-Moe
      QJniObject::construct<jstring>() will be correct for "no arguments to constructor", else you would have to specify them inside the (...).

      I also get a complaint

      Might help us if you showed the "complaint" message....

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved