How to disable highlights on QDateEdit PyQt5 - pyqt5

I have this code below where I created a QDateEdit widget, and when I ran it the it focuses or highlights the texts in the widget. is there a chance I can disable it so that it can't be mistakenly edited?
self.date = QDateEdit(calendarPopup=True)
self.date.clearFocus()
self.date.lineEdit().setReadOnly(True)
self.date.lineEdit()

If I am reading this right and you want to actually disable it, you can do so by setting its setEnabled property to False. This is done through the following code;
self.date.setEnabled(False)

Related

Remove Attributes on Rubberduck VBA

I'm just getting into using Rubberduck for my VBA applications. I came across a great post on adding attributes here:
How to set the Attribute VB_PredeclaredId using RubberDuck '#PredeclaredID
However, what if I want to remove the attribute? It seems like the only way to do it is via code inspections. However, after you initially set the '#PredeclaredId, there's no longer any error that shows up. So the option to remove the attribute is no longer available.
I tried deleting the attribute, but the "Predeclared" annotation is still in my explorer:
I'm sure I can export, edit in the text editor, and then re-import again, but one purpose of rubberduck is to avoid doing that.
Thanks.
After deleting the attribute annotation there will be a new "attribute value out of sync" inspection with 2 options:
adjust attribute value
adjust annotation
You want to do the first option which will nuke the hidden attribute value.
Update
Another 2 alternatives:
indent the module ctrl+m
cut and paste the code ctrl-a ctrl-x ctrl-v
Both these options will wipe out the attribute values by forcing VBA to recompile the module without them. This is normally an annoyance (indenting my project wipes the attributes and I need to restore them with RD annotation inspections)
Final thing remember to refresh RD code explorer so it picks up the changes and the icon will change. This often happens automatically though.

VS Code Intellisense don't suggest snippet at first

I want to use code snippets in VSCode. But when I type, for example, for in javascript file, the Intellisense doesn't suggest snippet "for-loop" - I need to manually scroll the dropdown and select it. Is there any way to make VSCode to suggest snippets at first? Thank you!
UPD: I have found the person with same problem, but he has no answers - link
You need to use editor.snippetSuggestions config option with "top" value. Please, see Customizing IntelliSense article for more tips and tricks.
There is one more way to deal with this issue by setting
"editor.tabCompletion": true,
that way whenever there is a snnipet available it will use it automatically without even opening the list by using tab twice.
File > Preferences > Settings (Code > Preferences > Settings on Mac)
open "Editor" menu on the left
edit "editor.tabCompletion": true
more info: https://code.visualstudio.com/docs/editor/intellisense#_customizing-intellisense
Now that VS Code mostly abstracted away the settings.json file, you can do the instructions shown by Kavu, with this bonus tip:
go to Preferences > Settings
find the Search settings text input, at the top
type in "snippet"
The setting should be at the top of the result set:
Setting editor.snippetSuggestions to top only works for certain snippets: for but not foreach. With top, the snippet does appear higher in the completion list, but for some reason the keyword version is what is highlighted, with the snippet option scrolled out of view (and the scrollbar quickly fades, giving the impression there's nothing hidden)
The editor.tabCompletion to true approach works for both for and foreach.

Adapt the extend selection in IntelliJ

Everyone knows that when you select some text in IntelliJ and press Ctrl+w your selection is expanded.
However,
you're kinda stuck on the presets for this:
when you have following code:
<a4j:commandButton execute="#form" render="tableProperties"
value="#{cjr_main.addExtractType}"
action="#{ExtractTypesBean.addExtractType()}"
styleClass="bigButton"
oncomplete="setLineAdded();"/>
and "Line" is selected but the method setLineAdded() is not yet defined you'd want "setLineAdded()" to be selected after hitting ctrl+w a couple of times.
However
Once "setLineAdded" is selected, and you press ctrl + w the whole tag is selected in stead of the accompanying "()"'s...
Is there a way to get this behavior?
(without writing a whole IntelliJ plugin just for this?)
best regards,
S.
No, the behavior of extend selection is controlled by code and is not configurable by users. You can indeed write a plugin to change the behavior.

How do I change selection properties in Jetbrains IDE(s)?

Several times, while working with Jetbrains' IDE(s), I have faced the following issue:
The natural selection type is changed to this kind of a selection. When I reload the IDE, it gets back to its normal position. Is it a bug, or a feature of the IDE? How do I fix it?
From Jetbrains:
Toggling between line and column selection modes
To toggle between the line and the column selection modes, do one of the following:
On the main menu, choose Edit | Column Selection Mode.
On the context menu of the editor, choose Column Selection Mode.
Press Shift+Alt+Insert.
P.S. My guess would be you by accident used the wrong key combination. (I currently use PHPStorm & C-Lion and have not seen this issue)
Here is the documentation for selecting text in Jetbrains' editors.

Creating code hints in XCode [duplicate]

This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
How to create documentation for instance variable and methods in Xcode?
Eclipse-based editors such as PDT and Eclipse allow you to automatically add code hints for your custom code by using a special commenting syntax. Is there anyway you can add these code hints to your custom code in XCode?
I think you're looking for the code snippet library. The shortcut key is [control][option][command]2
The code snippet library will appear in the lower-right corner of the window.
You can select some code on your screen and drag it to the Code Snippet Library. This will create a new code snippet called "My Code Snippet" which will likely appear at the bottom of the list. You can single click the new snippet to view it in a pop-up. From there, you can click the edit button to make the snippet more useful.
For place-holders, use <# text #>. For example, <#height#> would produce a placeholder labeled height.
Use the field called "Completion Shortcut" for the text you want to type in order to activate the snippet.
When you're done editing the snippet, click the done button and start typing your Completion Shortcut text to test it out.