当前位置: 首页>>代码示例>>C++>>正文


C++ QStyleOption类代码示例

本文整理汇总了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);
}
开发者ID:eriser,项目名称:Anthem,代码行数:7,代码来源:OperatorUi.cpp

示例2: paintEvent

void FmAddModifyDialog::paintEvent(QPaintEvent *)
{
    QStyleOption opt;
    opt.init(this);
    QPainter p(this);
    style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this);
}
开发者ID:JinduYin,项目名称:YQCMM,代码行数:7,代码来源:fmaddmodifydialog.cpp

示例3: widget

QRect GroupBoxTaskMenuInlineEditor::editRectangle() const
{
    QWidget *w = widget();
    QStyleOption opt; // ## QStyleOptionGroupBox
    opt.init(w);
    return QRect(QPoint(), QSize(w->width(),20));
}
开发者ID:phen89,项目名称:rtqt,代码行数:7,代码来源:groupbox_taskmenu.cpp

示例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;
    }
}
开发者ID:Ezeer,项目名称:JomTobo,代码行数:34,代码来源:PeakMeter.cpp

示例5: paintEvent

void QCustomTabWidget::paintEvent(QPaintEvent *)
{
    QStyleOption opt;
        opt.init(this);
        QPainter p(this);
        style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this);
}
开发者ID:kimphg,项目名称:Jupiter,代码行数:7,代码来源:qcustomtabwidget.cpp

示例6: paintEvent

void SongsQueryWideget::paintEvent(QPaintEvent *)
{
    QStyleOption opt;
    opt.init(this);
    QPainter p(this);
    style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this);
}
开发者ID:JinduYin,项目名称:YQCMM,代码行数:7,代码来源:songsquerywideget.cpp

示例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 );
}
开发者ID:trifolio6,项目名称:Bulmages,代码行数:9,代码来源:blwidget.cpp

示例8: paintEvent

void LibraryReadingLineGridViewer::paintEvent(QPaintEvent* )
{
    QStyleOption opt;
    opt.init(this);
    QPainter p(this);
    style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this);
}
开发者ID:oskrs111,项目名称:3p.cervantes,代码行数:7,代码来源:LibraryReadingLineGridViewer.cpp

示例9: paintEvent

void EditNullView::paintEvent(QPaintEvent * event)
{
  QStyleOption opt;
  opt.init(this);
  QPainter p(this);
  style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this);
}
开发者ID:airguider,项目名称:OpenStudio,代码行数:7,代码来源:EditView.cpp

示例10: paintEvent

void SyncMeasuresDialog::paintEvent ( QPaintEvent * event )
{
  QStyleOption opt;
  opt.init(this);
  QPainter p(this);
  style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this);
}
开发者ID:pepsi7959,项目名称:OpenStudio,代码行数:7,代码来源:SyncMeasuresDialog.cpp

示例11: paintEvent

void ViewerBookmark::paintEvent( QPaintEvent* )
{
    QStyleOption opt;
    opt.init(this);
    QPainter p(this);
    style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this);
}
开发者ID:bq,项目名称:cervantes,代码行数:7,代码来源:ViewerBookmark.cpp

示例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);
    }
}
开发者ID:suyoghc,项目名称:mixxx,代码行数:33,代码来源:wdisplay.cpp

示例13: paintEvent

void WidgetBaseParameter::paintEvent(QPaintEvent *)
{
	QStyleOption opt;
	opt.init(this);
	QPainter p(this);
	style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this);
}
开发者ID:timmb,项目名称:HarmonicMotion,代码行数:7,代码来源:WidgetParameter.cpp

示例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
}
开发者ID:colinw7,项目名称:CQPaletteArea,代码行数:25,代码来源:CQSplitterArea.cpp

示例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);
}
开发者ID:easymodo,项目名称:qimgv,代码行数:7,代码来源:contextmenu.cpp


注:本文中的QStyleOption类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。