本文整理汇总了C++中QStyleOption类的典型用法代码示例。如果您正苦于以下问题:C++ QStyleOption类的具体用法?C++ QStyleOption怎么用?C++ QStyleOption使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了QStyleOption类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: paintEvent
void OperatorUi::paintEvent(QPaintEvent*)
{
QStyleOption opt;
opt.init(this);
QPainter p(this);
style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this);
}
示例2: paintEvent
void FmAddModifyDialog::paintEvent(QPaintEvent *)
{
QStyleOption opt;
opt.init(this);
QPainter p(this);
style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this);
}
示例3: widget
QRect GroupBoxTaskMenuInlineEditor::editRectangle() const
{
QWidget *w = widget();
QStyleOption opt; // ## QStyleOptionGroupBox
opt.init(w);
return QRect(QPoint(), QSize(w->width(),20));
}
示例4: painter
void PeakMeter::paintEvent(QPaintEvent *){
QPainter painter(this);
//to allow stylesheets
QStyleOption opt;
opt.init(this);
style()->drawPrimitive(QStyle::PE_Widget, &opt, &painter, this);
//meter
if(isEnabled()){
//draw bottom to up
painter.fillRect(1, height()-1 , width()-2, -currentPeak * height(), usingGradient ? gradient : QBrush(solidColor) );
//draw max peak marker
if(maxPeak > 0 && paintingMaxPeak){
int peakY = height() - maxPeak * height();
painter.fillRect(0, peakY, width(), 3, MAX_PEAK_COLOR);
}
}
//decay
long ellapsedTimeFromLastUpdate = QDateTime::currentMSecsSinceEpoch() - lastUpdate;
currentPeak -= (float)ellapsedTimeFromLastUpdate/decayTime;
if(currentPeak < 0){
currentPeak = 0;
}
lastUpdate = QDateTime::currentMSecsSinceEpoch();
//max peak
long ellapsedTimeFromLastMaxPeak = QDateTime::currentMSecsSinceEpoch() - lastMaxPeakTime;
if(ellapsedTimeFromLastMaxPeak >= MAX_PEAK_SHOW_TIME){
maxPeak = 0;
}
}
示例5: paintEvent
void QCustomTabWidget::paintEvent(QPaintEvent *)
{
QStyleOption opt;
opt.init(this);
QPainter p(this);
style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this);
}
示例6: paintEvent
void SongsQueryWideget::paintEvent(QPaintEvent *)
{
QStyleOption opt;
opt.init(this);
QPainter p(this);
style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this);
}
示例7: paintEvent
/* Necesario para poner estilos a traves de hojas CSS.
*/
void BlWidget::paintEvent ( QPaintEvent * )
{
QStyleOption option;
option.initFrom ( this );
QPainter painter ( this );
style()->drawPrimitive ( QStyle::PE_Widget, &option, &painter, this );
}
示例8: paintEvent
void LibraryReadingLineGridViewer::paintEvent(QPaintEvent* )
{
QStyleOption opt;
opt.init(this);
QPainter p(this);
style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this);
}
示例9: paintEvent
void EditNullView::paintEvent(QPaintEvent * event)
{
QStyleOption opt;
opt.init(this);
QPainter p(this);
style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this);
}
示例10: paintEvent
void SyncMeasuresDialog::paintEvent ( QPaintEvent * event )
{
QStyleOption opt;
opt.init(this);
QPainter p(this);
style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this);
}
示例11: paintEvent
void ViewerBookmark::paintEvent( QPaintEvent* )
{
QStyleOption opt;
opt.init(this);
QPainter p(this);
style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this);
}
示例12: paintEvent
void WDisplay::paintEvent(QPaintEvent* ) {
QStyleOption option;
option.initFrom(this);
QStylePainter p(this);
p.drawPrimitive(QStyle::PE_Widget, option);
if (m_pPixmapBack) {
m_pPixmapBack->draw(0, 0, &p);
}
// If we are disabled, use the disabled pixmaps. If not, use the regular
// pixmaps.
const QVector<PaintablePointer>& pixmaps = (isDisabled() && m_bDisabledLoaded) ?
m_disabledPixmaps : m_pixmaps;
if (pixmaps.empty()) {
return;
}
int idx = getActivePixmapIndex();
// Clamp active pixmap index to valid ranges.
if (idx < 0) {
idx = 0;
} else if (idx >= pixmaps.size()) {
idx = pixmaps.size() - 1;
}
PaintablePointer pPixmap = pixmaps[idx];
if (pPixmap) {
pPixmap->draw(0, 0, &p);
}
}
示例13: paintEvent
void WidgetBaseParameter::paintEvent(QPaintEvent *)
{
QStyleOption opt;
opt.init(this);
QPainter p(this);
style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this);
}
示例14: paintEvent
void
CQSplitterHandle::
paintEvent(QPaintEvent *)
{
QStylePainter ps(this);
QStyleOption opt;
#if 0
ps.fillRect(rect(), QBrush(QColor(100,100,150)));
#else
opt.initFrom(this);
opt.rect = rect();
opt.state = (! area_->isVerticalDockArea() ? QStyle::State_None : QStyle::State_Horizontal);
if (mouseState_.pressed)
opt.state |= QStyle::State_Sunken;
if (mouseOver_)
opt.state |= QStyle::State_MouseOver;
ps.drawControl(QStyle::CE_Splitter, opt);
#endif
}
示例15: Q_UNUSED
void ContextMenu::paintEvent(QPaintEvent *event) {
Q_UNUSED(event)
QStyleOption opt;
opt.init(this);
QPainter p(this);
style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this);
}