QT Creator / Designer : Files CANNOT be edited in Designer mode anymore - forms

So when using Qt to build user interfaces, you all know that .ui files (forms) open in Designer mode by default, and that if you manually switch back to the Editor, then this message appears "This file can only be edited in Designer-mode".
Well, for some reason, and at some point, my file now opens BY DEFAULT in the editor, and the message does not show up. Worse, when manually switching to Designer mode, the main editing field is gray and empty and none of my stuff shows up ... Also no scroll bars or anything.
EDIT : actually, it is whichever form was loaded last that appears. And it is editable and all ... only the drop-down menu with the file name clearly indicates that it is MY file that is opened. When I perform an edit, then the edit is performed to this same last-opened form, and is reflected upon compiling. My display remains unchanged to the state that it had the last time that I was able to open it in the Designer.
EDIT : Also, along with the fact that my .ui file now opens by default in the Editor, it is also editable there like any other source file. But edits don't seem to bother, I modified some stuff or added gibberish, and it never showed after compiling nor did the compiler ever complaine ...
What's going on ? What did I do ? I have no crash nor any recent weird events to report ... It just suddenly started happening.
Thanks in advance for any clues,
Charles

Related

VS Code Extension, how to programme a refresh of PlantUML preview

How can I force PlantUML to refresh its preview, using code?
Longer Explanation
I have 2 editors open
Editor 1 contains a yml file.
Editor 2 contains a plantuml .wsd file
and a 3rd pane is showing the plantuml preview. (which is technically not an editor)
When I modify the yml file, it modifies a json model, and rewrites the .wsd file, and thus I get a new state diagram showing me the structure of my yml file in graph format.
The content of wsd is updating correctly when the yml changes. V1 created a new file each time, it saved fine I could see the content change, but the preview never updated.
Settings->PlantUML auto update is ticked.
In order to trigger the refresh I had to select the editor, and either modify or save.
So I re-wrote the code to select the editor 2 wsd contents, replace it in the existing file, and then save that file. Still the preview does not update.
I have also tried to fire the vscode command plantuml.preview, which is what the plantuml extension itself fires to display the preview, it fires and returns, but does not update the preview.
I have vscode.window.visibleTextEditors[ii], from which I can select the right editor, but I cannot find anything to set the focus. I've tried setting selections, and saving but still no refresh.
I am now trying to find the right vs code way to set the focus on the right editor and save it, then switch back to the left editor, mimicking pressing CMD-2, CMD-S, CMD-1, or manually selecting the editor and saving, which is the only way to update the preview.
I cannot find anything on how to set the editor focus, so perhaps I am going down the wrong path. Can anyone suggest how this could be done?

Cannot edit imported project netbeans

i've recently imported a project shared with my friend for school in netbeans and we have a problem.
Everytime i try to edit or delete a comment or a code line it will show a red mark and leave a trace of my editing showing me the previous state of the c ode. I would like to edit and delete lines without this feature.
Hope i made myself clear and thanks in advance!
From your first screenshot it looks like your friend using Version Control System like Git, SVN, or other. If it's the case Yes it will show a red mark and leave a trace of your editing in Netbeans (in other IDEs for instance JetBrains Android Studio it's blue).
In your second screenshot the errors you're getting because of Auto Generated code for your GUI created using Form Editor. And your IDE already displaying waring like this
WARNING: Do NOT modify this code. The content of this method is always
regenerated by the Form Editor.
That means when you select Design tab and start editing (like dragging and dropping view elements) the Form Editor re-generates the code in back-end. Like below

"View code" context menu item inside Word

I have a code-backed Word template in which I am customizing numerous things, such as the ribbon, the backstage (the file menu), and the context menus.
Whenever I open the context menu for text, there is a menu item at the top labeled "View Code". It does nothing when selected.
This menu item does not appear for other content types, such as fields or lists. My customization of the text context menu does not include this item.
I found one other person on the internet that had this issue but they were not able to resolve it. I have looked through the list of control ids looking for this item but was not able to find it.
Where does this come from?
While I still don't know for sure the cause of this issue, I believe it may have come from using the Custom UI Editor For Microsoft Office at one point in the past. I did find a resolution though.
To find the issue, I removed each part of my project, item-by-item, until I was back to what was essentially a bare project, and the menu item still existed. So, I swapped in a freshly-created *.dotm file, and the menu item disappeared. Then, I dug into the file structure of the original *.dotm and compared it to the fresh one. One of the differences that stuck out was the presence of the file "word/attachedToolbars.bin". Despite the documentation I'm still not sure what it's supposed to hold. Anyway, I deleted it by taking the following steps.
Deleted the word\attachedToolbars.bin file
Deleted the word\customizations.xml file that references it (nothing else was in it)
Deleted the word\_rels\customizations.xml.rels file that references it (nothing else was in it)
Deleted the reference to customizations.xml in word\_rels\document.xml.rels
Deleted the reference to word/customizations.xml in [Content_Types].xml
This got rid of the menu item. However, several of my customizations were lost (a table style, two building blocks, and the list of quick styles, though the styles themselves were still present). So anyone encountering this will probably be better off just re-creating their customizations.
To try making it appear again, I tried
Editing the file in the Custom UI Editor again
Adding my customizations back
Publishing the template
None worked. But, at least I now have a template with everything I want and nothing I don't.

how to remove google sign in button in eclipse

I'm facing a wierd problem. My eclipse, has a google signin button which is occupying some of the space which I do not want to happen. Initially it had "Sign-in to Google" text along with it. I've followed some blog post and set accordingly to show just the icon (I don't remember that blog post link).
But now, the icon is getting replicating .. it is being shown 12 times. It is actually creating childs :P
I've gone through all the options present in Customize Perspective menu, none of them had this button listed. Can someone help me in removing that google sign button from my perspective? One possible suspect is- my eclipse crashes when I suspend and wakeup my machine.
You can use the Window > Reset Perspective... menu command to reset the perspective to its default state, which might eliminate that toolbar and buttons. If that fails, I would create a new workspace and import the projects into it using File > Import > Existing Projects into Workspace.
If you want to try to salvage your existing workspace, it's possible to do so my manually editing Eclipse's internal file that stores your Workbench layout, but it's a bit tricky. Here are the steps I've followed to eliminate a similar repeated toolbar item:
Exit Eclipse.
Find the Workbench layout file, it's path is <workbench>\.metadata\.plugins\org.eclipse.e4.workbench\workbench.xmi. Make a backup of this file before you touch it - this is essential because it's easy to corrupt the file if you change the wrong things.
Open the file in your favorite XML-aware editor - most packages of Eclipse include the XML editor that works just fine1, but be aware that if you use Eclipse to edit the file you can't have Eclipse open on the workspace that contains the workbench.xmi you want to edit.
Find the section of <trimBars> nodes in the XML; from there you have to determine which <trimBars> node you need to edit. In your case it looks like a vertical one, probably with a side="Right" attribute.
Under the correct <trimBars> node you'll find multiple <chlidren> nodes, each with an elementId attribute that should help you identify it; you're looking for <children> nodes that are identified as something related to the Google plugin.
Delete the <children> nodes that seem related to the unwanted toolbar buttons. In your case, it appears that there is an entire toolbar that you might want to eliminate, so you might want to delete the entire containing <trimBars> node.
Save the file and start Eclipse on that workspace.
1Some packages of Eclipse include EMF tools that will open it in a special XMI editor that does not provide a view of the source, only a structural tree view. Depending on how you like to work with XML, this might be easier than editing raw XML.
This is not a perspective but a view. You can hover over that bar with the buttons and click Alt+Shift+F1 to check where this View comes from. Then you can either disable/uninstall the contributing feature (Help -> Installation Details) or check where the feature came from.
If it comes from the IDE, you can open a bug for it. If it is contributed from a third party plugin, contact the developers of that plugin.
There is an eclipse bug concerning duplicate view toolbar buttons in Luna that has recently closed as well. Maybe this solves your problem as well.
Edit: Taken from this bug:
root cause is that in Luna 4.4M5 WorkbenchWindowControlContribution.createControl is called twice, the
first time with a null value for
WorkbenchWindowControlContribution.getWorkbenchWindow() while it is
still being created. This is related to what has been reported here
https://bugs.eclipse.org/bugs/show_bug.cgi?id=427452
second cause is that my createControl(Composite parent) method was calling PlatformUI.getWorkbench().getActiveWorkbenchWindow() instead
of WorkbenchWindowControlContribution.getWorkbenchWindow(). This
resulted in an attempt to create a new Workbench Window, which
recursively calls createControl() again. This has already been
reported here https://bugs.eclipse.org/bugs/show_bug.cgi?id=366708

How to programmatically reload a text editor in Eclipse?

In Eclipse, if I change a file programmatically, and it is open in a text editor, it doesn't always reload, not even when refreshing the resource programmatically. How can I forcibly reload the text editor from code so that it show the changed file contents?
In your project explorer or navigator, you can right-click on the file that's currently open and select refresh. This has always worked for me, even when editing files with several programs. Make sure to click the file itself, not parent objects like packages or folders or projects.
Edit
Refreshing programmatically? I would look into an Eclipse scripting tool:
http://eclipse-shell.sourceforge.net/
I guess there was another one called Monkey, but it doesn't appear to be maintained.
I don't know of any possibility to programmatically reload the file.
Some editors (e.g. GMF editors) look for changes in the underlying files, and refresh themselves, but this is not required at all.
I don't think that a forced reload is an option implemented globally, as in some cases there could be some merging steps involved that can be quite erroneous.
My ideas to solve this:
Have a specific editor that refreshes its content when the used resource changes (this can be timeconsuming);
Or close the editors of the file and reopen them (this is ugly in the eye of the user).
Since the Luna release of eclipse there's no need to reload files with F5/manual Refresh.
Really nice, especially as there was a bug with the F5 key binding.