Pyqt command line options - pyqt4

I cannot find any references to command line arguments for pyqt, such as:
-style windows
-background "yellow"
I've only found a couple by accident.
Hasn't helped to Google it or use Qt Assistant. (Unless it's well hidden)
Thanks,
Paul

From the PyQt4 manual entry for QApplication:
(http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qapplication.html)
All Qt programs automatically support
the following command line options:
-style= style, sets the application GUI style. Possible values are motif,
windows, and platinum. If you compiled
Qt with additional styles or have
additional styles as plugins these
will be available to the -style
command line option.
-style style, is the same as listed above.
-stylesheet= stylesheet, sets the application styleSheet. The value must
be a path to a file that contains the
Style Sheet. Note: Relative URLs in
the Style Sheet file are relative to
the Style Sheet file's path.
-stylesheet stylesheet, is the same as listed above.
-session= session, restores the application from an earlier session.
-session session, is the same as listed above.
-widgetcount, prints debug message at the end about number of widgets left
undestroyed and maximum number of
widgets existed at the same time
-reverse, sets the application's layout direction to Qt.RightToLeft
-graphicssystem, sets the backend to be used for on-screen widgets and
QPixmaps. Available options are raster
and opengl.
-qmljsdebugger=, activates the QML/JS debugger with a specified port. The
value must be of format
port:1234[,block], where block is
optional and will make the application
wait until a debugger connects to it.
The X11 version of Qt supports some
traditional X11 command line options:
-display display, sets the X display (default is $DISPLAY).
-geometry geometry, sets the client geometry of the first window that is
shown.
-fn or -font font, defines the application font. The font should be
specified using an X logical font
description. Note that this option is
ignored when Qt is built with
fontconfig support enabled.
-bg or -background color, sets the default background color and an
application palette (light and dark
shades are calculated).
-fg or -foreground color, sets the default foreground color.
-btn or -button color, sets the default button color.
-name name, sets the application name.
-title title, sets the application title.
-visual TrueColor, forces the application to use a TrueColor visual
on an 8-bit display.
-ncols count, limits the number of colors allocated in the color cube on
an 8-bit display, if the application
is using the QApplication.ManyColor
color specification. If count is 216
then a 6x6x6 color cube is used (i.e.
6 levels of red, 6 of green, and 6 of
blue); for other values, a cube
approximately proportional to a 2x3x1
cube is used.
-cmap, causes the application to install a private color map on an
8-bit display.
-im, sets the input method server (equivalent to setting the XMODIFIERS
environment variable)
-inputstyle, defines how the input is inserted into the given widget, e.g.,
onTheSpot makes the input appear
directly in the widget, while
overTheSpot makes the input appear in
a box floating over the widget and is
not inserted until the editing is
done.

Related

Guake terminal displays incorrect colors (insufficient contrast)

I use two dropdown terminals in parallel: Yakuake and Guake.
When using Guake, the colors are way too dark, which makes much of the colored text unreadable because of insufficient contrast. The problem is most severe when displaying color #4 (dark blue) on black background (which is the default color ls displays directories with) or in Midnight Commander (default theme, dark blue background).
Yakuake displays all 16 colors correctly and the text is readable very well, the colored output of ls and Midnight Commander.
My OS is Linux 5.15.11-gentoo with plasma-5.88.0, gtk+-2.24.33 and gtk+-3.24.29. Here is my TERM setting in the environment:
TERM=xterm-256color
COLORTERM=yes
I tried all available Guake themes and all of them have horrible contrast. Either all colors are too dark, or the other way around - all of them are too bright. It seems Guake somehow compresses the color contrast.
I also tried defining custom colors, copying the color settings from Yakuake, but even though I set specific colors explicitly, the actually displayed colors were darker. I validated this with a color picker.
Changing the GTK Theme setting in Guake's preference tab General did not yield any success either.
The question is: Why does Guake alter the colors? Is there a way to turn this off and let it display the actual colors I specified? The problem must be with Guake or GTK because everything else is identical when using Yakuake (environment, Midnight Commander colors, ls colors, ...)
The following screenshots demonstrate my Guake Appearance settings:
And here is some Guake support information:
<details><summary>$ guake --support</summary>
Guake Version: 3.8.0
Vte Version: 0.64.2
Vte Runtime Version: 0.64.2
--------------------------------------------------
GTK+ Version: 3.24.29
GDK Backend: <GdkX11.X11Display
--------------------------------------------------
Desktop Session: /usr/share/xsessions/plasma
--------------------------------------------------
Display: :0
RGBA visual: True
Composited: True
Thanks a lot in advance.
It turns out ls renders directories as bold font with the expectation that the text will appear in bright color. As explained by Guake developers this is non-standard behavior used with old terminals that did not supported fonts. Guake follows the ANSI standard and renders the text correctly.
The solution is to tweak the ls colors accordingly.

Font size rendering is different depending upon login using Gimp?

