<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Hello!</p>
<p><br>
</p>
<p>I'm having some issues with a QT application I'm developing right
now, but only on KDE, the same code works perfectly on GNOME.</p>
<p>I'm using the following code snippet:</p>
<div style="color: #d4d4d4;background-color: #1e1e1e;font-family: 'Droid Sans Mono', 'monospace', monospace, 'Droid Sans Fallback';font-weight: normal;font-size: 14px;line-height: 19px;white-space: pre;"><div style="color: #d4d4d4;background-color: #1e1e1e;font-family: 'Droid Sans Mono', 'monospace', monospace, 'Droid Sans Fallback';font-weight: normal;font-size: 14px;line-height: 19px;white-space: pre;"><span style="color: #d4d4d4;">// In my header file</span><div><span style="color: #d4d4d4;"> QAction *m_newTabAction;</span></div><div><span style="color: #d4d4d4;"> QToolButton *addTabButton;</span></div></div><div><span style="color: #d4d4d4;"></span></div><div><span style="color: #d4d4d4;">// The actual code
</span></div><div><span style="color: #d4d4d4;"> m_newTabAction = </span><span style="color: #c586c0;">new</span><span style="color: #d4d4d4;"> </span><span style="color: #dcdcaa;">QAction</span><span style="color: #d4d4d4;">(</span><span style="color: #569cd6;">this</span><span style="color: #d4d4d4;">);</span></div><div><span style="color: #d4d4d4;"> </span><span style="color: #9cdcfe;">m_newTabAction</span><span style="color: #d4d4d4;">-></span><span style="color: #dcdcaa;">setShortcuts</span><span style="color: #d4d4d4;">(</span><span style="color: #4ec9b0;">QKeySequence</span><span style="color: #d4d4d4;">::AddTab);</span></div><div><span style="color: #d4d4d4;"> </span><span style="color: #dcdcaa;">connect</span><span style="color: #d4d4d4;">(m_newTabAction, </span><span style="color: #dcdcaa;">SIGNAL</span><span style="color: #d4d4d4;">(</span><span style="color: #dcdcaa;">triggered</span><span style="color: #d4d4d4;">()), </span><span style="color: #569cd6;">this</span><span style="color: #d4d4d4;">, </span><span style="color: #dcdcaa;">SLOT</span><span style="color: #d4d4d4;">(</span><span style="color: #dcdcaa;">newTab</span><span style="color: #d4d4d4;">()));</span>
</div><div><span style="color: #d4d4d4;"> </span><span style="color: #9cdcfe;">m_newTabAction</span><span style="color: #d4d4d4;">-></span><span style="color: #dcdcaa;">setIcon</span><span style="color: #d4d4d4;">(</span><span style="color: #dcdcaa;">QIcon</span><span style="color: #d4d4d4;">(</span><span style="color: #dcdcaa;">QLatin1String</span><span style="color: #d4d4d4;">(</span><span style="color: #ce9178;">":graphics/addtab.png"</span><span style="color: #d4d4d4;">)));</span></div><div><span style="color: #d4d4d4;"> </span><span style="color: #9cdcfe;">m_newTabAction</span><span style="color: #d4d4d4;">-></span><span style="color: #dcdcaa;">setIconVisibleInMenu</span><span style="color: #d4d4d4;">(</span><span style="color: #569cd6;">false</span><span style="color: #d4d4d4;">);</span></div><div><span style="color: #569cd6;"> addTabButton </span><span style="color: #d4d4d4;">=</span><span style="color: #569cd6;"> new QToolButton(this);</span></div><div><span style="color: #d4d4d4;"> </span><span style="color: #9cdcfe;">addTabButton</span><span style="color: #d4d4d4;">-></span><span style="color: #dcdcaa;">setDefaultAction</span><span style="color: #d4d4d4;">(m_newTabAction);</span></div><div><span style="color: #d4d4d4;"> </span><span style="color: #9cdcfe;">addTabButton</span><span style="color: #d4d4d4;">-></span><span style="color: #dcdcaa;">setAutoRaise</span><span style="color: #d4d4d4;">(</span><span style="color: #569cd6;">true</span><span style="color: #d4d4d4;">);</span></div><div><span style="color: #d4d4d4;"> </span><span style="color: #9cdcfe;">addTabButton</span><span style="color: #d4d4d4;">-></span><span style="color: #dcdcaa;">setToolButtonStyle</span><span style="color: #d4d4d4;">(</span><span style="color: #4ec9b0;">Qt</span><span style="color: #d4d4d4;">::ToolButtonIconOnly);</span></div></div>
<p>Compiling and running this code (The button is positioned later)
result in the button being displayed and working, except the image
not being displayed. The image is displayed on GNOME though. This
also has nothing to do with dark mode, as the image contains black
and white parts, and I tested this using Breeze Light and Dark. I
already tried setting the icon and/or icon size directly on the
button, which also didn't help. My code is a fork of Arora, and
the same issue shows up there too, and the new tab button isn't
displayed.</p>
<p>Am I using some outdated methods that KDE doesn't support or is
there anything I can do to get this code working properly?</p>
<p><br>
</p>
<p>Aaron<br>
</p>
</body>
</html>