Re: ekr-qt branch Leo Won't Start When pyqt6 installed

2021-04-14 Thread tbp1...@gmail.com
A possible clue:  When I press  for the first time after launching 
Leo, I get the following error message:

  OpenType support missing for "Consolas", script 32
  OpenType support missing for "DejaVu Sans Mono", script 32
  OpenType support missing for "Arial", script 32
  OpenType support missing for "MS UI Gothic", script 32
  OpenType support missing for "SimSun", script 32
  OpenType support missing for "Segoe UI Emoji", script 32
  OpenType support missing for "Segoe UI Symbol", script 32

I haven't gotten this behavior when pressing  or .

If there is a problem with the type system, perhaps it's not a surprise if 
strange glyphs get inserted. In addition, my list of fonts in my 
font-family setting does not include some of these.  

In the configuration of this particular Leo instance I'm not using a Leo 
theme at all;  I have some settings in in MyLeoSettings for font-family, 
etc.  To avoid invoking the default theme, I'm specifying a non-existent 
theme name.
On Wednesday, April 14, 2021 at 5:35:41 AM UTC-4 Edward K. Ream wrote:

> On Tue, Apr 13, 2021 at 9:51 PM tbp1...@gmail.com  
> wrote:
>
> If I rpess a modifier key in the Nav or Console panes, nothing gets 
>> inserted, but in the log pane, I get this (gotten by copy-paste from the 
>> log pane - the "ctrl" + glyphs were added when I copied the "shift" + 
>> glyphs with CNTRL-C):
>>
>> ctrl+ៀ?shift+ៀ?
>>
>> In the body pane, I get the odd glyphs but not the words "ctrl" or "shift"
>>
>> In a headline, I get what seem to be the same glyphs.  
>>
>
> I just saw something similar after a Ctrl-Shift-C (paste-node). 
>  
>
>> I'm thinking illegal o broken utf-8 byte arrays instead of strings, maybe.
>>
>
> A reasonable hypothesis.
>
> 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 leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/ab63a29d-c5fc-464b-a683-f9bd4c0a55cen%40googlegroups.com.


Re: ekr-qt branch Leo Won't Start When pyqt6 installed

2021-04-14 Thread Edward K. Ream
On Tue, Apr 13, 2021 at 9:51 PM tbp1...@gmail.com 
wrote:

If I rpess a modifier key in the Nav or Console panes, nothing gets
> inserted, but in the log pane, I get this (gotten by copy-paste from the
> log pane - the "ctrl" + glyphs were added when I copied the "shift" +
> glyphs with CNTRL-C):
>
> ctrl+ៀ?shift+ៀ?
>
> In the body pane, I get the odd glyphs but not the words "ctrl" or "shift"
>
> In a headline, I get what seem to be the same glyphs.
>

I just saw something similar after a Ctrl-Shift-C (paste-node).


> I'm thinking illegal o broken utf-8 byte arrays instead of strings, maybe.
>

A reasonable hypothesis.

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 leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/CAMF8tS1Hewe60AQGD9Tk5WYk4%3DJ%3DyxUZ66vzHUseRpeaO%2B7JaQ%40mail.gmail.com.


Re: ekr-qt branch Leo Won't Start When pyqt6 installed

2021-04-13 Thread tbp1...@gmail.com
If I rpess a modifier key in the Nav or Console panes, nothing gets 
inserted, but in the log pane, I get this (gotten by copy-paste from the 
log pane - the "ctrl" + glyphs were added when I copied the "shift" + 
glyphs with CNTRL-C):

ctrl+ៀ?shift+ៀ?

In the body pane, I get the odd glyphs but not the words "ctrl" or "shift"

In a headline, I get what seem to be the same glyphs.  I'm thinking illegal 
o broken utf-8 byte arrays instead of strings, maybe.
On Tuesday, April 13, 2021 at 5:38:56 PM UTC-4 tbp1...@gmail.com wrote:

> Right.
>
> On Tuesday, April 13, 2021 at 4:25:26 PM UTC-4 Edward K. Ream wrote:
>
>> On Tue, Apr 13, 2021 at 10:39 AM tbp1...@gmail.com  
>> wrote:
>>
>>> This behavior makes it impossible to do any editing in Leo/pyqt6. 
>>>
>>
>> I can imagine.
>>
>> Just now I want to move on to the sabbatical. Feel free to investigate, 
>> or not, as you like. We can revisit this in a month or more if need be.
>>
>> 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 leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/10ff64bb-ca5d-46e2-9bd3-c6e85286de57n%40googlegroups.com.


Re: ekr-qt branch Leo Won't Start When pyqt6 installed

2021-04-13 Thread tbp1...@gmail.com
Right.

On Tuesday, April 13, 2021 at 4:25:26 PM UTC-4 Edward K. Ream wrote:

> On Tue, Apr 13, 2021 at 10:39 AM tbp1...@gmail.com  
> wrote:
>
>> This behavior makes it impossible to do any editing in Leo/pyqt6. 
>>
>
> I can imagine.
>
> Just now I want to move on to the sabbatical. Feel free to investigate, or 
> not, as you like. We can revisit this in a month or more if need be.
>
> 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 leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/08ac1878-3011-40f2-8faa-ef21f8b9dc40n%40googlegroups.com.


Re: ekr-qt branch Leo Won't Start When pyqt6 installed

2021-04-13 Thread Edward K. Ream
On Tue, Apr 13, 2021 at 10:39 AM tbp1...@gmail.com 
wrote:

> This behavior makes it impossible to do any editing in Leo/pyqt6.
>

I can imagine.

Just now I want to move on to the sabbatical. Feel free to investigate, or
not, as you like. We can revisit this in a month or more if need be.

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 leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/CAMF8tS3sm9LrMAP0wZAZeh2%3DAWcEwLO6%2BYNTNJsxo84DZhKGGw%40mail.gmail.com.


Re: ekr-qt branch Leo Won't Start When pyqt6 installed

2021-04-13 Thread Edward K. Ream
On Tue, Apr 13, 2021 at 2:20 PM tbp1...@gmail.com 
wrote:

> BTW, you said that you've been using Leo/Qt6 for some time.  But I
> couldn't get it to run until I fixed qt_text.  How did you manage it?
>

Apparently my installation did not execute the affected code.

> I don't know what qt_text does, really, but it's imported even though it's
> not in my enabled plugins list.
>

It's part of Leo's qt gui code, which is all in the plugins directory
because Leo can also use other guis.

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 leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/CAMF8tS2uNwufF13rZXq7u_PRtNRZjrqDs6dhVq0ZAS1oqg8BpQ%40mail.gmail.com.


Re: ekr-qt branch Leo Won't Start When pyqt6 installed

2021-04-13 Thread tbp1...@gmail.com
I have written a very simple QT edit app using QTextEdit (attached).  It 
works with both Qt5 and Qt6, and typing Shift, Control, and Alt keys does 
not cause any unexpected behavior.  So whatever is happening is coming from 
Leo somehow.

BTW, you said that you've been using Leo/Qt6 for some time.  But I couldn't 
get it to run until I fixed qt_text.  How did you manage it?  I don't know 
what qt_text does, really, but it's imported even though it's not in my 
enabled plugins list.

On Tuesday, April 13, 2021 at 11:39:46 AM UTC-4 tbp1...@gmail.com wrote:

> This behavior makes it impossible to do any editing in Leo/pyqt6.  I can 
> read the text, I can type into the body, but I can't use the ALT, SHIFT, or 
> CNTRL keys if anything has been selected, and pressing the SHIFT key also 
> inserts those strange glyphs so I can't type capitals.  The right and left 
> shift keys do the same things.
>
> I was going to capture the version/build info from the log pane, but 
> pressing CNTRL-C actually inserted thes glyphs into the log pane, and only 
> one line was copied.
>
> On Tuesday, April 13, 2021 at 11:10:38 AM UTC-4 Edward K. Ream wrote:
>
>> On Mon, Apr 12, 2021 at 3:49 PM tbp1...@gmail.com  
>> wrote:
>>
>>> The shift and ALT keys also do the same thing - delete the selection.  
>>> The strange characters get inserted when I press .  This is using 
>>> qt6, of course.
>>>
>>
>> Again, I see nothing like this. I've been using the qt6 code long enough 
>> that I would be surprised if there were any key-related problems.
>>
>> 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 leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/ef3a6c65-2ead-4d24-9a63-4f4a8a87521en%40googlegroups.com.
import sys

