connect(this,
SIGNAL(clicked
(QDate)),
this,
SLOT(dateSelected
(QDate)));
...
void CalendarManagerRep
::dateSelected(const QDate &date
) {
m_selectedDate = date;
menu.addAction("0",this, SLOT(noSelection()));
menu.addAction("½",this, SLOT(halfSelected()));
menu.addAction("1",this, SLOT(oneSelected()));
auto view = this->findChild<QAbstractItemView*>();
if(view){
view->viewport()->update();
} else update(); // fallback
emit datesChanged();
}
connect(this, SIGNAL(clicked(QDate)), this, SLOT(dateSelected(QDate)));
...
void CalendarManagerRep::dateSelected(const QDate &date)
{
m_selectedDate = date;
QMenu menu;
menu.addAction("0",this, SLOT(noSelection()));
menu.addAction("½",this, SLOT(halfSelected()));
menu.addAction("1",this, SLOT(oneSelected()));
menu.exec(QCursor::pos());
auto view = this->findChild<QAbstractItemView*>();
if(view){
view->viewport()->update();
} else update(); // fallback
emit datesChanged();
}
To copy to clipboard, switch view to plain text mode
Bookmarks