<?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[Rectangle instead of BackgroundImage as scrollbar handle for a TableView?]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">I am currently developing using Qt 5.1.1.</p>
<p dir="auto">I need to implement a custom style for a "TableView".  Thus I define a new TableViewStyle for my TableView including delegates: itemDelegate, headerDelegate, handle etc.</p>
<p dir="auto">When defining the scrollbar handle delegate I tried first to define it as a simple Rectangle with a certain background color. This did not work, the scrollbar handle was not visible.<br />
When i use Image or BackgroundImage all is fine. Can anybody explain to me why I can't use a Rectangle here?</p>
<p dir="auto">Also, I had trouble to find good documentation concerning the TableViewStyle. I had to gather a lot of information from the code. Am I missing a source of documentation?</p>
<p dir="auto">Some code for explanation:</p>
<p dir="auto">@TableView {<br />
model : id_dbaseLibModel<br />
style : TableViewStyle<br />
{<br />
itemDelegate: id_itemDelegate<br />
headerDelegate: id_headerDelegate<br />
rowDelegate: id_rowDelegate</p>
<pre><code>            minimumHandleLength: 20
            handleOverlap: 5

            /* not working: 
            handle:  Rectangle {
                width: 10;   
                color: "black"; 
            }
            */

            /* working fine: */
            handle:  Image
            {
                source: "/gfx/icons/naviOff.png"  // random image, temporary
            }

            decrementControl: Component { Rectangle{} }
            incrementControl: Component { Rectangle{} }

            scrollBarBackground : Rectangle { width: 10;  color: "green" }
        }

TableViewColumn{ ..... }
TableViewColumn{ ..... }
</code></pre>
<p dir="auto">}<br />
@</p>
<p dir="auto">Thx<br />
DaWoo</p>
]]></description><link>https://forum.qt.io/topic/35737/rectangle-instead-of-backgroundimage-as-scrollbar-handle-for-a-tableview</link><generator>RSS for Node</generator><lastBuildDate>Sun, 16 Aug 2026 12:54:19 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/35737.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 20 Dec 2013 12:25:02 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Rectangle instead of BackgroundImage as scrollbar handle for a TableView? on Mon, 06 Jan 2014 13:50:10 GMT]]></title><description><![CDATA[<p dir="auto">Hi Torgeir,</p>
<p dir="auto">your handle definition works for me also.  It seems to be important to define the implicitWidth of the handle instead of just the width.<br />
From the documentation I understand that the implicitWidth of an item is 0 by default, wich would explain why the scrollbar handle (as i defined it) was not visible.</p>
<p dir="auto">What I don't understand though: why is the "explicit" width ignored in this case?</p>
<p dir="auto">Thanks<br />
DaWoo</p>
]]></description><link>https://forum.qt.io/post/209646</link><guid isPermaLink="true">https://forum.qt.io/post/209646</guid><dc:creator><![CDATA[[[global:former-user]]]]></dc:creator><pubDate>Mon, 06 Jan 2014 13:50:10 GMT</pubDate></item><item><title><![CDATA[Reply to Rectangle instead of BackgroundImage as scrollbar handle for a TableView? on Fri, 20 Dec 2013 20:19:35 GMT]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">I use this, and it works for me:<br />
@<br />
handle: Rectangle {<br />
implicitWidth: 8<br />
implicitHeight: 8<br />
color: "black"<br />
}<br />
@</p>
]]></description><link>https://forum.qt.io/post/208152</link><guid isPermaLink="true">https://forum.qt.io/post/208152</guid><dc:creator><![CDATA[[[global:former-user]]]]></dc:creator><pubDate>Fri, 20 Dec 2013 20:19:35 GMT</pubDate></item></channel></rss>