qtvers = 'unknown'
try:
from PyQt6.QtWidgets import QMainWindow, QTextEdit, QApplication
from PyQt6.QtCore import Qt
qtvers = 'qt6'
except ImportError:
from PyQt5.QtWidgets import QMainWindow, QTextEdit, QApplication
from PyQt5.QtCore import Qt
qtvers='qt5'

QT5 = 'qt5'
QT6 = 'qt6'

print('Using', qtvers)

shift_modifier = Qt.ShiftModifier if qtvers == QT5 else 
Qt.KeyboardModifiers.ShiftModifier
cntrl_modifier = Qt.ControlModifier if qtvers == QT5 else 
Qt.KeyboardModifiers.ControlModifier
alt_modifier = Qt.AltModifier if qtvers == QT5 else 
Qt.KeyboardModifiers.AltModifier

modifer_name = {shift_modifier: "SHIFT", cntrl_modifier:"CTRL",
alt_modifier: "ALT"}
   
class TextEdit(QTextEdit):
def __init__(self):
   QTextEdit.__init__(self)
   self.setPlainText(f'Using {qtvers}')

def keyPressEvent(self, event):
super(TextEdit, self).keyPressEvent(event)
do_key(event)

def do_key(key):
modifiers = key.modifiers()
ischar = key.key() < 0x11
letter = chr(key.key()) if ischar else ''
msg = f'{modifer_name.get(modifiers)} {letter}' 

print(msg)

app = QApplication(sys.argv)
textedit = TextEdit()

textedit.setWindowTitle('QTextEdit Test')
textedit.show()

sys.exit(app.exec())


Re: ekr-qt branch Leo Won't Start When pyqt6 installed

2021-04-13 Thread tbp1...@gmail.com
OK, done.

On Tuesday, April 13, 2021 at 10:14:03 AM UTC-4 Edward K. Ream wrote:

> On Mon, Apr 12, 2021 at 1:59 PM tbp1...@gmail.com  
> wrote:
>
>> I got qt_text to work - at least on the surface - with these changes:
>>
> ... 
>
>> If you want, I can push these changes to my branch and do a PR. 
>>
>
> Please do that. I find PR's are good records. I'll approve the PR 
> immediately
>
> 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 leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/2ffdc6f9-f134-4b36-a20c-0384ded8df46n%40googlegroups.com.


Re: ekr-qt branch Leo Won't Start When pyqt6 installed

2021-04-13 Thread tbp1...@gmail.com
This behavior makes it impossible to do any editing in Leo/pyqt6.  I can 
read the text, I can type into the body, but I can't use the ALT, SHIFT, or 
CNTRL keys if anything has been selected, and pressing the SHIFT key also 
inserts those strange glyphs so I can't type capitals.  The right and left 
shift keys do the same things.

I was going to capture the version/build info from the log pane, but 
pressing CNTRL-C actually inserted thes glyphs into the log pane, and only 
one line was copied.

On Tuesday, April 13, 2021 at 11:10:38 AM UTC-4 Edward K. Ream wrote:

> On Mon, Apr 12, 2021 at 3:49 PM tbp1...@gmail.com  
> wrote:
>
>> The shift and ALT keys also do the same thing - delete the selection.  
>> The strange characters get inserted when I press .  This is using 
>> qt6, of course.
>>
>
> Again, I see nothing like this. I've been using the qt6 code long enough 
> that I would be surprised if there were any key-related problems.
>
> 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 leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/8f16273a-10ad-4991-82a5-8fcd8d55843cn%40googlegroups.com.


Re: ekr-qt branch Leo Won't Start When pyqt6 installed

2021-04-13 Thread tbp1...@gmail.com
No.  My keyboard is a logitech wireless one.  I don't have any other to try 
out.  I haven't changed the Windows keyboard settings.

On Tuesday, April 13, 2021 at 11:09:16 AM UTC-4 Edward K. Ream wrote:

