{"id":172187,"date":"2013-03-23T19:00:03","date_gmt":"2013-03-23T15:00:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=172187"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=172187","title":{"rendered":"<span class=\"post_title\">\u0418\u0435\u0440\u0430\u0440\u0445\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u0432 Qt<\/span>"},"content":{"rendered":"<div class=\"content html_format\">   \t\u041f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u044e \u0442\u0435\u043c\u0443 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c Qt MV. \u0412 <a href=\"http:\/\/habrahabr.ru\/post\/171443\/\">\u043f\u0440\u043e\u0448\u043b\u044b\u0439 \u0440\u0430\u0437<\/a> \u0431\u044b\u043b\u0430 \u043a\u0440\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u043f\u043e \u043f\u043e\u0432\u043e\u0434\u0443 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0435 \u043d\u0430\u0434\u043e. \u041f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043a \u043f\u043e\u0437\u0438\u0442\u0438\u0432\u043d\u043e\u0439 \u0447\u0430\u0441\u0442\u0438.<\/p>\n<p>  \u0414\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043f\u043b\u043e\u0441\u043a\u0438\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0441\u043f\u0438\u0441\u043a\u043e\u0432 \u0438 \u0442\u0430\u0431\u043b\u0438\u0446 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0437\u0430\u0433\u043e\u0442\u043e\u0432\u043a\u0438 <a href=\"http:\/\/qt-project.org\/doc\/qt-5.0\/qtcore\/qabstractlistmodel.html\">QAbstractListModel<\/a> \u0438 <a href=\"http:\/\/qt-project.org\/doc\/qt-5.0\/qtcore\/qabstracttablemodel.html\">QAbstractTableModel<\/a>. \u0414\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0438\u0445 \u0434\u043e \u0433\u043e\u0442\u043e\u0432\u043d\u043e\u0441\u0442\u0438 \u043d\u0435 \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u0442\u0440\u0443\u0434\u0430, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u0438\u0445 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043d\u0435\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438.<\/p>\n<p>  \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0436\u0435 \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u2013 \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430. \u041e \u043d\u0435\u0439 \u0438 \u043f\u043e\u0439\u0434\u0435\u0442 \u0440\u0435\u0447\u044c \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435. <a name=\"habracut\"><\/a><\/p>\n<p>  \u0412 \u043e\u0431\u0449\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435, Qt \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u0440\u0435\u0432\u043e\u0432\u0438\u0434\u043d\u044b\u0435 \u043c\u043e\u0434\u0435\u043b\u0438, \u043d\u043e \u0438 \u043c\u043e\u0434\u0435\u043b\u0438 \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0439 \u0438 \u0440\u0430\u0437\u043c\u0435\u0440\u043d\u043e\u0441\u0442\u0435\u0439. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0442\u0430\u0431\u043b\u0438\u0446\u0430, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043a\u0430\u0436\u0434\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u0443\u044e\u0449\u0438\u043c \u0434\u043b\u044f \u043f\u043e\u0434\u0442\u0430\u0431\u043b\u0438\u0446\u044b. \u041d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u044d\u0442\u043e, \u0432 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0435 \u0441\u043b\u0443\u0447\u0430\u0435\u0432, \u043a\u043e\u0433\u0434\u0430 \u0433\u043e\u0432\u043e\u0440\u044f\u0442 \u043e\u0431 \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043c\u043e\u0434\u0435\u043b\u044f\u0445 \u2013 \u0438\u043c\u0435\u044e\u0442 \u0432 \u0432\u0438\u0434\u0443 \u0434\u0435\u0440\u0435\u0432\u044c\u044f. \u0418\u043c\u0435\u043d\u043d\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0434\u0435\u0440\u0435\u0432\u044c\u0435\u0432 \u044f \u0438 \u0445\u043e\u0447\u0443 \u043e\u0441\u0432\u0435\u0442\u0438\u0442\u044c.<\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/f27\/8de\/370\/f278de370fdf230c79d8e8202aa132b2.png\" align=\"center\"\/><\/p>\n<h6>\u0420\u0438\u0441\u0443\u043d\u043e\u043a: Ta\u0431\u043b\u0438\u0446\u0430 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435<\/h6>\n<p>  \u0415\u0449\u0435 \u043e\u0434\u043d\u043e \u0432\u0432\u043e\u0434\u043d\u043e\u0435 \u0437\u0430\u043c\u0435\u0447\u0430\u043d\u0438\u0435 \u043a\u0430\u0441\u0430\u0435\u0442\u0441\u044f \u0441\u0443\u0442\u0438 \u043c\u043e\u0434\u0435\u043b\u0438, \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u044f \u0431\u0443\u0434\u0443 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u0430. \u0425\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u0447\u0442\u043e-\u0442\u043e \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0435 \u0438 \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u043e\u0435, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u0440\u0435\u0448\u0438\u043b \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0434\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u043c\u043e\u0434\u0435\u043b\u044c, \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u044e\u0449\u0443\u044e \u0444\u0430\u0439\u043b\u043e\u0432\u0443\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u0443. \u041e\u043d\u0430 \u043d\u0435 \u0441\u0442\u0440\u0430\u0434\u0430\u0435\u0442 \u043f\u043e\u043b\u043d\u043e\u0442\u043e\u0439 \u0438 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u043e\u0441\u0442\u044c\u044e, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u0440\u044f\u0434 \u043b\u0438 \u043a\u0442\u043e-\u0442\u043e \u0437\u0430\u0445\u043e\u0447\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0435\u0435 \u0432\u0441\u0435\u0440\u044c\u0435\u0437 (\u0442\u0435\u043c \u0431\u043e\u043b\u0435\u0435 \u0447\u0442\u043e \u0443\u0436\u0435 \u0435\u0441\u0442\u044c <a href=\"http:\/\/qt-project.org\/doc\/qt-5.0\/qtwidgets\/qfilesystemmodel.html\">QFileSystemModel<\/a>), \u043d\u043e \u0434\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0432\u043f\u043e\u043b\u043d\u0435 \u043f\u043e\u0434\u043e\u0439\u0434\u0435\u0442. \u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0435, \u0435\u0441\u043b\u0438 \u0442\u0430\u043a\u0430\u044f \u0431\u0443\u0434\u0435\u0442, \u0432\u043e\u043a\u0440\u0443\u0433 \u044d\u0442\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 \u044f \u0441\u043e\u0431\u0438\u0440\u0430\u044e\u0441\u044c \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e proxy.<\/p>\n<h4>\u041f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435<\/h4>\n<p><img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/d1a\/ff1\/082\/d1aff1082aefa4f11793f4606010af45.png\" align=\"right\"\/>\u041f\u0440\u0435\u0436\u0434\u0435 \u0432\u0441\u0435\u0433\u043e, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0441\u043e<i> \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043e\u0439 \u0434\u0430\u043d\u043d\u044b\u0445<\/i>. \u0417\u0434\u0435\u0441\u044c \u044f \u0432\u044b\u0434\u0435\u043b\u0438\u043b \u0431\u044b 2 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f:  <\/p>\n<ul>\n<li>\u041c\u043e\u0434\u0435\u043b\u0438 \u0441 \u0445\u043e\u0440\u043e\u0448\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043e\u0439 \u0438\u043b\u0438 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0441\u0442\u044c\u044e.<br \/>  \u041f\u0440\u0438\u043c\u0435\u0440\u043e\u043c \u043c\u043e\u0436\u0435\u0442 \u044f\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440 \u0441\u0432\u043e\u0439\u0441\u0442\u0432 \u0432 Qt Designer. \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0432\u0441\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u043c\u043e\u0434\u0435\u043b\u0438 \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0432 \u0441\u0430\u043c\u043e\u043c \u0438\u043d\u0434\u0435\u043a\u0441\u0435 (<a href=\"http:\/\/qt-project.org\/doc\/qt-5.0\/qtcore\/qmodelindex.html\">QModelIndex<\/a>), \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f <code>internalId<\/code>. \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441\u043b\u0443\u0447\u0430\u044f \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0430 \u0441\u0432\u043e\u0439\u0441\u0442\u0432 \u0432 <code>internalId <\/code>\u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u0433\u0440\u0443\u043f\u043f\u044b \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430.<br \/>  \u0414\u0440\u0443\u0433\u043e\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u2013 \u043c\u043e\u0434\u0435\u043b\u044c \u0437\u0430\u043f\u0438\u0441\u043d\u043e\u0439 \u043a\u043d\u0438\u0436\u043a\u0438. \u041e\u0447\u0435\u0432\u0438\u0434\u043d\u043e, \u0437\u0430\u043f\u0438\u0441\u044c \u00ab<i>Lol4t0<\/i>\u00bb \u0432\u0445\u043e\u0434\u0438\u0442 \u0432 \u043f\u043e\u0434\u0433\u0440\u0443\u043f\u043f\u0443 <i>Lo<\/i>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f, \u0432 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c, \u0432\u0445\u043e\u0434\u0438\u0442 \u0432 \u0433\u0440\u0443\u043f\u043f\u0443 <i>L<\/i>. \u0418 \u043e\u0431\u0440\u0430\u0442\u043d\u043e \u2013 \u0432 \u0433\u0440\u0443\u043f\u043f\u0443 <i>Lo<\/i> \u0432\u0445\u043e\u0434\u044f\u0442 \u0442\u0435, \u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u0435 \u0437\u0430\u043f\u0438\u0441\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0442\u0441\u044f \u0441 \u043f\u0440\u0435\u0444\u0438\u043a\u0441\u0430 \u00ab<i>Lo<\/i>\u00bb. \u042d\u0442\u043e \u044f \u0438 \u043d\u0430\u0437\u044b\u0432\u0430\u044e \u0445\u043e\u0440\u043e\u0448\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043e\u0439.\n<\/li>\n<li>\u041c\u043e\u0434\u0435\u043b\u0438 \u0431\u0435\u0437 \u0447\u0435\u0442\u043a\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b. \u041c\u043e\u0434\u0435\u043b\u044c \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0441\u044f \u0438\u043c\u0435\u043d\u043d\u043e \u043a \u0442\u0430\u043a\u0438\u043c. \u0417\u043d\u0430\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043f\u0430\u043f\u043a\u0438 <i>Documents<\/i>, \u0432\u043e\u043e\u0431\u0449\u0435 \u0433\u043e\u0432\u043e\u0440\u044f, \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c, \u0432 \u043a\u0430\u043a\u043e\u0439 \u043f\u0430\u043f\u043a\u0435 \u043e\u043d\u0430 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0438 \u043a\u0430\u043a\u0438\u0435 \u043f\u0430\u043f\u043a\u0438 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442.<\/li>\n<\/ul>\n<p>  \u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0441\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0438 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0442\u0438\u043f\u0430 \u043e\u0431\u044b\u0447\u043d\u043e \u043d\u0435 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c. \u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u0440\u0435\u0447\u044c \u043f\u043e\u0439\u0434\u0435\u0442 \u043e \u043c\u043e\u0434\u0435\u043b\u044f\u0445 \u0432\u0442\u043e\u0440\u043e\u0433\u043e \u0442\u0438\u043f\u0430.<\/p>\n<p>  \u0412\u0441\u0435 \u0432\u0438\u0434\u044b \u0434\u0430\u043d\u043d\u044b\u0445, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0438\u043c\u0435\u0442\u044c \u0434\u0435\u043b\u043e \u043f\u0440\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0434\u0440\u0435\u0432\u043e\u0432\u0438\u0434\u043d\u044b\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439, \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u043f\u043e\u0445\u043e\u0436\u0438. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0435 \u0441\u043e\u0441\u0442\u0430\u0432\u0438\u0442 \u0442\u0440\u0443\u0434\u0430 \u0432\u044b\u0434\u0435\u043b\u0438\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0431\u0449\u0438\u0435 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0430\u0446\u0438\u0438 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u043d\u043e \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0439 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0445:  <\/p>\n<ul>\n<li>\u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0443\u0437\u043b\u043e\u0432<\/li>\n<li>\u0414\u043e\u043b\u0436\u043d\u0430 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0432\u0437\u0430\u0438\u043c\u043d\u043e\u043e\u0434\u043d\u043e\u0437\u043d\u0430\u0447\u043d\u0430\u044f \u0441\u0432\u044f\u0437\u044c \u043c\u0435\u0436\u0434\u0443 <code>QModelIndex<\/code> \u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u043c \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0434\u0430\u043d\u043d\u044b\u0445<\/li>\n<li>\u041a\u0430\u0436\u0434\u044b\u0439 \u0443\u0437\u0435\u043b \u0434\u043e\u043b\u0436\u0435\u043d \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439 \u0443\u0437\u0435\u043b \u0438 \u0434\u043e\u0447\u0435\u0440\u043d\u0438\u0435 \u0443\u0437\u043b\u044b<\/li>\n<\/ul>\n<p>  \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b, \u044f \u0431\u0443\u0434\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <a href=\"http:\/\/qt-project.org\/doc\/qt-5.0\/qtcore\/qfileinfo.html\">QFileInfo<\/a> \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e \u043a\u0430\u0436\u0434\u043e\u043c \u0443\u0437\u043b\u0435. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0431\u0443\u0434\u0435\u0442 \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0434\u043e\u0447\u0435\u0440\u043d\u0438\u0445 \u0443\u0437\u043b\u0430\u0445 \u0438 \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u043c \u0443\u0437\u043b\u0435. \u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e, \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u0442\u043e\u043c, \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u043b\u0441\u044f \u043b\u0438 \u043f\u043e\u0438\u0441\u043a \u0434\u043e\u0447\u0435\u0440\u043d\u0438\u0445 \u0443\u0437\u043b\u043e\u0432, \u0438\u043b\u0438 \u043d\u0435\u0442.<\/p>\n<h6>\u0411\u0438\u0437\u043d\u0435\u0441 \u0434\u0430\u043d\u043d\u044b\u0435 (<code>QFileInfo<\/code>) \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u043e\u0431\u0435\u0440\u043d\u0443\u0442\u044c \u0441\u043b\u0443\u0436\u0435\u0431\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0435\u0439. \u0412 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0435 \u0441\u043b\u0443\u0447\u0430\u0435\u0432, \u0431\u0435\u0437 \u044d\u0442\u043e\u0433\u043e \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043e\u0431\u043e\u0439\u0442\u0438\u0441\u044c. \u0415\u0441\u043b\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u0440\u0435\u0434\u043c\u0435\u0442\u043d\u043e\u0439 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u0443\u0436\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442 \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u044e, \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0435\u0435, \u043e\u0434\u043d\u0430\u043a\u043e \u044f \u0435\u0449\u0435 \u043d\u0438 \u0440\u0430\u0437\u0443 \u043d\u0435 \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u043b\u0441\u044f \u0441\u043e \u0441\u043b\u0443\u0447\u0430\u0435\u043c, \u043a\u043e\u0433\u0434\u0430 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u043b\u0438 \u0431\u044b \u0432\u0441\u044e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e.<\/h6>\n<p>  \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u044e\u044e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0434\u0430\u043d\u043d\u044b\u0445:  <\/p>\n<pre><code class=\"cpp\">struct FilesystemModel::NodeInfo { \tQFileInfo fileInfo; \/\/ \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e\u0431 \u0443\u0437\u043b\u0435 \tQVector&lt;NodeInfo&gt; children; \/\/ \u0441\u043f\u0438\u0441\u043e\u043a \u0434\u043e\u0447\u0435\u0440\u043d\u0438\u0445 \u0443\u0437\u043b\u043e\u0432 \tNodeInfo* parent; \/\/ \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439 \u0443\u0437\u0435\u043b  \tbool mapped; \/\/ \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u043b\u0441\u044f \u043b\u0438 \u043f\u043e\u0438\u0441\u043a \u0434\u043e\u0447\u0435\u0440\u043d\u0438\u0445 \u0443\u0437\u043b\u043e\u0432. }; <\/code><\/pre>\n<p>  \u041f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u0434\u0435\u0440\u0435\u0432\u0430, \u044f \u0441\u043a\u043e\u043d\u0441\u0442\u0440\u0443\u0438\u0440\u0443\u044e \u0441\u043f\u0438\u0441\u043e\u043a \u0443\u0437\u043b\u043e\u0432, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0440\u043d\u0435\u0432\u044b\u043c \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u043c \u0444\u0430\u0439\u043b\u043e\u0432\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c, \u0430 \u0438\u0445 \u0434\u043e\u0447\u0435\u0440\u043d\u0438\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u044f \u0431\u0443\u0434\u0443 \u043f\u043e\u0434\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u043f\u043e \u043c\u0435\u0440\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438:  <\/p>\n<pre><code class=\"cpp\">typedef QVector&lt;NodeInfo&gt; NodeInfoList; NodeInfoList _nodes; \/\/ \u0441\u043f\u0438\u0441\u043e\u043a \u043a\u043e\u0440\u043d\u0435\u0432\u044b\u0445 \u0443\u0437\u043b\u043e\u0432 \u0444\u0430\u0439\u043b\u043e\u0432\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c <\/code><\/pre>\n<p>  \u0412 \u0434\u0435\u0440\u0435\u0432\u0435 \u0431\u0443\u0434\u0435\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0442\u043e\u043b\u0431\u0446\u043e\u0432:  <\/p>\n<pre><code class=\"cpp\">enum Columns { \tRamificationColumn, \/\/ \u0441\u0442\u043e\u043b\u0431\u0435\u0446, \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u0432\u0435\u0442\u0432\u043b\u0435\u043d\u0438\u0435, \u0432\u0441\u0435\u0433\u0434\u0430 \u043f\u0435\u0440\u0432\u044b\u0439.                         \/\/ \u0414\u0440\u0443\u0433\u043e\u0433\u043e \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430 \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 QTreeView \tNameColumn = RamificationColumn, \/\/ \u0441\u0442\u043e\u043b\u0431\u0435\u0446 \u0441 \u0438\u043c\u0435\u043d\u0435\u043c \u0443\u0437\u043b\u0430 \tModificationDateColumn, \/\/ \u0441\u0442\u043e\u043b\u0431\u0435\u0446 \u0441 \u0434\u0430\u0442\u043e\u0439 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0443\u0437\u043b\u0430 \tSizeColumn, \/\/ \u0441\u0442\u043e\u043b\u0431\u0435\u0446 \u0441 \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u043c \u0444\u0430\u0439\u043b\u0430 \tColumnCount \/\/ \u0447\u0438\u0441\u043b\u043e \u0441\u0442\u043e\u043b\u0431\u0446\u043e\u0432 }; <\/code><\/pre>\n<h4>\u041c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f<\/h4>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043b\u0438\u0441\u044c \u0441\u043e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043e\u0439 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445, \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u0442\u044c \u043a \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043c\u043e\u0434\u0435\u043b\u0438.<br \/>  \u0415\u0441\u043b\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u043c\u043e\u0434\u0435\u043b\u044c, \u0442\u043e \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f, \u043a\u0440\u043e\u043c\u0435 \u043a\u0430\u043a \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043e\u0442 <a href=\"http:\/\/qt-project.org\/doc\/qt-5.0\/qtcore\/qabstractitemmodel.html\">QAbstractItemModel<\/a>. \u0414\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0443\u044e \u043c\u043e\u0434\u0435\u043b\u044c, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0432\u0441\u0435\u0433\u043e \u043f\u044f\u0442\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0439:  <\/p>\n<pre><code class=\"cpp\">virtual QModelIndex index(int row, int column, const QModelIndex &parent) const; virtual QModelIndex parent(const QModelIndex &child) const; virtual int rowCount(const QModelIndex &parent = QModelIndex()) const; virtual int columnCount(const QModelIndex &parent = QModelIndex()) const; virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; <\/code><\/pre>\n<p>  \u041e\u0434\u043d\u0430\u043a\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u0435\u0440\u0432\u044b\u0445 \u0434\u0432\u0443\u0445 \u043e\u0431\u044b\u0447\u043d\u043e \u0438 \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 80% \u043f\u0440\u043e\u0431\u043b\u0435\u043c, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0445 \u0441 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435\u043c \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439. \u0414\u0435\u043b\u043e \u0435\u0449\u0435 \u0438 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043e\u043d\u0438 \u043e\u0447\u0435\u043d\u044c \u0447\u0430\u0441\u0442\u043e, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0432 \u043d\u0438\u0445 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432 \u0441\u043b\u043e\u0436\u043d\u0435\u0435 O(1), \u0432\u043e\u043e\u0431\u0449\u0435 \u0433\u043e\u0432\u043e\u0440\u044f, \u043d\u0435 \u0436\u0435\u043b\u0430\u0442\u0435\u043b\u044c\u043d\u043e.<\/p>\n<p>  \u042f \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 <code>NodeInfo<\/code> \u0432 <code>internalPointer<\/code> \u0438\u043d\u0434\u0435\u043a\u0441\u0430. \u0412 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0435 \u0441\u043b\u0443\u0447\u0430\u0435\u0432, \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u0430\u043a \u0438 \u043f\u043e\u0441\u0442\u0443\u043f\u0430\u044e\u0442. \u041f\u0440\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 <code>index<\/code> \u043d\u0438 \u0432 \u043a\u043e\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0435\u043b\u044c\u0437\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c \u043d\u0435\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0438\u043d\u0434\u0435\u043a\u0441\u044b. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0439 \u0438\u043d\u0434\u0435\u043a\u0441 \u043d\u0438\u043a\u0442\u043e \u043d\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u0438\u0442. \u0414\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u0438\u044f \u0438\u043d\u0434\u0435\u043a\u0441\u0430 \u0435\u0441\u0442\u044c \u043e\u0447\u0435\u043d\u044c \u0443\u0434\u043e\u0431\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f <code>hasIndex<\/code>.  <\/p>\n<pre><code class=\"cpp\">QModelIndex FilesystemModel::index(int row, int column, const QModelIndex &parent) const { \tif (!hasIndex(row, column, parent)) { \t\treturn QModelIndex(); \t}  \tif (!parent.isValid()) { \/\/ \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u044e\u0442 \u0438\u043d\u0434\u0435\u043a\u0441\u044b \u043a\u043e\u0440\u043d\u0435\u0432\u044b\u0445 \u0443\u0437\u043b\u043e\u0432 \t\treturn createIndex(row, column, const_cast&lt;NodeInfo*&gt;(&_nodes[row])); \t}  \tNodeInfo* parentInfo = static_cast&lt;NodeInfo*&gt;(parent.internalPointer()); \treturn createIndex(row, column, &parentInfo-&gt;children[row]); } <\/code><\/pre>\n<p>  \u0421 <code>parent <\/code>\u0432\u0441\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u043b\u043e\u0436\u043d\u0435\u0435. \u041d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u043f\u043e \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u043c\u0443 \u0438\u043d\u0434\u0435\u043a\u0441\u0443 \u0432\u0441\u0435\u0433\u0434\u0430 \u043c\u043e\u0436\u043d\u043e \u043e\u0442\u044b\u0441\u043a\u0430\u0442\u044c <code>NodeInfo<\/code> \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430, \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0438\u043d\u0434\u0435\u043a\u0441\u0430 \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0442\u0430\u043a\u0436\u0435 \u0437\u043d\u0430\u0442\u044c \u0435\u0433\u043e \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0441\u0440\u0435\u0434\u0438 \u00ab\u0431\u0440\u0430\u0442\u044c\u0435\u0432\u00bb. <\/p>\n<p>  \u0422\u0443\u0442 \u0435\u0441\u0442\u044c \u0434\u0432\u0430 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430 \u2013 \u0438\u043b\u0438 \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0441 \u043a\u0430\u0436\u0434\u044b\u043c \u0443\u0437\u043b\u043e\u043c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0435\u0433\u043e \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0438, \u0438\u043b\u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c \u044d\u0442\u043e \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u0437\u0430\u043d\u043e\u0432\u043e. \u0411\u0435\u0434\u0430 \u0441 \u043f\u0435\u0440\u0432\u044b\u043c \u2014 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043f\u0440\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0438 \u0438 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0438 \u0443\u0437\u043b\u043e\u0432 \u0432\u0441\u0435 \u043d\u0438\u0436\u0435\u043b\u0435\u0436\u0430\u0449\u0438\u0435 \u0443\u0437\u043b\u044b \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0442\u044c. \u0427\u0435\u0433\u043e \u043c\u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u043d\u0435 \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u0432\u044b\u0431\u0440\u0430\u043b \u0432\u0442\u043e\u0440\u043e\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442, \u043d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0435\u0433\u043e \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c. \u0412 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 \u044f \u0431\u044b \u043f\u0440\u0438\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u043b\u0441\u044f \u0442\u0430\u043a\u043e\u0433\u043e \u0432\u044b\u0431\u043e\u0440\u0430 \u0434\u043e \u0442\u0435\u0445 \u043f\u043e\u0440, \u043f\u043e\u043a\u0430 \u043d\u0435 \u0441\u043c\u043e\u0433 \u0434\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0447\u0442\u043e \u044d\u0442\u043e \u2013 \u0443\u0437\u043a\u043e\u0435 \u043c\u0435\u0441\u0442\u043e.   <\/p>\n<pre><code class=\"cpp\">QModelIndex FilesystemModel::parent(const QModelIndex &child) const { \tif (!child.isValid()) { \t\treturn QModelIndex(); \t}  \tNodeInfo* childInfo = static_cast&lt;NodeInfo*&gt;(child.internalPointer()); \tNodeInfo* parentInfo = childInfo-&gt;parent; \tif (parentInfo != 0) { \/\/ parent \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0435 \u0443 \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \t\treturn createIndex(findRow(parentInfo), RamificationColumn, parentInfo); \t} \telse { \t\treturn QModelIndex(); \t} }  int FilesystemModel::findRow(const NodeInfo *nodeInfo) const { \tconst NodeInfoList& parentInfoChildren = nodeInfo-&gt;parent != 0 ? nodeInfo-&gt;parent-&gt;children: _nodes; \tNodeInfoList::const_iterator position = qFind(parentInfoChildren, *nodeInfo); \treturn std::distance(parentInfoChildren.begin(), position); } <\/code><\/pre>\n<p>  \u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f <code>rowCount<\/code> \u0438 <code>columnCount <\/code>\u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u0430: \u0432 \u043f\u0435\u0440\u0432\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u044b \u0432\u0441\u0435\u0433\u0434\u0430 \u043c\u043e\u0436\u0435\u043c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0447\u0438\u0441\u043b\u043e \u0434\u043e\u0447\u0435\u0440\u043d\u0438\u0445 \u0443\u0437\u043b\u043e\u0432 \u0438\u0437 <code>NodeInfo::children::size<\/code>, \u0430 \u0447\u0438\u0441\u043b\u043e \u0441\u0442\u043e\u043b\u0431\u0446\u043e\u0432 \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043e.  <\/p>\n<pre><code class=\"cpp\">int FilesystemModel::rowCount(const QModelIndex &parent) const { \tif (!parent.isValid()) { \t\treturn _nodes.size(); \t} \tconst NodeInfo* parentInfo = static_cast&lt;const NodeInfo*&gt;(parent.internalPointer()); \treturn parentInfo-&gt;children.size(); }  int FilesystemModel::columnCount(const QModelIndex &) const { \treturn ColumnCount; } <\/code><\/pre>\n<p>  \u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f <code>data<\/code> \u0442\u043e\u0436\u0435 \u043d\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u043d\u0438\u0447\u0435\u0433\u043e \u0441\u043b\u043e\u0436\u043d\u043e\u0433\u043e, \u0432\u0441\u044e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0438\u0437 <code>QFileInfo<\/code>. \u041a\u0430\u043a \u043c\u0438\u043d\u0438\u043c\u0443\u043c, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 \u0440\u043e\u043b\u0435\u0439 <code>Qt::DisplayRole<\/code> \u0434\u043b\u044f \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0442\u0435\u043a\u0441\u0442\u0430 \u0432\u043e <code>view<\/code> \u0438 <code>Qt::EditRole<\/code>, \u0435\u0441\u043b\u0438 \u043f\u0440\u0435\u0434\u0443\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u043e \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435. \u0414\u0430\u043d\u043d\u044b\u0435, \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0435 \u043e\u0442 \u043c\u043e\u0434\u0435\u043b\u0438 \u0441 \u0440\u043e\u043b\u044c\u044e<code> Qt::EditRole<\/code> \u0431\u0443\u0434\u0443\u0442 \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u044b \u0432 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440. \u041f\u0440\u0438\u0447\u0435\u043c, \u0434\u0430\u043d\u043d\u044b\u0435, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043c\u043e\u0434\u0435\u043b\u044c \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043f\u0440\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u0435 \u0441 <code>Qt::DisplayRole<\/code> \u0438 <code>Qt::EditRole<\/code> \u043c\u043e\u0433\u0443\u0442 \u0440\u0430\u0437\u043b\u0438\u0447\u0430\u0442\u044c\u0441\u044f. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0431\u0443\u0434\u0435\u043c \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c \u0444\u0430\u0439\u043b\u044b \u0431\u0435\u0437 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0439, \u0430 \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u2014 \u0441 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435\u043c.   <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043e\u0434 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 data<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\">QVariant FilesystemModel::data(const QModelIndex &index, int role) const { \tif (!index.isValid()) { \t\treturn QVariant(); \t}  \tconst NodeInfo* nodeInfo = static_cast&lt;NodeInfo*&gt;(index.internalPointer()); \tconst QFileInfo& fileInfo = nodeInfo-&gt;fileInfo;  \tswitch (index.column()) { \tcase NameColumn: \t\treturn nameData(fileInfo, role); \tcase ModificationDateColumn: \t\tif (role == Qt::DisplayRole) { \t\t\treturn fileInfo.lastModified(); \t\t} \t\tbreak; \tcase SizeColumn: \t\tif (role == Qt::DisplayRole) { \t\t\treturn fileInfo.isDir()? QVariant(): fileInfo.size(); \t\t} \t\tbreak; \tdefault: \t\tbreak; \t} \treturn QVariant(); }  QVariant FilesystemModel::nameData(const QFileInfo &fileInfo, int role) const { \tswitch (role) { \tcase Qt::EditRole: \t\treturn fileInfo.fileName(); \tcase Qt::DisplayRole: \t\tif (fileInfo.isRoot()) { \t\t\treturn fileInfo.absoluteFilePath(); \t\t} \t\telse if (fileInfo.isDir()){ \t\t\treturn fileInfo.fileName(); \t\t} \t\telse { \t\t\treturn fileInfo.completeBaseName(); \t\t} \tdefault: \t\treturn QVariant(); \t} \tQ_UNREACHABLE(); } <\/code><\/pre>\n<p>  \u0414\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u043c\u043e\u0434\u0435\u043b\u044c \u00ab\u043e\u0436\u0438\u043b\u0430\u00bb, \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043a\u043e\u0440\u043d\u0435\u0432\u044b\u0435 \u0443\u0437\u043b\u044b:  <\/p>\n<pre><code class=\"cpp\">void FilesystemModel::fetchRootDirectory() { \tconst QFileInfoList drives = QDir::drives(); \tqCopy(drives.begin(), drives.end(), std::back_inserter(_nodes)); }  FilesystemModel::FilesystemModel(QObject *parent) : \tQAbstractItemModel(parent) { \tfetchRootDirectory(); } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u043e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u044c \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c <code>QTreeView <\/code>\u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442.<\/p>\n<p>  \u041e\u0434\u043d\u0430\u043a\u043e, \u0447\u0442\u043e \u0436\u0435 \u0442\u0430\u043a\u043e\u0435! \u041a\u043e\u0440\u043d\u0435\u0432\u044b\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u044c.<br \/>  \u0414\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e, \u0432\u0435\u0434\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u043d\u0438\u0445 \u0435\u0449\u0435 \u043d\u0435 \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u044b. <\/p>\n<h4>\u0414\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u043f\u043e\u0434\u0433\u0440\u0443\u0437\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445<\/h4>\n<p>\u0427\u0442\u043e\u0431\u044b \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u043f\u043e\u0434\u0433\u0440\u0443\u0437\u043a\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u043e \u043c\u0435\u0440\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438, \u0432 Qt \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435 API:  <\/p>\n<pre><code class=\"cpp\">bool canFetchMore(const QModelIndex &parent) const; void fetchMore(const QModelIndex &parent); <\/code><\/pre>\n<p>  \u041f\u0435\u0440\u0432\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0434\u043e\u043b\u0436\u043d\u0430 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c <code>true<\/code>, \u043a\u043e\u0433\u0434\u0430 \u0434\u0430\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0434\u0433\u0440\u0443\u0437\u0438\u0442\u044c, \u0430 \u0432\u0442\u043e\u0440\u0430\u044f \u2013 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043f\u043e\u0434\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435.<br \/>  \u0417\u0434\u0435\u0441\u044c \u043f\u0440\u0438\u0433\u043e\u0434\u0438\u0442\u0441\u044f <code>NodeInfo::mapped<\/code>. \u0414\u0430\u043d\u043d\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0434\u0433\u0440\u0443\u0437\u0438\u0442\u044c, \u043a\u043e\u0433\u0434\u0430 <code>mapped == false<\/code>.  <\/p>\n<pre><code class=\"cpp\">bool FilesystemModel::canFetchMore(const QModelIndex &parent) const { \tif (!parent.isValid()) { \t\treturn false; \t} \tconst NodeInfo* parentInfo = static_cast&lt;const NodeInfo*&gt;(parent.internalPointer()); \treturn !parentInfo-&gt;mapped; } <\/code><\/pre>\n<p>  \u0414\u043b\u044f \u043f\u043e\u0434\u0433\u0440\u0443\u0437\u043a\u0438 \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c\u044b\u0435 <code>QDir<\/code>. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u043d\u0435 \u0437\u0430\u0431\u044b\u0432\u0430\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <code>beginInsertRows <\/code>\u0438 <code>endInsertRows <\/code>\u043f\u0440\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0438 \u0447\u0438\u0441\u043b\u0430 \u0441\u0442\u0440\u043e\u043a. \u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, <code>QTreeView<\/code> \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u043f\u043e\u0434\u0433\u0440\u0443\u0437\u043a\u0443 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438 \u043f\u043e\u043f\u044b\u0442\u043a\u0435 \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0443\u0437\u0435\u043b, \u0438 \u043d\u0435 \u043f\u044b\u0442\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u0434\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u043d\u043e\u0432\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u0440\u0438 \u043f\u0440\u043e\u043a\u0440\u0443\u0442\u043a\u0435 \u0441\u043f\u0438\u0441\u043a\u0430. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f, \u043a\u0430\u043a \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0432\u0435\u0441\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u0434\u043e\u0447\u0435\u0440\u043d\u0438\u0445 \u0443\u0437\u043b\u043e\u0432 \u0446\u0435\u043b\u0438\u043a\u043e\u043c. \u0418\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u044d\u0442\u043e \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043c\u043e\u0436\u043d\u043e, \u0440\u0430\u0437\u0432\u0435 \u0447\u0442\u043e, \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435\u043c \u0441\u0432\u043e\u0435\u0433\u043e \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f.  <\/p>\n<pre><code class=\"cpp\">void FilesystemModel::fetchMore(const QModelIndex &parent) { \tNodeInfo* parentInfo = static_cast&lt;NodeInfo*&gt;(parent.internalPointer()); \tconst QFileInfo& fileInfo = parentInfo-&gt;fileInfo; \tQDir dir = QDir(fileInfo.absoluteFilePath()); \tQFileInfoList children = dir.entryInfoList(QStringList(), QDir::AllEntries | QDir::NoDotAndDotDot, QDir::Name);  \tbeginInsertRows(parent, 0, children.size() - 1); \tparentInfo-&gt;children.reserve(children.size()); \tfor (const QFileInfo& entry: children) { \t\tNodeInfo nodeInfo(entry, parentInfo); \t\tnodeInfo.mapped = !entry.isDir(); \t\tparentInfo-&gt;children.push_back(std::move(nodeInfo)); \t} \tparentInfo-&gt;mapped = true; \tendInsertRows(); } <\/code><\/pre>\n<p>  \u0414\u0435\u043b\u0430\u0435\u043c \u043f\u043e\u0434\u0433\u0440\u0443\u0437\u043a\u0443, \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443, \u0430 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 \u2013 \u043d\u0435\u0442. \u041a\u043e\u0440\u043d\u0435\u0432\u044b\u0435 \u0443\u0437\u043b\u044b \u0432\u0441\u0435 \u0442\u0430\u043a\u0436\u0435 \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u044c. \u0412\u0441\u0435 \u0434\u0435\u043b\u043e \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e <code>QTreeView <\/code>\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u044e <code>hasChildren<\/code> \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0442\u043e\u0433\u043e, \u0435\u0441\u0442\u044c \u043b\u0438 \u0443 \u0443\u0437\u043b\u0430 \u0434\u043e\u0447\u0435\u0440\u043d\u0438\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b, \u0438 \u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442, \u0447\u0442\u043e \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u044c \u043c\u043e\u0436\u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u0435 \u0443\u0437\u043b\u044b, \u0443 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0434\u043e\u0447\u0435\u0440\u043d\u0438\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0435\u0441\u0442\u044c. <code>hasChildren<\/code> \u0436\u0435 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 <code>true<\/code>, \u0442\u043e\u043b\u044c\u043a\u043e \u043a\u043e\u0433\u0434\u0430 \u0447\u0438\u0441\u043b\u043e \u0441\u0442\u0440\u043e\u043a \u0438 \u0447\u0438\u0441\u043b\u043e \u0441\u0442\u043e\u043b\u0431\u0446\u043e\u0432 \u0434\u043b\u044f \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u0443\u0437\u043b\u0430 \u0431\u043e\u043b\u044c\u0448\u0435 0.<\/p>\n<p>  \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u0442\u0430\u043a\u043e\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043d\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442. \u041f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e <code>hasChildren<\/code> \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u043e\u043d\u0430 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u043b\u0430 <code>true<\/code> \u0434\u043b\u044f \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0443\u0437\u043b\u0430, \u043a\u043e\u0433\u0434\u0430 \u0443 \u043d\u0435\u0433\u043e \u0442\u043e\u0447\u043d\u043e \u0435\u0441\u0442\u044c \u0438\u043b\u0438 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c (\u043a\u043e\u0433\u0434\u0430 <code>mapped ==false<\/code>) \u0434\u043e\u0447\u0435\u0440\u043d\u0438\u0435 \u0443\u0437\u043b\u044b. <\/p>\n<p>  \u041c\u043e\u0436\u043d\u043e \u0442\u043e\u0447\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c, \u043f\u0443\u0441\u0442\u0430 \u043b\u0438 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044f, \u043d\u043e \u044d\u0442\u043e \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0434\u043e\u0440\u043e\u0433\u0430\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043b\u0438 \u0435\u0435 \u2013 \u0440\u0435\u0448\u0430\u0442\u044c \u0432\u0430\u043c.  <\/p>\n<pre><code class=\"cpp\">bool FilesystemModel::hasChildren(const QModelIndex &parent) const { \tif (parent.isValid()) { \t\tconst NodeInfo* parentInfo = static_cast&lt;const NodeInfo*&gt;(parent.internalPointer()); \t\tQ_ASSERT(parentInfo != 0); \t\tif (!parentInfo-&gt;mapped) { \t\t\treturn true;\/\/QDir(parentInfo-&gt;fileInfo.absoluteFilePath()).count() &gt; 0; -- \u0442\u043e\u0447\u043d\u043e\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044f \u043d\u0435 \u043f\u0443\u0441\u0442\u0430 \t\t} \t} \treturn QAbstractItemModel::hasChildren(parent); } <\/code><\/pre>\n<p>  \u0412\u043e\u0442 \u0442\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0434\u0435\u043b\u044c \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u043f\u0430\u043f\u043a\u0438. <\/p>\n<p>  \u042f \u0434\u0443\u043c\u0430\u044e, \u043d\u0430 \u044d\u0442\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u0442\u044c, \u0434\u043b\u044f \u043f\u043e\u043b\u043d\u043e\u0442\u044b \u043a\u0430\u0440\u0442\u0438\u043d\u044b \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u044f \u0444\u0430\u0439\u043b\u043e\u0432 \u0438 \u043f\u0430\u043f\u043e\u043a, \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0439 \u0438 \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u043d\u0438\u044f \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b. \u041d\u043e \u044d\u0442\u043e \u044f\u0432\u043d\u043e \u0432\u044b\u0445\u043e\u0434\u0438\u0442 \u0437\u0430 \u0440\u0430\u043c\u043a\u0438 \u0434\u043e\u0437\u0432\u043e\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0441\u0442\u0430\u0442\u044c\u0435 \u043d\u0430 \u0445\u0430\u0431\u0440. \u0427\u0443\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u043d\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u044f \u0432\u044b\u043b\u043e\u0436\u0438\u043b \u043d\u0430 <a href=\"https:\/\/github.com\/Lol4t0\/tree-model-example\">GitHub<\/a>.    \t \t\t   \t<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/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\/172187\/\"> http:\/\/habrahabr.ru\/post\/172187\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">   \t\u041f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u044e \u0442\u0435\u043c\u0443 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c Qt MV. \u0412 <a href=\"http:\/\/habrahabr.ru\/post\/171443\/\">\u043f\u0440\u043e\u0448\u043b\u044b\u0439 \u0440\u0430\u0437<\/a> \u0431\u044b\u043b\u0430 \u043a\u0440\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u043f\u043e \u043f\u043e\u0432\u043e\u0434\u0443 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0435 \u043d\u0430\u0434\u043e. \u041f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043a \u043f\u043e\u0437\u0438\u0442\u0438\u0432\u043d\u043e\u0439 \u0447\u0430\u0441\u0442\u0438.<\/p>\n<p>  \u0414\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043f\u043b\u043e\u0441\u043a\u0438\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0441\u043f\u0438\u0441\u043a\u043e\u0432 \u0438 \u0442\u0430\u0431\u043b\u0438\u0446 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0437\u0430\u0433\u043e\u0442\u043e\u0432\u043a\u0438 <a href=\"http:\/\/qt-project.org\/doc\/qt-5.0\/qtcore\/qabstractlistmodel.html\">QAbstractListModel<\/a> \u0438 <a href=\"http:\/\/qt-project.org\/doc\/qt-5.0\/qtcore\/qabstracttablemodel.html\">QAbstractTableModel<\/a>. \u0414\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0438\u0445 \u0434\u043e \u0433\u043e\u0442\u043e\u0432\u043d\u043e\u0441\u0442\u0438 \u043d\u0435 \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u0442\u0440\u0443\u0434\u0430, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u0438\u0445 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043d\u0435\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438.<\/p>\n<p>  \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0436\u0435 \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u2013 \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430. \u041e \u043d\u0435\u0439 \u0438 \u043f\u043e\u0439\u0434\u0435\u0442 \u0440\u0435\u0447\u044c \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435. <\/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-172187","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/172187","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=172187"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/172187\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=172187"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=172187"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=172187"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}