Changeset 769 for trunk/examples/network/loopback/dialog.cpp
- Timestamp:
- Aug 2, 2010, 9:27:30 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/vendor/nokia/qt/4.6.3 (added) merged: 768 /branches/vendor/nokia/qt/current merged: 767 /branches/vendor/nokia/qt/4.6.2 removed
- Property svn:mergeinfo changed
-
trunk/examples/network/loopback/dialog.cpp
r651 r769 45 45 #include "dialog.h" 46 46 47 #if !defined(Q_OS_WINCE) 47 #if !defined(Q_OS_WINCE) 48 48 static const int TotalBytes = 50 * 1024 * 1024; 49 49 #else 50 50 static const int TotalBytes = 5 * 1024 * 1024; 51 51 #endif 52 static const int PayloadSize = 6 5536;52 static const int PayloadSize = 6 53 53 54 54 Dialog::Dialog(QWidget *parent) … … 131 131 void Dialog::startTransfer() 132 132 { 133 133 134 bytesToWrite = TotalBytes - (int)tcpClient.write(QByteArray(PayloadSize, '@')); 134 135 clientStatusLabel->setText(tr("Connected")); … … 156 157 void Dialog::updateClientProgress(qint64 numBytes) 157 158 { 159 158 160 bytesWritten += (int)numBytes; 159 if (bytesToWrite > 0) 161 162 // only write more if not finished and when the Qt write buffer is below a certain size. 163 if (bytesToWrite > 0 && tcpClient.bytesToWrite() <= 4*PayloadSize) 160 164 bytesToWrite -= (int)tcpClient.write(QByteArray(qMin(bytesToWrite, PayloadSize), '@')); 161 165
Note:
See TracChangeset
for help on using the changeset viewer.