QMessageBox warning yellow exclamation mark icon - qt

How is possible to display a QMessageBox::warning with the triangular exclamation mark symbol like the one following?
I can't find any option in QMessageBox::warning, I only get the red circular symbol.

The triangular icon should be the default for the QMessageBox::warning dialog, while the red circular one is the default for the QMessageBox::critical dialog.
In my python code I use either
QMessageBox.warning(None,QString("..."),QString("...."))
or the more complex
msg = "..."
q = QMessageBox(QMessageBox.Warning, "...", QString(msg))
q.setStandardButtons(QMessageBox.Ok);
i = QIcon()
i.addPixmap(QPixmap("..."), QIcon.Normal)
q.setWindowIcon(i)
q.exec_()
And both of them works well.
Eventually can you show the code you use to show the dialog ?

You can use the QMessageBox.setIcon() function to configure which symbol you see when the dialog is displayed.
The predefined icon property types are listed here: https://doc.qt.io/qt-5/qmessagebox.html#severity-levels-and-the-icon-and-pixmap-properties
Here is my C++ example of a message box with the yellow triangle icon:
QMessageBox msgWarning;
msgWarning.setText("WARNING!\nRunning low on coffee.");
msgWarning.setIcon(QMessageBox::Warning);
msgWarning.setWindowTitle("Caution");
msgWarning.exec();
And here is my C++ example of a message box with the red circle icon:
QMessageBox msgError;
msgError.setText("CRITICAL ERROR!\nThe McRib is no longer available!");
msgError.setIcon(QMessageBox::Critical);
msgError.setWindowTitle("Danger");
msgError.exec();

Related

How to get rid of the yellow highlighted background in old search text in Qt Creator?

I have searched for the string "as" a few hours before in Qt Creator.
However it seems to be still active and whenever I type "as" again it is highlighted automatically.
And I can't get rid of it.
It looks like this:
Do you know what could be the problem and how to remove the yellow highlight?
According to your comment, you are using FakeVim so you can set whether or not search results are highligthed in Qt Creator ( Tools > Options > FakeVim). And if you want to clear the highlighted results, just type :nohlsearch in FakeVim.
If you are using FakeVim you can set up a user command in Tools -> Options -> FakeVim -> User Command Mapping. E.g., User command #1 = ":noh". Then you can use 'Alt+V 1' to get rid of the yellow highlight.

autohotkey remap surface volume button

I have a surface pro 4 but the physical buttons has a hardware problem where the buttons press them self or when you move or touch the corner of the screen.
I was hoping to remap the buttons to "nothing" but it seems to be remapped to Shift, Ctrl, Alt.
Am i missing something?
Here is the code:
#SingleInstance,
Force SetBatchLines, -1
SC130::
SC12E::
Is that the entire code?
Since there is no return, it's going to continue on with the script. In other words, if I wanted AHK to type "help" anytime I pressed "y" or "e", I could do this:
y::
e::
SendInput help
return
Try changing the hotkey to something like this and see if it makes a difference:
SC130::Return
SC12E::Return

Bokeh MultiLine p.add_tools(HoverTool(), renderers = [multiline]) not working

So when trying to add a HoverTool to a plot, the MultiLine Hover works.
But the problem I am having is, that I have another highlighting Single Line, that I do not want the Hover to act on.
So I wanted to input just the multiline to the renderers keyword
p.add_tools(HoverTool(tooltips = [('Name: ', '#Name'),
('Value', '#Value')],
renderers = [multiline]
)
and I am getting the following error:
ValueError: expected an element of either Auto or List(Instance(Renderer)), got [MultiLine(id='4982e76f-7dda-4d78-b729-240c9a29bdef', ...)]
What am I missing?
Glyphs (such as MultiLine) are more like a description of what to draw. There is a seperate GlyphRenderer that takes glyphs and uses them to draw (it can actually have several versions of a glyph to use in different cases, e.g. for selecting and highlighting and decimating). The renderers arg of the hover tool expects the GlyphRenderer, not the glyph.
If you are using bokeh.plotting, then the glyph renderer is returned by the method on the figure:
r = plot.multi_line(...) # r is what to configure on the hover tool
If you are using the low level bokeh.models API then you must already be configuring a GlyphRenderer manually for your MultiLine. Pass that to the hover tool instead.

Console not showing up on Xcode Playground 7.1.1

This is what Standard Editor looks like:
This is what Assistant Editor looks like:
This is a problem because whether I click on the eye icon or the + next to (6 times), it shows me a graph only: I was wondering if there would be a way to show more useful output?
Edit: When I show the debug area, it doesn't show any output there:
You can access the console by the menu
View > Debug Area > Show Debug Area
There's also a little upper arrow icon in the bottom left of the Playground, and the SHIFT+CMD+Y shortcut.
In the console you will be able to see not only the error messages but also anything you print.
To be able to see the output in the preview panel you have to place the statement you want to see on a separate line, and break down the logic on separate lines up to some point.
In your case, for example:
let arr = [1,2,3,4,5]
let triple = arr.map({
(i:Int) -> Int in
return i*3
})
Here with let triple ... not being on the same line as the closure anymore, the Playground is able to preview it.
And by clicking on the + on the right side, you can now unfold the special panel where all values are visible:

What do colour codes mean in Isabelle/jEdit?

What do the colour codes mean in Isabelle/jEdit? I could not find their description in the Isabelle/jEdit manual. The only thing it writes is
Prover feedback works via colors, boxes, squiggly underline, hyper-
links, popup windows, icons, clickable output — all based on semantic
markup produced by Isabelle in the background.
Colours are used as proof script background and on a vertical bar beside the scrollbar.
Could you point to some documentation or explain it here?
You can see their names and change them in "Plugins/Plugin Options" and then "Isabelle/Rendering". The names give a relatively clear explanation, and you can refer to the manuals from the terms used in the names.
There is a lot of colors so I won't describe them all.
For the most important default colors:
Logic:
blue : free variable
green : bound variable
orange : skolem constant ("free" variables existentially "quantified")
cyan : syntax (not a variable or a constant, like case or if)
Isar Keywords:
sky blue : commands (like lemma, proof or have)
red : tactic-style commands (like apply, done or prefer)
turquoise : statements (like where, fixes, shows or and)
Messages highlighting in output:
red : error
yellow : warning
light blue : info
Highlighting in editor:
red : error
light yellow : current line
gray : quoted text (logic and types)
light gray : comment and formal text (introduced with text or section)
purple : running process on the command (also shown on the right)
pink : unprocessed (outdated) command (also shown on the right)
In general, an underlined command displays a message in the output (possibly associated with an icon and a box on the right). More specifically:
Icons, [boxes] and {in text}:
red exclamation mark [red box] {squiggly red underline} : error
orange exclamation mark [orange box] {squiggly orange underline} : warning
blue i {squiggly blue underline}: information (often provided by automatic tools)
{squiggly gray underline} : the command shows a message in the output
{red text} : comment (like (* This is a comment *))

Resources