Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to interact with each cell in calender

How to interact with each cell in calender

Scheduled Pinned Locked Moved General and Desktop
3 Posts 3 Posters 2.1k Views 1 Watching
  • 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.
  • B Offline
    B Offline
    BorahAnshuman
    wrote on last edited by
    #1

    weather i can use the same cell IN CALENDER WIDGET for two clicking instance that means if i click once it will show information on textbrowser…AND when i click again it move to the another dialog n both click is done one after another...

    i had write code for that but the problem is that..at first click it will show information on textbrowser but after that i hv to double click the cell to perform next operation...

    @#include "seecyclem.h"
    #include "ui_seecyclem.h"
    #include "setcyclem.h"
    #include "ui_setcyclem.h"
    SeeCycleM::SeeCycleM(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::SeeCycleM)
    {
    ui->setupUi(this);

    connect(ui->calendarWidget,SIGNAL(clicked(QDate)),this,SLOT(showDate(QDate)));
    connect(ui->calendarWidget,SIGNAL(activated(QDate)),this,SLOT(showset()));
    

    }
    void SeeCycleM::showDate(QDate date)
    {
    ui->lineEdit->setText(date.toString());
    }
    void SeeCycleM::showset()
    {

    SetCycleM a(this);
    connect(&a,SIGNAL(setclicked()),this,SLOT(setcolors()));
    connect(&a,SIGNAL(unsetClicked()),this,SLOT(unsetColors()));
    a.show();
    a.exec();
    

    }
    void SeeCycleM::setcolors()
    {

    safedate.setBackground(Qt::green);
    
    unsafedate.setBackground(Qt::yellow);
    
    fertiledate.setBackground(Qt::red);
    
    startdate.setBackground(Qt::blue);
    
    ui->calendarWidget->setDateTextFormat(QDate(2011,4,1),startdate);
    ui->calendarWidget->setDateTextFormat(QDate(2011,4,5),safedate);
    ui->calendarWidget->setDateTextFormat(QDate(2011,4,8),unsafedate);
    ui->calendarWidget->setDateTextFormat(QDate(2011,4,9),fertiledate);
    ui->calendarWidget->setDateTextFormat(QDate(2011,4,12),unsafedate);
    ui->calendarWidget->setDateTextFormat(QDate(2011,4,14),safedate);
    

    }
    void SeeCycleM::unsetColors()
    {
    startdate.clearBackground();

    safedate.clearBackground();
    
    unsafedate.clearBackground();
    
    fertiledate.clearBackground();
    
    ui->calendarWidget->setDateTextFormat(QDate(2011,4,1),startdate);
    ui->calendarWidget->setDateTextFormat(QDate(2011,4,5),safedate);
    ui->calendarWidget->setDateTextFormat(QDate(2011,4,8),unsafedate);
    ui->calendarWidget->setDateTextFormat(QDate(2011,4,9),fertiledate);
    ui->calendarWidget->setDateTextFormat(QDate(2011,4,12),unsafedate);
    ui->calendarWidget->setDateTextFormat(QDate(2011,4,14),safedate);
    

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

    1 Reply Last reply
    0
    • D Offline
      D Offline
      DenisKormalev
      wrote on last edited by
      #2

      I highlighted your code (don't forget to do it by yourself next time), but it looks like part of code was lost. Can you check it and fix?

      1 Reply Last reply
      0
      • A Offline
        A Offline
        andre
        wrote on last edited by
        #3

        This is the exact same topic as "this":http://developer.qt.nokia.com/forums/viewthread/5205/P15/#31601 thread. Closing.

        1 Reply Last reply
        0

        • Login

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