Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Developing a calendar using an array of buttons [closed]

Developing a calendar using an array of buttons [closed]

Scheduled Pinned Locked Moved Mobile and Embedded
2 Posts 2 Posters 3.1k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    rankad
    wrote on 21 Apr 2011, 08:56 last edited by
    #1

    hey friends and qt experts ,I am new here and I have taken up the project of customizing calendar widget,i have created an array of buttons of size 6*7,ie, 6 rows and 7 cols,now i want to develop a calendar with this array of buttons,so instead of cells,i am using buttons,so any idea how to proceed,I apologize if i have not followed any forum rules.
    I have coded for array of buttons ,which i am pasting it below

    @#include "mainwindow.h"
    #include "ui_mainwindow.h"

    MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
    {

    ui->setupUi(this);
    QWidget *centralWidget = new QWidget;
    selectedDate=QDate::currentDate();
    int count=1,i,j;
    
    QPushButton *button[10][10];
    QGridLayout *controlsLayout = new QGridLayout;
    
    for(i=0;i<7;i++)
    {
    
        for(j=0;j<7;j++)
        {
    
    
            if(count<=42)
            {
    
                button[i][j] = new QPushButton(QString::number(count));
    
                button[i][j]->resize(40,40);
    
                button[i][j]->move(40*j, 40*i);
    
                button[i][j]->show();
    
                controlsLayout->addWidget(button[i][j],i,j);
    
    
    
                controlsLayout->setSpacing(0);
    
                centralWidget->setLayout(controlsLayout);
    
                setCentralWidget(centralWidget);
    
                count++;
            }
    
        }
    
    
    }
    

    }
    MainWindow::~MainWindow()
    {
    delete ui;
    }
    @

    1 Reply Last reply
    0
    • A Offline
      A Offline
      andre
      wrote on 21 Apr 2011, 09:08 last edited by
      #2

      This topic has very recently been discussed in detail. Is this some kind of school assignment?

      Please refer to:
      http://developer.qt.nokia.com/forums/viewthread/5031/
      http://developer.qt.nokia.com/forums/viewthread/5207
      http://developer.qt.nokia.com/forums/viewthread/5363/

      Closing for now. If you feel it should be re-openened, please either contact me through email, or use the report button and explain why your case is different and deserves to stay open.

      1 Reply Last reply
      0

      1/2

      21 Apr 2011, 08:56

      • Login

      • Login or register to search.
      1 out of 2
      • First post
        1/2
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved