Saturday, 15 February 2014

android - How to remove selected date rectangle in QCalendarWidget and small icons in widgets -



android - How to remove selected date rectangle in QCalendarWidget and small icons in widgets -

i'm writing own implementation of qcalendarwidget. want dates selectable don't want see default selection rectangle. looks that:

and code:

in constructor: setselectionmode(singleselection); void shiftcalendar::paintcell(qpainter *painter, const qrect &rect, const qdate &date) const { if(date == selecteddate()) { fillcell(painter, rect, calendarwidget::cellfillcolor); } drawcelltext(painter, rect, qstring::number(date.day()), color); } void shiftcalendar::fillcell(qpainter *painter, const qrect &rect, const qcolor &color) const { painter->save(); painter->setrenderhint(qpainter::antialiasing); painter->setpen(qpen(color)); painter->setbrush(qbrush(color)); painter->drawellipse(frect.center(), rect.width() / 2, rect.height() / 2); painter->restore(); }

what can do?

the sec problem can seen in image little size of pushbuttons icons , comboboxes icons. looks fine on desktop on android it's little time. modifying icon size doesn't have effect.

edit:

first problem solved adding selection-background-color: rgba(0, 0, 0, 0); widget's stylesheet. sec 1 still not solved.

do have different dpi versions of icons? page discusses how big various icons should be: http://developer.android.com/design/style/iconography.html

android c++ qt qt5

No comments:

Post a Comment