Icon in the tab

Added by Mahmudul Hasan almost 2 years 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 almost 2 years 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 almost 2 years 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 almost 2 years ago

Another attachment

BrowserSource.png (54.1 KB)

RE: Icon in the tab - Added by Wim Dumon almost 2 years 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 almost 2 years 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 over 1 year 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 over 1 year 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)