{"id":263707,"date":"2015-08-17T15:39:02","date_gmt":"2015-08-17T11:39:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=263707"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=263707","title":{"rendered":"\u041f\u0440\u043e\u0441\u0442\u043e\u0439 \u043e\u0431\u043e\u0437\u0440\u0435\u0432\u0430\u0442\u0435\u043b\u044c \u0434\u043b\u044f Amazon S3 \u043d\u0430 Qt"},"content":{"rendered":"<p>     \t\u042d\u0442\u0430 \u0442\u043e\u043f\u0438\u043a \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u0437\u0430\u0434\u0430\u043d\u0438\u044f, \u0441\u043e \u0441\u0440\u043e\u043a\u043e\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f 1 \u043d\u0435\u0434\u0435\u043b\u044f. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043a\u043e\u0434 \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u043f\u0440\u043e\u0442\u043e\u0442\u0438\u043f\u0430.<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/b2d\/476\/51f\/b2d47651fd1c4eeeab1bf54e352821ac.png\"\/><br \/>  <a name=\"habracut\"><\/a><\/p>\n<h4><b>Amazon Simple Storage Service(S3)<\/b><\/h4>\n<p>  \u0421 \u043c\u043e\u0435\u0439 \u043a\u043e\u043b\u043e\u043a\u043e\u043b\u044c\u043d\u0438(\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f REST API) S3-\u044d\u0442\u043e \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435 \u0442\u0438\u043f\u0430 key-value, \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0434\u043e\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043a\u043b\u044e\u0447\u0438 \u0441 \u043f\u0443\u0441\u0442\u044b\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c. \u041f\u0440\u0438 \u0442\u0430\u043a\u043e\u043c \u043f\u043e\u0434\u044a\u0445\u043e\u0434\u0435 \u0441\u0442\u0440\u0443\u0442\u043a\u0443\u0440\u0430 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430 \u043f\u043b\u043e\u0441\u043a\u0430\u044f, \u043d\u0438\u043a\u0430\u043a\u043e\u0433\u043e \u043f\u0440\u0438\u0432\u044b\u0447\u043d\u043e\u0433\u043e \u043d\u0430\u043c \u0434\u0435\u0440\u0435\u0432\u0430 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u043e\u0432 \u0438 \u0444\u0430\u0439\u043b\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043c\u044b \u043f\u0440\u0438\u0432\u044b\u043a\u043b\u0438 \u0432\u0438\u0434\u0435\u0442\u044c \u0432 \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435.<\/p>\n<p>  \u041a\u0430\u043a \u0432\u043e\u0434\u0438\u0442\u0441\u044f \u0441\u0440\u0435\u0434\u0438 key-value \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0448\u044c, \u0435\u0441\u043b\u0438 \u043d\u0443\u0436\u043d\u043e \u0447\u0442\u043e-\u0442\u043e \u043e\u0442\u043b\u0438\u0447\u043d\u043e\u0435 \u043e\u0442 \u0445\u0435\u0448-\u0442\u0430\u0431\u043b\u0438\u0446\u044b,<br \/>  \u0434\u043e \u0433\u043e\u0432\u0430\u0440\u0438\u0432\u0430\u0435\u043c\u0441\u044f \u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043a\u043b\u044e\u0447\u0430, \u0430 \u0432\u0441\u0435 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u0445\u043e\u0442\u0435\u043b\u043a\u0438 \u0432\u044b\u043d\u043e\u0447\u0438\u043c \u043d\u0430 \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<br \/>  \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0431\u0443\u0434\u0443\u0442 \u0438\u0441\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0441\u043e\u0433\u043b\u0430\u0448\u0435\u043d\u0438\u044f:  <\/p>\n<ul>\n<li>foo\/bar\/-\u044d\u0442\u043e \u043a\u0430\u0442\u0430\u043b\u043e\u0433 foo, c \u043f\u043e\u0434\u043a\u0430\u0442\u0430\u043b\u043e\u0433\u043e\u043c bar. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043f\u0443\u0441\u0442\u044b\u0445 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u043e\u0432;<\/li>\n<li>foo\/bar-\u044d\u0442\u043e \u043a\u0430\u0442\u0430\u043b\u043e\u0433 foo, \u0441 \u0444\u0430\u0439\u043b\u043e\u043c bar;<\/li>\n<li>\u043d\u0430 \u044d\u0442\u043e\u043c \u043d\u0430\u0431\u043e\u0440\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044f \u043c\u0435\u0441\u0442\u0430\u043c\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0441\u044f \u0441\u0438\u043c\u0432\u043e\u043b &#8216;:&#8217;.<\/li>\n<\/ul>\n<p>  \u0412 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0442\u043e\u0433\u043e \u043a\u0430\u043a\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0432\u044b \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0435, \u0442\u043e \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u0442\u0435 \u0443\u0434\u043e\u0431\u043d\u043e\u0435 \u0441\u043e\u0433\u043b\u0430\u0448\u0435\u043d\u0438\u0435 \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043a\u043b\u044e\u0447\u0435\u0439.<\/p>\n<h5><b>\u0410\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f \u0432 S3<\/b><\/h5>\n<p>  \u0417\u0434\u0435\u0441\u044c \u043d\u0435\u0442 \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u0442\u043e\u043a\u0435\u043d\u043e\u0432. \u0422\u0443\u0442 \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u0434\u043f\u0438\u0441\u0432\u0430\u0442\u044c \u043a\u0430\u0436\u0434\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441. \u0412 <a href=\"http:\/\/docs.aws.amazon.com\/general\/latest\/gr\/sigv4_signing.html\">Signing AWS Requests By Using Signature Version 4<\/a> \u0440\u0430\u0441\u043f\u0438\u0441\u0430\u043d\u043e \u043f\u043e \u0448\u0430\u0433\u0430\u043c \u0438 \u0435\u0441\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u0434\u043b\u044f \u0440\u0430\u0437\u043d\u044b\u0445 \u044f\u0437\u044b\u043a\u043e\u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f. \u0422\u0443\u0442 \u043e\u0442\u043c\u0435\u0447\u0443, \u0447\u0442\u043e \u0442\u0430\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f <a href=\"https:\/\/ru.wikipedia.org\/wiki\/HMAC\">HMAC-SHA256<\/a>, \u0434\u043b\u044f \u0435\u0433\u043e \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u043b\u0430\u0441\u0441 <a href=\"http:\/\/doc.qt.io\/qt-5\/qmessageauthenticationcode.html\">QMessageAuthenticationCode<\/a> \u043f\u043e\u044f\u0432\u0438\u0432\u0448\u0438\u0439\u0441\u044f \u0432 Qt5.1.<\/p>\n<h5><b>\u0417\u0430\u043f\u0440\u043e\u0441\u044b<\/b><\/h5>\n<p>  \u0412 \u043a\u0430\u0436\u0434\u043e\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u0435 \u043a\u0440\u043e\u043c\u0435 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0430 <i>Authorization<\/i> \u043f\u0435\u0440\u0435\u0434\u0430\u044e \u0435\u0449\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435: <i>Date, Host, x-amz-date, x-amz-content-sha256<\/i>. <b>x-amz-content-sha256<\/b> \u2014 \u044d\u0442\u043e \u0445\u0435\u0448 \u0442\u0435\u043b\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043f\u043e\u0434\u0441\u0447\u0438\u0442\u0430\u043d\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434\u043e\u043c SHA256. \u042d\u0442\u043e\u0442 \u0445\u0435\u0448 \u0442\u0430\u043a \u0436\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432 <a href=\"http:\/\/docs.aws.amazon.com\/general\/latest\/gr\/sigv4-create-canonical-request.html\">\u00ab\u043a\u0430\u043d\u043e\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0437\u0430\u043f\u0440\u043e\u0441\u00bb<\/a> \u043f\u0440\u0438 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0438 \u0441\u0438\u0433\u043d\u0430\u0442\u0443\u0440\u044b \u0437\u0430\u043f\u0440\u043e\u0441\u0430. \u0414\u0430 \u0436\u0435 \u0435\u0441\u043b\u0438 \u0438\u0434\u0435\u0442 GET \u0437\u0430\u043f\u0440\u043e\u0441 \u0443 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0442\u0435\u043b\u043e, \u044d\u0442\u043e\u0442 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e \u0432\u0441\u0435 \u0440\u0430\u0432\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442\u0441\u044f. \u0412\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u043c \u043a\u043b\u0430\u0441\u0441\u043e\u043c <a href=\"http:\/\/doc.qt.io\/qt-5\/qcryptographichash.html\">QCryptographicHash<\/a>.<\/p>\n<p>  \u0414\u0430\u043b\u0435\u0435 \u0438\u0434\u0435\u0442 \u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432  <\/p>\n<table>\n<tr>\n<td>GET \/ HTTP\/1.1<br \/>  Host s3.amazon.com  <\/td>\n<td>\u041f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u0431\u0430\u043a\u0435\u0442\u043e\u0432  <\/td>\n<\/tr>\n<tr>\n<td>GET \/ HTTP\/1.1<br \/>  Host BucketName.s3.amazon.com  <\/td>\n<td>\u041f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0432 \u0431\u0430\u043a\u0435\u0442\u0435 BucketName  <\/td>\n<\/tr>\n<tr>\n<td>GET \/ObjectName HTTP\/1.1<br \/>  Host BucketName.s3.amazon.com  <\/td>\n<td>\u0421\u043a\u0430\u0447\u0430\u0442\u044c \u0444\u0430\u0439\u043b \u0438\u0437 \u0431\u0430\u043a\u0435\u0442\u0430 BucketName. \u0426\u0435\u043b\u0438\u043a\u043e\u043c \u0438\u043b\u0438 \u0447\u0430\u0441\u0442\u044c.  <\/td>\n<\/tr>\n<tr>\n<td>PUT \/ObjectName HTTP\/1.1<br \/>  Host BucketName.s3.amazon.com  <\/td>\n<td>\u0417\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0444\u0430\u0439\u043b \u043d\u0430 S3, \u0432 \u0431\u0430\u043a\u0435\u0442 BucketName  <\/td>\n<\/tr>\n<\/table>\n<p>  \u041d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439 \u043f\u043e \u0432\u0442\u043e\u0440\u043e\u043c\u0443 \u0437\u0430\u043f\u0440\u043e\u0441\u0443, \u043f\u043e\u043b\u0443\u0447\u0430\u044e\u0449\u0435\u043c\u0443 \u0441\u043f\u0438\u0441\u043e\u043a \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432. \u041a\u043b\u044e\u0447\u0438 \u0432 \u043e\u0442\u0432\u0435\u0442\u0435 \u0443\u043f\u043e\u0440\u044f\u0434\u043e\u0447\u0435\u043d\u044b \u0432 \u043b\u0435\u043a\u0441\u0438\u043a\u043e\u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u043e\u043c \u043f\u043e\u0440\u044f\u0434\u043a\u0435. \u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0437\u0430\u043f\u0440\u043e\u0441 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043f\u0435\u0440\u0432\u0443\u044e 1000 \u043a\u043b\u044e\u0447\u0435\u0439. \u0415\u0441\u043b\u0438 \u0437\u0430\u043f\u0440\u043e\u0441 \u043e\u0431\u0440\u0435\u0437\u0430\u0435\u0442\u0441\u044f,<br \/>  \u0442\u043e \u0432\u044b\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0444\u043b\u0430\u0433 <b>IsTruncated:true<\/b>, \u0432 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u043f\u0430\u0440\u0442\u0438\u0438 \u043a\u043b\u044e\u0447\u0435\u0439 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442\u0441\u044f <b>marker<\/b> \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0449\u0438\u0439 \u043d\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0439 \u043a\u043b\u044e\u0447. \u0417\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <i>1000<\/i> \u043c\u043e\u0436\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u043c <b>max-keys<\/b>.<\/p>\n<h4><b>\u0421\u0442\u0440\u043e\u0438\u043c \u0434\u0435\u0440\u0435\u0432\u043e<\/b><\/h4>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/738\/dc8\/13e\/738dc813efea4b32b7591e94f9de8a1c.png\"\/><br \/>  \u041f\u043e \u0445\u043e\u0440\u043e\u0448\u0435\u043c\u0443, \u0434\u043b\u044f \u0443\u043c\u0435\u043d\u044c\u0448\u0435\u043d\u0438\u044f \u043f\u043e\u0442\u0440\u0435\u0431\u043b\u0435\u043d\u0438\u044f \u043f\u0430\u043c\u044f\u0442\u0438, \u0434\u0435\u0440\u0435\u0432\u043e \u0445\u043e\u0440\u043e\u0448\u043e \u0431\u044b \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043d\u0430 \u0434\u0438\u0441\u043a\u0435. \u041d\u043e \u0442.\u043a. \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0431\u044b\u043b\u043e \u0432 \u043e\u0431\u0440\u0435\u0437, \u0441\u0434\u0435\u043b\u0430\u043b \u0442\u0440\u0430\u0434\u0438\u0446\u0438\u043e\u043d\u043d\u043e \u0432 \u043f\u0430\u043c\u044f\u0442\u0438:<\/p>\n<pre><code>struct ObjectTree {     TreeNode* root;     ASSS::ObjectInfoList objects; }; struct TreeNode {     typedef QList&lt;TreeNode*&gt; NodeList;     enum Type     {         Undef,         Leaf,         Node     };      Type type;     TreeNode* parent;     NodeList children;     int objectPos;     QString segment;     bool isRoot; }; <\/code><\/pre>\n<p>  \u0412 \u0443\u0437\u043b\u0430\u0445 \u0434\u0435\u0440\u0435\u0432\u0430 \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u044b \u043f\u0443\u0442\u0438(\u0432 UI \u043e\u043d\u0438 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u044e\u0442\u0441\u044f \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0430\u043c\u0438), \u0432 \u043b\u0438\u0441\u0442\u044c\u044f\u0445 \u043f\u043e\u0437\u0438\u0446\u0438\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0432 \u0441\u043f\u0438\u0441\u043a\u0435 <i>objects<\/i>. \u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0432\u0441\u0442\u0430\u0432\u043a\u0438 \u043f\u0440\u043e\u0441\u0442\u043e\u0439: \u0440\u0430\u0437\u0431\u0438\u0432\u0430\u0435\u043c \u043a\u043b\u044e\u0447 \u043d\u0430 \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u044b, \u0438\u0434\u0435\u043c \u043f\u043e \u0434\u0435\u0440\u0435\u0432\u0443 \u0438 \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u043d\u043e\u0432\u044b\u0435 \u0443\u0437\u043b\u044b.<br \/>  \u041f\u0440\u0438\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0447\u0442\u043e \u0438\u0437-\u0437\u0430 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043a\u043b\u044e\u0447\u0438 \u0443\u043f\u043e\u0440\u044f\u0434\u043e\u0447\u0435\u043d\u044b, \u0430 \u0432\u0441\u0442\u0430\u0432\u043a\u0430 \u043d\u0435 \u043d\u0430\u0440\u0443\u0448\u0430\u0435\u0442 \u043f\u043e\u0440\u044f\u0434\u043e\u043a, \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u0434\u0435\u0440\u0435\u0432\u043e \u043f\u043e\u0438\u0441\u043a\u0430.<\/p>\n<h4><b>\u041d\u0435\u043c\u043d\u043e\u0433\u043e \u00abModel\/View Programming\u00bb<\/b><\/h4>\n<h5><b>\u041c\u043e\u0434\u0435\u043b\u044c \u0434\u0435\u0440\u0435\u0432\u0430<\/b><\/h5>\n<p>  \u041a\u043e\u0433\u0434\u0430 \u0435\u0441\u0442\u044c \u0433\u043e\u0442\u043e\u0432\u0430\u044f \u0434\u0440\u0435\u0432\u043e\u0432\u0438\u0434\u043d\u0430\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043b\u0435\u0433\u043a\u043e \u043f\u0438\u0448\u0435\u0442\u0441\u044f \u0432\u0440\u0430\u043f\u043f\u0435\u0440 \u043f\u043e\u0434 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 <a href=\"http:\/\/doc.qt.io\/qt-5\/qabstractitemmodel.html\">QAbstractItemModel<\/a>. \u0412\u0441\u0435 \u0432\u0430\u043b\u0438\u0434\u043d\u044b\u0435 \u043c\u043e\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u0438\u043d\u0434\u0435\u043a\u0441\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u0434\u0430\u044e\u0442\u0441\u044f \u0432 \u043c\u0435\u0442\u043e\u0434\u044b \u043a\u043b\u0430\u0441\u0441\u0430 <a href=\"http:\/\/doc.qt.io\/qt-5\/qabstractitemmodel.html\">QAbstractItemModel<\/a> \u0431\u0443\u0434\u0443\u0442 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c\u0441\u044f \u043c\u0435\u0442\u043e\u0434\u043e\u043c:  <\/p>\n<pre><code>QModelIndex QAbstractItemModel::createIndex(int row, int column, void * ptr = 0) const <\/code><\/pre>\n<p>  \u0422\u0440\u0435\u0442\u044c\u0438\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u043c \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442\u0441\u044f \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0434\u0435\u0440\u0435\u0432\u0430 TreeNode.<br \/>  \u0412 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c \u044d\u0442\u043e\u0442 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u0431\u0443\u0434\u0435\u0442 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c\u0441\u044f \u043c\u0435\u0442\u043e\u0434\u043e\u043c \u0438\u043d\u0434\u0435\u043a\u0441\u0430:  <\/p>\n<pre><code>void * QModelIndex::internalPointer() const <\/code><\/pre>\n<p>  \u0414\u0430\u043b\u0435\u0435 \u043f\u0440\u043e\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0438\u0440\u0443\u044e \u043a\u0430\u043a\u043e\u0439 \u0441\u043c\u044b\u0441\u043b \u0438\u043c\u0435\u044e\u0442 \u043c\u0435\u0442\u043e\u0434\u044b <b>QAbstractItemModel<\/b> \u043f\u0440\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0434\u0435\u0440\u0435\u0432\u0430.<\/p>\n<pre><code>virtual QModelIndex index(int row, int column, const QModelIndex & parent = QModelIndex()) const; <\/code><\/pre>\n<p>  \u0412 \u043c\u043e\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f <i>row<\/i> \u0438 <i>parent<\/i>. \u0414\u0430\u043d\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u043c\u043e\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0438\u043d\u0434\u0435\u043a\u0441 \u0434\u043b\u044f \u043f\u043e\u0442\u043e\u043c\u043a\u0430 \u0443\u0437\u043b\u0430 <i>parent<\/i>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u0442\u043e\u0438\u0442 \u043d\u0430 \u043f\u043e\u0437\u0438\u0446\u0438\u0438 <i>row<\/i>.<br \/>  \u0412 \u043c\u043e\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u044d\u0442\u043e \u043f\u043e\u0437\u0438\u0446\u0438\u044f \u0443\u0437\u043b\u0430 \u0432 \u0441\u043f\u0438\u0441\u043a\u0435 TreeNode.children.<\/p>\n<pre><code>virtual int rowCount(const QModelIndex & parent = QModelIndex()) const; <\/code><\/pre>\n<p>  \u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u043e\u0442\u043e\u043c\u043a\u043e\u0432 \u0443 \u0443\u0437\u043b\u0430 <i>parent<\/i>. \u0412\u043d\u0443\u0442\u0440\u0438 \u0441\u0435\u0431\u044f \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 TreeNode.children.size()<\/p>\n<pre><code>virtual QModelIndex parent(const QModelIndex & index) const; <\/code><\/pre>\n<p>  \u041f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0438\u043d\u0434\u0435\u043a\u0441 \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u0443\u0437\u043b\u0430. \u041c\u043e\u0436\u0435\u0442 \u043f\u043e\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u0442\u044c \u0434\u043e \u0434\u0432\u0443\u0445 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u043e\u0432 \u043f\u043e TreeNode.parent, \u0447\u0442\u043e \u0431\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u0443\u044e \u043f\u043e\u0437\u0438\u0446\u0438\u044e \u0443\u0437\u043b\u0430 \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0435\u0451 \u0432 <i>createIndex<\/i><\/p>\n<p>  \u041f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0432 \u044d\u0442\u0438 \u0442\u0440\u0438 \u043c\u0435\u0442\u043e\u0434\u0430, \u0443 \u0432\u0430\u0441 \u0431\u0443\u0434\u0435\u0442 \u0434\u0435\u0440\u0435\u0432\u043e.<\/p>\n<h5><b>\u0414\u0435\u043b\u0435\u0433\u0430\u0442<\/b><\/h5>\n<p>  \u041d\u0430 \u043b\u0438\u0441\u0442\u044c\u044f\u0445 \u043c\u043e\u0435\u0433\u043e \u0434\u0435\u0440\u0435\u0432\u0430 \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0435 <a href=\"http:\/\/docs.aws.amazon.com\/AmazonS3\/latest\/API\/RESTBucketGET.html\">\u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u044b\u0435<\/a> AWS, \u0442\u043e \u0441\u0440\u0435\u0434\u0438 \u043d\u0438\u0445 \u043d\u0435\u0442 \u00ab\u0438\u043c\u0435\u043d\u0438 \u0434\u043b\u044f \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f\u00bb.<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/c93\/b7b\/480\/c93b7b4806a845fa94b6b0e5430cc562.png\"\/><br \/>  \u0417\u043d\u0430\u0447\u0438\u0442 \u044d\u0442\u043e \u0438\u043c\u044f \u043d\u0430\u0434\u043e \u0438\u0437\u0432\u043b\u0435\u0447\u044c \u0438\u0437 \u043a\u043b\u044e\u0447\u0430. \u0418\u0437 \u0441\u043e\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439, \u0447\u0442\u043e \u0432 ListView \u0438 TaleView \u0443\u0434\u043e\u0431\u043d\u043e \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c \u043a\u043b\u044e\u0447\u0438, \u0430 \u0432 TreeView \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u043c\u044b\u0445 \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u043c\u0435\u043d\u044c\u0448\u0435 \u0447\u0435\u043c \u0432 TableView, \u0431\u044b\u043b\u043e \u043f\u0440\u0438\u043d\u044f\u0442\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0434\u043b\u044f TreeView \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0434\u0435\u043b\u0435\u0433\u0430\u0442. \u0422\u0430\u043a\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0432\u043f\u043e\u043b\u043d\u0435 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 <a href=\"http:\/\/doc.qt.io\/qt-5\/model-view-programming.html\">Model\/View Programming<\/a>. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0435\u0441\u043b\u0438 \u0441\u0442\u0440\u043e\u043a\u0430 \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0431\u043e\u043b\u044c\u0448\u0430\u044f \u0438 \u043d\u0435 \u0432\u043c\u0435\u0449\u0430\u0435\u0442\u0441\u044f \u0432 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u043c\u0443\u044e \u043e\u0431\u043b\u0430\u0441\u0442\u044c,<br \/>  \u0442\u043e \u0434\u0435\u043b\u0435\u0433\u0430\u0442 \u043c\u043e\u0436\u0435\u0442 \u043e\u0431\u0440\u0435\u0437\u0430\u0442\u044c \u0435\u0451 \u0438 \u0434\u043e\u043f\u0438\u0441\u0430\u0442\u044c \u043c\u043d\u043e\u0433\u043e\u0442\u043e\u0447\u0438\u0435.<\/p>\n<p>  \u041e\u0442\u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0432\u0448\u0438\u0441\u044c \u043e\u0442 <a href=\"http:\/\/doc.qt.io\/qt-5\/qitemdelegate.html\">QItemDelegate<\/a> \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043b:  <\/p>\n<pre><code>void drawDisplay(QPainter * painter, const QStyleOptionViewItem & option, const QRect & rect, const QString & text) const <\/code><\/pre>\n<p>  \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442:<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/768\/aad\/b90\/768aadb90b1a474d924c21f5cce035f8.png\"\/><\/p>\n<h5><b>\u041d\u0435\u0434\u043e\u0447\u0435\u0442\u044b \u0432 \u044e\u0437\u0430\u0431\u0438\u043b\u0438\u0442\u0438<\/b><\/h5>\n<p>  \u041e \u044e\u0437\u0430\u0431\u0438\u043b\u0438\u0442\u0438 \u0432\u043e\u043e\u0431\u0449\u0435 \u043d\u0435 \u0434\u0443\u043c\u0430\u043b, \u043a\u0430\u043a \u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0435 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c \u0440\u0435\u0433\u0438\u043e\u043d, \u0445\u043e\u0442\u044f \u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0442\u0430\u0449\u0438\u0442\u044c \u0438\u0437 \u0445\u043e\u0441\u0442\u0430.<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/fd1\/78a\/c68\/fd178ac6893d43fea83c9e6b323f56f3.png\"\/><\/p>\n<p>  \u0410 \u0442\u0430\u043a \u0436\u0435 \u043d\u0435\u043e\u0447\u0435\u0432\u0438\u0434\u043d\u043e\u0441\u0442\u044c \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043a\u043d\u043e\u043f\u043a\u0438 \u043d\u0430 \u0442\u0443\u043b\u0431\u0430\u0440\u0435.<\/p>\n<h5><b>\u0427\u0442\u043e \u0432 \u043e\u0441\u0442\u0430\u0442\u043a\u0435?<\/b><\/h5>\n<p>  \u0415\u0441\u0442\u044c <a href=\"https:\/\/github.com\/RPG-18\/qtawss3\/tree\/master\/src\/core\">\u043a\u043e\u0434<\/a> \u0441 <a href=\"https:\/\/github.com\/RPG-18\/qtawss3\/blob\/master\/test\/TestBucket.cpp\">\u043f\u0440\u0438\u043c\u0435\u0440\u0430\u043c\u0438<\/a> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c,<br \/>  \u0435\u0441\u043b\u0438 \u0432\u0430\u043c \u0447\u0435\u043c \u0442\u043e \u043d\u0435 \u0443\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442 <a href=\"https:\/\/qtcloudservices.com\/\">Qt Cloud Services<\/a>.     \t<\/p>\n<div class=\"clear\"><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/264715\/\"> http:\/\/habrahabr.ru\/post\/264715\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>     \t\u042d\u0442\u0430 \u0442\u043e\u043f\u0438\u043a \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u0437\u0430\u0434\u0430\u043d\u0438\u044f, \u0441\u043e \u0441\u0440\u043e\u043a\u043e\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f 1 \u043d\u0435\u0434\u0435\u043b\u044f. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043a\u043e\u0434 \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u043f\u0440\u043e\u0442\u043e\u0442\u0438\u043f\u0430.<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/b2d\/476\/51f\/b2d47651fd1c4eeeab1bf54e352821ac.png\"\/>  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-263707","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/263707","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=263707"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/263707\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=263707"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=263707"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=263707"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}