本文整理汇总了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);
}
示例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);
}
示例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;
}