MCPcopy Create free account
hub / github.com/altairwei/WizNotePlus / drawControl

Method drawControl

src/WizNoteStyle.cpp:324–387  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

322}
323
324void CWizNoteStyle::drawControl(ControlElement element, const QStyleOption *option, QPainter *painter, const QWidget *widget) const
325{
326 switch (element)
327 {
328 case CE_ItemViewItem:
329 {
330 const QStyleOptionViewItem *vopt = qstyleoption_cast<const QStyleOptionViewItem *>(option);
331 Q_ASSERT(vopt);
332
333 if (const WizMessageListView* view = dynamic_cast<const WizMessageListView*>(widget))
334 {
335 view->drawItem(painter, vopt);
336 //drawMessageListViewItem(vopt, painter, view);
337 }
338 else if (const WizDocumentListView *view = dynamic_cast<const WizDocumentListView *>(widget))
339 {
340// qDebug() << "view left top : " << view->mapToGlobal(view->rect().topLeft());
341 view->drawItem(painter, vopt);
342 //drawDocumentListViewItem(vopt, painter, view);
343 }
344 else if (const WizMultiLineListWidget *view = dynamic_cast<const WizMultiLineListWidget *>(widget))
345 {
346 drawMultiLineListWidgetItem(vopt, painter, view);
347 }
348 else if (const WizCategoryBaseView *view = dynamic_cast<const WizCategoryBaseView *>(widget))
349 {
350 drawCategoryViewItem(vopt, painter, view);
351 }
352 else
353 {
354 CWizNoteBaseStyle::drawControl(element, option, painter, widget);
355 }
356 break;
357 }
358 //case CE_PushButton:
359 // {
360 // const QStyleOptionButton* vopt = qstyleoption_cast<const QStyleOptionButton *>(option);
361 // ATLASSERT(vopt);
362 // //
363 // if (const CWizImagePushButton *button = dynamic_cast<const CWizImagePushButton *>(widget))
364 // {
365 // drawImagePushButton(vopt, painter, button);
366 // }
367 // else
368 // {
369 // CWizNoteBaseStyle::drawControl(element, option, painter, widget);
370 // }
371 // }
372 // break;
373 //case CE_Splitter:
374 //{
375 // if (const QSplitter* splitter = dynamic_cast<const QSplitter *>(widget))
376 // {
377 // drawSplitter(option, painter, splitter);
378 // } else {
379 // CWizNoteBaseStyle::drawControl(element, option, painter, widget);
380 // }
381 //}

Callers 1

drawComplexControlMethod · 0.45

Calls 7

pixelMetricMethod · 0.80
isNullMethod · 0.80
isEmptyMethod · 0.80
sizeMethod · 0.80
heightMethod · 0.80
widthMethod · 0.80
drawItemMethod · 0.45

Tested by

no test coverage detected