Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setting window style in PyQT/PySide?

I've been looking for how to do this and I've found places where the subject comes up, but none of the suggestions actually work for me, even though they seem to work out okay for the questioner (they don't even list what to import). I ran across self.setWindowFlags(Qt.FramelessWindowHint) but it doesn't seem to work regardless of the import I try (QtGui.FramelessWindowHint, QtCore.FramelessWindowHint, etc.).

Any ideas?

like image 213
Tryst Avatar asked Sep 21 '10 08:09

Tryst


People also ask

Which is better PyQt or PySide?

PyQt is significantly older than PySide and, partially due to that, has a larger community and is usually ahead when it comes to adopting new developments. It is mainly developed by Riverbank Computing Limited and distributed under GPL v3 and a commercial license.

Why use PySide instead of PyQt?

Advantages of PySide PySide represents the official set of Python bindings backed up by the Qt Company. PySide comes with a license under the LGPL, meaning it is simpler to incorporate into commercial projects when compared with PyQt. It allows the programmer to use QtQuick or QML to establish the user interface.

Is PyQt and PySide same?

The key difference in the two versions — in fact the entire reason PySide2 exists — is licensing. PyQt5 is available under a GPL or commercial license, and PySide2 under a LGPL license.

Can I use PySide for commercial use?

Can I use PySide for commercial applications? Yes, and you don't need to release your source code to customers. The LGPL only requires you to release any changes you make to PySide itself.


1 Answers

u need to import QtCore

so the code will look like this :
self.setWindowFlags(QtCore.Qt.FramelessWindowHint)

whenever you see Qt.something put in mind that they are talking about the Qt class inside QtCore module .

hope this helps

like image 66
Moayyad Yaghi Avatar answered Nov 14 '22 23:11

Moayyad Yaghi