> On Mon, Apr 12, 2021 at 2:58 PM tbp1...@gmail.com  
> wrote:
>
>> Major problem - in the body pane, when I highlight a line of text, then 
>> press , the line vanishes.  I can get it back with .  
>> Sometimes it left a residue of strange non-ascii characters, but I'm not 
>> sure what else I did to cause that (see attached screenshot).
>>
>
> I don't see this behavior.
>
> I wonder, are you using an alternate keyboard?  I got similar behavior 
> when using the us-international keyboard on windows.
>
> 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 leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/d7f8d563-9c22-46c8-871a-fdbc91b80276n%40googlegroups.com.


Re: ekr-qt branch Leo Won't Start When pyqt6 installed

2021-04-13 Thread Edward K. Ream
On Mon, Apr 12, 2021 at 3:49 PM tbp1...@gmail.com 
wrote:

> The shift and ALT keys also do the same thing - delete the selection.  The
> strange characters get inserted when I press .  This is using qt6,
> of course.
>

Again, I see nothing like this. I've been using the qt6 code long enough
that I would be surprised if there were any key-related problems.

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 leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/CAMF8tS2t4WbFkQUhkiw96UsARUroo2gyr8BGsdjZjqmy6nmDdg%40mail.gmail.com.


Re: ekr-qt branch Leo Won't Start When pyqt6 installed

2021-04-13 Thread Edward K. Ream
On Mon, Apr 12, 2021 at 2:58 PM tbp1...@gmail.com 
wrote:

> Major problem - in the body pane, when I highlight a line of text, then
> press , the line vanishes.  I can get it back with .
> Sometimes it left a residue of strange non-ascii characters, but I'm not
> sure what else I did to cause that (see attached screenshot).
>

I don't see this behavior.

I wonder, are you using an alternate keyboard?  I got similar behavior when
using the us-international keyboard on windows.

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 leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/CAMF8tS1kTcqOOPPehxt2c%3D0U8CxpCsFqgZ%3DnST_puvYuAY-MVQ%40mail.gmail.com.


Re: ekr-qt branch Leo Won't Start When pyqt6 installed

2021-04-13 Thread Edward K. Ream
On Mon, Apr 12, 2021 at 1:59 PM tbp1...@gmail.com 
wrote:

> I got qt_text to work - at least on the surface - with these changes:
>
...

> If you want, I can push these changes to my branch and do a PR.
>

Please do that. I find PR's are good records. I'll approve the PR
immediately

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 leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/CAMF8tS2nhULFjNpaQ886pC1ad5XyJhjS3Z%3DBo2X3VWdDm5KGMg%40mail.gmail.com.


Re: ekr-qt branch Leo Won't Start When pyqt6 installed

2021-04-12 Thread tbp1...@gmail.com
It would, but this is simpler and doesn't require one to keep various venvs 
straight.  I tend to forget which is for what and what state they are in.

On Monday, April 12, 2021 at 7:17:37 PM UTC-4 gates...@gmail.com wrote:

> Sounds like a situation that virtualenv would solve.
>
> On Apr 12, 2021, at 6:00 PM, tbp1...@gmail.com  wrote:
>
> 
>
> Here is how I configured my installation to let me either use or not use 
> pyqt6. Obviously it's a Windows computer:
>
> 1. Create new directory.  I used %USERPROFILE%\.python\site-packages
> 2. Cut all the installed pyqt6 directories from the standard 
> Lib\site-packages directory.
> 3. Paste the pyqy6 directories into the new .python\site-packages 
> directory.
>
> To run without pyqt6, I just launch Leo as usual.  To run using pyqt6, I 
> set the PYTHONPATH environmental variable:
>
> set PYTHONPATH=%USERPROFILE%\.python\site-packages
>
> Now Leo will launch using pyqt6.
>
> If you have copied all the pyqt6 install directories also, then pip will 
> find them and be able to properly list pyqt6 as well as the pyqt5  that is 
> in the standard location.
> On Monday, April 12, 2021 at 5:24:50 PM UTC-4 tbp1...@gmail.com wrote:
>
>> 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 tbp1...@gmail.com 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 tbp1...@gmail.com 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 tbp1...@gmail.com 
> 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 
>  and a shadow style 
>  that is used to 
> visually separate the frame from surrounding widgets. These properties 
> can 
> be set together using the 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 leo-editor+...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/leo-editor/3f9f3c39-678b-4b22-b1a2-183ab0e04cb9n%40googlegroups.com
>  
> 
> .
>
>