I am using Gimp python-fu plugin. The plug-in written correctly renders a text block:
(GIMP_UNIT_POINT = 3)
titleBlockLayer = pdb.gimp_text_layer_new(img, title, <font_name>, 40, GIMP_UNIT_POINT)
but only if gimp is invoked from the X window manager (or a terminal window) when logged in on the computer's console (Fedora, various releases, same behavior; various releases of GIMP, same behavior).
However, when logged in via ssh, (using X11 forwarding to display locally), the fonts are rendered HUGE by comparison.
I am confused because (supposedly) the same login .profile and .rc files have been run regardless.
Does anyone have a clue as to what/where/how GIMP determines what a POINT means, because it is obviously not coded in but dependent upon some resource file.
For Gimp a point is 1/72 of an inch, according to the doc of gimp_text_get_extents_fontname() in the PDB browser:
If you need to display a font in points, divide the size in points by 72.0 and multiply it by the vertical resolution of the image you are taking into account.
Experimentally, when using points in gimp_text_layer_new() the size depends on the image print definition. This value can depend on user settings (72DPI by default) but you can control/set it using gimp_image_get_resolution(...) and gimp_image_set_resolution(...). What bothers me though it that it seems that at least on my Ubuntu 16.04 gimp_text_layer_new() works in inches and not in points (at 72DPI, points and pixels should be equivalent), so I would stick to using pixels and to the point<->pixels conversions using the image resolution.
Btw, what are the versions of Gimp and the Pango and Cairo libs on your various systems?
Edit: Possible explanation: it appears that in recent versions (since 2.8 at least), gimp_text_layer_new() accepts more than units than just pixels and points. It also takes millimeters, inches, and picas. So it's no longer 0 for pixels and 1 for points, and you can use the predefined UNIT_* values. The catch: 1 is no longer the value for points but is now the value for inches:
UNIT_PIXEL=0
UNIT_INCH=1
UNIT_MM=2
UNIT_POINT=3
UNIT_PICA=4

Temporarily colour Linux Terminal foreground and background text

How can I temporarily set the colors of my Linux Terminal? I wish to add to a script, a color setting so that I remember to run the partner script a few minutes later. The color change would be set on in one script and removed in the other and would act as a visible reminder to me.
So the color change needs to be applied after the terminal is started up and needs to stay for all subsequent typing until it is removed by another equivalent command.
My terminal is GNOME Terminal 2.31.3
There's more than one way to change colors. VTE (the actual terminal within GNOME Terminal) implements these features (generally from xterm):
"ANSI color" escapes (which would be useless to you, since many programs reset those)
changing the text foreground and background using non-ANSI dynamic colors (resetters are rare)
changing the color palette (again, resetters are rare)
The latter two are documented in XTerm Control Sequences, in the section Operating System Commands:
OSC Ps ; Pt BEL
OSC Ps ; Pt ST
gives the form of the control sequence, e.g., escape]Ps;PtBEL
The dynamic colors are described here:
The 10 colors (below) which may be set or queried using 1 0
through 1 9 are denoted dynamic colors, since the correspond-
ing control sequences were the first means for setting xterm's
colors dynamically, i.e., after it was started. They are not
the same as the ANSI colors. These controls may be disabled
using the allowColorOps resource. At least one parameter is
expected for Pt. Each successive parameter changes the next
color in the list. The value of Ps tells the starting point
in the list. The colors are specified by name or RGB specifi-
cation as per XParseColor.
and other colors here:
Ps = 4 ; c; spec -> Change Color Number c to the color spec-
ified by spec. This can be a name or RGB specification as per
XParseColor. Any number of c/spec pairs may be given. The
color numbers correspond to the ANSI colors 0-7, their bright
versions 8-15, and if supported, the remainder of the 88-color
or 256-color table.

Remove terminal border colors from vim colorschemes

I want the color scheme to span completely across the terminal boundaries. I am using Color Scheme Scroller Plugin to switch between different theme. I have uploaded a .gif file so that you can clearly see what I want to get fixed. Vim colorschemes doesn't completely change the color of editor. There are some terminal color's borders left around the vim's overridden color scheme. How would I fix it.
Please check the image on this link. Stackoverflow doesn't allow uploading an image > 2Mb
You can't do that from Vim itself.
Terminal emulators use that padding to preserve readability when characters are displayed next to the borders of the window. The programs you run in your terminal have no knowledge of that padding and thus no ability to change it.
But you can read the documentation of your terminal emulator or take a look at its source code to find a way to enable/adjust/disable that padding.
FWIW, there's no way to change that in Terminal but it can be done for iTerm.
Alternatively, you could simply set the background color of your terminal to the one used in your vim colorscheme.
The image appears to depict behavior outside vim's control:
it is using a terminal emulator (could be xterm, could be some other).
the terminal emulator draws character cells on a window
those cells form a grid; the window may extend beyond the grid
the window can have a background color
the grid can have a background color
within the grid, most terminals provide some capability of drawing text with specific foreground and background colors
the grid can have a default background color which is not any of the specified colors
outside the grid, the window can also have a default background color
normally, the grid- and window-default backgrounds are the same
the window can be resized to (more or less) arbitrary sizes
the grid is constrained to exact character sizes
because of this difference, the window can have areas outside the grid which use its default color, and not match the grid's background color.
escape sequences which could affect the grid- and window-background colors are doing erases (see for example the ncurses FAQ My terminal shows some uncolored spaces).
though it is conceivable that erasures within the grid could affect those outside areas, doing that generally leads to odd visual effects.

Eclipse Mars under Linux: Selection overwrites word specific coloring

What I'm trying to say is, when selecting a bit of code, the special coloring a word has (purple for keywords, blue for member variables, brown-ish for local identifiers...) is overwritten by black.
I'm not sure whether this is a Linux thing or if there are some settings I haven't seen. Changing foreground selection color in Preferences unsurprisingly only changes the color the font has and doesn't influence the fact that its color gets overridden - what I'd like is something like a transparent foreground selection color. I'm on Fedora 22 if that's of any relevance.
Ordinary text - color communicates information:
Selection causes whole text to be completely black:

Resources