Skip to content

Language Bindings

You're using Qt with other languages than C++, eh? Post here!
865 Topics 3.4k Posts
  • Unspecified Error while updating Qt translations(.ts files) in Visual Studio

    Unsolved
    1
    0 Votes
    1 Posts
    581 Views
    No one has replied
  • QPushButton binding does not work without lambda keyword

    Unsolved
    5
    0 Votes
    5 Posts
    923 Views
    SGaistS
    Can you rather post a minimal example that shows that behaviour ?
  • Problem with SetIcon when using a png

    Unsolved
    7
    0 Votes
    7 Posts
    1k Views
    SGaistS
    Because the environment variable is described here. The fact that you are using python is of no importance here.
  • glitch in javascript bindings

    Unsolved
    7
    0 Votes
    7 Posts
    1k Views
    Gojir4G
    @skylendar Sorry, I miss your last message. Any improvements here ?
  • Golang TreeView example not working

    Unsolved
    2
    0 Votes
    2 Posts
    1k Views
    mrjjM
    Hi and welcome to the forums I dont know Golang but the interface is the same so i would check in func (m *CustomTableModel) data that this test if role != int(core.Qt__DisplayRole) { return core.NewQVariant() } is not always returning an empty variant for each call. also case 0: return core.NewQVariant12(item.firstName) case 1: return core.NewQVariant12(item.lastName) does return a valid QVariant ? i wondered why the empty one is NewQVariant() but with data its NewQVariant12 ?
  • Which is Better C or C++?

    Unsolved c++
    5
    0 Votes
    5 Posts
    1k Views
    JonBJ
    @Mayankjain C is plain better (IMHO) :) But for your career, C++ is definitely more advisable!
  • QAxServer in Python [PySide] [PyQt]

    2
    0 Votes
    2 Posts
    2k Views
    F
    Hello, I'm facing the same issue. Have you solved this problem?
  • Q_Property add range macros

    Unsolved
    2
    0 Votes
    2 Posts
    758 Views
    SGaistS
    Hi, AFAIK, there's none. You need to implement your own macro on top Q_PROPERTY to do that.
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    9 Views
    No one has replied
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    18 Views
    No one has replied
  • C function as QJSValue

    Unsolved
    5
    0 Votes
    5 Posts
    1k Views
    S
    So I give up. I'll declare a method instead. Maybe in a further version of Qt5. Thank you anyway.
  • Read a specific tag in xml

    Solved
    8
    0 Votes
    8 Posts
    2k Views
    KroMignonK
    @Nathan-Miguel said in Read a specific tag in xml: PROGRAM DIRECTORY: E:\Git\Denoiser-Script\QML_C++\build-Denosier-Desktop_Qt_5_12_3_MSVC2017_64bit2-Debug\debug XML DIRECTORY: E:\Git\Denoiser-Script\QML_C++\build-Denosier-Desktop_Qt_5_12_3_MSVC2017_64bit2-Debug\debug\sysinfo\system.xml In your code extract you have hard coded the path and with you output it should be: QString systeminfo::getCpuName() { QString rootDir = qApp->applicationDirPath(); // QDir::currentPath() != not application path QString xmlDir = "/sysinfo/system.xml"; QDomDocument docxml; QString test; QFile xmlread; xmlread.setFileName(rootDir+xmlDir); test = "head"; if (xmlread.open(QIODevice::ReadOnly)) { QXmlStreamReader reader(&xmlread); if (docxml.setContent(&xmlread)){ //Open xml with success test = "xml loaded with success"; //Read specifc tag xml auto nodes = docxml.elementsByTagName("cpuname"); for(int i = 0; i < nodes.count(); i++) { QDomNode elm = nodes.at(i); if(elm.isElement()) { test = QStringLiteral("%1 = %2").arg(elm.toElement().tagName(), elm.toElement().text()); } } } } return test; } ==> my output with this code and your XML document is: [image: fe56ed37-5ce7-4b97-aeb4-fddadee5b3f0.png]
  • Generating bindings for other languages

    Unsolved
    2
    0 Votes
    2 Posts
    738 Views
    JKSHJ
    Hi @semtexzv, and welcome! @semtexzv said in Generating bindings for other languages: ...mainly utilize Rust language. Have you seen the Rust-Qt project? https://github.com/rust-qt could the shiboken generator used to generate bindings for other languages in custom format ? I'll leave this question for someone else who has experience with Shiboken. But if you want to check yourself, this is a good place to start: https://blog.qt.io/blog/2018/05/31/write-python-bindings/
  • I want to good tutorial or book on PyQt

    Unsolved
    7
    0 Votes
    7 Posts
    8k Views
    M
    I just published a PyQt5 book: [image: pyqt5-book.jpg] Even Phil Thompson, the creator of PyQt, read it and says it's "very good". It saves you a lot of time when learning PyQt. It's the resource I wish I had had when I was getting started.
  • This topic is deleted!

    Unsolved
    3
    0 Votes
    3 Posts
    100 Views
  • Dynamically call methods from a scripting engine using QMetaMethod and QVariant.

    Unsolved
    1
    0 Votes
    1 Posts
    561 Views
    No one has replied
  • how can I join and run a program when starting application?

    Unsolved
    11
    0 Votes
    11 Posts
    2k Views
    JonBJ
    @Nathan-Miguel As I said/suspevted: You show us the code of your Qt application, which does not create the file, so it does not help. Nowhere do you you show whatever code does create the file, so since we cannot see that we cannot advise what it is you need to do. I wrote above: Are you now talking about what the current directory will be for the main.exe you run from your Qt program (perhaps because it creates systeminfo.txt without specifying a path)?? but you didn't reply to that. If you want help, you'll need to provide information.
  • how can I use c ++ not qt QUICK / QML?

    Solved
    5
    0 Votes
    5 Posts
    1k Views
    N
    @sierdzio said in how can I use c ++ not qt QUICK / QML?: engine.rootContext()->setContextProperty("cpuname", &CpuName); its works tnks
  • How to I get cpu description and cpu name

    Solved
    7
    0 Votes
    7 Posts
    5k Views
    SGaistS
    Something like lspci -vnn | grep VGA ?
  • Emitting and handling signals with GoLang and QML respectively.

    Solved
    5
    0 Votes
    5 Posts
    2k Views
    Nikhilesh NN
    @SGaist Thank you, Samuel. I will definetely try it out. Marking this topic as solved.