Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Prepare for pyside2 #1869

Merged
merged 7 commits into from
Jul 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions openpype/modules/log_viewer/tray/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@ class LogsWindow(QtWidgets.QWidget):
def __init__(self, parent=None):
super(LogsWindow, self).__init__(parent)

self.setStyleSheet(style.load_stylesheet())
self.setWindowTitle("Logs viewer")

self.resize(1400, 800)
log_detail = OutputWidget(parent=self)
logs_widget = LogsWidget(log_detail, parent=self)

main_layout = QtWidgets.QHBoxLayout()
main_layout = QtWidgets.QHBoxLayout(self)

log_splitter = QtWidgets.QSplitter(self)
log_splitter.setOrientation(QtCore.Qt.Horizontal)
Expand All @@ -24,5 +25,4 @@ def __init__(self, parent=None):
self.logs_widget = logs_widget
self.log_detail = log_detail

self.setLayout(main_layout)
self.setWindowTitle("Logs")
self.setStyleSheet(style.load_stylesheet())
9 changes: 3 additions & 6 deletions openpype/modules/log_viewer/tray/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,10 @@ def __init__(self, title, parent=None):
toolbutton.setMenu(toolmenu)
toolbutton.setPopupMode(QtWidgets.QToolButton.MenuButtonPopup)

layout = QtWidgets.QHBoxLayout()
layout = QtWidgets.QHBoxLayout(self)
layout.setContentsMargins(0, 0, 0, 0)
layout.addWidget(toolbutton)

self.setLayout(layout)

toolmenu.selection_changed.connect(self.selection_changed)

self.toolbutton = toolbutton
Expand Down Expand Up @@ -141,7 +139,6 @@ def __init__(self, detail_widget, parent=None):
filter_layout.addWidget(refresh_btn)

view = QtWidgets.QTreeView(self)
view.setAllColumnsShowFocus(True)
view.setEditTriggers(QtWidgets.QAbstractItemView.NoEditTriggers)

layout = QtWidgets.QVBoxLayout(self)
Expand Down Expand Up @@ -229,9 +226,9 @@ def __init__(self, parent=None):
super(OutputWidget, self).__init__(parent=parent)
layout = QtWidgets.QVBoxLayout(self)

show_timecode_checkbox = QtWidgets.QCheckBox("Show timestamp")
show_timecode_checkbox = QtWidgets.QCheckBox("Show timestamp", self)

output_text = QtWidgets.QTextEdit()
output_text = QtWidgets.QTextEdit(self)
output_text.setReadOnly(True)
# output_text.setLineWrapMode(QtWidgets.QTextEdit.FixedPixelWidth)

Expand Down
11 changes: 10 additions & 1 deletion openpype/style/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ QWidget:disabled {
color: {color:font-disabled};
}

QLabel {
background: transparent;
}

/* Inputs */
QAbstractSpinBox, QLineEdit, QPlainTextEdit, QTextEdit {
border: 1px solid {color:border};
Expand Down Expand Up @@ -97,7 +101,7 @@ QToolButton:disabled {
background: {color:bg-buttons-disabled};
}

QToolButton[popupMode="1"] {
QToolButton[popupMode="1"], QToolButton[popupMode="MenuButtonPopup"] {
/* make way for the popup button */
padding-right: 20px;
border: 1px solid {color:bg-buttons};
Expand Down Expand Up @@ -340,6 +344,11 @@ QAbstractItemView {
selection-background-color: transparent;
}

QAbstractItemView::item {
/* `border: none` hide outline of selected item. */
border: none;
}

QAbstractItemView:disabled{
background: {color:bg-view-disabled};
alternate-background-color: {color:bg-view-alternate-disabled};
Expand Down
5 changes: 4 additions & 1 deletion openpype/tools/settings/settings/window.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,10 @@ def _on_restart_required(self):
# Don't show dialog if there are not registered slots for
# `trigger_restart` signal.
# - For example when settings are runnin as standalone tool
if self.receivers(self.trigger_restart) < 1:
# - PySide2 and PyQt5 compatible way how to find out
method_index = self.metaObject().indexOfMethod("trigger_restart()")
method = self.metaObject().method(method_index)
if not self.isSignalConnected(method):
return

dialog = RestartDialog(self)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import os
from Qt import QtCore, QtGui, QtWidgets
from .resources import get_resource
from avalon import style


class ComponentItem(QtWidgets.QFrame):
Expand Down Expand Up @@ -61,7 +60,7 @@ def __init__(self, parent, main_parent):
name="menu", size=QtCore.QSize(22, 22)
)

self.action_menu = QtWidgets.QMenu()
self.action_menu = QtWidgets.QMenu(self.btn_action_menu)

expanding_sizePolicy = QtWidgets.QSizePolicy(
QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding
Expand Down Expand Up @@ -229,7 +228,6 @@ def add_action(self, action_name):
if not self.btn_action_menu.isVisible():
self.btn_action_menu.setVisible(True)
self.btn_action_menu.clicked.connect(self.show_actions)
self.action_menu.setStyleSheet(style.load_stylesheet())

def set_repre_name_valid(self, valid):
self.has_valid_repre = valid
Expand Down