Icon in the tab

Added by Mahmudul Hasan 3 months ago

I am trying to add icon to the tab as below -

The code executes well but i can't see any icon :(

m_firstTab = m_tabWidget->addTab(std::move(firstTabContent), tr("str.firsttab"));
m_firstTab->setIcon("resources/assets/images/snow.png");

Resource is in place and it's 16 x 16.

Is this a bug or i am trying in the wrong way.


Replies (7)

RE: Icon in the tab - Added by lm at 3 months ago

A few more debugging steps: Do your server logs indicate that the image is being served? Does the browser indicate that the image is being successfully fetched? When you view the webpage source, do you see where the icon should be?

RE: Icon in the tab - Added by Mahmudul Hasan 3 months ago

- The log has no error regarding image not loaded
- The source shows the image is in proper location

Please see the attachment

ImgProperties.png (11.4 KB)

RE: Icon in the tab - Added by Mahmudul Hasan 3 months ago

Another attachment

BrowserSource.png (54.1 KB)

RE: Icon in the tab - Added by Wim Dumon 3 months ago

Hello,

In the network tab, do you see the image being loaded? With result code 200 or 404 (not found)?

Wim.

RE: Icon in the tab - Added by Mahmudul Hasan 3 months ago

result is 200. But i can't see it on the page!

network.png (24.4 KB)

imageNotShowing.png (4.28 KB)

RE: Icon in the tab - Added by Mahmudul Hasan about 1 month ago

Hello Wim,
I have attached the outcome for better understanding long ago but not getting any further communication on this thread.

Thanks

RE: Icon in the tab - Added by Wim Dumon about 1 month ago

hello,

There seems to be a style sheet missing in the bootstrap themes:

.Wt-icon {
    display: inline-block;
    margin-right: 8px;
    background-repeat: no-repeat;
    background-position: center left;
    width: 16px;
    height: 16px;
    line-height: 16px;
    vertical-align: text-top;
}

Fix is on its way to github.

Wim.

(1-7/7)