-- 
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 leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/0cd522ce-746e-4ac8-bdb4-d907428e3487n%40googlegroups.com.


Re: ekr-qt branch Leo Won't Start When pyqt6 installed

2021-04-12 Thread Jacob Peck
Sounds like a situation that virtualenv would solve.

> On Apr 12, 2021, at 6:00 PM, tbp1...@gmail.com  wrote:
> 
> 
> Here is how I configured my installation to let me either use or not use 
> pyqt6. Obviously it's a Windows computer:
> 
> 1. Create new directory.  I used %USERPROFILE%\.python\site-packages
> 2. Cut all the installed pyqt6 directories from the standard 
> Lib\site-packages directory.
> 3. Paste the pyqy6 directories into the new .python\site-packages directory.
> 
> To run without pyqt6, I just launch Leo as usual.  To run using pyqt6, I set 
> the PYTHONPATH environmental variable:
> 
> set PYTHONPATH=%USERPROFILE%\.python\site-packages
> 
> Now Leo will launch using pyqt6.
> 
> If you have copied all the pyqt6 install directories also, then pip will find 
> them and be able to properly list pyqt6 as well as the pyqt5  that is in the 
> standard location.
>> On Monday, April 12, 2021 at 5:24:50 PM UTC-4 tbp1...@gmail.com wrote:
>> 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 tbp1...@gmail.com 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 tbp1...@gmail.com 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 tbp1...@gmail.com 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 and a shadow style that is used to visually 
> separate the frame from surrounding widgets. These properties can be set 
> together using the 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 leo-editor+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/leo-editor/3f9f3c39-678b-4b22-b1a2-183ab0e04cb9n%40googlegroups.com.

-- 
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 leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/33180E0E-4858-43D8-8D60-EF229CE0EF4A%40gmail.com.


Re: ekr-qt branch Leo Won't Start When pyqt6 installed

2021-04-12 Thread tbp1...@gmail.com
Here is how I configured my installation to let me either use or not use 
pyqt6. Obviously it's a Windows computer:

1. Create new directory.  I used %USERPROFILE%\.python\site-packages
2. Cut all the installed pyqt6 directories from the standard 
Lib\site-packages directory.
3. Paste the pyqy6 directories into the new .python\site-packages directory.

To run without pyqt6, I just launch Leo as usual.  To run using pyqt6, I 
set the PYTHONPATH environmental variable:

set PYTHONPATH=%USERPROFILE%\.python\site-packages

Now Leo will launch using pyqt6.

If you have copied all the pyqt6 install directories also, then pip will 
find them and be able to properly list pyqt6 as well as the pyqt5  that is 
in the standard location.
On Monday, April 12, 2021 at 5:24:50 PM UTC-4 tbp1...@gmail.com wrote:

> 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 tbp1...@gmail.com 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 tbp1...@gmail.com 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 tbp1...@gmail.com 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 
  and a shadow style 
  that is used to 
 visually separate the frame from surrounding widgets. These properties can 
 be set together using the 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 leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/3f9f3c39-678b-4b22-b1a2-183ab0e04cb9n%40googlegroups.com.


Re: ekr-qt branch Leo Won't Start When pyqt6 installed

2021-04-12 Thread tbp1...@gmail.com
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 tbp1...@gmail.com 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 tbp1...@gmail.com 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 tbp1...@gmail.com 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 
>>>  and a shadow style 
>>>  that is used to 
>>> visually separate the frame from surrounding widgets. These properties can 
>>> be set together using the 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 leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/ca62fa4a-1190-4eaf-a832-d73e602068e0n%40googlegroups.com.


Re: ekr-qt branch Leo Won't Start When pyqt6 installed

2021-04-12 Thread tbp1...@gmail.com
AS best as I can tell, QtWebEngine isn't available yet for qt6.  The github 
site for it only refers to qt5.15 as the latest reference I see.  I maybe 
had better remove qt6 from my everyday Python installation.

On Monday, April 12, 2021 at 2:59:44 PM UTC-4 tbp1...@gmail.com wrote:

