Skip to content

Language Bindings

You're using Qt with other languages than C++, eh? Post here!
865 Topics 3.4k Posts
  • qmake fine tuning

    Solved
    2
    0 Votes
    2 Posts
    748 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
    972 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
    750 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
    797 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
    782 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
    15k 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
    1k 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
    23k 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
    14k 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!
  • How to jump millisecond in video?

    Moved Unsolved pyqt5
    2
    0 Votes
    2 Posts
    868 Views
    SGaistS
    Hi, What résolution are you expecting ?
  • Build frames in GUI Program

    Moved Unsolved python
    6
    0 Votes
    6 Posts
    2k Views
    SGaistS
    A quick google search with PyQt5 layout gives that nice article.
  • Adding video window

    Moved Unsolved pyqt5
    4
    0 Votes
    4 Posts
    1k Views
    SGaistS
    Well... Then you can translate the example from the class detailed documentation in Python and you have a minimal video player.
  • Picamera significant delay and low FPS, but low CPU and memory usage

    Moved Unsolved python
    3
    0 Votes
    3 Posts
    2k Views
    W
    @jazzycamel said in Picamera significant delay and low FPS, but low CPU and memory usage: Thanks this worked i also changed the camera parameters so it runs even faster. self._camera=PiCamera(sensor_mode=4,resolution='640x480',framerate=40). Now the only problem is when i try to capture using the worker thread is not responding to the signal ,this is also happening with the stop function its not responding to a button click or custom emit signal to stop the camera it just keeps running @pyqtSlot() def snapshot(self): self._looping=False self._camera.capture('image.jpg') self._looping=True stopcamera = pyqtSignal() self._thread = QThread() self.stopcamera.connect(self._camera.stop) self._thread.start() self.CameraSnap.clicked.connect(self._camera.snapshot) self.CameraBack.clicked.connect(self.functionstopcamera) def functionstopcamera(self): self.stopcamera.emit()