Navigation

    Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Search
    • Unsolved
    1. Home
    2. Qt Development
    3. Language Bindings
    Log in to post

    Language Bindings

    • UNSOLVED How to set text color of QTextEdit in PyQt5
      • QtFranchise  

      4
      0
      Votes
      4
      Posts
      16
      Views

      Hi, What color do you want to change ? The text color ? The background ? Both ?
    • UNSOLVED What is the best practice to use PyQt with non PyQt back-end code
      • QtFranchise  

      3
      0
      Votes
      3
      Posts
      13
      Views

      @JonB That sounds cool. Will follow your suggestion.
    • UNSOLVED PySide6 QML How to connect signals and slots over different class-instances correctly
      qml python signal & slot pyside6 • • test123-all  

      1
      0
      Votes
      1
      Posts
      49
      Views

      No one has replied

    • UNSOLVED qmake is not recognized as an internal or external command
      • Zua90  

      8
      0
      Votes
      8
      Posts
      65
      Views

      @SGaist Ok I will try and return the result. Thanks for your support
    • UNSOLVED I'm on the w10
      • Zua90  

      1
      0
      Votes
      1
      Posts
      18
      Views

      No one has replied

    • UNSOLVED Integrate Python Qt-based GUI tools into console app
      • Bob64  

      3
      0
      Votes
      3
      Posts
      55
      Views

      @SGaist thank you. What we have at the moment is a pretty vanilla console and I had been thinking about how to extend that with some limited GUI facilities. But the ipython route isn't something I had considered and I wasn't aware of the Qt console. It would be a change of direction but certainly something to consider and investigate. Thanks again.
    • This topic is deleted!
      • MikeLemon  

      2
      0
      Votes
      2
      Posts
      4
      Views
    • SOLVED Failed to connect signal in Python (using Pyside) to signal (work as slot) in QML, What is QVarient equivalent in PySide ?
      • VoLinhTruc  

      3
      0
      Votes
      3
      Posts
      88
      Views

      The problem was solved. Replace QVariant -> "QVariant" The correct definition of the signal in python code is: toUI = Signal(str, "QVariant") Refer: https://github.com/mottosso/Qt5.py/issues/5
    • This topic is deleted!
      • Eidus  

      1
      0
      Votes
      1
      Posts
      41
      Views

      No one has replied

    • UNSOLVED Custom scrollbar doesn't translate to pyqt from designer
      • Faustify  

      6
      0
      Votes
      6
      Posts
      136
      Views

      Tested on a Mac with PyQt installed through conda. Package is pyqt-5.12.3. The scrollbar is changed. Note that your code cannot be run directly, it's missing a QMainWindow instance as well as the QApplication part.
    • UNSOLVED Update texts in qml from python backend for Dummies
      python qstring qml binding backend • • 2MJay  

      3
      0
      Votes
      3
      Posts
      122
      Views

      Thanks for the reply @SGaist. What I wanted was to update some data (in form of text) from python backend, most of the tutorials I saw were based on using signals and slots. were as I only needed a slot to read without any triggering signal. Though I've been able to finally figure it out and spending this much time actually made me understood it more. I used QTimer to refresh the backend function every half a second.
    • UNSOLVED Rust bindings
      qt application rust • • Olivier92m  

      4
      0
      Votes
      4
      Posts
      158
      Views

      @Olivier92m Then just include that library in your code, assuming it has the right bindings for c++? if it ain't then I don't know, as far as I can't tell you can't make it work. If you're about to compile something c++ linking to the said library it has to have c++ header files, you know.
    • UNSOLVED Can we change subtitle size and font ?
      • spfl97  

      2
      0
      Votes
      2
      Posts
      82
      Views

      Hi and welcome to devnet, From the looks of it, there's nothing related to that. You might want to check the bug report system to see if there's something related and if not, open a feature request.
    • UNSOLVED [PySide/QWidget] Screen resize issue between monitor and laptop
      • Azzazil  

      9
      0
      Votes
      9
      Posts
      181
      Views

      @SGaist Thanks for advice, I will try to use them.
    • UNSOLVED closeEvent not working
      • ZioLupo  

      29
      0
      Votes
      29
      Posts
      11735
      Views

      is this thing solved? it's 2021 almost 2022 now. PySide6 still has the same issue I think. as far as I know, with pyside6.QtUiTools.QUiLoader(), you can only load ui to an attribute of a shell class e.g. "self.ui" instead of to "self" which causes some trouble triggering the modified closeEvent method. The type of "self.ui" will still be QMainWindow(depends on what u use). I tried to override closeEvent() but it still won't work that's what confuses me. Why cant they just add some method to let us load widgets to "self" -_- like "uic.loauUi()" in pyqt
    • UNSOLVED I need help with my Deno Qt/QML bindings - QGuiApplication::exec is blocking
      • nxctr  

      3
      0
      Votes
      3
      Posts
      155
      Views

      @SGaist Thanks for the reply. Unfortunately, Deno's event loop isn't exposed, at all. It's just calling functions from a C ABI using dlopen().
    • This topic is deleted!
      • freddiewoods  

      1
      0
      Votes
      1
      Posts
      6
      Views

      No one has replied

    • SOLVED Shiboken - Signals don't work
      • vberlier  

      2
      0
      Votes
      2
      Posts
      105
      Views

      Turns out Shiboken shouldn't do anything for signals and let PySide setup the signals using the MOC data. Shiboken generates bindings for signals as if they were plain methods and shadows the actual signals. I ended up wrapping the signals with an ifdef: #ifndef BINDINGS_H Q_SIGNALS: void positionChanged(qint64 position); #endif
    • UNSOLVED Use C# DLL and QT C++
      • Nathan Miguel  

      2
      0
      Votes
      2
      Posts
      165
      Views

      Hi, See this stack overflow answer for several possibilités.
    • UNSOLVED Translation of text from controlscript in maintenancetool
      • YoavSal  

      1
      0
      Votes
      1
      Posts
      112
      Views

      No one has replied

    • UNSOLVED Qt 6 LinguistTools for Android and iOS is missing
      • Marands  

      1
      0
      Votes
      1
      Posts
      103
      Views

      No one has replied

    • UNSOLVED Unable to get display on QT window if i use pthread pipelining
      • DhivyaJR  

      5
      0
      Votes
      5
      Posts
      209
      Views

      Thank you for the reply . I am new to Qthread and comfortable with pthread, that is the reason behind I used it in my code. Let me go through the link and use qthread. Thank you for the sugesstion. If possible Please share me some tutorial links for qthreads which helps to build pipeline Thank you, Dhivya JR
    • This topic is deleted!
      • asimkumar  

      1
      0
      Votes
      1
      Posts
      4
      Views

      No one has replied

    • UNSOLVED Way to display Selectable image thumbnails with names under like PC desktop?
      • MikeLemon  

      5
      0
      Votes
      5
      Posts
      208
      Views

      @SGaist Huh I've read a little about that QListView and in conjunction with setViewMode(QListView.IconMode) I believe It can do the intended job I'll try that later when I have a little more free time for it and update. Thanks!
    • UNSOLVED Shiboken - Problem linking to shiboken2.abi3.lib
      • vberlier  

      4
      0
      Votes
      4
      Posts
      218
      Views

      It might be that you are linking to a static library (just a wild guess here).
    • UNSOLVED Pysyde/QTableView: openPersistentEditor works only once?
      • dammilo  

      11
      0
      Votes
      11
      Posts
      1749
      Views

      There's no need to close them first. The issue here comes rather from the replacement of the delegate. There's no need for that. If you just set it in the constructor and trigger the persistent editors when you add a line, you should be fine. One thing that might be worth checking is why replacing the delegate does not close de persistent editor. I do not know whether it's on purpose as you asked for a persistent editor after all.
    • UNSOLVED Controlling QT C++ Project from Python Script
      • MR2552  

      4
      0
      Votes
      4
      Posts
      165
      Views

      Did you consider implementing an IPC solution ?
    • SOLVED Problem with PySide6 and QtWebEngineWidgets module
      • cards  

      9
      0
      Votes
      9
      Posts
      6350
      Views

      @eyllanesc :ModuleNotFoundError: No module named 'PySide2.QtWebKitWidgets' how can i resolve it?in ubundu 20.04,python 3.8.5
    • SOLVED PySide2 QToolButton stylesheets
      • iLLiCiT  

      2
      0
      Votes
      2
      Posts
      169
      Views

      Ok so I found out that I had to use MenuButtonPopup as value QToolButton[popupMode="MenuButtonPopup"] { padding-right: 20px; }
    • UNSOLVED PySide2 with Python3 Built-In Multiprocessing
      qthread pyside2 python3 multiprocessing • • GLaDOS1105  

      3
      0
      Votes
      3
      Posts
      1352
      Views

      I confirm the same observation, that the script runs with PyQt5 (pyqt5 5.15.4) installed via pip and fails when run with PySide2 (PySide2-5.15.2) installed via pip: QObject::moveToThread: Current thread (0x22b951c64b0) is not the object's thread (0x22b951c6c50). Cannot move to target thread (0x22b951c64b0) qt.qpa.plugin: Could not load the Qt platform plugin "windows" in "" even though it was found. This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem. Available platform plugins are: direct2d, minimal, offscreen, webgl, windows. Following the advice of this thread (https://forum.qt.io/topic/93085/qt-python-development-pyside2/6), I removed the PySide2 installed via pip and installed the version via conda-forge (v 5.13.2) and was able to run the script. So, it appears a matter of packaging/dependencies rather than a strict inability for PySide2 to handle it or something related to the version.
    • UNSOLVED QJSEngine with QUILoader undefined ui childe bject
      • Ricardo MAtos  

      1
      0
      Votes
      1
      Posts
      121
      Views

      No one has replied

    • UNSOLVED When I include <Python.h> I get this error in object.h line 190 how do I fix this?
      • AI_Messiah  

      4
      0
      Votes
      4
      Posts
      229
      Views

      Can you show the actual message you get ?
    • UNSOLVED Can i use the same std::unique_ptr smart pointer in multiple Classes ?
      • dziko147  

      3
      0
      Votes
      3
      Posts
      185
      Views

      thank you for your reply Ok i will try this
    • SOLVED Copy folder qt c ++
      • Nathan Miguel  

      5
      0
      Votes
      5
      Posts
      3824
      Views

      Since QDir & QDir::EntryList has some serious trouble with (MacOS) app-bundles, I ended up implementing the QDirIterator solution @Chris-Kawa suggested: void copyAndReplaceFolderContents(const QString &fromDir, const QString &toDir, bool copyAndRemove = false) { QDirIterator it(fromDir, QDirIterator::Subdirectories); QDir dir(fromDir); const int absSourcePathLength = dir.absoluteFilePath(fromDir).length(); while (it.hasNext()){ it.next(); const auto fileInfo = it.fileInfo(); if(!fileInfo.isHidden()) { //filters dot and dotdot const QString subPathStructure = fileInfo.absoluteFilePath().mid(absSourcePathLength); const QString constructedAbsolutePath = toDir + subPathStructure; if(fileInfo.isDir()){ //Create directory in target folder dir.mkpath(constructedAbsolutePath); } else if(fileInfo.isFile()) { //Copy File to target directory //Remove file at target location, if it exists, or QFile::copy will fail QFile::remove(constructedAbsolutePath); QFile::copy(fileInfo.absoluteFilePath(), constructedAbsolutePath); } } } if(copyAndRemove) dir.removeRecursively(); }
    • SOLVED Confused about how connect is passing argument to a function
      • TenG  

      10
      0
      Votes
      10
      Posts
      452
      Views

      @TenG XY Problem: https://meta.stackexchange.com/questions/66377/what-is-the-xy-problem
    • SOLVED Pyd cannot be imported, using shiboken6 to bind
      c++ qt6 binding pyside6 shiboken • • Cr0ss  

      4
      0
      Votes
      4
      Posts
      644
      Views

      Hi @SGaist, I took you advice and finally found out where the problem is. I looked into Wependency Walker and realized that I can import PySide6.QWidgets before I import wiggly, So that the dlls needed is already loaded for wiggly. I've been testing wiggly using one single import wiggly in IPython, not runing the main.py directly in the examples, trying to copy dlls from one place to another, and kept getting ImportErrors. Now I write: import PySide6.QtWidget import wiggly and it works. Thanks for your help!
    • UNSOLVED what would be a good editor to put an assembly function into QT from a library
      • AI_Messiah  

      2
      0
      Votes
      2
      Posts
      171
      Views

      I'm under the impression that Visual C++ has disallowed inline assembly for x64 for a while. Quoting from https://docs.microsoft.com/en-us/cpp/assembler/inline/inline-assembler?view=msvc-160: Inline assembly is not supported on the ARM and x64 processors.
    • SOLVED PyQt doesn't understand &
      • user4592357  

      28
      0
      Votes
      28
      Posts
      5945
      Views

      @Rodrigo-B hi and welcome to devnet, As already written, the accelerators are not permanently shown on Windows.
    • UNSOLVED how to set "Ctrl + c" for copy shortcut on a QMainWindow?
      qmainwindow pyqt qaction • • Herzl Sh  

      7
      0
      Votes
      7
      Posts
      472
      Views

      Because we had declarations of shortcuts littered all over the place we came up with the following solution to handle them in one place. We derived a class MyApplication from QApplication and overrode bool notify(QObject *receiver, QEvent *e) override. Within this function we checked e->type() == QEvent::Shortcut. Everything that couldn't be handled is then forwarded to QApplication::notify. We didn't override the Ctrl+C shortcut or anything similar. However, because this is so early in Qt's signal handling you could be lucky with this approach.
    • UNSOLVED I encountered a problem about monitoring multi-monitor access and disconnect, I do not know if you have encountered
      • guard  

      3
      0
      Votes
      3
      Posts
      239
      Views

      No, there are three monitors, and if I disconnect one of them, I get a signal, and if I plug it back in, I get a signal, but if I disconnect it again, I don't get a signal.