Typo: NoFrame = QtWidgets.QFrame.Shape.NoFrame if isQt6 else self.noFrame should be
NoFrame = QtWidgets.QFrame.Shape.NoFrame if isQt6 else self.NoFrame With this correction, it runs when only qt5 is available. On Monday, April 12, 2021 at 2:59:44 PM UTC-4 [email protected] wrote: > I got qt_text to work - at least on the surface - with these changes: > > Sunken = QtWidgets.QFrame.Shadow.Sunken if isQt6 else > self.Sunken > > Raised = QtWidgets.QFrame.Shadow.Raised if isQt6 else > self.StyledPanel > NoFrame = QtWidgets.QFrame.Shape.NoFrame if isQt6 else self.noFrame > self.setFrameStyle(Raised | Sunken) > self.edit = e # A QTextEdit > e.setFrameStyle(NoFrame) > > Then I also needed to change in update(): > > #width = self.fm.width(str(max(1000, > self.highest_line))) + self.w_adjust > if isQt6: > width = self.fm.boundingRect(str(max(1000, > self.highest_line))).width() > else: > width = self.fm.width(str(max(1000, self.highest_line))) + > self.w_adjust > if self.width() != width: > self.setFixedWidth(width) > > With these changes. Leo opens outlines without crashing. I notice that > the gutter numbers have too much padding-left, so they are cut off on the > right. I don't know where that is set, so I didn't do anything about it. > > If you want, I can push these changes to my branch and do a PR. It's > probably easier for you to jsut copy them into yours. Just let me know if > you want the PR. > > Next up: VR3 won't load because > > viewrendered3.py requires QtWebKitWidgets.QWebView > pip install PyQtWebEngine > > But how to get this without stepping on the one for qt5? Hmmm. > > On Monday, April 12, 2021 at 1:57:39 PM UTC-4 [email protected] wrote: > >> It failed because >> LeoLineTextWidget' object has no attribute 'StyledPanel >> >> as expected ... >> On Monday, April 12, 2021 at 1:03:57 PM UTC-4 Edward K. Ream wrote: >> >>> On Monday, April 12, 2021 at 11:55:03 AM UTC-5 [email protected] wrote: >>> >>> Without testing it I don't think that will work. >>>> >>> >>> From https://doc.qt.io/qt-6/qframe.html#details "The frame style is >>> specified by a frame shape >>> <https://doc.qt.io/qt-6/qframe.html#Shape-enum> and a shadow style >>> <https://doc.qt.io/qt-6/qframe.html#Shadow-enum> that is used to >>> visually separate the frame from surrounding widgets. These properties can >>> be set together using the setFrameStyle >>> <https://doc.qt.io/qt-6/qframe.html#setFrameStyle>() function..." >>> >>> The only way to know for sure is to test it. The qt6 documentation has >>> proved unreliable in the past. >>> >>> Edward >>> >> -- You received this message because you are subscribed to the Google Groups "leo-editor" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/leo-editor/ca62fa4a-1190-4eaf-a832-d73e602068e0n%40googlegroups.com.
