Skip to content

Language Bindings

You're using Qt with other languages than C++, eh? Post here!
860 Topics 3.4k Posts
  • 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
    688 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
    14k 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
    3k Views
    SGaistS

    No it's not.

    See this excellent article from Arne Mertz on the subject.

  • 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.

  • 0 Votes
    55 Posts
    18k 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
    13k 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
    1k 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
    2
    0 Votes
    2 Posts
    777 Views
    SGaistS

    Hi,

    What résolution are you expecting ?

  • Build frames in GUI Program

    Moved Unsolved
    6
    0 Votes
    6 Posts
    1k Views
    SGaistS

    A quick google search with PyQt5 layout gives that nice article.

  • Adding video window

    Moved Unsolved
    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.

  • 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()
  • How I can to part?

    Moved Unsolved
    6
    0 Votes
    6 Posts
    2k Views
    mrjjM

    @Dl10

    Hi
    I think it exists

    https://www.youtube.com/watch?v=Dmo8eZG5I2w

    There you just place 4 qframes on center mainwindow
    Then right click (not on frames) and from layout menu
    select Grid layout

  • Adding to my project

    Moved Unsolved
    1
    0 Votes
    1 Posts
    640 Views
    No one has replied
  • QMdiSubWindow Buttons Merged With Menubar

    Unsolved
    3
    0 Votes
    3 Posts
    2k Views
    J

    @SGaist Thanks for the reply. It has the same behavior in the MATE desktop environment. So far I've also tried in Unity and Gnome 3.0 as well.

  • How can I delay but not time.sleep?

    Moved Unsolved
    3
    0 Votes
    3 Posts
    3k Views
    T

    @Dl10
    You may split the function and start a timer.. something like..
    from :

    testFunction(){ step1.. step2.. time.sleep().. step3.. }

    to

    testFunction(){ step1.. step2.. qtimer t; connect(&t,SIGNAL(timeOut()),this,SLOT(testFunction2())); t.start(2000); } testFunction2(){ step3... }

    PS: Syntax may vary.. this is a c++ code.. please convert it to pyqt5.. Hope this is what you are expecting...
    and thats what i understood from your post...

  • pyqt4 float slider

    Unsolved
    2
    0 Votes
    2 Posts
    856 Views
    SGaistS

    Hi and welcome to devnet,

    What slider are you talking about ?