My question is related to the inputMethodHints
https://doc.qt.io/qt-5/qml-qtquick-textinput.html#inputMethodHints-prop
All this flags work perfectly, and there is nothing to complain about. But I found two flags more, and in my situation it is very necessary to use them.
https://doc.qt.io/qt-5/qt.html#InputMethodHint-enum
Qt::ImhNoEditMenu and Qt::ImhNoTextHandles.
I haven't found, how to use this flags, maybe some one can help me? I tried to use this flags inside the TextInput, TextArea, TextEdit and TextField in the qml code, setting for example
inputMethodHints: Qt.ImhNoTextHandles
But they doesn't work. Also they are not mentioned anywhere in the documentation, only in the webpage(Qt namespaces) what I linked above. Thanks for attention, hope that someone can help me to figure out the problem.
If someone is looking for it, then don't. At the moment this flags are not integrated and are not able to be used.
Related
We need a tree view with File system and check boxes in QT. Is there any way to achieve that?
The tree we need would look something like below:
UPDATE:
I am able to achieve it with subclass of QFileSystemModel. Still have few challenges, but at least subclass is working. Below is the code if anyone needs it. Below is the link to the code -
https://drive.google.com/file/d/1qViZ3iEW2pV2th0jQhzneDL14SEhIgS0/view?usp=sharing
The pending work is to apply a wait cursor (or make treeview uneditable when the check/uncheck is taking place).
PS: It will take a lot of time if root node is checked.
Well, all of that can be achieved with minimal customizations of built-in classes, actually those checkboxes is almost the only thing that has to be done yourself.
QFileSystemModel already provides a proper model for displaying the current filesystem contents, it can be subclassed
As for QML, the best demo is already provided by Qt, check the File System Browser Example. This example uses some deprecaded Qt functionality, but still it shows the basic concept.
The modern techniqes can be also found in the answers to the following question: Qt File Browser based on QML
Hopefully, all that helps you, good luck!
For some reason, my QTableView seems to never emit a single signal. At first I tried connecting to any slot programmatically, but then I realized even through the Signal/Slot Editor from the GUI I could not make something happen, no matter which signal or slot I chose.
One detail that I noticed after a lot of research was that the Qt Documentation specifies that "The signal is only emitted when the index is valid.", so I understand this may be a problem with my models.
However, I still have no idea what might be the issue, or how I can fix it. Displaying the cells work perfectly fine on all models I have, but none of them seem to provide the correct signaling behavior, so I can't really detect the problematic code to post it.
It might be relevant to note, I tried disabling editing, and I'm testing this on Mac OS X Lion 10.7.5.
I appreciate any help. This is my first question here, although I've long benefited from those asked by others. So, yes, I've thoroughly searched for solutions.
Okay, I finally figured it out. After I realized Qt Creator was never updating the executable, no matter which code I changed, it was simply a matter of manually cleaning the build directory. Using the GUI options to do so (either rebuild or clean+build) hadn't had any effect. I guess it's because I had renamed the project, but didn't update the build directory or something. I had changed (improved) so much code since then that I would never have guessed there was an issue as everything was working fine, until I decided to add some more functionality.
As I had expected, this is kind of underwhelming for my first published issue, but I don't think it deserves negative points. The reason I didn't post some self-contained code is because I had no idea which code was causing the issue; I suppose I was just expecting someone with more experience to point me in the right direction. In the end, it wasn't even an issue with my code, it was with Qt Creator, so I really couldn't have been clearer.
I'll keep this as it might be useful for other people, so
tl;dr Qt Creator was silently failing to recompile the code, and the solution was to manually remove the old binaries.
I have a Qwidget inside of which, I have multiple children in the form of QmlApplicationViewer objects, each pointing to a different qml file.
Problem is, when I use mouse, all the qml files take events, but when I try to use the touch screen, only some of them does.
Can someone give a direction as to where the problem might be ? Will appreciate and sort of possible causes which might cause this issue.
Platform : Ubuntu 12.04 - Qt 4.8 - 32 bit
There really is not enough information here to even begin to answer this question. The most obvious answer that comes to mind is some of your qml files are not correctly defining the TouchArea within the qml. If you want more help you need to post code.
I tried using the EG-Touch touch drivers for my platform, which are supposed to have some issues on 12.04(as per some forums). I reverted back to Ubuntu 11.04 and used the e-Galax touch drivers instead, and things are working fine now.
P.S. : If someone finds a working driver for 12.04 or any other work around, please update. I will accept a better answer. Closing this for now.
I want to use a custom widget in the GUI-Designer of Qt-Creator IDE.
So i created a class which inherits from Qt's QWidget. It worked to place
it on a QMainWindow programaticaly, but have to do my work in the desiger
where it does not appear as an option in the kist of components.
I googled to find a solution for problem an found an manual on, who guesses, the
Qt doc page ( https://doc.qt.io/archives/qt-4.7/designer-creating-custom-widgets.html
and https://doc.qt.io/archives/qt-4.7/designer-creating-custom-widgets.html).
I tried to follow it but doesn't work.
Does someone know an other way to do this or can give a hint where i can search
for problems following this tutorial?
Thanks in advance.
Codierknecht
There is a different example in the examples section of the Qt documentation that I think is a lot clearer.
Custom Widget Plugin Example
It was a little unclear to me when reading the tutorial where the Q_EXPORT_PLUGIN2() macro goes, but having full example code and project alleviates that.
If you are like me, the analog clock example didn't do it for you, in which case I found just one better tutorial. It may be on the kde site but I you dont need kde to do it, it just explains how to make the custom widget a plugin so you can add it into Qt Designer, rather than having to code it in, which is the norm when you just add a widget to your project and customize the class. I hope this page helps you like it helped me, get in the right direction of writing a single Qt Designer (or multiple) plugin:
Writing Qt Designer Plugins
If this link ever becomes dead, just do a search for the link itself, usually that will turn up the original page in someone's cache, as they do in the other examples above (the dead links in the above answers that just take you to main area and not to the pages originally intended).
Well, i'm doing an IDE System. Basically, everything works Fine. Though, but i have a problem. The class "QTextEdit" doesn't have the member "setCompleter" which is for autocomplete. Right?
Well, is some class that supports it including all QTextEdit members?
PS: Any better way to do Autocomplete? I've asked this before, but i heard you can do it with QReg , but no idea.
Thanks!
The Qt documentation has an example on how to extend QTextEdit with a custom auto-completer here: http://doc.qt.io/qt-5/qtwidgets-tools-customcompleter-example.html