Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //row 1
- Cell *c0_1= new Cell(ui->centralWidget);
- c0_1->setText("1\n");
- Cell *c0_2= new Cell(ui->centralWidget);
- c0_2->setText("2\n");
- c0_2->setYellow();
- Cell *c0_3= new Cell(ui->centralWidget);
- c0_3->setText("3\n");
- ui->tableWidget->setCellWidget(0,2,c0_1);
- ui->tableWidget->setCellWidget(0,3,c0_2);
- ui->tableWidget->setCellWidget(0,4,c0_3);
- //row 2
- Cell *c1_1= new Cell(ui->centralWidget);
- c1_1->setText("4\n");
- Cell *c1_2= new Cell(ui->centralWidget);
- c1_2->setText("5\n");
- Cell *c1_3= new Cell(ui->centralWidget);
- c1_3->setText("6\n");
- ui->tableWidget->setCellWidget(1,2,c1_1);
- ui->tableWidget->setCellWidget(1,3,c1_2);
- ui->tableWidget->setCellWidget(1,4,c1_3);
- //row 3
- Cell *c2_1= new Cell(ui->centralWidget);
- c2_1->setText("7\n");
- c2_1->setYellow();
- Cell *c2_2= new Cell(ui->centralWidget);
- c2_2->setText("8\n");
- c2_2->setYellow();
- Cell *c2_3= new Cell(ui->centralWidget);
- c2_3->setText("9\n");
- Cell *c2_4= new Cell(ui->centralWidget);
- c2_4->setText("10\n");
- c2_4->setYellow();
- Cell *c2_5= new Cell(ui->centralWidget);
- c2_5->setText("11\n");
- Cell *c2_6= new Cell(ui->centralWidget);
- c2_6->setText("12\n");
- Cell *c2_7= new Cell(ui->centralWidget);
- c2_7->setText("13\n");
- ui->tableWidget->setCellWidget(2,0,c2_1);
- ui->tableWidget->setCellWidget(2,1,c2_2);
- ui->tableWidget->setCellWidget(2,2,c2_3);
- ui->tableWidget->setCellWidget(2,3,c2_4);
- ui->tableWidget->setCellWidget(2,4,c2_5);
- ui->tableWidget->setCellWidget(2,5,c2_6);
- ui->tableWidget->setCellWidget(2,6,c2_7);
- //row 4
- Cell *c3_1= new Cell(ui->centralWidget);
- c3_1->setText("14\n");
- Cell *c3_2= new Cell(ui->centralWidget);
- c3_2->setText("15\n");
- Cell *c3_3= new Cell(ui->centralWidget);
- c3_3->setText("16\n");
- c3_3->setYellow();
- Cell *c3_4= new Cell(ui->centralWidget);
- c3_4->setText("17\n");
- Cell *c3_5= new Cell(ui->centralWidget);
- c3_5->setText("18\n");
- Cell *c3_6= new Cell(ui->centralWidget);
- c3_6->setText("19\n");
- Cell *c3_7= new Cell(ui->centralWidget);
- c3_7->setText("20\n");
- ui->tableWidget->setCellWidget(3,0,c3_1);
- ui->tableWidget->setCellWidget(3,1,c3_2);
- ui->tableWidget->setCellWidget(3,2,c3_3);
- ui->tableWidget->setCellWidget(3,3,c3_4);
- ui->tableWidget->setCellWidget(3,4,c3_5);
- ui->tableWidget->setCellWidget(3,5,c3_6);
- ui->tableWidget->setCellWidget(3,6,c3_7);
- //row 5
- Cell *c4_1= new Cell(ui->centralWidget);
- c4_1->setText("21\n");
- Cell *c4_2= new Cell(ui->centralWidget);
- c4_2->setText("22\n");
- Cell *c4_3= new Cell(ui->centralWidget);
- c4_3->setText("23\n");
- Cell *c4_4= new Cell(ui->centralWidget);
- c4_4->setText("24\n");
- Cell *c4_5= new Cell(ui->centralWidget);
- c4_5->setText("25\n");
- c4_5->setYellow();
- Cell *c4_6= new Cell(ui->centralWidget);
- c4_6->setText("26\n");
- Cell *c4_7= new Cell(ui->centralWidget);
- c4_7->setText("27\n");
- ui->tableWidget->setCellWidget(4,0,c4_1);
- ui->tableWidget->setCellWidget(4,1,c4_2);
- ui->tableWidget->setCellWidget(4,2,c4_3);
- ui->tableWidget->setCellWidget(4,3,c4_4);
- ui->tableWidget->setCellWidget(4,4,c4_5);
- ui->tableWidget->setCellWidget(4,5,c4_6);
- ui->tableWidget->setCellWidget(4,6,c4_7);
- //row 6
- int dc=dt.date().daysInMonth();
- Cell *c5_1=new Cell(ui->centralWidget);
- c5_1->setText("28\n");
- c5_1->setYellow();
- ui->tableWidget->setCellWidget(5,2,c5_1);
- Cell *c5_2=new Cell(ui->centralWidget);
- if (dc>=29)
- {
- c5_2->setText("29\n");
- ui->tableWidget->setCellWidget(5,3,c5_2);
- } else {
- c5_2->setWhite();
- }
- Cell *c5_3=new Cell(ui->centralWidget);
- ui->tableWidget->setCellWidget(5,4,c5_3);
- if (dc>=30)
- {
- c5_3->setText("30\n");
- } else {
- c5_3->setWhite();
- }
- Cell *c6_1=new Cell(ui->centralWidget);
- ui->tableWidget->setCellWidget(6,2,c6_1);
- if (dc>=31)
- {
- c6_1->setText("31\n");
- } else {
- c6_1->setText("");
- c6_1->setWhite();
- }
- Cell *c6_2=new Cell(ui->centralWidget);
- c6_2->setText("");
- c6_2->setWhite();
- ui->tableWidget->setCellWidget(6,3,c6_2);
- Cell *c6_3=new Cell(ui->centralWidget);
- c6_3->setText("");
- c6_3->setWhite();
- ui->tableWidget->setCellWidget(6,4,c6_3);
- updateMonthYear();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement