×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Apr 2010
    Posts
    2

    how to resize row in QCalendarWidget [setRowHeight doesn't work]

    Hi
    I am trying to set row height in QCalendarWidget. I want to have 3rd week of month size bigger than other.

    setRowHeight doesn't work:
    Code:
      	QCalendarWidgetMy (QWidget *parent=0) : QCalendarWidget (parent)
      	{
        	view2 = qFindChild<QTableView *>(this);	
      	}
     
    	calendar->view2->resizeColumnsToContents();
    	//calendar->view2->setShowGrid(true);   // work
    
    	calendar->view2->verticalHeader()->setDefaultSectionSize(51);//doesn't work
    	calendar->view2->setRowHeight ( 0, 51 ); //doesn't work
    	calendar->view2->setRowHeight ( 1, 51 );//doesn't work
    	calendar->view2->setRowHeight ( 2, 55 );//doesn't work
    How to resize rows?
    Thanks in advance

  2. #2
    Super Contributor
    Join Date
    Oct 2009
    Posts
    4,326

    Re: how to resize row in QCalendarWidget [setRowHeight doesn't work]

    You can disable stretch, but then widget will look quite ugly.

    Code:
    #include <QtGui>
    #include <QDebug>
    
    int main (int argc, char **argv)
    {
        QApplication app(argc, argv);
        QCalendarWidget calendar;
    
        QTableView *table = qFindChild<QTableView *>(&calendar);
        QHeaderView *verticalHeader = table->verticalHeader();
        verticalHeader->setResizeMode(QHeaderView::Fixed);
        verticalHeader->resizeSection(3, 100);
    
        calendar.show();
    
        return app.exec();
    }
    Last edited by divanov; 2010-04-16 at 17:49. Reason: removing irrelevant code

  3. #3
    Registered User
    Join Date
    Apr 2010
    Posts
    2

    Re: how to resize row in QCalendarWidget [setRowHeight doesn't work]

    Thanks it works

Similar Threads

  1. introducing delay
    By dineshdreamworld in forum Mobile Java Media (Graphics & Sounds)
    Replies: 14
    Last Post: 2010-03-16, 07:18
  2. Parsing data from txt file in J2ME
    By CSFYPMAIL in forum Mobile Java General
    Replies: 6
    Last Post: 2009-01-07, 01:30

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •