<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Crash with Qt6.11.1 and VerticalHeaderView]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">I've got the following example code:<br />
<strong>main.cpp:</strong></p>
<pre><code>#include "tablemodel.h"
#include &lt;QGuiApplication&gt;
#include &lt;QQmlApplicationEngine&gt;

int main(int argc, char *argv[]) {
  QGuiApplication app(argc, argv);

  qmlRegisterType&lt;TableModel&gt;("Models", 1, 0, "TableModel");

  QQmlApplicationEngine engine;
  QObject::connect(
      &amp;engine, &amp;QQmlApplicationEngine::objectCreationFailed, &amp;app, []() { QCoreApplication::exit(-1); },
      Qt::QueuedConnection);
  engine.loadFromModule("MatrixView", "Main");

  return QGuiApplication::exec();
}
</code></pre>
<p dir="auto"><strong>tablemodel.h:</strong></p>
<pre><code>#pragma once

#include &lt;QAbstractTableModel&gt;

class TableModel : public QAbstractTableModel {
public:
  enum RoleNames { NameRole = Qt::UserRole };
  explicit TableModel(QObject *parent = nullptr) : QAbstractTableModel{parent} {}

  // QAbstractItemModel interface
public:
  int rowCount(const QModelIndex &amp;parent) const override { return 2; }
  int columnCount(const QModelIndex &amp;parent) const override { return 2; }
  QVariant data(const QModelIndex &amp;index, int role) const override { return ""; }
  QVariant headerData(int section, Qt::Orientation orientation, int role) const override { return ""; }
  QHash&lt;int, QByteArray&gt; roleNames() const override { return {{NameRole, "name"}}; }  // #1
};
</code></pre>
<p dir="auto"><strong>Main.qml:</strong></p>
<pre><code>import QtQuick
import QtQuick.Controls
import Models

ApplicationWindow {
    visible: true
    width: 640
    height: 480
    title: qsTr("HeaderView")

    VerticalHeaderView {
        id: vhv
        anchors.top: tv.top
        syncView: tv
        textRole: 'name' // #2
    }

    TableView {
        id: tv
        anchors.left: vhv.right
        anchors.top: parent.top
        anchors.right: parent.right
        anchors.bottom: parent.bottom

        columnSpacing: 1
        rowSpacing: 1

        model: TableModel {}

        delegate: Rectangle {
            implicitWidth: 40
            implicitHeight: 20
            color: 'black'
            Label {
                anchors.fill: parent
                text: name // #3
                color: 'white'
                horizontalAlignment: Label.AlignHCenter
                verticalAlignment: Label.AlignVCenter
            }
        }
    }
}
</code></pre>
<p dir="auto">When I run this, the app crashes with:</p>
<pre><code>appMatrixView(27748,0x1f5466180) malloc: *** error for object 0xc01927bf8: pointer being freed was not allocated
appMatrixView(27748,0x1f5466180) malloc: *** set a breakpoint in malloc_error_break to debug
[1]    27748 abort
</code></pre>
<p dir="auto">Everything works, if I change the lines in the code like this:</p>
<ul>
<li>delete line #1 and #2</li>
<li>change line #3 to:</li>
</ul>
<pre><code>text: display
</code></pre>
<p dir="auto">Whats goint on there? Any help is very appreciated!</p>
<p dir="auto">Cheers!</p>
]]></description><link>https://forum.qt.io/topic/165011/crash-with-qt6.11.1-and-verticalheaderview</link><generator>RSS for Node</generator><lastBuildDate>Fri, 18 Sep 2026 12:50:13 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/165011.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 15 Aug 2026 06:46:12 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Crash with Qt6.11.1 and VerticalHeaderView on Sun, 16 Aug 2026 21:39:10 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/dubu">@<bdi>DuBu</bdi></a>  your model will not update in your qml gui without Q_OBJECT macro in TableModel. I did not change anything in your code and it works on ubuntu .</p>
]]></description><link>https://forum.qt.io/post/839750</link><guid isPermaLink="true">https://forum.qt.io/post/839750</guid><dc:creator><![CDATA[JoeCFD]]></dc:creator><pubDate>Sun, 16 Aug 2026 21:39:10 GMT</pubDate></item><item><title><![CDATA[Reply to Crash with Qt6.11.1 and VerticalHeaderView on Sun, 16 Aug 2026 19:04:41 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/dubu">@<bdi>DuBu</bdi></a> said in <a href="/post/839746">Crash with Qt6.11.1 and VerticalHeaderView</a>:</p>
<blockquote>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sgaist">@<bdi>SGaist</bdi></a> said in <a href="/post/839744">Crash with Qt6.11.1 and VerticalHeaderView</a>:</p>
<blockquote>
<p dir="auto">Can you test with 6.12 ?</p>
<p dir="auto">I just did and your code is working without issue.</p>
</blockquote>
<p dir="auto">6.12.0-beta2?</p>
</blockquote>
<p dir="auto">It seems, I can't:</p>
<pre><code>Undefined symbols for architecture arm64:
  "QQmlPrivate::AOTLookupValidation::validateLookupSignature(QQmlEngine*, QV4::CompiledData::CompilationUnit*, QQmlPrivate::AOTLookupValidation::Lookup const&amp;, std::variant&lt;QQmlPrivate::AOTLookupValidation::PropertySignature, QQmlPrivate::AOTLookupValidation::EnumKeySignature, QQmlPrivate::AOTLookupValidation::MethodSignature&gt; const&amp;)", referenced from:
      QmlCacheGeneratedCode::_qt_qml_MatrixView_Main_qml::validateLookupSignatures(QQmlEngine*, QV4::CompiledData::CompilationUnit*) in appMatrixView_Main_qml.cpp.o
ld: symbol(s) not found for architecture arm64
collect2: error: ld returned 1 exit status
</code></pre>
]]></description><link>https://forum.qt.io/post/839748</link><guid isPermaLink="true">https://forum.qt.io/post/839748</guid><dc:creator><![CDATA[DuBu]]></dc:creator><pubDate>Sun, 16 Aug 2026 19:04:41 GMT</pubDate></item><item><title><![CDATA[Reply to Crash with Qt6.11.1 and VerticalHeaderView on Sun, 16 Aug 2026 19:04:27 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/dubu">@<bdi>DuBu</bdi></a> yes please.</p>
]]></description><link>https://forum.qt.io/post/839747</link><guid isPermaLink="true">https://forum.qt.io/post/839747</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Sun, 16 Aug 2026 19:04:27 GMT</pubDate></item><item><title><![CDATA[Reply to Crash with Qt6.11.1 and VerticalHeaderView on Sun, 16 Aug 2026 18:54:55 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sgaist">@<bdi>SGaist</bdi></a> said in <a href="/post/839744">Crash with Qt6.11.1 and VerticalHeaderView</a>:</p>
<blockquote>
<p dir="auto">Can you test with 6.12 ?</p>
<p dir="auto">I just did and your code is working without issue.</p>
</blockquote>
<p dir="auto">6.12.0-beta2?</p>
]]></description><link>https://forum.qt.io/post/839746</link><guid isPermaLink="true">https://forum.qt.io/post/839746</guid><dc:creator><![CDATA[DuBu]]></dc:creator><pubDate>Sun, 16 Aug 2026 18:54:55 GMT</pubDate></item><item><title><![CDATA[Reply to Crash with Qt6.11.1 and VerticalHeaderView on Sun, 16 Aug 2026 18:26:19 GMT]]></title><description><![CDATA[<p dir="auto">Can you test with 6.12 ?</p>
<p dir="auto">I just did and your code is working without issue.</p>
]]></description><link>https://forum.qt.io/post/839744</link><guid isPermaLink="true">https://forum.qt.io/post/839744</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Sun, 16 Aug 2026 18:26:19 GMT</pubDate></item><item><title><![CDATA[Reply to Crash with Qt6.11.1 and VerticalHeaderView on Sun, 16 Aug 2026 17:09:50 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/joecfd">@<bdi>JoeCFD</bdi></a> said in <a href="/post/839730">Crash with Qt6.11.1 and VerticalHeaderView</a>:</p>
<blockquote>
<p dir="auto">Although I can build with meson and run your code on Ubuntu 22.04,  TableModel needs Q_OBJECT macro.<br />
qmake6 --version<br />
QMake version 3.1<br />
Using Qt version 6.11.1 in /opt/Qt6/6.11.1/gcc_64/lib</p>
</blockquote>
<p dir="auto">I use Qt 6.11.1 on macOS. This project is a cmake project and was created with the project template of Qt Creator. The lines I showed are the only changes I made. And building works fine, it just doesn't run.<br />
Are you sure about the Q_OBJECT? I thought Q_OBJECT is only needed, when I use Q_PROPERTY, signals or slots. But anyway, adding Q_OBJECT doesn't stop it from crashing.</p>
]]></description><link>https://forum.qt.io/post/839743</link><guid isPermaLink="true">https://forum.qt.io/post/839743</guid><dc:creator><![CDATA[DuBu]]></dc:creator><pubDate>Sun, 16 Aug 2026 17:09:50 GMT</pubDate></item><item><title><![CDATA[Reply to Crash with Qt6.11.1 and VerticalHeaderView on Sun, 16 Aug 2026 16:51:33 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sgaist">@<bdi>SGaist</bdi></a> said in <a href="/post/839727">Crash with Qt6.11.1 and VerticalHeaderView</a>:</p>
<blockquote>
<p dir="auto">Hi,</p>
<p dir="auto">One thing I would do is to return a <code>QVariant()</code> rather than an empty string in your model data and headerData functions. I am not saying that this is the right solution but the model will be queried for more than a single role and not all of them uses strings.</p>
</blockquote>
<p dir="auto">This is just a minimal example. The string will be implicitly converted to a QVariant, but with an empty QVariant() I get QML warnings for the line marked with //#3 ("Can't convert undefined to string"). I also added a "qDebug() &lt;&lt; role" line to data() to see what roles this function get called with and since I have only one role "NameRole" it only get called with this role only. But anyway it doesn't fix the crash.</p>
]]></description><link>https://forum.qt.io/post/839742</link><guid isPermaLink="true">https://forum.qt.io/post/839742</guid><dc:creator><![CDATA[DuBu]]></dc:creator><pubDate>Sun, 16 Aug 2026 16:51:33 GMT</pubDate></item><item><title><![CDATA[Reply to Crash with Qt6.11.1 and VerticalHeaderView on Sat, 15 Aug 2026 19:40:55 GMT]]></title><description><![CDATA[<p dir="auto">Although I can build with meson and run your code on Ubuntu 22.04,  TableModel needs Q_OBJECT macro.<br />
qmake6 --version<br />
QMake version 3.1<br />
Using Qt version 6.11.1 in /opt/Qt6/6.11.1/gcc_64/lib</p>
]]></description><link>https://forum.qt.io/post/839730</link><guid isPermaLink="true">https://forum.qt.io/post/839730</guid><dc:creator><![CDATA[JoeCFD]]></dc:creator><pubDate>Sat, 15 Aug 2026 19:40:55 GMT</pubDate></item><item><title><![CDATA[Reply to Crash with Qt6.11.1 and VerticalHeaderView on Sat, 15 Aug 2026 15:17:04 GMT]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">One thing I would do is to return a <code>QVariant()</code> rather than an empty string in your model data and headerData functions. I am not saying that this is the right solution but the model will be queried for more than a single role and not all of them uses strings.</p>
]]></description><link>https://forum.qt.io/post/839727</link><guid isPermaLink="true">https://forum.qt.io/post/839727</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Sat, 15 Aug 2026 15:17:04 GMT</pubDate></item></channel></rss>