-
-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Optimizing UI Design: Harnessing Frameless Windows in PySide 6 with Qt Designer for Compiled UI #143
Comments
You can't use frameless window in designer |
Hello, appreciate your response! I'm looking to integrate the custom title bar developed in your code, not within the designer itself but in the main.py file, Can you assist me with this implementation? class MainWindow(QMainWindow):
|
@YouKnow-sys |
Please check this demo: https://pyqt-frameless-window.readthedocs.io/en/latest/usage.html#work-with-qt-designer |
|
can you explain to me how i can user the the frameless window to set a Customize title bar in my code, i'm kinda lost in the documentation
i'm using pyside 6 last version
`# main.py
import os
import sys
import tempfile
from PySide6 import QtWidgets, QtCore
from PySide6.QtWidgets import QMainWindow
from qframelesswindow import FramelessMainWindow
from UI.IFRS_user_interface import Ui_MainWindow
from front_end.shadow_effect import ShadowEffectProvider
from front_end.mouse_interaction import MouseInteraction
from front_end.intro_animation import IntroAnimation
Loading Code
Use this code to signal the splash screen removal.
if "NUITKA_ONEFILE_PARENT" in os.environ:
splash_filename = os.path.join(
tempfile.gettempdir(),
"onefile_%d_splash_feedback.tmp" % int(os.environ["NUITKA_ONEFILE_PARENT"]),
)
print("Splash Screen has been removed")
Fix problem for High DPI and Scale above 100%
os.environ["QT_FONT_DPI"] = "96"
class MainWindow(QMainWindow):
def init(self):
super().init()
if name == "main":
# Create the QApplication instance
app = QtWidgets.QApplication([])
`
`# -- coding: utf-8 --
################################################################################
Form generated from reading UI file 'IFRS_user_interface.ui'
Created by: Qt User Interface Compiler version 6.6.0
WARNING! All changes made in this file will be lost when recompiling UI file!
################################################################################
from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale,
QMetaObject, QObject, QPoint, QRect,
QSize, QTime, QUrl, Qt)
from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor,
QFont, QFontDatabase, QGradient, QIcon,
QImage, QKeySequence, QLinearGradient, QPainter,
QPalette, QPixmap, QRadialGradient, QTransform)
from PySide6.QtWidgets import (QApplication, QFrame, QHBoxLayout, QLabel,
QMainWindow, QProgressBar, QPushButton, QSizePolicy,
QSpacerItem, QVBoxLayout, QWidget)
import ressources
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
if not MainWindow.objectName():
MainWindow.setObjectName(u"MainWindow")
MainWindow.resize(977, 542)
sizePolicy = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Preferred)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(MainWindow.sizePolicy().hasHeightForWidth())
MainWindow.setSizePolicy(sizePolicy)`
The text was updated successfully, but these errors were encountered: