• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ QBitmap函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中QBitmap函数的典型用法代码示例。如果您正苦于以下问题:C++ QBitmap函数的具体用法?C++ QBitmap怎么用?C++ QBitmap使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了QBitmap函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: qAbs

void FStateButton::changeState()
{
    state = qAbs(1 - state);
    if(state == 0){
        if(bflag == 0){
            setIcon(QIcon(fStateIcon));
            setMask(QBitmap(fStateIcon).mask());
        }
        else if(bflag == 1)
        {
            setText(fStateIcon);
        }

    }
    else if(state == 1)
    {
        if(bflag == 0){
            setIcon(QIcon(bStateIcon));
            setMask(QBitmap(bStateIcon).mask());
        }
        else if(bflag == 1)
        {
            setText(bStateIcon);
        }
    }
    emit stateChanged();
}
开发者ID:dragondjf,项目名称:QFramerTest,代码行数:27,代码来源:fstatebutton.cpp


示例2: cursorCross

void MainWindow::loadCursors()
{
   cursorList << Qt::ArrowCursor;
   
   QPixmap cursorCrossPic;
   cursorCrossPic.load((cursorDir+QString("cursorCross.bmp")), "BMP", Qt::MonoOnly);
   cursorCrossPic.setMask(QBitmap(cursorCrossPic));
   QCursor cursorCross(cursorCrossPic, 15,15);
   cursorList << cursorCross;

   QPixmap cursorDownPic;
   cursorDownPic.load((cursorDir+QString("cursorDown.bmp")), "BMP", Qt::MonoOnly);
   cursorDownPic.setMask(QBitmap(cursorDownPic));
   QCursor cursorDown(cursorDownPic, 15,31);
   cursorList << cursorDown;

   QPixmap cursorLeftPic;
   cursorLeftPic.load((cursorDir+QString("cursorLeft.bmp")), "BMP", Qt::MonoOnly);
   cursorLeftPic.setMask(QBitmap(cursorLeftPic));
   QCursor cursorLeft(cursorLeftPic, 0,15);
   cursorList << cursorLeft;

   QPixmap cursorRightPic;
   cursorRightPic.load((cursorDir+QString("cursorRight.bmp")), "BMP", Qt::MonoOnly);
   cursorRightPic.setMask(QBitmap(cursorRightPic));
   QCursor cursorRight(cursorRightPic, 31,15);
   cursorList << cursorRight;
   
   cursorList+=cursorList;
   roundNum = 1;
}
开发者ID:B-Rich,项目名称:3770Project,代码行数:31,代码来源:mainWindow.cpp


示例3: QCursor

/*!
  What do you think it does?
 */
void QHeader::init( int n )
{
    if ( !hSplitCur )
	hSplitCur = new QCursor( QBitmap( hsplit_width, hsplit_height, hsplit_bits, TRUE),
				 QBitmap( hsplit_width, hsplit_height, hsplitm_bits, TRUE)
				 );
    if ( !vSplitCur )
	vSplitCur = new QCursor( QBitmap( vsplit_width, vsplit_height, vsplit_bits, TRUE),
				 QBitmap( vsplit_width, vsplit_height, vsplitm_bits, TRUE)
				 );
    state = Idle;

    data = new QHeaderData;


    data->sizes.resize(n+1);
    data->labels.resize(n+1);
    data->a2l.resize(n+1);
    data->l2a.resize(n+1);
    data->clicks.resize(n+1);
    data->resize.resize(n+1);
    for ( int i = 0; i < n ; i ++ ) {
	data->labels[i] = 0;
	data->sizes[i] = 88;
	data->a2l[i] = i;
	data->l2a[i] = i;
    }
    data->clicks.fill( TRUE );
    data->resize.fill( TRUE );
    data->move = TRUE;

    setFrameStyle( QFrame::NoFrame );

    if ( orient == Horizontal ) {
	setCellWidth( 0 );
	setCellHeight( height() );
	setNumCols( n );
	setNumRows( 1 );
    } else {
	setCellWidth( width() );
	setCellHeight( 0 );
	setNumCols( 1 );
	setNumRows( n );
    }
    handleIdx = 0;
    //################
    data->labels[n] = 0;
    data->sizes[n] = 0;
    data->a2l[n] = 0;
    data->l2a[n] = 0;
    //#############
    setMouseTracking( TRUE );
    trackingIsOn = FALSE;
}
开发者ID:kthxbyte,项目名称:Qt1.45-Linaro,代码行数:57,代码来源:qheader.cpp


示例4: DEBUG_MSG

void
QDBase::createCursors(void)
{
   DEBUG_MSG("QDBase::createCursors(): loading cursors...\n");
   DEBUG_MAKE_INDENT(3);
#ifdef UNIX
   QSize wait_size(wait_width, wait_height);
   cur_wait=new QCursor(QBitmap(wait_size, (u_char *) wait_bits, TRUE),
		    QBitmap(wait_size, (u_char *) wait_mask_bits, TRUE),
		    wait_x, wait_y);

   QSize hand1_size(hand1_width, hand1_height);
   cur_hand1=new QCursor(QBitmap(hand1_size, (u_char *) hand1_bits, TRUE),
		     QBitmap(hand1_size, (u_char *) hand1_mask_bits, TRUE),
		     hand1_x, hand1_y);

   QSize hand2_size(hand2_width, hand2_height);
   cur_hand2=new QCursor(QBitmap(hand2_size, (u_char *) hand2_bits, TRUE),
		     QBitmap(hand2_size, (u_char *) hand2_mask_bits, TRUE),
		     hand2_x, hand2_y);

   QSize zoom_select_size(zoom_select_width, zoom_select_height);
   cur_zoom_select=new QCursor(QBitmap(zoom_select_size, 
                                       (u_char *) zoom_select_bits, TRUE),
                               QBitmap(zoom_select_size, 
                                       (u_char *) zoom_select_mask_bits, TRUE),
		     zoom_select_x, zoom_select_y);

   cur_hand_hl=new QCursor(ArrowCursor);	// TODO: get X11 cursor instead
   cur_ptr=new QCursor(ArrowCursor);
   cur_blank=new QCursor(BlankCursor);
#endif
}
开发者ID:OpenInkpot-archive,项目名称:iplinux-djvulibre,代码行数:33,代码来源:qd_base.cpp


示例5: QPainterPath

void TimeTooltip::buildPath()
{
    // Prepare the painter path for future use so
    // we only have to generate the text at runtime.

    // Draw the text box
    mPainterPath = QPainterPath();
    mPainterPath.addRect( mBox );

    // Draw the tip
    QPolygon polygon;
    polygon << QPoint( qMax( 0, mTipX - 3 ), mBox.height() )
            << QPoint( mTipX, mBox.height() + TIP_HEIGHT )
            << QPoint( qMin( mTipX + 3, mBox.width() ), mBox.height() );
    mPainterPath.addPolygon( polygon );

    // Store the simplified version of the path
    mPainterPath = mPainterPath.simplified();

    // Create the mask used to erase the background
    // Note: this is a binary bitmap (black & white)
    mMask = QBitmap( size() );
    QPainter painter( &mMask );
    painter.fillRect( mMask.rect(), Qt::white );
    painter.setPen( Qt::black );
    painter.setBrush( Qt::black );
    painter.drawPath( mPainterPath );
    painter.end();
}
开发者ID:Three-DS,项目名称:VLC-2.1.4,代码行数:29,代码来源:timetooltip.cpp


示例6: fromData

/*!
    Returns a copy of the given \a image converted to a bitmap using
    the specified image conversion \a flags.

    \sa fromData()
*/
QBitmap QBitmap::fromImage(const QImage &image, Qt::ImageConversionFlags flags)
{
    if (image.isNull())
        return QBitmap();

    QImage img = image.convertToFormat(QImage::Format_MonoLSB, flags);

    // make sure image.color(0) == Qt::color0 (white)
    // and image.color(1) == Qt::color1 (black)
    const QRgb c0 = QColor(Qt::black).rgb();
    const QRgb c1 = QColor(Qt::white).rgb();
    if (img.color(0) == c0 && img.color(1) == c1) {
        img.invertPixels();
        img.setColor(0, c1);
        img.setColor(1, c0);
    }

    QPixmapData *d;
//     QGraphicsSystem* gs = QApplicationPrivate::graphicsSystem();
//     if (gs)
//         d = gs->createPixmapData(QPixmapData::BitmapType);
//     else
//         d = QGraphicsSystem::createDefaultPixmapData(QPixmapData::BitmapType);
// 
//     d->fromImage(img, flags | Qt::MonoOnly);
    return QPixmap(d);
}
开发者ID:eaglezzb,项目名称:wtlcontrols,代码行数:33,代码来源:qbitmap.cpp


示例7: QBitmap

void wxBitmap::SetDepth(int depth)
{
    if (depth == 1)
        M_PIXDATA = QBitmap(GetWidth(), GetHeight());
    else
        M_PIXDATA = QPixmap(GetWidth(), GetHeight());
}
开发者ID:HanruZhou,项目名称:wxWidgets,代码行数:7,代码来源:bitmap.cpp


示例8: QBitmap

HCURSOR QWindowsCursor::createPixmapCursor(const QPixmap &pixmap, int hotX, int hotY)
{
    HCURSOR cur = 0;
    QBitmap mask = pixmap.mask();
    if (mask.isNull()) {
        mask = QBitmap(pixmap.size());
        mask.fill(Qt::color1);
    }

    HBITMAP ic = qt_pixmapToWinHBITMAP(pixmap, /* HBitmapAlpha */ 2);
    const HBITMAP im = qt_createIconMask(mask);

    ICONINFO ii;
    ii.fIcon     = 0;
    ii.xHotspot  = hotX;
    ii.yHotspot  = hotY;
    ii.hbmMask   = im;
    ii.hbmColor  = ic;

    cur = CreateIconIndirect(&ii);

    DeleteObject(ic);
    DeleteObject(im);
    return cur;
}
开发者ID:3163504123,项目名称:phantomjs,代码行数:25,代码来源:qwindowscursor.cpp


示例9: QWidget

Splash::Splash(const QString& imagePath)
    : QWidget(0, Qt::SplashScreen | Qt::X11BypassWindowManagerHint)
{
    cachedPixmap = QPixmap(imagePath);
    if (!cachedPixmap.mask().isNull())
    {
        QBitmap mask(cachedPixmap.size());
        mask.fill(Qt::color0);
        QBitmap pixMask = cachedPixmap.mask();
        QPainter p(&mask);
        p.drawPixmap((mask.width() - pixMask.width())/2, (mask.height() - pixMask.height())/2,
                     pixMask);
        setMask(mask);
    }
    else
        setMask(QBitmap());

    QWidget *d = QApplication::desktop()->screen();
    move( (d->width() - cachedPixmap.width ()) / 2,
          (d->height() - cachedPixmap.height()) / 2 );
    resize( cachedPixmap.size() );
    setFocusPolicy( Qt::NoFocus );

    show();
    update();

    QTimer::singleShot( SPLASH_DURATION, this, SLOT(hide()) );
}
开发者ID:mfuchs,项目名称:kget-gsoc,代码行数:28,代码来源:splash.cpp


示例10: QObject

// the what's this manager class
QWhatsThisPrivate::QWhatsThisPrivate()
    : QObject( 0, "global what's this object" )
{
    qAddPostRoutine( tearDownWhatsThis );
    whatsThat = 0;
    dict = new QPtrDict<QWhatsThisPrivate::Item>;
    tlw = new QPtrDict<QWidget>;
    wt = this;
    buttons = new QPtrDict<Button>;
    state = Inactive;
    cursor = new QCursor( QBitmap( cursor_bits_width, cursor_bits_height,
				   cursor_bits_bits, TRUE ),
			  QBitmap( cursor_mask_width, cursor_mask_height,
				   cursor_mask_bits, TRUE ),
			  1, 1 );
}
开发者ID:kthxbyte,项目名称:Qt1.45-Linaro,代码行数:17,代码来源:qwhatsthis.cpp


示例11: setAcceptDrops

//---------------------------------------------init
void ModuleWidget::init()
{
  m_pUi = new Ui::ModuleWidgetUI();
  m_pUi->setupUi(this);
  m_pUi->m_pModuleName->setText(QString(m_pModule->getRuntimeModuleID().c_str()));

  setAcceptDrops(true);

  m_aTimer.start(TIMER_UNIT); //interval the timer is invoked

  connectModuleSignals(); //call virtual method

  //QObject::connect(m_pUi->m_pRunButton, SIGNAL(pressed()), this, SLOT(onRunButton()));
  //QObject::connect(m_pUi->m_pResetButton, SIGNAL(pressed()), this, SLOT(onResetButton()));
  QObject::connect(&m_aTimer, SIGNAL(timeout()), this, SLOT(onTimer()));

  initInputs();
  initOutputs();

  setContextMenuPolicy(Qt::CustomContextMenu);

  static QBitmap aMask;
  if(aMask.width() == 0) //create the mask only once
  {
    aMask = QBitmap(size());
    aMask.clear();
    QPainter aPainter(&aMask);
    aPainter.setBrush(QBrush(Qt::SolidPattern));
    aPainter.drawEllipse(QPoint(width()/2, height()/2), width()/2, width()/2);
  }
  setMask(aMask);
}
开发者ID:cbastuck,项目名称:clay,代码行数:33,代码来源:ModuleWidget.cpp


示例12: b

void wxQtDCImpl::SetBrush(const wxBrush& brush)
{
    m_brush = brush;
    
    if (brush.GetStyle() == wxBRUSHSTYLE_STIPPLE_MASK_OPAQUE)
    {
        // Use a monochrome mask: use foreground color for the mask
        QBrush b(brush.GetHandle());
        b.setColor(m_textForegroundColour.GetHandle());
        b.setTexture(b.texture().mask());
        m_qtPainter->setBrush(b);
    }
    else if (brush.GetStyle() == wxBRUSHSTYLE_STIPPLE)
    {
        //Don't use the mask
        QBrush b(brush.GetHandle());

        QPixmap p = b.texture();
        p.setMask(QBitmap());
        b.setTexture(p);

        m_qtPainter->setBrush(b);
    }
    else
    {
        m_qtPainter->setBrush(brush.GetHandle());
    }

    ApplyRasterColourOp();
}
开发者ID:EEmmanuel7,项目名称:wxWidgets,代码行数:30,代码来源:dc.cpp


示例13: eventFilter

/*!
  Handle a mouse release event for the observed widget.

  \param mouseEvent Mouse event
  \sa eventFilter(), widgetMousePressEvent(),
      widgetMouseMoveEvent(),
*/
void QwtPanner::widgetMouseReleaseEvent( QMouseEvent *mouseEvent )
{
    if ( isVisible() )
    {
        hide();
#ifndef QT_NO_CURSOR
        showCursor( false );
#endif

        QPoint pos = mouseEvent->pos();
        if ( !isOrientationEnabled( Qt::Horizontal ) )
            pos.setX( d_data->initialPos.x() );
        if ( !isOrientationEnabled( Qt::Vertical ) )
            pos.setY( d_data->initialPos.y() );

        d_data->pixmap = QPixmap();
        d_data->contentsMask = QBitmap();
        d_data->pos = pos;

        if ( d_data->pos != d_data->initialPos )
        {
            Q_EMIT panned( d_data->pos.x() - d_data->initialPos.x(),
                d_data->pos.y() - d_data->initialPos.y() );
        }
    }
}
开发者ID:iclosure,项目名称:jdataanalyse,代码行数:33,代码来源:qwt_panner.cpp


示例14: QDialog

RongHe::RongHe(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::RongHe)
{
    ui->setupUi(this);
    //脡猫脰脙脭虏陆脟麓掳脤氓
    setWindowFlags(Qt::FramelessWindowHint);
    QPixmap mask(":/Images/images/ui_fix_min3.png");//录脫脭脴脩脷脗毛脥录脧帽
    setMask(QBitmap(mask.mask())); //脡猫脰脙麓掳脤氓碌脛脩脷脗毛脥录脧帽,驴脵鲁媒脥录脧帽碌脛掳脳脡芦脟酶脫貌脢碌脧脰虏禄鹿忙脭貌麓掳脤氓
    QPalette p;//脡猫脰脙碌梅脡芦掳氓
    p.setBrush(QPalette::Window, QBrush(mask));//陆芦碌梅脡芦掳氓碌脛禄颅脣垄脡猫脰脙脦陋脩脷脗毛脦禄脥录,脭脷虏禄鹿忙脭貌麓掳脤氓脡脧脧脭脢戮鲁枚脩脷脗毛脦禄脥录
    setPalette(p);
    //QPainter painter(this);
    //painter.drawPixmap(0,0,width(),height(),QPixmap(":/Images/images/ui_fix.png"));

    ui->pushButton->setStyleSheet("QPushButton{border-image: url(:/Images/images/pb_fix_work_normal.png);}"
                                   "QPushButton:hover{border-image: url(:/Images/images/pb_fix_work_hover.png);}"
                                     "QPushButton:pressed{border-image: url(:/Images/images/pb_fix_work_press.png);}");
    ui->pushButton_5->setStyleSheet("QPushButton{border-image: url(:/Images/images/pb_windwork_normal.png);}"
                                   "QPushButton:hover{border-image: url(:/Images/images/pb_windwork_hover.png);}"
                                     "QPushButton:pressed{border-image: url(:/Images/images/pb_windwork_press.png);}");
//    ui->pushButton_8->setStyleSheet("QPushButton{border-image: url(:/Images/images/pb_wavework_normal.png);}"
//                                   "QPushButton:hover{border-image: url(:/Images/images/pb_wavework_hover.png);}"
//                                     "QPushButton:pressed{border-image: url(:/Images/images/pb_wavework_press.png);}");
    //显示结果样式

    ui->pushButton_8->setStyleSheet("QPushButton{border-image: url(:/Images/images/pb_datatrans_normal.png);}"
                                   "QPushButton:hover{border-image: url(:/Images/images/pb_datatrans_hover.png);}"
                                     "QPushButton:pressed{border-image: url(:/Images/images/pb_datatrans_press.png);}");
    ui->pushButton_9->setStyleSheet("QPushButton{border-image: url(:/Images/images/pb_fix_result_normal.png);}"
                                   "QPushButton:hover{border-image: url(:/Images/images/pb_fix_result_hover.png);}"
                                     "QPushButton:pressed{border-image: url(:/Images/images/pb_fix_result_press.png);}");
    ui->pushButton_10->setStyleSheet("QPushButton{border-image: url(:/Images/images/pb_datamix_normal.png);}"
                                   "QPushButton:hover{border-image: url(:/Images/images/pb_datamix_hover.png);}"
                                     "QPushButton:pressed{border-image: url(:/Images/images/pb_datamix_press.png);}");
    ui->pushButton_6->setStyleSheet("QPushButton{border-image: url(:/Images/images/pb_mainui_return_normal2.png);}"
                                   "QPushButton:hover{border-image: url(:/Images/images/pb_mainui_return_hover2.png);}"
                                     "QPushButton:pressed{border-image: url(:/Images/images/pb_mainui_return_press2.png);}");
    /*source button
    ui->pushButton_bf->setStyleSheet("QPushButton{border-image: url(:/Images/images/pb_play_normal.png);}"
                                   "QPushButton:hover{border-image: url(:/Images/images/pb_play_hover.png);}"
                                     "QPushButton:pressed{border-image: url(:/Images/images/pb_play_press.png);}");
    ui->pushButton_zt->setStyleSheet("QPushButton{border-image: url(:/Images/images/pb_pause_normal.png);}"
                                   "QPushButton:hover{border-image: url(:/Images/images/pb_pause_hover.png);}"
                                     "QPushButton:pressed{border-image: url(:/Images/images/pb_pause_press.png);}");
    ui->pushButton_jias->setStyleSheet("QPushButton{border-image: url(:/Images/images/pb_foreward_normal.png);}"
                                   "QPushButton:hover{border-image: url(:/Images/images/pb_foreward_hover.png);}"
                                     "QPushButton:pressed{border-image: url(:/Images/images/pb_foreward_press.png);}");
    ui->pushButton_jians->setStyleSheet("QPushButton{border-image: url(:/Images/images/pb_back_normal.png);}"
                                   "QPushButton:hover{border-image: url(:/Images/images/pb_back_hover.png);}"
                                     "QPushButton:pressed{border-image: url(:/Images/images/pb_back_press.png);}");
    */

	timer = new QTimer;
    speed = 500;
    label = NULL;
    iterator = NULL;
    connect(timer,SIGNAL(timeout()),this,SLOT(nextPicture()));
}
开发者ID:ice200117,项目名称:oceanrs,代码行数:59,代码来源:ronghe.cpp


示例15: QLabel

VertexWidget::VertexWidget(QWidget *shapeWidget, QWidget *parent)
    : QLabel(parent)
    , m_widget(shapeWidget)
    , m_pressed(false)
{
    QPixmap p(vertexPng);
    setPixmap(p);
    setMask(QBitmap(p));
}
开发者ID:ascetic85,项目名称:ziwei,代码行数:9,代码来源:vertexwidget.cpp


示例16: QPixmap

void BackgroundWidget::paintEvent( QPaintEvent *e )
{
    if ( !b_withart )
    {
        /* we just want background autofill */
        QWidget::paintEvent( e );
        return;
    }

    int i_maxwidth, i_maxheight;
    QPixmap pixmap = QPixmap( pixmapUrl );
    QPainter painter(this);
    QBitmap pMask;
    float f_alpha = 1.0;

    i_maxwidth  = __MIN( maximumWidth(), width() ) - MARGIN * 2;
    i_maxheight = __MIN( maximumHeight(), height() ) - MARGIN * 2;

    painter.setOpacity( property( "opacity" ).toFloat() );

    if ( height() > MARGIN * 2 )
    {
        /* Scale down the pixmap if the widget is too small */
        if( pixmap.width() > i_maxwidth || pixmap.height() > i_maxheight )
        {
            pixmap = pixmap.scaled( i_maxwidth, i_maxheight,
                            Qt::KeepAspectRatio, Qt::SmoothTransformation );
        }
        else
        if ( b_expandPixmap &&
             pixmap.width() < width() && pixmap.height() < height() )
        {
            /* Scale up the pixmap to fill widget's size */
            f_alpha = ( (float) pixmap.height() / (float) height() );
            pixmap = pixmap.scaled(
                    width() - MARGIN * 2,
                    height() - MARGIN * 2,
                    Qt::KeepAspectRatio,
                    ( f_alpha < .2 )? /* Don't waste cpu when not visible */
                        Qt::SmoothTransformation:
                        Qt::FastTransformation
                    );
            /* Non agressive alpha compositing when sizing up */
            pMask = QBitmap( pixmap.width(), pixmap.height() );
            pMask.fill( QColor::fromRgbF( 1.0, 1.0, 1.0, f_alpha ) );
            pixmap.setMask( pMask );
        }

        painter.drawPixmap(
                MARGIN + ( i_maxwidth - pixmap.width() ) /2,
                MARGIN + ( i_maxheight - pixmap.height() ) /2,
                pixmap);
    }
    QWidget::paintEvent( e );
}
开发者ID:BloodExecutioner,项目名称:vlc,代码行数:55,代码来源:interface_widgets.cpp


示例17: QSize

void LaptopButton::setBitmap(const unsigned char *bitmap)
{
    if (bitmap)
        deco = QBitmap::fromData( QSize(8,  8),  bitmap);
    else {
        deco = QBitmap(8,8);
        deco.fill(Qt::color0);
    }
    deco.setMask(deco);
    repaint();
}
开发者ID:mgottschlag,项目名称:kwin-tiling,代码行数:11,代码来源:laptopclient.cpp


示例18: QDialog

Forecast::Forecast(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::Forecast)
{
    ui->setupUi(this);

    //ÉèÖô°Ìå
    setWindowFlags(Qt::FramelessWindowHint);
    QPixmap mask(":/Images/images/ui_pre_min2.png");
    setMask(QBitmap(mask.mask()));
    QPalette p;
    p.setBrush(QPalette::Window, QBrush(mask));
    setPalette(p);
    ui->pushButton->setStyleSheet("QPushButton{border-image: url(:/Images/images/pb_pre_3dstream_normal.png);}"
                                  "QPushButton:hover{border-image: url(:/Images/images/pb_pre_3dstream_hover.png);}"
                                  "QPushButton:pressed{border-image: url(:/Images/images/pb_pre_3dstream_press.png);}");
    ui->pushButton_6->setStyleSheet("QPushButton{border-image: url(:/Images/images/pb_mainui_return_normal2.png);}"
                                    "QPushButton:hover{border-image: url(:/Images/images/pb_mainui_return_hover2.png);}"
                                    "QPushButton:pressed{border-image: url(:/Images/images/pb_mainui_return_press2.png);}");
    ui->pushButton_hyf->setStyleSheet("QPushButton{border-image: url(:/Images/images/pb_pre_workocean_normal.png);}"
                                      "QPushButton:hover{border-image: url(:/Images/images/pb_pre_workocean_hover.png);}"
                                      "QPushButton:pressed{border-image: url(:/Images/images/pb_pre_workocean_press.png);}");
    ui->pushButton_xw->setStyleSheet("QPushButton{border-image: url(:/Images/images/pb_pre_workoral_normal.png);}"
                                     "QPushButton:hover{border-image: url(:/Images/images/pb_pre_workoral_hover.png);}"
                                     "QPushButton:pressed{border-image: url(:/Images/images/pb_pre_workoral_press.png);}");
    ui->pushButton_yc->setStyleSheet("QPushButton{border-image: url(:/Images/images/pb_pre_uplayer_normal.png);}"
                                     "QPushButton:hover{border-image: url(:/Images/images/pb_pre_uplayer_hover.png);}"
                                     "QPushButton:pressed{border-image: url(:/Images/images/pb_pre_uplayer_press.png);}");
    ui->pushButton_2->setStyleSheet("QPushButton{border-image: url(:/Images/images/pb_fix_result_normal2.png);}"
                                    "QPushButton:hover{border-image: url(:/Images/images/pb_fix_result_hover2.png);}"
                                    "QPushButton:pressed{border-image: url(:/Images/images/pb_fix_result_press2.png);}");
//    ui->pushButton_bf->setStyleSheet("QPushButton{border-image: url(:/Images/images/pb_play_normal.png);}"
//                                   "QPushButton:hover{border-image: url(:/Images/images/pb_play_hover.png);}"
//                                     "QPushButton:pressed{border-image: url(:/Images/images/pb_play_press.png);}");
//    ui->pushButton_zt->setStyleSheet("QPushButton{border-image: url(:/Images/images/pb_pause_normal.png);}"
//                                   "QPushButton:hover{border-image: url(:/Images/images/pb_pause_hover.png);}"
//                                     "QPushButton:pressed{border-image: url(:/Images/images/pb_pause_press.png);}");
//    ui->pushButton_jias->setStyleSheet("QPushButton{border-image: url(:/Images/images/pb_foreward_normal.png);}"
//                                   "QPushButton:hover{border-image: url(:/Images/images/pb_foreward_hover.png);}"
//                                     "QPushButton:pressed{border-image: url(:/Images/images/pb_foreward_press.png);}");
//    ui->pushButton_jians->setStyleSheet("QPushButton{border-image: url(:/Images/images/pb_back_normal.png);}"
//                                   "QPushButton:hover{border-image: url(:/Images/images/pb_back_hover.png);}"
//                                     "QPushButton:pressed{border-image: url(:/Images/images/pb_back_press.png);}");

    timer = new QTimer;
    speed = 500;
    label = NULL;
    iterator = NULL;
    connect(timer,SIGNAL(timeout()),this,SLOT(nextPicture()));

    select_window=NULL;
}
开发者ID:ice200117,项目名称:oceanrs,代码行数:52,代码来源:forecast.cpp


示例19: switch

