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


C++ QBitmap::clear方法代码示例

本文整理汇总了C++中QBitmap::clear方法的典型用法代码示例。如果您正苦于以下问题:C++ QBitmap::clear方法的具体用法?C++ QBitmap::clear怎么用?C++ QBitmap::clear使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在QBitmap的用法示例。


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

示例1: init

//---------------------------------------------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

示例2: createCrossCursor

//-------------------------------------------------------
void Terrain::createCrossCursor ()
{            
	//---------------------------------------------------
	// Define new cross cursor, more visible
	//---------------------------------------------------
/*		* B=1 and M=1 gives black.
		* B=0 and M=1 gives white.
		* B=0 and M=0 gives transparent.
		* B=1 and M=0 gives an XOR'd result.*/
	QBitmap *crossBits = new QBitmap(32,32);
	QBitmap *crossMask = new QBitmap(32,32);
	crossBits->clear();
 	crossMask->clear();
	QPainter pb (crossBits);
	QPainter pm (crossMask);
	QPen pen1(Qt::color1);
	pen1.setWidth(1);
	pb.setPen(pen1);
	pb.drawLine(6,16, 26,16);
	pb.drawLine(16,6, 16,26);
	pm.setPen(pen1);
	 // black
	pm.drawLine(6,16, 26,16);
	pm.drawLine(16,6, 16,26);
	// white
	pm.drawLine(6,15, 26,15);
	pm.drawLine(6,17, 26,17);
	
	pm.drawLine(15,6, 15,26);
	pm.drawLine(17,6, 17,26);
	
	pb.end();
	pm.end();
	myCrossCursor = QCursor(*crossBits, *crossMask);
    
    int v = 180;
    selectColor     = QColor(v,v,v);
    setCursor(myCrossCursor);
}
开发者ID:prohan91,项目名称:zyGrib,代码行数:40,代码来源:Terrain.cpp

示例3: sipNoMethod

static PyObject *meth_QBitmap_clear(PyObject *sipSelf, PyObject *sipArgs)
{
    PyObject *sipParseErr = NULL;

    {
        QBitmap *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_QBitmap, &sipCpp))
        {
            sipCpp->clear();

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    /* Raise an exception if the arguments couldn't be parsed. */
    sipNoMethod(sipParseErr, sipName_QBitmap, sipName_clear, doc_QBitmap_clear);

    return NULL;
}
开发者ID:rff255,项目名称:python-qt5,代码行数:21,代码来源:sipQtGuiQBitmap.cpp


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