void StatusNavigateBar::setNavigateBarState(bool hasPrev, bool hasNext) { if (hasPrev && hasNext) { setButtonsState(ItemCurrent); } else if (!hasPrev && hasNext) { setButtonsState(ItemFirst); } else if (hasPrev && !hasNext) { setButtonsState(ItemLast); } else { setButtonsState(NoNavigation); } }
void FirmView::paintEvent(QPaintEvent *event) { QPainter p(this); p.drawImage(0, 0, FirmPict); p.drawImage(17, 11, FlagPict[fp->m_flag]); p.drawImage(117, 6, WorkTypePict[fp->m_pict]); p.fillRect(9, 38, 139, 3, PlColor[fp->owner]); p.fillRect(9, 69, 139, 3, PlColor[fp->owner]); QFont fn = QFont(); fn.setBold(1); p.setFont(fn); p.drawText(QRect(60, 11, 39, 20), Qt::AlignCenter, Cuntry[fp->m_flag]); p.drawText(QRect(8, 43, 141, 26), Qt::AlignCenter, fp->name); QString tmpStr; tmpStr = fp->price.toString(); if (fp->type == 1) tmpStr += '*'; if (fp->type == 2) tmpStr += "**"; p.drawText(QRect(10, 80, 39, 20), Qt::AlignCenter, tmpStr); RedrawMesons(&p); setButtonsState(); }