void wxCursor::InitFromStock( wxStockCursor cursorId )
{
    Qt::CursorShape qt_cur;
    switch (cursorId)
    {
    case wxCURSOR_BLANK:
    {
        m_qtCursor = QBitmap();
        return;
    }
//    case wxCURSOR_ARROW: 
    case wxCURSOR_DEFAULT:     qt_cur = Qt::ArrowCursor;    break;
//    case wxCURSOR_RIGHT_ARROW:
    case wxCURSOR_HAND:        qt_cur = Qt::OpenHandCursor; break;
    case wxCURSOR_CROSS:       qt_cur = Qt::CrossCursor;    break;
    case wxCURSOR_SIZEWE:      qt_cur = Qt::SizeHorCursor;  break;
    case wxCURSOR_SIZENS:      qt_cur = Qt::SizeVerCursor;  break;
    case wxCURSOR_ARROWWAIT:   qt_cur = Qt::BusyCursor;     break;
    case wxCURSOR_WATCH:
    case wxCURSOR_WAIT:        qt_cur = Qt::WaitCursor;     break;
    case wxCURSOR_SIZING:      qt_cur = Qt::SizeAllCursor;  break;
//    case wxCURSOR_SPRAYCAN:
    case wxCURSOR_IBEAM:       qt_cur = Qt::IBeamCursor;    break;
//    case wxCURSOR_PENCIL:
    case wxCURSOR_NO_ENTRY:    qt_cur = Qt::ForbiddenCursor; break;
    case wxCURSOR_SIZENWSE:    qt_cur = Qt::SizeFDiagCursor; break;
    case wxCURSOR_SIZENESW:    qt_cur = Qt::SizeBDiagCursor; break;
    case wxCURSOR_QUESTION_ARROW: qt_cur = Qt::WhatsThisCursor; break;
/*  case wxCURSOR_PAINT_BRUSH:
    case wxCURSOR_MAGNIFIER:
    case wxCURSOR_CHAR:
    case wxCURSOR_LEFT_BUTTON: 
    case wxCURSOR_MIDDLE_BUTTON:
    case wxCURSOR_RIGHT_BUTTON:
    case wxCURSOR_BULLSEYE:
    case wxCURSOR_POINT_LEFT:
    case wxCURSOR_POINT_RIGHT:
    case wxCURSOR_DOUBLE_ARROW:
    case wxCURSOR_CROSS_REVERSE:
    case wxCURSOR_BASED_ARROW_DOWN:
    case wxCURSOR_BASED_ARROW_UP:   qt_cur = Qt::UpArrowCursor; break;
*/
    default:
        wxFAIL_MSG(wxT("unsupported cursor type"));
        // will use the standard one
        break;
    }

    m_qtCursor.setShape(qt_cur);
}
开发者ID:vdm113,项目名称:wxWidgets-ICC-patch,代码行数:50,代码来源:cursor.cpp


示例20: r

/*!
   Calculate a mask, that can be used to clip away the border frame

   \param size Size including the frame
*/
QBitmap QwtPlotCanvas::borderMask( const QSize &size ) const
{
    const QRect r( 0, 0, size.width(), size.height() );

    const QPainterPath path = borderPath( r );
    if ( path.isEmpty() )
        return QBitmap();

    QImage image( size, QImage::Format_ARGB32_Premultiplied );
    image.fill( Qt::color0 );

    QPainter painter( &image );
    painter.setClipPath( path );
    painter.fillRect( r, Qt::color1 );

    // now erase the frame

    painter.setCompositionMode( QPainter::CompositionMode_DestinationOut );

    if ( testAttribute(Qt::WA_StyledBackground ) )
    {
        QStyleOptionFrame opt;
        opt.initFrom(this);
        opt.rect = r;
        style()->drawPrimitive( QStyle::PE_Frame, &opt, &painter, this );
    }
    else
    {
        if ( d_data->borderRadius > 0 && frameWidth() > 0 )
        {
            painter.setPen( QPen( Qt::color1, frameWidth() ) );
            painter.setBrush( Qt::NoBrush );
            painter.setRenderHint( QPainter::Antialiasing, true );

            painter.drawPath( path );
        }
    }

    painter.end();

    const QImage mask = image.createMaskFromColor(
        QColor( Qt::color1 ).rgb(), Qt::MaskOutColor );

    return QBitmap::fromImage( mask );
}
开发者ID:Alex-Rongzhen-Huang,项目名称:OpenPilot,代码行数:50,代码来源:qwt_plot_canvas.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ QBluetoothAddress函数代码示例发布时间:2022-05-30
下一篇:
C++ QAngle函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap