Skip to main content

QtFrameless

QtFrameless


Overview

A PySide6 Implementation of a draggable, resizable, and frameless QMainWindow widget. It comes with a built in title bar with standard close, maximize and minimize buttons, however it users can also provide their own Titlebar QWidget subclass.

Features

  • Frameless
  • Custom Title Bar
  • Resizeable
  • Draggable
  • Pluggable
  • Extensible

Install

Using PyPi

pip install QtFrameless

Using git

git clone https://github.com/alexpdev/QtFrameless.git
cd QtFrameless
pip install .

Examples

The simplest possible example:

from PySide6.QtWidgets import QApplication
from QtFrameless import FramelessWindow

app = QApplication([])
FramelessWindow().show()
app.exec()

basic.py


Another simple Hello World example that uses subclassing and changes the window title.

from PySide6.QtWidgets import QApplication
from QtFrameless import FramelessWindow

class MainWindow(FramelessWindow):
    def __init__(self):
        super().__init__()
        self.setWindowTitle("HELLO WORLD!")

helloworld


Example that creates a QTextEdit widget as the central widget.

from PySide6.QtWidgets import QApplication, QTextEdit
from QtFrameless import FramelessWindow

class MainWindow(FramelessWindow):
    def __init__(self):
        super().__init__()
        self.setWindowTitle("Text Editor")
        self.textEdit = QTextEdit(parent=self)
        self.setCentralWidget(self.textEdit)
        self.setStyleSheet("QTextEdit {border: 1px solid black;}")

texteditor


An example of providing a custom widget class to use as the title bar.

from PySide6.QtWidgets import *
from QtFrameless import FramelessWindow

class TitleBar(QWidget):
    def __init__(self, parent=None):
        super().__init__(parent=parent)
        self.layout = QHBoxLayout(self)
        self.setup_menubar()
        self.button = QPushButton("CLOSE", self)
        self.button.clicked.connect(app.exit)
        self.layout.addWidget(self.menu_bar)
        self.layout.addWidget(self.button)
        self.setMaximumHeight(50)

    def setup_menubar(self):
        self.menu_bar = QMenuBar()
        self.file_menu = QMenu("File")
        self.options_menu = QMenu("Options")
        self.edit_menu = QMenu("Edit")
        self.menu_bar.addMenu(self.options_menu)
        self.menu_bar.addMenu(self.file_menu)
        self.menu_bar.addMenu(self.edit_menu)
        self.save_action = QAction("Save")
        self.exit_action = QAction("Exit")
        self.about_action = QAction("About")
        self.copy_action = QAction("Copy")
        self.paste_action = QAction("Paste")
        self.cut_action = QAction("Cut")
        self.file_menu.addActions([self.save_action, self.exit_action])
        self.edit_menu.addActions(
            [self.copy_action, self.cut_action, self.paste_action])
        self.options_menu.addAction(self.about_action)

if "main" in __name__:
    app = QApplication([])
    window = FramelessWindow(titleBar=TitleBar)
    window.show()
    app.exec()

customtitlebar.py

Metadata

Release files for QtFrameless 0.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for QtFrameless 0.1.4
File Size Uploaded
QtFrameless-0.1.4.tar.gz 34.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for QtFrameless 0.1.4
File Interpreter ABI Platform
QtFrameless-0.1.4-py3-none-any.whl Python 3 none any Details

Total release size: 49.6 kB

Release files / QtFrameless-0.1.4.tar.gz

Download URL QtFrameless-0.1.4.tar.gz
Size 34.0 kB
Tags Source
SHA-256 checksum
How to use checksums
5eaa270742a4561b34e7c0b90878ccaa6f1ab193d60aa6e6cfff68b20c827591
BLAKE2b-256 checksum
How to use checksums
ec9c14288d451ff1b9dcb4347143989ddb38bb152eb17b07bf3d35658c0d04f0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.9

Release files / QtFrameless-0.1.4-py3-none-any.whl

Download URL QtFrameless-0.1.4-py3-none-any.whl
Size 15.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6efe62bd312ccb11ea78956241c805d497cf114b84ae3bb1f6882f2c46967351
BLAKE2b-256 checksum
How to use checksums
4e197c9b5bd40bc3edb96118c4f5d72634f37d06f8ba71656e82234cbcf6a7d8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.9

Release history Release notifications | RSS feed

This release

0.1.4 This release

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page