Skip to content

Language Bindings

You're using Qt with other languages than C++, eh? Post here!
869 Topics 3.4k Posts
  • how to create custom style class on PyQt4 / PyQt5

    Unsolved
    5
    0 Votes
    5 Posts
    3k Views
    J
    @SGaist thx for the hint. Will look into it
  • trying to open .so with QLibrary

    Unsolved qlibrary open .so
    2
    0 Votes
    2 Posts
    1k Views
    SGaistS
    Hi and welcome to devnet, Are you sure you library can be found ? What version of Qt are you using ? On what platform ?
  • qtreeview select single item & column

    Solved
    3
    0 Votes
    3 Posts
    4k Views
    H
    Thanks a lot for the hints! I had tried these without success but your input triggered me to look further in this direction and I discovered something called selectionbehavior. In pyqt5 I use: self.view.setSelectionBehavior(QAbstractItemView.SelectItems) Thanks again!
  • pyqt5 qtreeview QAbstractItemModel set coloring of single column based on function?

    Solved
    3
    0 Votes
    3 Posts
    1k Views
    H
    Great, I had missed that.... I simply could not believe that it is actually that easy... Thanks a lot!
  • qmake fine tuning

    Solved
    2
    0 Votes
    2 Posts
    838 Views
    Stanislav SilnickiS
    @Stanislav-Silnicki long story short: i did it. write correct targets interdependency in .pro: #------------------------------------------------- # # Project created by QtCreator 2018-04-02T04:41:55 # #------------------------------------------------- QT -= core gui TARGET = andy TEMPLATE = lib DEFINES += ANDROID_ANDY_LIB_LIBRARY SOURCES += \ andy_native.cpp HEADERS += \ com_andy_EartActivity.h \ andy_native.h firsttarget.target = firsttarget firsttarget.commands += javac -cp /home/user/Android/platforms/android-26/android.jar:/home/user/Unity-2018.1.0b8/Editor/Data/PlaybackEngines/AndroidPlayer/Variations/mono/Release/Classes/classes.jar -sourcepath java/src java/src/com/andy/AndyActivity.java -d java/classes secondtarget.target = secondtarget secondtarget.commands = javah -cp java/src com.andy.AndyActivity lasttarget.target = lasttarget lasttarget.commands = jar cvfM andy.jar -C java/classes . libandy.so QMAKE_EXTRA_TARGETS = firsttarget secondtarget lasttarget PRE_TARGETDEPS = firsttarget secondtarget DISTFILES += \ java/src/com/andy/AndyActivity.java this will produce first three targets while in first make invocation. Than, the last forth target (.jar) has to be built during second make invocation, that is added via QtCreators menu: [image: 26ebfbd9-9df9-4c3d-872d-9f783c65cf85.png] note, last two default build steps in QtCreators menu are disabled. This saves compile time. It just adds no value to my goal. We are the champions! )) UPDATE: just couple sidenotes for those, who stucks in android's development like I constantly do: a) packing native libYourNativeLib.so in java's .jar will make it hard to init... so, finally I refused this approach and just left binary lib for deployment as a separate file. b) if your Android app will crush due to inability to load gnustl_shared, just add this line in qmake's .pro: QMAKE_LIBS_PRIVATE -= -lgnustl_shared
  • Pyside2 5.9 Branch/QT 5.8/GCC 6.4/Linux - Build Failure

    Unsolved
    2
    1 Votes
    2 Posts
    1k Views
    H
    I had the same error with gcc 7.3. I ended up just using clang for compiling as that seemed to work: CC=clang CXX=clang++ python setup.py build --qmake=/usr/bin/qmake-qt5 --ignore-git --build-tests --jobs=8
  • PySide Signals not being sent to Slot, from QThread object.

    Unsolved
    2
    0 Votes
    2 Posts
    854 Views
    SGaistS
    Hi and welcome to devnet, There's no event loop running at all. Therefore signals and slots won't be working.
  • python-pyqt5

    Unsolved
    1
    0 Votes
    1 Posts
    869 Views
    No one has replied
  • 0 Votes
    8 Posts
    3k Views
    aha_1980A
    @CLang I now tried your example with HTML: it would look like this: QString plotYAxis = tr("Emission Factor(g/m<sup>2</sup>h)"); and I got this nicely rendered on a QLabel.
  • too many positional arguments for constructor call

    Solved
    2
    0 Votes
    2 Posts
    2k Views
    U
    found out the reason. it should be window_flags=Qt.WindowFlags(), not window_flags=None
  • check for non valid object

    Solved
    2
    0 Votes
    2 Posts
    889 Views
    JonBJ
    @user4592357 And do what if it isn't? You're only going to raise, and self.mw.addDockWidget will raise anyway if it isn't. Plus self.mw = QMainWindow() would have raised in the first place if it couldn't create a main window. Of course you can check everywhere if you wish. But that can be a lot of code. I wouldn't bother here. P.S. Unless you're doing it for a school project. In which case, goodness knows...
  • PyQt5 closeEvent reimplementation

    Solved
    20
    0 Votes
    20 Posts
    16k Views
    SGaistS
    In the python case, that's indeed something debatable. Most of the time, people don't need to implement __del__. What I would do is to store the settings once you close the corresponding dialog so that you avoid the trouble you had with the unintended interruption you have (unless it's done while the dialog is open). In the extreme case, you can even save you settings on modification if you have an "apply immediately" without cancel style of application preferences.
  • initializing an attribute in __init__

    Solved
    10
    0 Votes
    10 Posts
    4k Views
    SGaistS
    No it's not. See this excellent article from Arne Mertz on the subject.
  • PyQt (but possibly C++) Very simple signal/slot "transference"/encapsulation?

    Solved
    4
    0 Votes
    4 Posts
    2k Views
    SGaistS
    Same as before except that you will have two Q_SIGNAL in the connect statement if using the old version.
  • insert text to textbox and..

    Unsolved
    6
    0 Votes
    6 Posts
    2k Views
    Pablo J. RoginaP
    @Dl10 said in insert text to textbox and..: I managed to thank you all ! it looks like you have solved your problem, so two things please: write a reply showing how you actually solved it :-) and two, don't forget to mark you post as solved. Thanks.
  • QTableView row selection highlight pyside2 issue

    Unsolved
    6
    0 Votes
    6 Posts
    2k Views
    mrjjM
    Ok. i cant find any other reporting that issue. You could look in https://bugreports.qt.io If you can reproduce it with a minimal example, then open bug report.
  • Python/PyQt freeing of objects

    Solved
    5
    0 Votes
    5 Posts
    2k Views
    JonBJ
    @SGaist Great stuff --- I'll study that link.
  • Code suddenly stops at self.cam = QCamera() , PyQt5.9.2, Qt5.9.3, Python3.5

    Moved Unsolved pyqt python
    55
    0 Votes
    55 Posts
    28k Views
    JonBJ
    @Xenoshell There is literally like one occurrence on the whole of the Interweb of your error in vainfo (va_openDriver() returns -1)! https://bugs.launchpad.net/ubuntu/+source/libva-utils/+bug/1719150 It was suggested: Please install mesa-va-drivers and try gain. I suggest you try that.... :)
  • Convert .ui to .py file?

    Moved Unsolved
    5
    0 Votes
    5 Posts
    16k Views
    JonBJ
    @Ken_Du I use PyCharm as my Python/PyQt IDE, and I shan't be moving off that. But OOI does your eric really do much other than allow you to convert .ui to .py, which I see I can do via PyQt's pyuic5?
  • How i can check if char is '\'?

    Moved Unsolved
    5
    0 Votes
    5 Posts
    2k Views
    JonBJ
    @SGaist said in How i can check if char is '\'?: To add to @JonB: file_ += char would be even cleaner. I left it using the literal rather than the "variable", as it's not obvious from the context whether OP really wants the same char he's testing for appended or always a \, if you see what I mean!