On Mon, Aug 4, 2014 at 4:42 PM, Edward K. Ream <[email protected]> wrote:

> On Mon, Aug 4, 2014 at 4:29 PM, 'Terry Brown' via leo-editor

>> I'd do this:
>>
>>     w = widget.to.be.styled()
> [snip]
>
> Thanks!  I'll try this soon.

Not working yet.  I added the stylesheets you suggested to @data
qt-gui-user-style-sheet in myLeoSettings.leo.

I attempt to set the 'vim_state' property in a method called vc.set_border:

    if isinstance(w,QtWidgets.QTextEdit):
        selector = 'vim_%s' % (vc.state)
        val = w.setProperty('vim_state',selector)
        g.trace(vc.state,selector,w,val)
        w.style().unpolish(w)
        w.style().polish(w)

w.setProperty is returning False in a method called vc.set_border.
But that probably doesn't matter.  See the P.S. Here is a partial
trace:

    set_border visual vim_visual (LeoQTextBrowser) 111125896 False

Hmm.  I replaced the stylesheets that you suggested with just:

    QTextEdit {
        background-color: red;
    }

This affects the background of the log pane, but not the body pane.  Any ideas?

Edward

P.S. w.setProperty returning False doesn't seem to matter.  From
http://qt-project.org/doc/qt-4.8/properties.html#qt-s-property-system

QQQ
If the value is not compatible with the property's type, the property
is not changed, and false is returned.

But if the property with the given name doesn't exist in the QObject
(i.e., if it wasn't declared with Q_PROPERTY(), a new property with
the given name and value is automatically added to the QObject, but
false is still returned.

This means that a return of false can't be used to determine whether a
particular property was actually set, unless you know in advance that
the property already exists in the QObject.
QQQ

EKR

-- 
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 post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.

Reply via email to