> 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.
>
>
>

-- 
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 leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/c743289d-62e6-4261-815e-b4410974461en%40googlegroups.com.


Re: ekr-qt branch Leo Won't Start When pyqt6 installed

2021-04-12 Thread tbp1...@gmail.com
The shift and ALT keys also do the same thing - delete the selection.  The 
strange characters get inserted when I press .  This is using qt6, 
of course.

On Monday, April 12, 2021 at 3:58:32 PM UTC-4 tbp1...@gmail.com wrote:

> Major problem - in the body pane, when I highlight a line of text, then 
> press , the line vanishes.  I can get it back with .  
> Sometimes it left a residue of strange non-ascii characters, but I'm not 
> sure what else I did to cause that (see attached screenshot).
>
> On Monday, April 12, 2021 at 3:46:35 PM UTC-4 tbp1...@gmail.com wrote:
>
>> On Monday, April 12, 2021 at 2:59:44 PM UTC-4 tbp1...@gmail.com wrote:
>>
>>> I got qt_text to work - at least on the surface - with these changes:
>>>
>>#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)
>>>
>>> It's possible that *self.setFixedWidth(width)* has had an API change - 
>>> I didn't look it up to see.  Perhaps this line didn't get executed so an 
>>> error didn't show up.
>>>
>>

-- 
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 leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/6d960564-f9eb-4d07-b841-2afef6fa7733n%40googlegroups.com.


Re: ekr-qt branch Leo Won't Start When pyqt6 installed

2021-04-12 Thread tbp1...@gmail.com
Major problem - in the body pane, when I highlight a line of text, then 
press , the line vanishes.  I can get it back with .  
Sometimes it left a residue of strange non-ascii characters, but I'm not 
sure what else I did to cause that (see attached screenshot).

On Monday, April 12, 2021 at 3:46:35 PM UTC-4 tbp1...@gmail.com wrote:

> On Monday, April 12, 2021 at 2:59:44 PM UTC-4 tbp1...@gmail.com wrote:
>
>> I got qt_text to work - at least on the surface - with these changes:
>>
>#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)
>>
>> It's possible that *self.setFixedWidth(width)* has had an API change - I 
>> didn't look it up to see.  Perhaps this line didn't get executed so an 
>> error didn't show up.
>>
>

-- 
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 leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/453b5ced-2d83-4a75-b2b4-64bcb593e614n%40googlegroups.com.


Re: ekr-qt branch Leo Won't Start When pyqt6 installed

2021-04-12 Thread tbp1...@gmail.com


On Monday, April 12, 2021 at 2:59:44 PM UTC-4 tbp1...@gmail.com wrote:

> I got qt_text to work - at least on the surface - with these changes:
>#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)
>
> It's possible that *self.setFixedWidth(width)* has had an API change - I 
> didn't look it up to see.  Perhaps this line didn't get executed so an 
> error didn't show up.
>

-- 
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 leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/9955325a-d089-47ba-a0c6-b23280820b08n%40googlegroups.com.


Re: ekr-qt branch Leo Won't Start When pyqt6 installed

2021-04-12 Thread tbp1...@gmail.com
That's what I did with qt_text, except for using EditPlus instead.

On Monday, April 12, 2021 at 3:30:18 PM UTC-4 Edward K. Ream wrote:

> On Mon, Apr 12, 2021 at 12:26 PM tbp1...@gmail.com  
> wrote:
>
>> As a practical matter, how are you managing to edit one of these files 
>> when Leo won't start until the file has been fixed?  
>>
>
> No problem: it works for me. I assume some plugin or setting is activating 
> the code.
>
>> If you check out an earlier changeset, you won't have the current copy of 
>> the file to work on.
>>
>
> Nah. When Leo is hosed I just make the needed change in the scite editor.
>
> 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 leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/1f62f046-d20a-483c-baf4-12f3d5e5eb12n%40googlegroups.com.


Re: ekr-qt branch Leo Won't Start When pyqt6 installed

2021-04-12 Thread Edward K. Ream
On Mon, Apr 12, 2021 at 1:59 PM tbp1...@gmail.com 
wrote:

> I got qt_text to work - at least on the surface - with these changes:
>

