void swcRectangle::setBorderRadius(int flag, int x, int y) { if (flag & C_NW) setBorderRadius(C_NW, x, y); if (flag & C_NE) setBorderRadius(C_NE, x, y); if (flag & C_SE) setBorderRadius(C_SE, x, y); if (flag & C_SW) setBorderRadius(C_SW, x, y); }
void FloatingActionButton::onContentSizeDirty() { float width = MIN(_contentSize.width, _contentSize.height); setBorderRadius((uint32_t)width); MaterialNode::onContentSizeDirty(); _drawNode->setContentSize(_contentSize * 2 * stappler::screen::density()); _drawNode->setPosition(_contentSize.width / 2, _contentSize.height / 2); _label->setPosition(_contentSize.width / 2, _contentSize.height / 2); _icon->setPosition(_contentSize.width / 2, _contentSize.height / 2); }
LegendItem::LegendItem(QwtPlot* owner) { setRenderHint(QwtPlotItem::RenderAntialiased); setTextPen(QPen(Qt::black)); setBackgroundOpacity(200); setBackgroundMode(ItemBackground); setBorderRadius(4); setAlignment(Qt::AlignTop | Qt::AlignHCenter); setMargin(0); setSpacing(4); setItemMargin(2); attach(owner); }
JLegendItem() { setRenderHint(QwtPlotItem::RenderAntialiased); setAlignment(Qt::AlignTop | Qt::AlignRight); setTextPen(QColor(200, 200, 200, 150)); setBorderPen(QColor(150, 150, 150, 50)); setBackgroundBrush(QColor(150, 150, 150, 20)); setBorderRadius(3); setMargin(2); setSpacing(10); setItemMargin(0); QFont _font = font(); _font.setPointSize(8); setFont(_font); }
int QwtPlotCanvas::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QFrame::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; } #ifndef QT_NO_PROPERTIES else if (_c == QMetaObject::ReadProperty) { void *_v = _a[0]; switch (_id) { case 0: *reinterpret_cast< double*>(_v) = borderRadius(); break; } _id -= 1; } else if (_c == QMetaObject::WriteProperty) { void *_v = _a[0]; switch (_id) { case 0: setBorderRadius(*reinterpret_cast< double*>(_v)); break; } _id -= 1; } else if (_c == QMetaObject::ResetProperty) { _id -= 1; } else if (_c == QMetaObject::QueryPropertyDesignable) { _id -= 1; } else if (_c == QMetaObject::QueryPropertyScriptable) { _id -= 1; } else if (_c == QMetaObject::QueryPropertyStored) { _id -= 1; } else if (_c == QMetaObject::QueryPropertyEditable) { _id -= 1; } else if (_c == QMetaObject::QueryPropertyUser) { _id -= 1; } #endif // QT_NO_PROPERTIES return _id; }
Canvas( QwtPlot *plot = NULL ): QwtPlotCanvas( plot ) { // The backing store is important, when working with widget // overlays ( f.e rubberbands for zooming ). // Here we don't have them and the internal // backing store of QWidget is good enough. setPaintAttribute( QwtPlotCanvas::BackingStore, false ); setBorderRadius( 10 ); if ( QwtPainter::isX11GraphicsSystem() ) { #if QT_VERSION < 0x050000 // Even if not liked by the Qt development, Qt::WA_PaintOutsidePaintEvent // works on X11. This has a nice effect on the performance. setAttribute( Qt::WA_PaintOutsidePaintEvent, true ); #endif // Disabling the backing store of Qt improves the performance // for the direct painter even more, but the canvas becomes // a native window of the window system, receiving paint events // for resize and expose operations. Those might be expensive // when there are many points and the backing store of // the canvas is disabled. So in this application // we better don't disable both backing stores. if ( testPaintAttribute( QwtPlotCanvas::BackingStore ) ) { setAttribute( Qt::WA_PaintOnScreen, true ); setAttribute( Qt::WA_NoSystemBackground, true ); } } setupPalette(); }