QCalendarWidget doesn't resize properly
-
Hi everyone,
I've been trying to put a QCalendarWidget inside a custom widget that i'm designing. The problem is that it does not fit the widget width so, even it resizes the navigation bar right, the table appears cropped
https://postimg.org/image/5xt53f817/
Is there any way to adjust the table width to fix this ?
Thanks
-
Finally I found a good method to rescale the children table. It's some crazy thing but it works
calendar = new QCalendarWidget(frame); calendar->setObjectName(QStringLiteral("calendar")); calendar->setGeometry(QRect(1, 40, 281, 183)); calendar->setLocale(QLocale::English); calendar->setFirstDayOfWeek(Qt::DayOfWeek::Monday); calendar->showToday(); QTableView* aux = calendar->findChild<QTableView*>(); aux->horizontalHeader()->setSectionResizeMode(QHeaderView::ResizeMode::Fixed); aux->horizontalHeader()->setDefaultSectionSize(40);
-
Hi
You are using an layout?Just tested. It seems that each numbers box has a fixed size and it won't reduce the font used nor the
interspace between the number boxes.
So there is minimum size it will scale to before some of the days row till be clipped. -
Finally I found a good method to rescale the children table. It's some crazy thing but it works
calendar = new QCalendarWidget(frame); calendar->setObjectName(QStringLiteral("calendar")); calendar->setGeometry(QRect(1, 40, 281, 183)); calendar->setLocale(QLocale::English); calendar->setFirstDayOfWeek(Qt::DayOfWeek::Monday); calendar->showToday(); QTableView* aux = calendar->findChild<QTableView*>(); aux->horizontalHeader()->setSectionResizeMode(QHeaderView::ResizeMode::Fixed); aux->horizontalHeader()->setDefaultSectionSize(40);