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


    Is there any way to adjust the table width to fix this ?


  • Qt Champions 2017

    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.

  • @mrjj

    No, only a frame as a container. I can resize the table font size but, as you well said it seems as the box sizes are fixed

  • Finally I found a good method to rescale the children table. It's some crazy thing but it works

    calendar = new QCalendarWidget(frame);
    	calendar->setGeometry(QRect(1, 40, 281, 183));
    	QTableView* aux = calendar->findChild<QTableView*>();

  • For the record, the correct way, as mentioned by @mrjj above is to add a layout

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.