Thanks.  I'll make them in the ekr-qt branch later today.

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 leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/CAMF8tS1Q0o8ajXi3QX89rMSHNq3Fbn80b87SYzqN1ANV9xXckQ%40mail.gmail.com.


Re: ekr-qt branch Leo Won't Start When pyqt6 installed

2021-04-12 Thread Edward K. Ream
On Mon, Apr 12, 2021 at 12:26 PM tbp1...@gmail.com 
wrote:

> As a practical matter, how are you managing to edit one of these files
> when Leo won't start until the file has been fixed?
>

No problem: it works for me. I assume some plugin or setting is activating
the code.

> If you check out an earlier changeset, you won't have the current copy of
> the file to work on.
>

Nah. When Leo is hosed I just make the needed change in the scite editor.

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 leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/CAMF8tS0HNg7YP-iGu2j3gxVTCwFEWxbGHA1WDk9EXhmg_HgBpQ%40mail.gmail.com.


Re: ekr-qt branch Leo Won't Start When pyqt6 installed

2021-04-12 Thread tbp1...@gmail.com
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 tbp1...@gmail.com 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 tbp1...@gmail.com 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 
>>  and a shadow style 
>>  that is used to 
>> visually separate the frame from surrounding widgets. These properties can 
>> be set together using the 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 leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/741ab895-5641-4590-905b-a30bb7e0dbf9n%40googlegroups.com.


Re: ekr-qt branch Leo Won't Start When pyqt6 installed

2021-04-12 Thread tbp1...@gmail.com
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 tbp1...@gmail.com 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  
> and a shadow style  that 
> is used to visually separate the frame from surrounding widgets. These 
> properties can be set together using the 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 leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/add8180a-b6ef-4e1f-90de-d3273e76dfean%40googlegroups.com.


Re: ekr-qt branch Leo Won't Start When pyqt6 installed

2021-04-12 Thread tbp1...@gmail.com
As a practical matter, how are you managing to edit one of these files when 
Leo won't start until the file has been fixed?  If you check out an earlier 
changeset, you won't have the current copy of the file to work on.

For VR3, I work on my own copy located elsewhere, and use a shortcut 
command to copy it to my repo working directory.  That works pretty well 
for one file, but it would be cumbersome for a lot of them.

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 tbp1...@gmail.com 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  
> and a shadow style  that 
> is used to visually separate the frame from surrounding widgets. These 
> properties can be set together using the 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 leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/8f2b5695-967f-4f36-9e15-ff188ca8ae0dn%40googlegroups.com.


Re: ekr-qt branch Leo Won't Start When pyqt6 installed

2021-04-12 Thread Edward K. Ream
On Monday, April 12, 2021 at 11:55:03 AM UTC-5 tbp1...@gmail.com 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  
and a shadow style  that is 
used to visually separate the frame from surrounding widgets. These 
properties can be set together using the 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 leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/15af4b7b-b2eb-4d88-936d-942d2fd9e467n%40googlegroups.com.


Re: ekr-qt branch Leo Won't Start When pyqt6 installed

2021-04-12 Thread Edward K. Ream
On Mon, Apr 12, 2021 at 11:55 AM tbp1...@gmail.com 
wrote:

> Without testing it I don't think that will work. *StyledPanel *has been
> replaced by *Raised*.  I would expect something like this would do it -
>
> Sunken = QtWidgets.QFrame.Shadow.Sunken if isQt6 else self.Sunken
> Raised = QtWidgets.QFrame.Shadow.Raised if isQt6 else self.StyledPanel
> self.setFrameStyle(Raised | Sunken)
>
> Also, couldn't *self.Shadow* be used instead of *QtWidgets.QFrame.Shadow*?
>

The new code follows the pattern used throughout the conversion.

Please test the code, and we'll go from there.

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 leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/CAMF8tS2pcz5%2B%3DRLRmUTU14O1y0K-DPUfJpPyUeeEE7p%2B6GJC3w%40mail.gmail.com.


Re: ekr-qt branch Leo Won't Start When pyqt6 installed

2021-04-12 Thread tbp1...@gmail.com
Without testing it I don't think that will work. *StyledPanel *has been 
replaced by *Raised*.  I would expect something like this would do it -

Sunken = QtWidgets.QFrame.Shadow.Sunken if isQt6 else self.Sunken 
Raised = QtWidgets.QFrame.Shadow.Raised if isQt6 else self.StyledPanel
self.setFrameStyle(Raised | Sunken) 

Also, couldn't *self.Shadow* be used instead of *QtWidgets.QFrame.Shadow*?
On Monday, April 12, 2021 at 11:59:16 AM UTC-4 Edward K. Ream wrote:

> On Mon, Apr 12, 2021 at 10:32 AM tbp1...@gmail.com  
> wrote:
>
>> Looks like the names of the constants have been changed to
>>
>> label.setFrameStyle(QFrame ::
>> Panel | QFrame ::Raised); 
>>
>> See https://doc.qt.io/qt-6/qframe.html#details
>>
>
> Rev d5a26c0 in ekr-qt attempts a fix.  The new code is:
>
> Shadow = QtWidgets.QFrame.Shadow.Sunken if isQt6 else self.Sunken
> self.setFrameStyle(self.StyledPanel | Shadow.Sunken)
>
> I only tested that Shadow.Sunken exists on qt6. Please let me know if the 
> fix works for you.
>
> 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 leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/47f09af1-5d80-42d2-83a6-a4fb1041b6d5n%40googlegroups.com.


Re: ekr-qt branch Leo Won't Start When pyqt6 installed

2021-04-12 Thread Edward K. Ream
On Mon, Apr 12, 2021 at 10:32 AM tbp1...@gmail.com 
wrote:

> Looks like the names of the constants have been changed to
>
> label.setFrameStyle(QFrame ::
> Panel | QFrame ::Raised);
>
> See https://doc.qt.io/qt-6/qframe.html#details
>

Rev d5a26c0 in ekr-qt attempts a fix.  The new code is:

Shadow = QtWidgets.QFrame.Shadow.Sunken if isQt6 else self.Sunken
self.setFrameStyle(self.StyledPanel | Shadow.Sunken)

I only tested that Shadow.Sunken exists on qt6. Please let me know if the
fix works for you.

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 leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/CAMF8tS3jabyetUyQ6idn_dcePr-%3Dd20Pxiiorvw05DmtqnN-ew%40mail.gmail.com.


Re: ekr-qt branch Leo Won't Start When pyqt6 installed

2021-04-12 Thread tbp1...@gmail.com
Looks like the names of the constants have been changed to

label.setFrameStyle(QFrame ::
Panel | QFrame ::Raised); 

See https://doc.qt.io/qt-6/qframe.html#details

On Monday, April 12, 2021 at 11:17:10 AM UTC-4 Edward K. Ream wrote:

> On Mon, Apr 12, 2021 at 10:13 AM tbp1...@gmail.com  
> wrote:
>
>> I got a large number of messages as Leo tried to start.  Here is the last 
>> one before it quit:
>>
>>   File "d:\Tom\git\leo-editor\leo\plugins\qt_text.py", line 413, in 
>> __init__
>> self.setFrameStyle(self.StyledPanel | self.Sunken)
>>
>> AttributeError: 'LeoLineTextWidget' object has no attribute 'StyledPanel'
>>
>
> Thanks for the report. I'll fix it immediately.
>
> 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 leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/a18ccf34-d9ff-4335-8e61-135551b103e6n%40googlegroups.com.


Re: ekr-qt branch Leo Won't Start When pyqt6 installed

2021-04-12 Thread Edward K. Ream
On Mon, Apr 12, 2021 at 10:13 AM tbp1...@gmail.com 
wrote:

> I got a large number of messages as Leo tried to start.  Here is the last
> one before it quit:
>
>   File "d:\Tom\git\leo-editor\leo\plugins\qt_text.py", line 413, in
> __init__
> self.setFrameStyle(self.StyledPanel | self.Sunken)
>
> AttributeError: 'LeoLineTextWidget' object has no attribute 'StyledPanel'
>

Thanks for the report. I'll fix it immediately.

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 leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/CAMF8tS0dWVqbZcyWEO8oWnTY0h%3DkukOtNL7RNGiOpD21iR7L%3Dg%40mail.gmail.com.