<?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[Custom widget border-radius stylesheet]]></title><description><![CDATA[<p dir="auto">Well, suppose I have a custom widget with my custom paint event<br />
@<br />
class customWidget : public QWidget<br />
{<br />
// constructor etc.<br />
void paintEvent(QPaintEvent *e) { // some painting here };<br />
}<br />
@</p>
<p dir="auto">Then I add this widget to the layout and set it's stylesheet. Like that<br />
@<br />
// in main window constructor<br />
customWidget *custom=new customWidget;<br />
custom-&gt;setStyleSheet("border-top-right-raduis: 8px;");<br />
setCentralWidget(custom);<br />
@</p>
<p dir="auto">So, how to account for border-top-right-radius in paint event of my widget? Or how to know of those 8px raduis inside paint event.</p>
]]></description><link>https://forum.qt.io/topic/19548/custom-widget-border-radius-stylesheet</link><generator>RSS for Node</generator><lastBuildDate>Thu, 14 May 2026 04:13:09 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/19548.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 03 Sep 2012 08:10:21 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Custom widget border-radius stylesheet on Mon, 03 Sep 2012 12:04:24 GMT]]></title><description><![CDATA[<p dir="auto">Ah, ok.<br />
My custom widget is placed inside qscrollarea, which in turn has a stylesheet, specifying border-raduis. My widget is then rendered over the border-radius, which is ugly. Is it true, that I, oh-ah, just have do like that:<br />
@<br />
class customWidget : public QAbstractSrollArea<br />
{<br />
// all the mess with painting<br />
};<br />
@</p>
<p dir="auto">Hmm?</p>
]]></description><link>https://forum.qt.io/post/149348</link><guid isPermaLink="true">https://forum.qt.io/post/149348</guid><dc:creator><![CDATA[elephanten]]></dc:creator><pubDate>Mon, 03 Sep 2012 12:04:24 GMT</pubDate></item><item><title><![CDATA[Reply to Custom widget border-radius stylesheet on Mon, 03 Sep 2012 09:14:50 GMT]]></title><description><![CDATA[<p dir="auto">Hi elephanten</p>
<p dir="auto">I'm not quiet sure what you are trying to do?<br />
It seams to me that you are mixing the stylesheet approach with the inherit by QStyle approach.</p>
<p dir="auto">Why would you need stylesheet in your customwidget where you have full control of paintEvent?</p>
<p dir="auto">Also good is to checkout the source of QWidget</p>
<p dir="auto">or here</p>
<p dir="auto"><a href="http://qt-project.org/faq/answer/example_of_how_to_style_qtoolbox_with_qstyle" target="_blank" rel="noopener noreferrer nofollow ugc">http://qt-project.org/faq/answer/example_of_how_to_style_qtoolbox_with_qstyle</a></p>
<p dir="auto">or here</p>
<p dir="auto"><a href="http://qt-project.org/doc/qt-4.8/qstyle.html" target="_blank" rel="noopener noreferrer nofollow ugc">http://qt-project.org/doc/qt-4.8/qstyle.html</a></p>
<p dir="auto">or the examples of qt</p>
]]></description><link>https://forum.qt.io/post/149326</link><guid isPermaLink="true">https://forum.qt.io/post/149326</guid><dc:creator><![CDATA[messi]]></dc:creator><pubDate>Mon, 03 Sep 2012 09:14:50 GMT</pubDate></item></channel></rss>