@flydragon
Do not duplicate posting because you do not get an answer immendiately.
[edit:koahnig see https://forum.qt.io/topic/82629/why-qsqlquery-exec-exit-failed ]
Thank you for the report. I have banned the user, which got rid of the spam posting. Not a loss, as this user did not post any other content on the site. Just deleting this one posting was not possible.
Thanks for reporting this.
Hi,
First of all, using the QGraphicsView is not as complicated as you think. It can be done in less than an hour if its your first time using it.
Second, all the other aproaches resize the image into a widget and when you try to obtain the pixel coordinates in the image you have to take into account that it have been scaled. So, as I said, QGraphicsScene is able to map the view coordinates to the item coordinates to get you the real pixel position.
@Poor-English
Do a Google for qtextedit highlight line and you will come up with several examples. You have to be careful about what exactly you mean by "line". It may be easier if you are able/choose to use a QPlainTextEdit.
@Styx
I don't think I really understand the question. Yes, you have to do things one item at a time, no, there isn't some magic which can by-pass this and do it one row at a time or in a single "blob" for the whole table.
If you care about speed/flexibility, you might consider using a QTableView instead of a QTableWidget. The latter has its own, internal data model; with the former you can have your own model as you please, if that helps. You can also use setData() instead of new QTableWidgetItem.
Sounds like the Scribble Example.
It draws the lines to a QImage and calls drawImage in the paintEvent.
Otherwise AFAIK there's no something like "save image" in painting.
You can call repaint with a QRect and then in paintEvent only draw within event->rect(), but that doesn't seem to be what you want.
@euchkatzl said in How to check whether the computer connects the internet?:
It is really no good idea to ping google for detecting a working internet connection.
Your customers will have to verify that they are not a bot on every google search afterwards.
Besides that, it will also not work in some countries where google is blocked.
@cawlfj said in QSqlQueryModel and QPixmap's alignment:
when the QTableView cell contains "no" , how to set it red color in by YesDelegate?
You have all information about the content in the paint event. So check for the string in there and set the background color to red.
@SGaist QT version 4.7.3 program can run on fb1:
Through export QWS_DISPLAY= :/dev/fb1
When executing the program: xx -qws
fb1 is a virtual frame buffer
@mrjbom Try replacing your calls to delete with QObject::deleteLater(). In general, deleteLater() is safer because it waits for all pending tasks to complete before deleting the object.
If you still get crashes, run your program through your debugger and check the stack trace.
@JKSH Thanks a lot, that works the way I need it.
I also noticed that QDesktopService will still open the file in the editor (even when its executable and clicking calls python)
@Christian-Ehrlicher said in Cannot create children for a parent that is in a different thread.:
I don't see a need for user threads for network operations at all...
Well, my code is an extension for the bigger project. Query handlers of all extensions in this project are called in parallel threads and I can't do anything with it.
Installed Ubuntu 20.10, installed Qt 5.15.2 and my program seems to work fine!
The question is, why doesn't it work on Windows 10, but works on Ubuntu? That being said, the Qt examples work fine on WIndows 10 as well as on Ubuntu, but my program doesn't work. Why?
And I went through all the services of my BLE device, each service works great, the search works great. But not on Windows. Help, my head is broken.
@SGaist Thanks for replying.
Are you aware of any alternatives to QWindow where using a thread is possible?
I do most of my rendering on a QOffscreenSurface subclass and the QWindow is only displaying the result. But since it sits on the GUI thread, any events there cause it to drop frames and stall.
@SGaist
Thanks for the fast reply. I am using many different roles, like fontRole, decoratorRole etc. Up too now it worked fine without QStyledItemDelegate, but we always used new models, even when using the same data. Now we changed the general design and we run into this problems.
Could you maybe explain a bit more about the QStyledItemDelegate? Where do I have to implement it?
Could you maybe also answer my question before? Is the behavior normal, that the data method of the SortFilterProxy is ignored as soon as I use setFilterFixedString?
Thanks
Daniel
@SGaist I heard you, I tried throwing it in there but I got the same error. Anyways I should be good for now. I'll come back if I can't figure it out later on lol. Thanks again.
@BrMisha said in Encrypted TCP connection between client and server with dynamic server domain:
At this point, this is a networking problem, not a Qt related issue.
Given that said,
This IP (192.168.1.20) can be changed in any time.
Well, that's not a good use case to use digital certificates issued for IP values. Please keep in mind that the certificate will have a domain name (i.e. google.com) or an IP (192.168.1.1) "embedded" in it, and the machine using such certificate must have either such domain name or such IP. If not, the whole security concept is useless.
So if you still wants to go assigning a dynamic IP to your server, it looks like you should go with DNS resolution and creating the certificate using domain names.
You may even want to resort to use the .local domain for your internal LAN.
PS: I use self-signed certificates to the server and the client
You may want to take that into account while working with Qt code, see this interesting post.
@Konstantin13 said in How to run Qt Application(GUI) from DLL?:
how I can communicate with UI(Qt) from my application and back???
https://doc.qt.io/qt-5/ipc.html
or
https://doc.qt.io/qt-5/qtremoteobjects-index.html
@nsourl
ad 1) like any other application when port forwarding is properly setup. Or like in a vpn you already have "direct" access to the machine running your application
ad 2)
you may want to read this: https://www.qt.io/blog/2018/11/23/qt-quick-webgl-release-512
a bit outdated though, but i am not aware that it is supported yet (but doesnt mean it isnt)
ad 3)
a possibility is to design your application the way that the UI is strictly decoupled from the logic and each UI client accesses a single backend service. This way each UI client instance launched accesses the same data simultaniously.
@coutKateM
If you are going to post code, please make the effort to use the forum's Code tags around it to make it readable.
Please make an effort to provide something minimal in your questions. Not a paste of your complete code, rather something cut down which illustrates the issue with reams of code for us to look through.
You have the error, so please indicate which line/statement it comes from if you want others to take the time to help you.
Not the cause of your problem, but you are keeping a member variable of type QSqlDatabase which the docs state you should not do.
You have left in clearly erroneous code, such as
query.exec("""DELETE FROM integrals WHERE id="""+QString::number(id)+""";""");
query.exec("DELETE FROM inputs WHERE connectionid="+QString::number(id)+";");
Half your other SQL statements are similarly incorrect, such as using quoting incorrectly.
You have a long.multi-line statement commencing
input.getName()+"""','"""+
which makes no sense as a statement, doesn't the compiler warn you about this?
And so on....
@nguyenhuy
And?
I think you should be looking at https://wiki.qt.io/Download_Data_from_URL rather than your deceased nokia link. There you will see
m_pImgCtrl = new FileDownloader(imageUrl, this);
so you are supposed to figure for yourself that the member variable declaration will need to be
FileDownloader *m_pImgCtrl;
Thank you all for your support .
Somehow i managed in completing the application using emiting signal from a keypressevent method. it worked for me with little condition that until we keep cursor in plaintextedit box it will continue writing but once if we place the cursor it is failng to write and then it works normal as plaintextedit where only we can write in to box but cannot write to serialport
I am working on it how to solve so as of now for these i am closing this belt as solved
@James-Mark-Chan said in QDebug() Thread Safe ?:
I know this is old but as of 2021/Qt 5 the documentation indicates it is thread safe:
https://doc.qt.io/qt-5/qtglobal.html#qDebug
qDebug() is thread-safe. That means your program won't get corrupted or crash if you use qDebug() in multiple threads.
However, qDebug() sends data to stderr which is unbuffered. That means if stderr receives data from multiple threads, it might display the data in a way that looks jumbled.