Resizing widgets in QTabWidget leaves blank space if border disabled
-
I have QTabWidget with widgets that have fixed size depending on font size in it.
I want to disable border of QTabWidget, so i use this line of code:
setStyleSheet("QTabWidget::pane { border: 0; }");But now, when i resize widgets i have an empty gaps on bottom and right side (~3 - 5px).
If not use this line of code, then after resizing on each side of widget these gaps are equal.This is resizing code (SessionsWidget inherits QTabWidget):
void SessionsWidget::updateSize(int size) { static_cast<Placeholder*>(widget(0))->setFontSize(size); for (auto i = 1; i < count(); ++i) static_cast<Terminal*>(widget(i))->setFontSize(size); } void Terminal::setFontSize(int size) { m_Impl->m_Display->setFontSize(size); } void Display::setFontSize(int size) { auto currentFont = font(); currentFont.setPointSize(size); setFont(currentFont); updateSize(); } void Display::updateSize() { QFontMetrics metrics(font()); m_FontHeight = metrics.height(); m_FontWidth = metrics.horizontalAdvance("A"); setFixedSize(m_FontWidth * 80, m_FontHeight * 25); update(); }How to fix this? Thanks