<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-1947396704779700036</id><updated>2026-10-07T15:14:27.914+03:00</updated><category term="Qt"/><category term="PHP"/><category term="Ubuntu"/><category term="QML"/><category term="Linux"/><category term="c++"/><category term="SQL Server"/><category term="Shopping"/><category term="Buisness"/><category term="car"/><category term="WinAPI"/><category term="HTML"/><category term="JavaScript"/><category term="MFC"/><category term="C#"/><category term="Web-Kit"/><category term="Firefox"/><category term="Windows"/><category term="photo"/><category term="teach"/><category term="RegExp"/><category term="books"/><category term="С++"/><category term="Apache"/><category term="Eclipse"/><category term="GTK"/><category term="Internet"/><category term="ODBC"/><category term="OpenBox"/><category term="QtCreator"/><category term="Vi"/><category term="VirtualBox"/><category term="Web"/><category term="multi-thread"/><category term="programing"/><category term="Цитаты"/><category term="ALTlinux"/><category term="Blogger"/><category term="C"/><category term="CSS"/><category term="Cheat"/><category term="DLL"/><category term="Draw"/><category term="Films"/><category term="Flash"/><category term="GUI"/><category term="Home server"/><category term="Hotels"/><category term="IE"/><category term="Java"/><category term="KDE"/><category term="KeeTouch"/><category term="Makefile"/><category term="Music"/><category term="SQL"/><category term="SVN"/><category term="Soft"/><category term="Sound Card"/><category term="Subversion"/><category term="Travels"/><category term="Upstart"/><category term="Virtualization"/><category term="big-endian"/><category term="books links"/><category term="jQuery"/><category term="little-endian"/><category term="proxy"/><category term="shutdown"/><category term="text-editor"/><category term="vkontakte.ru"/><category term="Стихи"/><category term="тонировка"/><title type='text'>Igorkam</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://igorkam.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1947396704779700036/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://igorkam.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/1947396704779700036/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Igorka</name><uri>http://www.blogger.com/profile/03805569397781043459</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>352</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-1947396704779700036.post-7693666739189306694</id><published>2018-10-09T18:56:00.003+03:00</published><updated>2018-10-09T18:56:55.149+03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="QML"/><title type='text'>QML - в переводе добавить перенос строки</title><content type='html'>Если необходимо в ts файле перевода добавить перенос строки, то \n обычно не срабатывает.
Тогда необходимо при редактировании ts файла нажать Enter.
&lt;br&gt;
Additional info &lt;a href=&quot;https://stackoverflow.com/questions/25148147/how-to-write-text-formatting-in-translated-strings-with-qt-qt-linguist&quot;&gt;here&lt;/a&gt;.</content><link rel='replies' type='application/atom+xml' href='http://igorkam.blogspot.com/feeds/7693666739189306694/comments/default' title='Комментарии к сообщению'/><link rel='replies' type='text/html' href='http://igorkam.blogspot.com/2018/10/qml.html#comment-form' title='Комментарии: 0'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1947396704779700036/posts/default/7693666739189306694'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1947396704779700036/posts/default/7693666739189306694'/><link rel='alternate' type='text/html' href='http://igorkam.blogspot.com/2018/10/qml.html' title='QML - в переводе добавить перенос строки'/><author><name>Igorka</name><uri>http://www.blogger.com/profile/03805569397781043459</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1947396704779700036.post-6209493443448416734</id><published>2018-09-27T17:55:00.003+03:00</published><updated>2018-09-27T17:55:37.293+03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="QML"/><title type='text'>QML - set default font</title><content type='html'>If you want set font for all items in ApplicationWindow.
In main.cpp you must configure QFont and set it to QApplication.
&lt;br&gt;
&lt;pre&gt;&lt;code class=&quot;Qt&quot;&gt;
    QApplication app(argc, argv);
    QFont font;
    font.setPixelSize(20);
    app.setFont(font);
}
&lt;/code&gt;&lt;/pre&gt;
&lt;br&gt;
Additional info &lt;a href=&quot;https://forum.qt.io/topic/76023/applicationwindow-font-not-changed-by-qguiapplication-setfont/20&quot;&gt;here&lt;/a&gt;.</content><link rel='replies' type='application/atom+xml' href='http://igorkam.blogspot.com/feeds/6209493443448416734/comments/default' title='Комментарии к сообщению'/><link rel='replies' type='text/html' href='http://igorkam.blogspot.com/2018/09/qml-set-default-font.html#comment-form' title='Комментарии: 0'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1947396704779700036/posts/default/6209493443448416734'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1947396704779700036/posts/default/6209493443448416734'/><link rel='alternate' type='text/html' href='http://igorkam.blogspot.com/2018/09/qml-set-default-font.html' title='QML - set default font'/><author><name>Igorka</name><uri>http://www.blogger.com/profile/03805569397781043459</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1947396704779700036.post-2887507701613264455</id><published>2018-09-27T17:49:00.000+03:00</published><updated>2018-09-27T17:49:08.425+03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="QtCreator"/><title type='text'>QtCreator highlight current line </title><content type='html'>If you want highlight current line in editor
&lt;br&gt;
Main menu: Tools &gt; Options &gt; Text Editor &gt; Display &gt; Highlight current line</content><link rel='replies' type='application/atom+xml' href='http://igorkam.blogspot.com/feeds/2887507701613264455/comments/default' title='Комментарии к сообщению'/><link rel='replies' type='text/html' href='http://igorkam.blogspot.com/2018/09/qtcreator-highlight-current-line.html#comment-form' title='Комментарии: 0'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1947396704779700036/posts/default/2887507701613264455'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1947396704779700036/posts/default/2887507701613264455'/><link rel='alternate' type='text/html' href='http://igorkam.blogspot.com/2018/09/qtcreator-highlight-current-line.html' title='QtCreator highlight current line '/><author><name>Igorka</name><uri>http://www.blogger.com/profile/03805569397781043459</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1947396704779700036.post-1458521429082030975</id><published>2018-09-27T15:54:00.003+03:00</published><updated>2018-09-27T15:59:09.165+03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="QML"/><title type='text'>QML - SystemPalette visible in all files</title><content type='html'>If you want use system colors create static variable in special singleton object.
&lt;br&gt;
&lt;pre&gt;&lt;code class=&quot;Qt&quot;&gt;
// Style.qml
pragma Singleton
import QtQuick 2.11
QtObject {
     property SystemPalette palette: SystemPalette { colorGroup: SystemPalette.Active }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;br&gt;
And then use it.
&lt;br&gt;
&lt;pre&gt;&lt;code class=&quot;Qt&quot;&gt;
import QtQuick 2.0
Rectangle {
    color: Style.palette.highlight
}
&lt;/code&gt;&lt;/pre&gt;
&lt;br&gt;
Additional info &lt;a href=&quot;http://doc.qt.io/qt-5/qtquick-window-window-qml.html&quot;&gt;here&lt;/a&gt;.</content><link rel='replies' type='application/atom+xml' href='http://igorkam.blogspot.com/feeds/1458521429082030975/comments/default' title='Комментарии к сообщению'/><link rel='replies' type='text/html' href='http://igorkam.blogspot.com/2018/09/qml-systempalette-visible-in-all-files.html#comment-form' title='Комментарии: 0'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1947396704779700036/posts/default/1458521429082030975'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1947396704779700036/posts/default/1458521429082030975'/><link rel='alternate' type='text/html' href='http://igorkam.blogspot.com/2018/09/qml-systempalette-visible-in-all-files.html' title='QML - SystemPalette visible in all files'/><author><name>Igorka</name><uri>http://www.blogger.com/profile/03805569397781043459</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1947396704779700036.post-1644566623194656701</id><published>2018-08-30T13:44:00.003+03:00</published><updated>2018-08-30T13:47:26.051+03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="QtCreator"/><title type='text'>QtCreator - missing main menu</title><content type='html'>To open settings window in QtCreator
&lt;ul&gt;
&lt;li&gt;1. Switch to debug mode&lt;/li&gt;
&lt;li&gt;2. Right click on &#39;Name|Value|Type&#39; area&lt;/li&gt;
&lt;li&gt;3. In menu choose &#39;Configure debugger&#39;&lt;/li&gt;
&lt;li&gt;4. Configure hot keys in &#39;Envioronment&#39; tab&lt;/li&gt;
&lt;/ul&gt;
&lt;br&gt;
Additional info &lt;a href=&quot;http://www.prog.org.ru/topic_25623_0.html&quot;&gt;here&lt;/a&gt;.</content><link rel='replies' type='application/atom+xml' href='http://igorkam.blogspot.com/feeds/1644566623194656701/comments/default' title='Комментарии к сообщению'/><link rel='replies' type='text/html' href='http://igorkam.blogspot.com/2018/08/qtcreator-missing-main-menu.html#comment-form' title='Комментарии: 0'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1947396704779700036/posts/default/1644566623194656701'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1947396704779700036/posts/default/1644566623194656701'/><link rel='alternate' type='text/html' href='http://igorkam.blogspot.com/2018/08/qtcreator-missing-main-menu.html' title='QtCreator - missing main menu'/><author><name>Igorka</name><uri>http://www.blogger.com/profile/03805569397781043459</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1947396704779700036.post-2761915179174498051</id><published>2018-08-16T12:52:00.002+03:00</published><updated>2018-08-16T12:54:42.634+03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Qt"/><title type='text'>Qt - check QObject derived class type</title><content type='html'>Example of using DelegateModel for hierarchical tree of data.
&lt;br&gt;
&lt;pre&gt;&lt;code class=&quot;Qt&quot;&gt;
Tag* tag = new Tag();
Tag* tag_cast = qobject_cast&amp;lt;QObject*&amp;gt;(tag);
if(tag_cast) qDebug() &lt;&lt; &quot;Cool!&quot;;
else qDebug() &lt;&lt; &quot;oh..&quot;;
&lt;/code&gt;&lt;/pre&gt;
&lt;br&gt;
Additional info &lt;a href=&quot;https://stackoverflow.com/questions/31999376/how-to-detect-what-class-an-object-is-from-qt&quot;&gt;here&lt;/a&gt; and &lt;a href=&quot;https://stackoverflow.com/questions/1537080/proper-way-to-check-qobject-derived-class-type-in-qt&quot;&gt;here&lt;/a&gt;.</content><link rel='replies' type='application/atom+xml' href='http://igorkam.blogspot.com/feeds/2761915179174498051/comments/default' title='Комментарии к сообщению'/><link rel='replies' type='text/html' href='http://igorkam.blogspot.com/2018/08/qt-check-qobject-derived-class-type.html#comment-form' title='Комментарии: 0'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1947396704779700036/posts/default/2761915179174498051'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1947396704779700036/posts/default/2761915179174498051'/><link rel='alternate' type='text/html' href='http://igorkam.blogspot.com/2018/08/qt-check-qobject-derived-class-type.html' title='Qt - check QObject derived class type'/><author><name>Igorka</name><uri>http://www.blogger.com/profile/03805569397781043459</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1947396704779700036.post-240728273677480197</id><published>2018-07-16T18:30:00.000+03:00</published><updated>2018-07-16T18:30:40.698+03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="QML"/><title type='text'>QML - nested ListView</title><content type='html'>Example of using DelegateModel for hierarchical tree of data.
&lt;br&gt;
&lt;pre&gt;&lt;code class=&quot;QML&quot;&gt;
import QtQuick 2.0
import QtQuick.Controls 2.2
import QtQml.Models 2.3

ListView {
    id: view
    anchors.fill: parent
    focus: true
    highlight: Rectangle {
        width: view.width; height: view.currentItem.height
        y: view.currentItem.y
        color: &quot;blue&quot;
    }
    highlightFollowsCurrentItem: true
    model: DelegateModel {
        model: catalogTreeModel //common QAbstractItemModel model
        delegate: Item {
            width: view.width; height: colDlg.height
            Column {
                id: colDlg
                width: view.width
                height: itemDlg.height + subView.height
                Item {
                    id: itemDlg
                    width: view.width
                    height: childrenRect.height
                    Text { text: session }
                    MouseArea {
                        anchors.fill: parent
                        propagateComposedEvents: true
                        onClicked: {
                            view.currentIndex = index
                            subView.shown = !subView.shown
                        } //onClicked:
                    } //MouseArea
                } //Item
                ListView { // nested ListView
                    id: subView
                    property int parentIndex: index
                    property bool isParrentSelected: view.currentIndex===index
                    property bool shown: false
                    width: view.width; height: shown ? /*_rowsCount * 25*/ subView.count * 25 : 0
                    visible: shown
                    enabled: shown
                    highlight: Rectangle {
                        id: subHighlight
                        visible: subView.isParrentSelected
                        focus: true
                        color: &quot;red&quot;
                    } //highlight:
                    model: DelegateModel {
                        model: catalogTreeModel
                        rootIndex: view.model.modelIndex(subView.parentIndex) // change root index for nested branch
                        delegate: Item {
                            width: view.width; height: txt.contentHeight
                            Text { id: txt; text: session }
                            MouseArea {
                                anchors.fill: parent
                                z: 1
                                hoverEnabled: true
                                propagateComposedEvents: true
                                onClicked: {
                                    subView.currentIndex = index
                                    view.currentIndex = subView.parentIndex
                                } //onClicked:
                            } //MouseArea
                        } //delegate:
                    } //model
                } //ListView
            } //Column
        } //delegate:
    } //model:
} //ListView&lt;/code&gt;&lt;/pre&gt;
&lt;br&gt;
Additional info &lt;a href=&quot;http://doc.qt.io/qt-5/qml-qtqml-models-delegatemodel.html#rootIndex-prop&quot;&gt;here&lt;/a&gt;.</content><link rel='replies' type='application/atom+xml' href='http://igorkam.blogspot.com/feeds/240728273677480197/comments/default' title='Комментарии к сообщению'/><link rel='replies' type='text/html' href='http://igorkam.blogspot.com/2018/07/qml-nested-listview.html#comment-form' title='Комментарии: 0'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1947396704779700036/posts/default/240728273677480197'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1947396704779700036/posts/default/240728273677480197'/><link rel='alternate' type='text/html' href='http://igorkam.blogspot.com/2018/07/qml-nested-listview.html' title='QML - nested ListView'/><author><name>Igorka</name><uri>http://www.blogger.com/profile/03805569397781043459</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1947396704779700036.post-7445711479468913826</id><published>2018-04-06T11:50:00.001+03:00</published><updated>2018-04-06T11:54:42.412+03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="KDE"/><title type='text'>KDE - одинаковые панели на каждом экране</title><content type='html'>При подключении второго монитора в KDE обычно системная панель не появляется, поэтому ее необходимо добавить.&lt;br&gt;
&amp;nbsp;- На экране нажимаем правую кнопку мыши.&lt;br&gt;
&amp;nbsp;&amp;nbsp;    Add Panel &gt; Default panel (если вы хотите настроить свою панель выберите Application Menu Bar)&lt;br&gt;
&amp;nbsp;- Если панель появилась не на нужной стороне:&lt;br&gt;
&amp;nbsp;&amp;nbsp;    Правой кнопкой мыши по панели.&lt;br&gt;
&amp;nbsp;&amp;nbsp;    Panel Options &gt; Panel Settings&lt;br&gt;
&amp;nbsp;&amp;nbsp;    Нажимаем на Screen Edge и тащим к нужной грани экрана.&lt;br&gt;
&lt;br&gt;
Более подробно &lt;a href=&quot;https://forum.manjaro.org/t/dual-monitors-how-to-get-the-same-default-panel-on-each-screen/3624&quot;&gt;тут&lt;/a&gt;.</content><link rel='replies' type='application/atom+xml' href='http://igorkam.blogspot.com/feeds/7445711479468913826/comments/default' title='Комментарии к сообщению'/><link rel='replies' type='text/html' href='http://igorkam.blogspot.com/2018/04/kde.html#comment-form' title='Комментарии: 0'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1947396704779700036/posts/default/7445711479468913826'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1947396704779700036/posts/default/7445711479468913826'/><link rel='alternate' type='text/html' href='http://igorkam.blogspot.com/2018/04/kde.html' title='KDE - одинаковые панели на каждом экране'/><author><name>Igorka</name><uri>http://www.blogger.com/profile/03805569397781043459</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1947396704779700036.post-1699258444313994116</id><published>2018-04-02T12:32:00.001+03:00</published><updated>2018-04-02T12:32:13.803+03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="QML"/><title type='text'>QQuickItem добавить дочерний элемент</title><content type='html'>Если необходимо чтобы один элемент рисовал поверх другого, то его необходимо сделать потомком. 
Это можно сделать передав родительский QQuickItem в конструктор потомка или вызвав метод setParentItem(parent) в потомке.
&lt;br&gt;
Более подробно &lt;a href=&quot;https://stackoverflow.com/questions/27249247/qt-quick-cannot-render-qquickpainteditems-children&quot;&gt;тут&lt;/a&gt;.</content><link rel='replies' type='application/atom+xml' href='http://igorkam.blogspot.com/feeds/1699258444313994116/comments/default' title='Комментарии к сообщению'/><link rel='replies' type='text/html' href='http://igorkam.blogspot.com/2018/04/qquickitem.html#comment-form' title='Комментарии: 0'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1947396704779700036/posts/default/1699258444313994116'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1947396704779700036/posts/default/1699258444313994116'/><link rel='alternate' type='text/html' href='http://igorkam.blogspot.com/2018/04/qquickitem.html' title='QQuickItem добавить дочерний элемент'/><author><name>Igorka</name><uri>http://www.blogger.com/profile/03805569397781043459</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1947396704779700036.post-6059633748051180512</id><published>2018-03-29T17:52:00.001+03:00</published><updated>2018-03-29T17:52:21.099+03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Qt"/><title type='text'>Qt - QAbstractItemModel обновить при добавлении содержимого</title><content type='html'>Для обновления связанных с моделью представлений необходимо использовать beginInsertRows() endInsertRows() во время добавления данных.
А в конце еще выпустить сигнал dataChanged().
&lt;br&gt;
Более подробно &lt;a href=&quot;http://www.qtcentre.org/threads/48230-QTreeView-How-to-refresh-the-view&quot;&gt;тут&lt;/a&gt;.</content><link rel='replies' type='application/atom+xml' href='http://igorkam.blogspot.com/feeds/6059633748051180512/comments/default' title='Комментарии к сообщению'/><link rel='replies' type='text/html' href='http://igorkam.blogspot.com/2018/03/qt-qabstractitemmodel.html#comment-form' title='Комментарии: 0'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1947396704779700036/posts/default/6059633748051180512'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1947396704779700036/posts/default/6059633748051180512'/><link rel='alternate' type='text/html' href='http://igorkam.blogspot.com/2018/03/qt-qabstractitemmodel.html' title='Qt - QAbstractItemModel обновить при добавлении содержимого'/><author><name>Igorka</name><uri>http://www.blogger.com/profile/03805569397781043459</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1947396704779700036.post-1877545778525409881</id><published>2018-03-29T17:17:00.002+03:00</published><updated>2018-03-29T17:17:32.628+03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="QML"/><title type='text'>QML - TreeView скроллинг к текущему элементу</title><content type='html'>Если размер содержимого превышает размер TableView необходимо проскроллировать до текущего элемента.
Для этого необходимо использовать скрытую переменную __listView.
&lt;br&gt;
&lt;pre&gt;&lt;code class=&quot;QML&quot;&gt;
    __listView.positionViewAtIndex(row, mode)
&lt;/code&gt;&lt;/pre&gt;
&lt;br&gt;
Более подробно &lt;a href=&quot;https://forum.qt.io/topic/59132/solved-scroll-to-item-in-treeview&quot;&gt;тут&lt;/a&gt;.</content><link rel='replies' type='application/atom+xml' href='http://igorkam.blogspot.com/feeds/1877545778525409881/comments/default' title='Комментарии к сообщению'/><link rel='replies' type='text/html' href='http://igorkam.blogspot.com/2018/03/qml-treeview_29.html#comment-form' title='Комментарии: 0'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1947396704779700036/posts/default/1877545778525409881'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1947396704779700036/posts/default/1877545778525409881'/><link rel='alternate' type='text/html' href='http://igorkam.blogspot.com/2018/03/qml-treeview_29.html' title='QML - TreeView скроллинг к текущему элементу'/><author><name>Igorka</name><uri>http://www.blogger.com/profile/03805569397781043459</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1947396704779700036.post-8497229444731545661</id><published>2018-03-29T11:31:00.006+03:00</published><updated>2018-03-29T11:31:58.881+03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="QML"/><title type='text'>QML - ListView прокрутить до выбранного значения</title><content type='html'>Если содержимое ListView превышает его размеры, то возможно понадобится программно совершить прокрутку до выделенного элемента, для этого используется positionViewAtIndex
&lt;br&gt;
&lt;pre&gt;&lt;code class=&quot;QML&quot;&gt;
   ListView {
        id: listView
        onCurrentIndexChanged: {
            positionViewAtIndex(currentIndex, ListView.Visible)
        }
   }
&lt;/code&gt;&lt;/pre&gt;
&lt;br&gt;
Более подробно &lt;a href=&quot;https://forum.qt.io/topic/59132/solved-scroll-to-item-in-treeview&quot;&gt;тут&lt;/a&gt;.</content><link rel='replies' type='application/atom+xml' href='http://igorkam.blogspot.com/feeds/8497229444731545661/comments/default' title='Комментарии к сообщению'/><link rel='replies' type='text/html' href='http://igorkam.blogspot.com/2018/03/qml-listview_29.html#comment-form' title='Комментарии: 0'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1947396704779700036/posts/default/8497229444731545661'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1947396704779700036/posts/default/8497229444731545661'/><link rel='alternate' type='text/html' href='http://igorkam.blogspot.com/2018/03/qml-listview_29.html' title='QML - ListView прокрутить до выбранного значения'/><author><name>Igorka</name><uri>http://www.blogger.com/profile/03805569397781043459</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1947396704779700036.post-6882268523994958794</id><published>2018-03-29T11:21:00.001+03:00</published><updated>2018-03-29T11:21:15.108+03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="QML"/><title type='text'>QML - TreeView выделить строку программно</title><content type='html'>Если есть необходимость выделить строку из JavaScript необходимо использовать selection.setCurrentIndex.
&lt;br&gt;
&lt;pre&gt;&lt;code class=&quot;QML&quot;&gt;
import QtQml.Models 2.2

TreeView {
    id: viewPerSe
    selection: ItemSelectionModel {
        model: viewPerSe.model
    }
}
function select (idx) {
    viewPerSe.selection.setCurrentIndex(idx, ItemSelectionModel.ClearAndSelect)
}
&lt;/code&gt;&lt;/pre&gt;
&lt;br&gt;
Более подробно &lt;a href=&quot;https://forum.qt.io/topic/54216/qml-treeview-set-active-item&quot;&gt;тут&lt;/a&gt; и &lt;a href=&quot;http://doc.qt.io/qt-5/qml-qtquick-controls-treeview.html#selection-prop&quot;&gt;тут&lt;/a&gt;.</content><link rel='replies' type='application/atom+xml' href='http://igorkam.blogspot.com/feeds/6882268523994958794/comments/default' title='Комментарии к сообщению'/><link rel='replies' type='text/html' href='http://igorkam.blogspot.com/2018/03/qml-treeview.html#comment-form' title='Комментарии: 0'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1947396704779700036/posts/default/6882268523994958794'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1947396704779700036/posts/default/6882268523994958794'/><link rel='alternate' type='text/html' href='http://igorkam.blogspot.com/2018/03/qml-treeview.html' title='QML - TreeView выделить строку программно'/><author><name>Igorka</name><uri>http://www.blogger.com/profile/03805569397781043459</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1947396704779700036.post-9132584792769881232</id><published>2018-03-19T12:28:00.000+03:00</published><updated>2018-03-19T12:28:03.711+03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="QML"/><title type='text'>QML - TableViewColumn delegate вывести значение роли</title><content type='html'>Если необходимо переписать делегат, и вывести значение содержащееся в роли можно воспользоваться специальным свойством styleData.value.
&lt;br&gt;
&lt;pre&gt;&lt;code class=&quot;QML&quot;&gt;
delegate: {
   Text { text: styleData.value }
}&lt;/code&gt;&lt;/pre&gt;
&lt;br&gt;
Более подробно &lt;a href=&quot;https://stackoverflow.com/questions/19577210/how-to-access-data-in-qml-tableviewcolumn-delegate&quot;&gt;тут&lt;/a&gt; и &lt;a href=&quot;http://doc.qt.io/qt-5/qml-qtquick-controls-tableviewcolumn.html#delegate-prop&quot;&gt;тут&lt;/a&gt;.</content><link rel='replies' type='application/atom+xml' href='http://igorkam.blogspot.com/feeds/9132584792769881232/comments/default' title='Комментарии к сообщению'/><link rel='replies' type='text/html' href='http://igorkam.blogspot.com/2018/03/qml-tableviewcolumn-delegate.html#comment-form' title='Комментарии: 0'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1947396704779700036/posts/default/9132584792769881232'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1947396704779700036/posts/default/9132584792769881232'/><link rel='alternate' type='text/html' href='http://igorkam.blogspot.com/2018/03/qml-tableviewcolumn-delegate.html' title='QML - TableViewColumn delegate вывести значение роли'/><author><name>Igorka</name><uri>http://www.blogger.com/profile/03805569397781043459</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1947396704779700036.post-1365031048573084700</id><published>2018-03-15T18:02:00.001+03:00</published><updated>2018-03-15T18:44:03.233+03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="QML"/><title type='text'>QML - перенаправить вывод в свой C++ обработчик </title><content type='html'>Если есть необходимость использовать например свой логгер.
Если это делать на стороне QML то могут возникнуть сложности с получением контекста, который хранит информацию о файле и строке.
По аналогии с макросами __LINE__ __FILE__ в C++.
Единственный найденный вариант это подменить обработчик сообщений методом qInstallMessageHandler().
&lt;br&gt;
&lt;pre&gt;&lt;code class=&quot;QML&quot;&gt;
#include &lt;qapplication.h&gt;
#include &lt;stdio.h&gt;
#include &lt;stdlib.h&gt;

void myMessageOutput(QtMsgType type, const QMessageLogContext &amp;context, const QString &amp;msg)
{
    QByteArray localMsg = msg.toLocal8Bit();
    switch (type) {
    case QtDebugMsg:
        fprintf(stderr, &quot;Debug: %s (%s:%u, %s)\n&quot;, localMsg.constData(), context.file, context.line, context.function);
        break;
    case QtInfoMsg:
        fprintf(stderr, &quot;Info: %s (%s:%u, %s)\n&quot;, localMsg.constData(), context.file, context.line, context.function);
        break;
    case QtWarningMsg:
        fprintf(stderr, &quot;Warning: %s (%s:%u, %s)\n&quot;, localMsg.constData(), context.file, context.line, context.function);
        break;
    case QtCriticalMsg:
        fprintf(stderr, &quot;Critical: %s (%s:%u, %s)\n&quot;, localMsg.constData(), context.file, context.line, context.function);
        break;
    case QtFatalMsg:
        fprintf(stderr, &quot;Fatal: %s (%s:%u, %s)\n&quot;, localMsg.constData(), context.file, context.line, context.function);
        abort();
    }
}

int main(int argc, char **argv)
{
    qInstallMessageHandler(myMessageOutput);
    QApplication app(argc, argv);
    ...
    return app.exec();
}&lt;/code&gt;&lt;/pre&gt;
&lt;br&gt;
Более подробно &lt;a href=&quot;http://doc.qt.io/qt-5/qtglobal.html#qInstallMessageHandler&quot;&gt;тут&lt;/a&gt;, &lt;a href=&quot;https://stackoverflow.com/questions/41340692/line-file-or-similar-function-in-qml?rq=1&quot;&gt;тут&lt;/a&gt;, &lt;a href=&quot;https://stackoverflow.com/questions/4954140/how-to-redirect-qdebug-qwarning-qcritical-etc-output&quot;&gt;тут&lt;/a&gt; и &lt;a href=&quot;https://stackoverflow.com/questions/24012108/qdebug-not-showing-file-line&quot;&gt;тут&lt;/a&gt;.</content><link rel='replies' type='application/atom+xml' href='http://igorkam.blogspot.com/feeds/1365031048573084700/comments/default' title='Комментарии к сообщению'/><link rel='replies' type='text/html' href='http://igorkam.blogspot.com/2018/03/qml-c.html#comment-form' title='Комментарии: 0'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1947396704779700036/posts/default/1365031048573084700'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1947396704779700036/posts/default/1365031048573084700'/><link rel='alternate' type='text/html' href='http://igorkam.blogspot.com/2018/03/qml-c.html' title='QML - перенаправить вывод в свой C++ обработчик '/><author><name>Igorka</name><uri>http://www.blogger.com/profile/03805569397781043459</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1947396704779700036.post-8356847933802369177</id><published>2018-03-13T15:58:00.001+03:00</published><updated>2018-03-13T15:58:26.612+03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Qt"/><title type='text'>QBS - прописать define</title><content type='html'>Для прописывания define в QBS есть модуль cpp, в который можно прописать необходимые дефайны разделенные запятой.
&lt;br&gt;
&lt;pre&gt;&lt;code class=&quot;QML&quot;&gt;
        cpp.defines: [&quot;CONFIG__H&quot;,&quot;QML_VER&quot;]
&lt;/code&gt;&lt;/pre&gt;
&lt;br&gt;
Более подробно &lt;a href=&quot;http://doc.qt.io/qbs/cpp-module.html&quot;&gt;тут&lt;/a&gt;.</content><link rel='replies' type='application/atom+xml' href='http://igorkam.blogspot.com/feeds/8356847933802369177/comments/default' title='Комментарии к сообщению'/><link rel='replies' type='text/html' href='http://igorkam.blogspot.com/2018/03/qbs-define.html#comment-form' title='Комментарии: 0'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1947396704779700036/posts/default/8356847933802369177'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1947396704779700036/posts/default/8356847933802369177'/><link rel='alternate' type='text/html' href='http://igorkam.blogspot.com/2018/03/qbs-define.html' title='QBS - прописать define'/><author><name>Igorka</name><uri>http://www.blogger.com/profile/03805569397781043459</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1947396704779700036.post-3156777673240931278</id><published>2018-03-06T13:58:00.004+03:00</published><updated>2018-03-06T13:58:54.720+03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="QML"/><title type='text'>QML - Button сделать нажатой</title><content type='html'>Если необходимо после нажатия на Button оставить ее в нажатом состоянии.
Можно установить свойство down в true.
&lt;br&gt;
&lt;pre&gt;&lt;code class=&quot;QML&quot;&gt;
            Button {
                id: but
                text: qsTr(&quot;Text&quot;)
                width: implicitWidth
                height: implicitHeight
                onClicked: {
                        down = true // button is visually down
                        checked = true // button is checked
                }
            }
&lt;/code&gt;&lt;/pre&gt;
&lt;br&gt;
Более подробно &lt;a href=&quot;http://www.qtcentre.org/threads/57186-How-to-deal-with-continuously-pressed-state-of-the-button-image-in-QML&quot;&gt;тут&lt;/a&gt;.</content><link rel='replies' type='application/atom+xml' href='http://igorkam.blogspot.com/feeds/3156777673240931278/comments/default' title='Комментарии к сообщению'/><link rel='replies' type='text/html' href='http://igorkam.blogspot.com/2018/03/qml-button.html#comment-form' title='Комментарии: 0'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1947396704779700036/posts/default/3156777673240931278'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1947396704779700036/posts/default/3156777673240931278'/><link rel='alternate' type='text/html' href='http://igorkam.blogspot.com/2018/03/qml-button.html' title='QML - Button сделать нажатой'/><author><name>Igorka</name><uri>http://www.blogger.com/profile/03805569397781043459</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1947396704779700036.post-7627795843051327782</id><published>2018-03-05T11:32:00.000+03:00</published><updated>2018-03-05T11:32:01.859+03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="QML"/><title type='text'>QML - vertical TabBar</title><content type='html'>Если необходимо повернуть панель вертикально, то могут быть сложности с привязкой к соседним элементам. 
Т.к. похоже размеры повернутого элемента не пересчитываются и соседний элемент находится на расстоянии как будто панель не повернута.
Для этого панель необходимо положить на элемент у которого размеры заданны заранее и тогда у соседнего элемента привязки будут рассчитаны корректно.
&lt;br&gt;
&lt;pre&gt;&lt;code class=&quot;QML&quot;&gt;
import QtQuick 2.0

            Item { //base component
                id: baseBar
                width: but1.height // width as TabBar height before rotation
                height: parent.height
                TabBar {
                    id: modeBar1
                    width: parent.height
                    height: but1.height

                    transform: [
                        Rotation { origin.x: 0; origin.y: 0; angle: -90} // rotate around the upper left corner counterclockwise
                        ,Translate { y: baseBar.height; x: 0 } // move to the bottom of the base
                    ]

                    TabButton {
                        id: but1
                        text: qsTr(&quot;Button1&quot;)
                    }
                    TabButton {
                        text: qsTr(&quot;Button2&quot;)
                } //TabBar
            } //Item
&lt;/code&gt;&lt;/pre&gt;
&lt;br&gt;
Более подробно &lt;a href=&quot;https://stackoverflow.com/questions/41130615/offset-rotation-for-qml-item&quot;&gt;тут&lt;/a&gt;.</content><link rel='replies' type='application/atom+xml' href='http://igorkam.blogspot.com/feeds/7627795843051327782/comments/default' title='Комментарии к сообщению'/><link rel='replies' type='text/html' href='http://igorkam.blogspot.com/2018/03/qml-vertical-tabbar.html#comment-form' title='Комментарии: 0'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1947396704779700036/posts/default/7627795843051327782'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1947396704779700036/posts/default/7627795843051327782'/><link rel='alternate' type='text/html' href='http://igorkam.blogspot.com/2018/03/qml-vertical-tabbar.html' title='QML - vertical TabBar'/><author><name>Igorka</name><uri>http://www.blogger.com/profile/03805569397781043459</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1947396704779700036.post-95660444087953824</id><published>2018-03-02T13:03:00.001+03:00</published><updated>2018-03-02T13:03:15.909+03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="QML"/><title type='text'>QML - ListView highlight не виден</title><content type='html'>Возможно вы по ошибке в делегате используете Rectangle вместо Item.
Тогда либо необходимо в Rectangle указать color: &quot;transparent&quot; либо заменить Rectangle на Item.
&lt;br&gt;
Более подробно &lt;a href=&quot;http://www.qtcentre.org/threads/52350-QML-ListView-and-Frustration&quot;&gt;тут&lt;/a&gt; и &lt;a href=&quot;https://stackoverflow.com/questions/19068794/rectangle-in-qml-that-is-transparent-except-for-the-borders&quot;&gt;тут&lt;/a&gt;.</content><link rel='replies' type='application/atom+xml' href='http://igorkam.blogspot.com/feeds/95660444087953824/comments/default' title='Комментарии к сообщению'/><link rel='replies' type='text/html' href='http://igorkam.blogspot.com/2018/03/qml-listview-highlight.html#comment-form' title='Комментарии: 0'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1947396704779700036/posts/default/95660444087953824'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1947396704779700036/posts/default/95660444087953824'/><link rel='alternate' type='text/html' href='http://igorkam.blogspot.com/2018/03/qml-listview-highlight.html' title='QML - ListView highlight не виден'/><author><name>Igorka</name><uri>http://www.blogger.com/profile/03805569397781043459</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1947396704779700036.post-3443367420052947017</id><published>2018-03-01T18:36:00.003+03:00</published><updated>2018-03-01T18:36:59.512+03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="QML"/><title type='text'>QML - определить что обьект принадлежит определенному типу</title><content type='html'>Начиная с Qt 5.10 появилась возможность проверять тип обьекта
&lt;br&gt;
&lt;pre&gt;&lt;code class=&quot;QML&quot;&gt;
import QtQuick 2.0

Item {
  // two QML items, used for type checking
  Item { id: testItem }
  Rectangle { id: testRect }

  // function to check wheter an item is a Rectangle
  function isRectangle(item) {
    return item instanceof Rectangle
  }

  // type check example
  Component.onCompleted: {
    console.log(&quot;testItem is Rectangle? &quot;+isRectangle(testItem))
    console.log(&quot;testRect is Rectangle? &quot;+isRectangle(testRect))
  }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;br&gt;
Более подробно &lt;a href=&quot;http://doc.qt.io/qt-5/qtqml-javascript-hostenvironment.html&quot;&gt;тут&lt;/a&gt; и &lt;a href=&quot;https://stackoverflow.com/questions/13923794/how-to-do-a-is-a-typeof-or-instanceof-in-qml&quot;&gt;тут&lt;/a&gt;.</content><link rel='replies' type='application/atom+xml' href='http://igorkam.blogspot.com/feeds/3443367420052947017/comments/default' title='Комментарии к сообщению'/><link rel='replies' type='text/html' href='http://igorkam.blogspot.com/2018/03/qml.html#comment-form' title='Комментарии: 0'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1947396704779700036/posts/default/3443367420052947017'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1947396704779700036/posts/default/3443367420052947017'/><link rel='alternate' type='text/html' href='http://igorkam.blogspot.com/2018/03/qml.html' title='QML - определить что обьект принадлежит определенному типу'/><author><name>Igorka</name><uri>http://www.blogger.com/profile/03805569397781043459</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1947396704779700036.post-6991912236764189201</id><published>2018-03-01T15:45:00.002+03:00</published><updated>2018-03-02T14:57:24.858+03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="QML"/><title type='text'>QML - ListView перемещение области просмотра вслед за курсором</title><content type='html'>Если по каким-то причинам, при листании клавишами, курсор уходит за край вьюпорта, возможно стоит принудительно вызвать функцию positionViewAtIndex()
&lt;br&gt;
&lt;pre&gt;&lt;code class=&quot;QML&quot;&gt;
    ListView {
        id: list_view
        anchors.fill: parent
        focus: true //
        Keys.onUpPressed: decrementCurrentIndex() //перемещение стрелками
        Keys.onDownPressed: incrementCurrentIndex() //перемещение стрелками
        model: myModel
        onCurrentIndexChanged: {
            positionViewAtIndex(currentIndex, ListView.Visible)
        }
    } //ListView
&lt;/code&gt;&lt;/pre&gt;
&lt;br&gt;
Более подробно &lt;a href=&quot;http://doc.qt.io/qt-5/qml-qtquick-listview.html#positionViewAtIndex-method&quot;&gt;тут&lt;/a&gt; и &lt;a href=&quot;https://stackoverflow.com/questions/40818593/how-to-scroll-list-view-to-the-current-item&quot;&gt;тут&lt;/a&gt;.</content><link rel='replies' type='application/atom+xml' href='http://igorkam.blogspot.com/feeds/6991912236764189201/comments/default' title='Комментарии к сообщению'/><link rel='replies' type='text/html' href='http://igorkam.blogspot.com/2018/03/qml-listview.html#comment-form' title='Комментарии: 0'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1947396704779700036/posts/default/6991912236764189201'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1947396704779700036/posts/default/6991912236764189201'/><link rel='alternate' type='text/html' href='http://igorkam.blogspot.com/2018/03/qml-listview.html' title='QML - ListView перемещение области просмотра вслед за курсором'/><author><name>Igorka</name><uri>http://www.blogger.com/profile/03805569397781043459</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1947396704779700036.post-8029947631638964900</id><published>2018-02-28T17:44:00.000+03:00</published><updated>2018-02-28T17:44:08.673+03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="QML"/><title type='text'>QML - ListView включить обработку нажатия клавиш</title><content type='html'>Для включения обработки нажатия клавиш необходимо добавить соответствующий обработчик, например Keys.onUpPressed.
И если этого оказалось недостаточно в событии onCompleted вызвать функцию forceActiveFocus().
Эта функция обходит дерево всех FocusScope и устанавливает focus: true а для последнего activeFocus: true. 
Так как только в такой конфигурации работают обработчики нажатия клавиш.
&lt;br&gt;
&lt;pre&gt;&lt;code class=&quot;QML&quot;&gt;
    ListView {
        id: list_view
        anchors.fill: parent
        focus: true //
        Keys.onUpPressed: decrementCurrentIndex() //перемещение стрелками
        Keys.onDownPressed: incrementCurrentIndex() //перемещение стрелками
        model: myModel
        Component.onCompleted: {
            forceActiveFocus(); //необходимо для обработки нажатия клавиш
            console.log(&quot;listView activeFocus: &quot;+activeFocus)
        }
    } //ListView
&lt;/code&gt;&lt;/pre&gt;
&lt;br&gt;
Более подробно &lt;a href=&quot;http://www.qtcentre.org/threads/66916-qml-listView-key-navigation-not-working-setting-focus-true&quot;&gt;тут&lt;/a&gt; и &lt;a href=&quot;https://stackoverflow.com/questions/43487731/forceactivefocus-vs-focus-true-in-qml&quot;&gt;тут&lt;/a&gt;.</content><link rel='replies' type='application/atom+xml' href='http://igorkam.blogspot.com/feeds/8029947631638964900/comments/default' title='Комментарии к сообщению'/><link rel='replies' type='text/html' href='http://igorkam.blogspot.com/2018/02/qml-listview_28.html#comment-form' title='Комментарии: 0'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1947396704779700036/posts/default/8029947631638964900'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1947396704779700036/posts/default/8029947631638964900'/><link rel='alternate' type='text/html' href='http://igorkam.blogspot.com/2018/02/qml-listview_28.html' title='QML - ListView включить обработку нажатия клавиш'/><author><name>Igorka</name><uri>http://www.blogger.com/profile/03805569397781043459</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1947396704779700036.post-8014693064181823824</id><published>2018-02-21T12:21:00.000+03:00</published><updated>2018-02-21T12:21:07.973+03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="QML"/><title type='text'>QML - ListView удалить пропуски если делегат содержит пустое значение</title><content type='html'>Может создастся ситуация, когда модель возвращает пустое(NULL) значение.
И в ListView появляются пустые строки.
Для того, чтобы их скрыть необходимо в делегате установить параметры visible и enabled в false.
&lt;br&gt;
&lt;pre&gt;&lt;code class=&quot;QML&quot;&gt;
ListView {
    anchors.fill: parent
    delegate: Rectangle {
        width: model.vis ? 100 : 0
        height: model.vis ? 62 : 0
        visible: model.vis
        enabled: model.vis
        Rectangle {
            anchors.fill: parent
            color: model.rectcolor
        }
    }
    model: ListModel {
        ListElement {
            rectcolor: &quot;red&quot;
            vis:true
        }
        ListElement {
            rectcolor: &quot;green&quot;
            vis:false
        }
        ListElement {
         rectcolor: &quot;brown&quot;
         vis:true
        }
    }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;br&gt;
Более подробно &lt;a href=&quot;https://stackoverflow.com/questions/19207913/removing-empty-spaces-when-the-delegate-is-not-visible-in-a-gridview/&quot;&gt;тут&lt;/a&gt;.</content><link rel='replies' type='application/atom+xml' href='http://igorkam.blogspot.com/feeds/8014693064181823824/comments/default' title='Комментарии к сообщению'/><link rel='replies' type='text/html' href='http://igorkam.blogspot.com/2018/02/qml-listview_21.html#comment-form' title='Комментарии: 0'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1947396704779700036/posts/default/8014693064181823824'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1947396704779700036/posts/default/8014693064181823824'/><link rel='alternate' type='text/html' href='http://igorkam.blogspot.com/2018/02/qml-listview_21.html' title='QML - ListView удалить пропуски если делегат содержит пустое значение'/><author><name>Igorka</name><uri>http://www.blogger.com/profile/03805569397781043459</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1947396704779700036.post-4622362057155780581</id><published>2018-02-20T19:41:00.004+03:00</published><updated>2018-02-20T19:41:47.821+03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="QML"/><title type='text'>QML - динамическое связывание свойств</title><content type='html'>Механизм property binding не распространяется на свойства, которые получают свои значения из JavaScript функций. Для того, чтобы заработал property binding, надо обернуть JavScript-функцию конструкцией Qt.binding( ... )
&lt;br&gt;
&lt;pre&gt;&lt;code class=&quot;QML&quot;&gt;
Keys.onSpacePressed: {
        height = Qt.binding(function() { return width * 3 })
    }
&lt;/code&gt;&lt;/pre&gt;
&lt;br&gt;
Более подробно &lt;a href=&quot;http://www.prog.org.ru/topic_31860_0.html&quot;&gt;тут&lt;/a&gt; и &lt;a href=&quot;http://doc.qt.io/qt-5/qtqml-syntax-propertybinding.html&quot;&gt;тут&lt;/a&gt;.</content><link rel='replies' type='application/atom+xml' href='http://igorkam.blogspot.com/feeds/4622362057155780581/comments/default' title='Комментарии к сообщению'/><link rel='replies' type='text/html' href='http://igorkam.blogspot.com/2018/02/qml_20.html#comment-form' title='Комментарии: 0'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1947396704779700036/posts/default/4622362057155780581'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1947396704779700036/posts/default/4622362057155780581'/><link rel='alternate' type='text/html' href='http://igorkam.blogspot.com/2018/02/qml_20.html' title='QML - динамическое связывание свойств'/><author><name>Igorka</name><uri>http://www.blogger.com/profile/03805569397781043459</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1947396704779700036.post-2589702595551308296</id><published>2018-02-20T16:28:00.000+03:00</published><updated>2018-02-21T11:59:00.080+03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="QML"/><title type='text'>QML - ListView сворачивать/разворачивать секции</title><content type='html'>Для этого необходимо создать свои сигнал и слот, через коннект которых передавать выбранную секцию.
&lt;br&gt;
&lt;pre&gt;&lt;code class=&quot;QML&quot;&gt;
Rectangle {
    id: container
    width: 300
    height: 360

    ListModel {
        id: animalsModel
        ListElement { name: &quot;Ant&quot;; size: &quot;Tiny&quot; }
        ListElement { name: &quot;Flea&quot;; size: &quot;Tiny&quot; }
        ListElement { name: &quot;Parrot&quot;; size: &quot;Small&quot; }
        ListElement { name: &quot;Guinea pig&quot;; size: &quot;Small&quot; }
        ListElement { name: &quot;Rat&quot;; size: &quot;Small&quot; }
        ListElement { name: &quot;Butterfly&quot;; size: &quot;Small&quot; }
        ListElement { name: &quot;Dog&quot;; size: &quot;Medium&quot; }
        ListElement { name: &quot;Cat&quot;; size: &quot;Medium&quot; }
        ListElement { name: &quot;Pony&quot;; size: &quot;Medium&quot; }
        ListElement { name: &quot;Koala&quot;; size: &quot;Medium&quot; }
        ListElement { name: &quot;Horse&quot;; size: &quot;Large&quot; }
        ListElement { name: &quot;Tiger&quot;; size: &quot;Large&quot; }
        ListElement { name: &quot;Giraffe&quot;; size: &quot;Large&quot; }
        ListElement { name: &quot;Elephant&quot;; size: &quot;Huge&quot; }
        ListElement { name: &quot;Whale&quot;; size: &quot;Huge&quot; }
    }

    // The delegate for each section header
    Component {
        id: sectionHeading
        Rectangle {
            id: sectionHeadingRectangle
            width: container.width
            height: childrenRect.height
            color: &quot;lightsteelblue&quot;

            Text {
                text: section
                font.bold: true
                font.pixelSize: 20;
            }
            MouseArea {
                anchors.fill: parent
                onClicked: view.sectionClicked(section)
            }
        }
    }

    Component {
        id: section
        Rectangle {
            id: rect
            width: container.width
            height: shown ? mainText.height : 0
            visible: shown
            property bool shown: true

            Text { id: mainText; text: name; font.pixelSize: 18 }
            Connections {
                target: rect.ListView.view
                onSectionClicked: if (rect.ListView.section === name) shown = !shown;
            }
        }
    }

    ListView {
        id: view
        anchors.fill: parent
        // width: parent.width
        signal sectionClicked(string name)
        model: animalsModel
        delegate: section
        section.property: &quot;size&quot;
        section.criteria: ViewSection.FullString
        section.delegate: sectionHeading
    }
}&lt;/code&gt;&lt;/pre&gt;
&lt;br&gt;
Более подробно &lt;a href=&quot;https://stackoverflow.com/questions/29647291/qt-qml-listview-visible&quot;&gt;тут&lt;/a&gt; и &lt;a href=&quot;https://forum.qt.io/topic/53275/qml-listview-visible&quot;&gt;тут&lt;/a&gt;.</content><link rel='replies' type='application/atom+xml' href='http://igorkam.blogspot.com/feeds/2589702595551308296/comments/default' title='Комментарии к сообщению'/><link rel='replies' type='text/html' href='http://igorkam.blogspot.com/2018/02/qml-listview_20.html#comment-form' title='Комментарии: 0'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1947396704779700036/posts/default/2589702595551308296'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1947396704779700036/posts/default/2589702595551308296'/><link rel='alternate' type='text/html' href='http://igorkam.blogspot.com/2018/02/qml-listview_20.html' title='QML - ListView сворачивать/разворачивать секции'/><author><name>Igorka</name><uri>http://www.blogger.com/profile/03805569397781043459</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>