/*! Draw the border of the canvas \param painter Painter */ void QwtPlotGLCanvas::drawBorder( QPainter *painter ) { const int fw = frameWidth(); if ( fw <= 0 ) return; if ( frameShadow() == QwtPlotGLCanvas::Plain ) { qDrawPlainRect( painter, frameRect(), palette().shadow().color(), lineWidth() ); } else { if ( frameShape() == QwtPlotGLCanvas::Box ) { qDrawShadeRect( painter, frameRect(), palette(), frameShadow() == Sunken, lineWidth(), midLineWidth() ); } else { qDrawShadePanel( painter, frameRect(), palette(), frameShadow() == Sunken, lineWidth() ); } } }
//! @todo add more frame types void ClassName::drawFrame(QPainter *p) { if (frameShape() == QFrame::Box) { if (frameShadow() == Plain) qDrawPlainRect(p, frameRect(), d->frameColor, lineWidth()); else qDrawShadeRect(p, frameRect(), palette(), frameShadow() == QFrame::Sunken, lineWidth(), midLineWidth()); } else { SuperClassName::drawFrame(p); } }
/*! */ void ColorPickerButton::paintEvent(QPaintEvent *e) { QFrame::paintEvent(e); QPainter p(this); p.fillRect(contentsRect(), palette().button()); QRect r = rect(); int offset = frameShadow() == Sunken ? 1 : 0; QPen pen(palette().buttonText(), 1); p.setPen(pen); p.drawRect(r.center().x() + offset - 4, r.center().y() + offset, 1, 1); p.drawRect(r.center().x() + offset , r.center().y() + offset, 1, 1); p.drawRect(r.center().x() + offset + 4, r.center().y() + offset, 1, 1); if (hasFocus()) { p.setPen( QPen( Qt::black, 0, Qt::SolidLine ) ); p.drawRect(0, 0, width() - 1, height() - 1); } p.end(); }
int KexiDBImageBox::realLineWidth() const { switch (frameShape()) { case QFrame::NoFrame: // shadow, line, midline unused return 0; case QFrame::Box: switch (frameShadow()) { case QFrame::Plain: // midline unused return lineWidth(); default: // sunken, raised: return 2 * lineWidth() + midLineWidth(); } break; case QFrame::Panel: // shadow, midline unused return lineWidth(); case QFrame::WinPanel: // shadow, line, midline unused return 2; case QFrame::StyledPanel: { // shadow, line, midline unused QStyleOptionFrameV3 option; option.initFrom(this); return style()->pixelMetric(QStyle::PM_DefaultFrameWidth, &option, this); } default: return lineWidth(); } }
int QwtPlotGLCanvas::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QGLWidget::qt_metacall(_c, _id, _a); if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { if (_id < 2) qt_static_metacall(this, _c, _id, _a); _id -= 2; } else if (_c == QMetaObject::RegisterMethodArgumentMetaType) { if (_id < 2) *reinterpret_cast<int*>(_a[0]) = -1; _id -= 2; } #ifndef QT_NO_PROPERTIES else if (_c == QMetaObject::ReadProperty) { void *_v = _a[0]; switch (_id) { case 0: *reinterpret_cast< Shadow*>(_v) = frameShadow(); break; case 1: *reinterpret_cast< Shape*>(_v) = frameShape(); break; case 2: *reinterpret_cast< int*>(_v) = lineWidth(); break; case 3: *reinterpret_cast< int*>(_v) = midLineWidth(); break; case 4: *reinterpret_cast< int*>(_v) = frameWidth(); break; case 5: *reinterpret_cast< QRect*>(_v) = frameRect(); break; } _id -= 6; } else if (_c == QMetaObject::WriteProperty) { void *_v = _a[0]; switch (_id) { case 0: setFrameShadow(*reinterpret_cast< Shadow*>(_v)); break; case 1: setFrameShape(*reinterpret_cast< Shape*>(_v)); break; case 2: setLineWidth(*reinterpret_cast< int*>(_v)); break; case 3: setMidLineWidth(*reinterpret_cast< int*>(_v)); break; } _id -= 6; } else if (_c == QMetaObject::ResetProperty) { _id -= 6; } else if (_c == QMetaObject::QueryPropertyDesignable) { _id -= 6; } else if (_c == QMetaObject::QueryPropertyScriptable) { _id -= 6; } else if (_c == QMetaObject::QueryPropertyStored) { _id -= 6; } else if (_c == QMetaObject::QueryPropertyEditable) { _id -= 6; } else if (_c == QMetaObject::QueryPropertyUser) { _id -= 6; } else if (_c == QMetaObject::RegisterPropertyMetaType) { if (_id < 6) *reinterpret_cast<int*>(_a[0]) = -1; _id -= 6; } #endif // QT_NO_PROPERTIES return _id; }
int QwtDial::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QwtAbstractSlider::qt_metacall(_c, _id, _a); if (_id < 0) return _id; #ifndef QT_NO_PROPERTIES if (_c == QMetaObject::ReadProperty) { void *_v = _a[0]; switch (_id) { case 0: *reinterpret_cast< bool*>(_v) = hasVisibleBackground(); break; case 1: *reinterpret_cast< int*>(_v) = lineWidth(); break; case 2: *reinterpret_cast< Shadow*>(_v) = frameShadow(); break; case 3: *reinterpret_cast< Mode*>(_v) = mode(); break; case 4: *reinterpret_cast< double*>(_v) = origin(); break; case 5: *reinterpret_cast< bool*>(_v) = wrapping(); break; } _id -= 6; } else if (_c == QMetaObject::WriteProperty) { void *_v = _a[0]; switch (_id) { case 0: showBackground(*reinterpret_cast< bool*>(_v)); break; case 1: setLineWidth(*reinterpret_cast< int*>(_v)); break; case 2: setFrameShadow(*reinterpret_cast< Shadow*>(_v)); break; case 3: setMode(*reinterpret_cast< Mode*>(_v)); break; case 4: setOrigin(*reinterpret_cast< double*>(_v)); break; case 5: setWrapping(*reinterpret_cast< bool*>(_v)); break; } _id -= 6; } else if (_c == QMetaObject::ResetProperty) { _id -= 6; } else if (_c == QMetaObject::QueryPropertyDesignable) { _id -= 6; } else if (_c == QMetaObject::QueryPropertyScriptable) { _id -= 6; } else if (_c == QMetaObject::QueryPropertyStored) { _id -= 6; } else if (_c == QMetaObject::QueryPropertyEditable) { _id -= 6; } else if (_c == QMetaObject::QueryPropertyUser) { _id -= 6; } #endif // QT_NO_PROPERTIES return _id; }
int QFrame::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QWidget::qt_metacall(_c, _id, _a); if (_id < 0) return _id; #ifndef QT_NO_PROPERTIES if (_c == QMetaObject::ReadProperty) { void *_v = _a[0]; switch (_id) { case 0: *reinterpret_cast< Shape*>(_v) = frameShape(); break; case 1: *reinterpret_cast< Shadow*>(_v) = frameShadow(); break; case 2: *reinterpret_cast< int*>(_v) = lineWidth(); break; case 3: *reinterpret_cast< int*>(_v) = midLineWidth(); break; case 4: *reinterpret_cast< int*>(_v) = frameWidth(); break; case 5: *reinterpret_cast< QRect*>(_v) = frameRect(); break; } _id -= 6; } else if (_c == QMetaObject::WriteProperty) { void *_v = _a[0]; switch (_id) { case 0: setFrameShape(*reinterpret_cast< Shape*>(_v)); break; case 1: setFrameShadow(*reinterpret_cast< Shadow*>(_v)); break; case 2: setLineWidth(*reinterpret_cast< int*>(_v)); break; case 3: setMidLineWidth(*reinterpret_cast< int*>(_v)); break; case 5: setFrameRect(*reinterpret_cast< QRect*>(_v)); break; } _id -= 6; } else if (_c == QMetaObject::ResetProperty) { _id -= 6; } else if (_c == QMetaObject::QueryPropertyDesignable) { _id -= 6; } else if (_c == QMetaObject::QueryPropertyScriptable) { _id -= 6; } else if (_c == QMetaObject::QueryPropertyStored) { _id -= 6; } else if (_c == QMetaObject::QueryPropertyEditable) { _id -= 6; } else if (_c == QMetaObject::QueryPropertyUser) { _id -= 6; } #endif // QT_NO_PROPERTIES return _id; }
int MessageListScript::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = MessageList::qt_metacall(_c, _id, _a); if (_id < 0) return _id; #ifndef QT_NO_PROPERTIES if (_c == QMetaObject::ReadProperty) { void *_v = _a[0]; switch (_id) { case 0: *reinterpret_cast< QColor*>(_v) = criColor(); break; case 1: *reinterpret_cast< QColor*>(_v) = attColor(); break; case 2: *reinterpret_cast< QColor*>(_v) = normColor(); break; case 3: *reinterpret_cast< QColor*>(_v) = backColor(); break; case 4: *reinterpret_cast< vtlmeta::types::NamedList*>(_v) = getList(); break; case 5: *reinterpret_cast< QString*>(_v) = sourcerName(); break; case 6: *reinterpret_cast< QString*>(_v) = toolTip(); break; case 7: *reinterpret_cast< VISIBLE*>(_v) = getVisible(); break; case 8: *reinterpret_cast< bool*>(_v) = useMask(); break; case 9: *reinterpret_cast< QString*>(_v) = globalListName(); break; case 10: *reinterpret_cast< QFont*>(_v) = font(); break; case 11: *reinterpret_cast< QRect*>(_v) = geometry(); break; case 12: *reinterpret_cast< Shape*>(_v) = frameShape(); break; case 13: *reinterpret_cast< Shadow*>(_v) = frameShadow(); break; case 14: *reinterpret_cast< int*>(_v) = lineWidth(); break; case 15: *reinterpret_cast< int*>(_v) = midLineWidth(); break; case 16: *reinterpret_cast< int*>(_v) = margin(); break; case 17: *reinterpret_cast< vtlmeta::types::NamedList*>(_v) = getFuncList(); break; } _id -= 18; } else if (_c == QMetaObject::WriteProperty) { void *_v = _a[0]; switch (_id) { case 0: setCriColor(*reinterpret_cast< QColor*>(_v)); break; case 1: setAttColor(*reinterpret_cast< QColor*>(_v)); break; case 2: setNormColor(*reinterpret_cast< QColor*>(_v)); break; case 3: setBackColor(*reinterpret_cast< QColor*>(_v)); break; case 4: setList(*reinterpret_cast< vtlmeta::types::NamedList*>(_v)); break; case 5: setSourcerName(*reinterpret_cast< QString*>(_v)); break; case 6: setToolTip(*reinterpret_cast< QString*>(_v)); break; case 7: setVisible(*reinterpret_cast< VISIBLE*>(_v)); break; case 8: setUseMask(*reinterpret_cast< bool*>(_v)); break; case 9: setGlobalListName(*reinterpret_cast< QString*>(_v)); break; case 10: setFont(*reinterpret_cast< QFont*>(_v)); break; case 11: setGeometry(*reinterpret_cast< QRect*>(_v)); break; case 12: setFrameShape(*reinterpret_cast< Shape*>(_v)); break; case 13: setFrameShadow(*reinterpret_cast< Shadow*>(_v)); break; case 14: setLineWidth(*reinterpret_cast< int*>(_v)); break; case 15: setMidLineWidth(*reinterpret_cast< int*>(_v)); break; case 16: setMargin(*reinterpret_cast< int*>(_v)); break; case 17: setFuncList(*reinterpret_cast< vtlmeta::types::NamedList*>(_v)); break; } _id -= 18; } else if (_c == QMetaObject::ResetProperty) { _id -= 18; } else if (_c == QMetaObject::QueryPropertyDesignable) { _id -= 18; } else if (_c == QMetaObject::QueryPropertyScriptable) { _id -= 18; } else if (_c == QMetaObject::QueryPropertyStored) { _id -= 18; } else if (_c == QMetaObject::QueryPropertyEditable) { _id -= 18; } else if (_c == QMetaObject::QueryPropertyUser) { _id -= 18; } #endif // QT_NO_PROPERTIES return _id; }
int Text::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = VtlWidget::qt_metacall(_c, _id, _a); if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { switch (_id) { case 0: { QString _r = getText(); if (_a[0]) *reinterpret_cast< QString*>(_a[0]) = _r; } break; case 1: setText((*reinterpret_cast< const QString(*)>(_a[1]))); break; default: ; } _id -= 2; } #ifndef QT_NO_PROPERTIES else if (_c == QMetaObject::ReadProperty) { void *_v = _a[0]; switch (_id) { case 0: *reinterpret_cast< QColor*>(_v) = backColor(); break; case 1: *reinterpret_cast< QColor*>(_v) = normColor(); break; case 2: *reinterpret_cast< QString*>(_v) = getText(); break; case 3: *reinterpret_cast< bool*>(_v) = useMask(); break; case 4: *reinterpret_cast< QString*>(_v) = sourcerName(); break; case 5: *reinterpret_cast< QString*>(_v) = toolTip(); break; case 6: *reinterpret_cast< VISIBLE*>(_v) = getVisible(); break; case 7: *reinterpret_cast< QFont*>(_v) = font(); break; case 8: *reinterpret_cast< QRect*>(_v) = geometry(); break; case 9: *reinterpret_cast< Shape*>(_v) = frameShape(); break; case 10: *reinterpret_cast< Shadow*>(_v) = frameShadow(); break; case 11: *reinterpret_cast< int*>(_v) = lineWidth(); break; case 12: *reinterpret_cast< int*>(_v) = midLineWidth(); break; case 13: *reinterpret_cast< int*>(_v) = margin(); break; } _id -= 14; } else if (_c == QMetaObject::WriteProperty) { void *_v = _a[0]; switch (_id) { case 0: setBackColor(*reinterpret_cast< QColor*>(_v)); break; case 1: setNormColor(*reinterpret_cast< QColor*>(_v)); break; case 2: setText(*reinterpret_cast< QString*>(_v)); break; case 3: setUseMask(*reinterpret_cast< bool*>(_v)); break; case 4: setSourcerName(*reinterpret_cast< QString*>(_v)); break; case 5: setToolTip(*reinterpret_cast< QString*>(_v)); break; case 6: setVisible(*reinterpret_cast< VISIBLE*>(_v)); break; case 7: setFont(*reinterpret_cast< QFont*>(_v)); break; case 8: setGeometry(*reinterpret_cast< QRect*>(_v)); break; case 9: setFrameShape(*reinterpret_cast< Shape*>(_v)); break; case 10: setFrameShadow(*reinterpret_cast< Shadow*>(_v)); break; case 11: setLineWidth(*reinterpret_cast< int*>(_v)); break; case 12: setMidLineWidth(*reinterpret_cast< int*>(_v)); break; case 13: setMargin(*reinterpret_cast< int*>(_v)); break; } _id -= 14; } else if (_c == QMetaObject::ResetProperty) { _id -= 14; } else if (_c == QMetaObject::QueryPropertyDesignable) { _id -= 14; } else if (_c == QMetaObject::QueryPropertyScriptable) { _id -= 14; } else if (_c == QMetaObject::QueryPropertyStored) { _id -= 14; } else if (_c == QMetaObject::QueryPropertyEditable) { _id -= 14; } else if (_c == QMetaObject::QueryPropertyUser) { _id -= 14; } #endif // QT_NO_PROPERTIES return _id; }