Metadata-Version: 2.1
Name: pyqt-frameless-window
Version: 0.0.2
Summary: PyQt Frameless window to inherit a variety of frameless widget
Home-page: https://github.com/yjg30737/pyqt-frameless-window.git
Author: Jung Gyu Yoon
Author-email: yjg30737@gmail.com
License: MIT
Description-Content-Type: text/markdown
License-File: LICENSE


# pyqt-frameless-window

PyQt frameless window



## Requirements

* PyQt5 >= 5.15 - to call <a href="https://doc.qt.io/qt-5/qwindow.html#startSystemMove">startSystemMove</a>, <a href="https://doc.qt.io/qt-5/qwindow.html#startSystemResize">startSystemResize</a> which are introduced in Qt 5.15.



## Setup

`python -m pip install pyqt-frameless-window`



## Detailed Description

This is the empty window which has no frame. It looks nothing special, but it has a great feature.



<b>It can be movable and resizable.</b> That's not the only feature. 



When you place the mouse cursor over the edge of the window, mouse cursor's shape will turn into one of those below based on direction of edge.



<a href="https://doc.qt.io/qt-5/qt.html#CursorShape-enum">CursorShape in Qt Documentations</a>

* Qt.SizeVerCursor

* Qt.SizeHorCursor

* Qt.SizeBDiagCursor

* Qt.SizeFDiagCursor



The window's minimum size is set to inner widget's recommended minimum size.



You can use this as a parent class if you want to make movable, resizable frameless window. This is no use on its own.



If you want to customize the title bar easily than use <a href="https://github.com/yjg30737/pyqt-custom-titlebar-setter">pyqt-custom-titlebar-setter</a>, which also uses the pyqt-frameless-window.



If you don't need any title bar or min/max/close buttons or something like that, just use this as a parent class of your widget.



## Method Overview

* `setResizable(f: bool)` - Set resizable/none-resizable

* `isResizable() -> bool` - Check if window is resizable or not

* `setPressToMove(f: bool)` - Set movable/non-movable

* `isPressToMove() -> bool` - Check if window is movable or not

* `setMargin(margin: int)` - Set the margin which allows cursor to change its shape to resize form

* `setFrameColor(color)` - Set the background color. `color` argument type can be both `QColor` and `str`.



## Example

Code Sample

```python

from PyQt5.QtWidgets import QApplication

from pyqt_frameless_window import FramelessWindow





if __name__ == "__main__":

    import sys



    app = QApplication(sys.argv)

    ex = FramelessWindow()

    ex.show()

    sys.exit(app.exec_())

```



Result



![image](https://user-images.githubusercontent.com/55078043/151485588-eea83a1b-7150-4a37-b0f1-6891d5f3da1f.png)



Try to move and resize it.





