How to disable Brackets autocomplete functionality on first letter - adobe-brackets

I'm using Brackets as my IDE now, and I really like it so far. Except for one thing, and that is if I go to a new line it start with suggestions (autocomplete). So when I move to a new line an hit 'enter' it selects the first suggestion. Is there any way to disable this ?

Related

How do I get rid of this anonymous draggable bar in qtcreator?

I wrote a program in qt creator, but it includes this anonymous draggable toolbar that I would like to get rid of. It does not show up in design mode. If I right click on it, it gives me a menu with a checkbox, which I can select to get rid of it while the program is running. What is this bar? How do I get rid of it? If I knew what it was, I could just programmatically tell it to hide when the program loads.
Here are some screenshots demonstrating this weird problem. In the first screenshot, the mouse is pointed at the bar. The second one demonstrates the right-click context menu. The third one shows the program without the bar. The box can also be dragged out of the program's window entirely. I can also upload a picture of that, if necessary.
(mouse pointing at bar)
(bar has a right-click menu!)
(bar is gone)
First things first, make sure you haven't added the toolbar yourself in code (the Designer form is nothing magical, it just generates normal Qt code to ui_XXXX.h, which you should totally study, so you understand what is really happening "under the hood").
Second, perhaps that is the main menu bar, not the main tool bar.
Then, on to remove the nasty bar. On the upper right corner of Design view, you have a tree of all items in your UI. Find the QToolBar there. It is probably called mainToolBar. Right click it and remove it there. Or, if you actually have menu bar, then find QMenuBar, probably called menuBar, and remove it instead. Remember to make version control commit (or other backup) before doing this, so you can easily revert changes.
If this fails for whatever reason, and you just want to get it to work, you can always find and delete (be careful about the dangling pointers left behind, set them to nullptr if possible):
ui->setupUi(this);
// a hack: we want to get rid of the toolbar and the menubar,
// but can't remove it from the .ui, so we delete them like this.
delete findChild<QToolBar *>(); // NULL return value is ok for delete
delete findChild<QMenuBar *>(); // NULL return value is ok for delete
Doc links for findChild and alternative findChildren.
What you have there is probably the mainToolBar QToolBar object you get with every QDesigner-created QMainWindow .ui file.
If you want to get rid of it, locate it in your .ui file and just delete it.
But better think twice: you might later decide you want a QToolBar object and (at least AFAIK) there is no way to recreate it in QDesigner...
you must use this code in your constructor.
ui->mainToolBar->toggleViewAction()->setVisible(false);
mainToolBar is my toolbar name.

PyQt5 - Signals&Slots - How to enable a button through content change of lineEdit?

since there isn't any useful How-To for beginners of PyQt5, I'm stuck with a little problem about signals & slots.
I do have a lineEdit which will get a directory path by a dialog (which works fine).
If one starts the program this lineEdit is empty by default and that's ok. A button, which shall generate a file list and show it in a list view, exists. It's functionality is implemented already and working fine. This button by default is disabled when the program is started for the first time.
What I want to do now is, enabling the button when something is entered at the lineEdit and disabling it when the content is removed.
I gave it a shot with this:
self.lineEdit_SelectedDirectory.editingFinished.connect(self.pushButton_CreateFileList.setEnabled)
but I get the error that it has not enough arguments, which might be clear because there aren't any provided in this code line.
Again, this was just a guess. How would one do this?
I would love something which takes the content into account like that, that it decides whether the content is empty or not and than sets the appropriate value to the button.
thx in advance for the help.
Christian
Looks like you want the textChanged signal, since that sends the current text:
self.lineEdit_SelectedDirectory.textChanged.connect(
lambda text: self.pushButton_CreateFileList.setEnabled(bool(text)))

AutoCompleteExtender seems to stop functioning after losing focus

