ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Okay, so I realise that I can't capture the bytesWritten() signal in order to show the file copy progress of the QFile.copy() function on a QProgressBar, but it's my understanding that this can be done using the QIODevice class, be it somewhat more complicated.
Okay, so I realise that I can't capture the bytesWritten() signal in order to show the file copy progress of the QFile.copy()
Why? o_O
Besides, what Qt version?
In Qt 4 - derive your own class from QProgressBar that has slot that accepts quint64. Or make temporary slot somewhere that can be linked to QFile's signal and will emit another signal for QProgressBar.
Unlike other QIODevice implementations, such as QTcpSocket, QFile does not emit the aboutToClose(), bytesWritten(), or readyRead() signals. This implementation detail means that QFile is not suitable for reading and writing certain types of files, such as device files on Unix platforms.
And I should probably say at this stage I don't have much experience in programming in C++ but I understand in principle what you're saying about deriving a class that will allow me to access the signal.
And I should probably say at this stage I don't have much experience in programming in C++ but I understand in principle what you're saying about deriving a class that will allow me to access the signal.
Thanks once again.
Well, I thought it was emitting signal.
If it isn't emitting signal, then you can create your own copy routine (or class or whatever), that will emit required signal. You might even try to make your own QFile derivative that supports those signals, but that might be too difficult. If I were you I'd write class (based on Q_OBJECT, of course) for copying files, and made it emit signals you need.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.