DialogDemo Example
import sys
from DevMachines import __pyside2__, __pyside6__
from DevMachines.QtitanBase import CommonStyle, WindowTitleBar
from DevMachines.QtitanStyle import AdobePhotoshopStyle, Office2016Style
from DevMachines.QtitanRibbon import RibbonBar
if __pyside2__:
from PySide2 import QtCore
from PySide2.QtCore import Qt
from PySide2.QtWidgets import QApplication, QDialog, QVBoxLayout
if __pyside6__:
from PySide6 import QtCore
from PySide6.QtCore import Qt
from PySide6.QtWidgets import QApplication, QDialog, QVBoxLayout
import DialogDemo_rc
class MainDialog(QDialog):
def __init__(self):
QDialog.__init__(self)
titleBar = WindowTitleBar.get(self)
titleBar.setVisible(True)
self.dlgRibbonBar = RibbonBar(self)
self.dlgRibbonBar.addPage(self.tr("Home"))
layout = QVBoxLayout()
layout.setSpacing(0)
layout.setContentsMargins(0, 0, 0, 0)
layout.addWidget(self.dlgRibbonBar)
layout.setAlignment(self.dlgRibbonBar, Qt.AlignTop)
self.setLayout(layout)
geom = self.screen().availableGeometry()
self.move(QtCore.QPoint(200, 200))
self.resize(2 * geom.width() / 3, 2 * geom.height() / 3)
if __name__ == "__main__":
app = QApplication(sys.argv)
app.setApplicationName("QtitanRibbon Dialog Sample")
app.setOrganizationName("Developer Machines")
#style = Office2016Style()
#style.setTheme(Office2016Style.Black)
style = AdobePhotoshopStyle()
style.setTheme(AdobePhotoshopStyle.Black)
qApp.setStyle(style)
w = MainDialog()
w.show()
sys.exit(app.exec_())