I love the AutoCompleteExtender and have used it before with great success. My new boss noticed something he doesn't like though, and unless I can get it figured out, he is going to have me scrap it for something else - yikes! Here's the scenario :
I click on the textbox, type in the first 3 letters - we'll say "pat" for this example - and then the list of names matching those first three initials comes up. Great so far.
Then, without selecting anything or changing the text in the box, I click away from the box (just on blank part of the page for example). Now, I click back in the textbox, type in "pat" again - expecting that the list will show up again. BUT - nothing comes up. Now, if I type one more letter, say 'patt' for example, then results are returned. But with the same character combo, nada. I have also noticed that if I move away from the page for awhile, 10-15 minutes, and come back, it stops responding as well.
Has anyone else experienced this, and if so, did you come up with a solution? If so, I would love to hear it. I REALLY don't want to force a page refresh or something, as I am sure my boss is NOT going to like that. Any suggestions are greatly appreciated.
Oh - and I tried adding a little JavaScript to forcibly clear out the textbox onlbur - no dice - still doesn't bring up any results in the above scenario.

Tab-Key blocks Circumflex (^)

i have a little Application where i can choose items by pressing ^, 1, 2, ...
The problem is, when i press tab the ^-key (Qt::Key_AsciiCircum) doesn't work anymore until i press the tab-key again. Anyway the numbers are still working and are handled in the same keyPressEvent(...) !
I tried to also handle the tab-key but it seems it doesn't even reach my event-handler (cout << event->key() doesn't print anything).
I just found out that the left/right arrows also don't work. Probably another widget catches those keys? But if thats the case, how can i find it?
thx, eL
Possibly the most likely explanation: Tab usually means go to next widget. If you've got two widgets tab might be alternating between them (try adding a text box?).
Look into how you can 'change' the tab order or somehow disable it to fix that.

How can I tell a QTableWidget to end editing a cell?

I'm showing a popup menu to select some values in a QTableWidget. The lowest item is a "Modify list" entry, when I select it a new window should automatically appear and the QComboBox should vanish and the cell return to a Qt::DisplayRole state.
Now Qt has all those nice API-calls like QTableWidget.edit() and QTableWidget.editItem(), what I'm really looking for is a QTableWidget.endEditing(), preferably without specifying the index of the cell, though I could get that using this call:
table.currentIndex()
… but I don't know if I can guarantee that the current cell is the cell being edited at all times.
Is there an API to close those kind of editors?
QTableWidget inherits 19 public slots from QWidget. One of those is setDisabled(), which should disable input events for that widget and all of its children.
I would try:
table.setDisabled( true );
table.setDisabled( false );
Although you said it does not work for you, there is an alternative method:
If you don't like that (the table loses focus, I believe), you can try using EditTriggers. For example:
table.setEditTriggers( QAbstractItemView::NoEditTriggers );
table.setCurrentItem(None) is what worked for me. (Don’t forget to block signals if you use some cellChanged/itemChanged slot function.)
This is with PyQt. For C++ I think replace None with NULL.
You may be able to use QTableWidget.closePersistentEditor() to close the editor. However, QAbstractItemView.closeEditor() may be closer to what you want, especially since you seem to be comfortable with the QModelIndex-based API and are already using a custom editor widget.
In my case, none of the options worked properly. So, I figured: I need to send the key press event to the line edit itself. The following works with QTreeView but probably does work with any other view or widget that opens a line edit to edit cells.
QWidget* editingWidget = treeView->findChild<QLineEdit*>();
if(editingWidget)
{
QKeyEvent keyPressEvent(QEvent::KeyPress, Qt::Key_Return, Qt::NoModifier);
QApplication::sendEvent(editingWidget, &keyPressEvent);
QApplication::processEvents(); // see note below
}
In my case, I wanted to start editing another field directly when having finished editing one item. That is why I put processEvents there, in most cases you can probably remove that line.
PS: yeah, it's C++, but should be easily adaptable to Python. I found this thread when I searched for the C++ solution, so maybe it helps anyone else, too.
I can't speak for list widgets. But, I got here trying to do something similar.
I was double-clicking a cell, and based on the column, bringing up a sub-form with a list, then when that was closed move to the next appropriate column based on the value selected.
My problem was I could get the value in the cell and "select" the next appropriate cell, but the original cell stayed selected in edit mode!
It finally dawned on me that my double-click was selecting the cell, ie. editing.
A single-click selects the cell but doesn't open an edit mode.
Side note: Never could get that sub-form to act truly modal, so I created a loop in the calling form: while the sub form was visible, with the only code being app.processEvents()

Resources