本文整理汇总了C++中setMask函数的典型用法代码示例。如果您正苦于以下问题:C++ setMask函数的具体用法?C++ setMask怎么用?C++ setMask使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setMask函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: ndbrequire
void
DblqhProxy::execEXEC_SR_2(Signal* signal, GlobalSignalNumber gsn)
{
ndbrequire(signal->getLength() == Ss_EXEC_SR_2::Sig::SignalLength);
const Ss_EXEC_SR_2::Sig* sig =
(const Ss_EXEC_SR_2::Sig*)signal->getDataPtr();
Uint32 ssId = getSsId(sig);
bool found = false;
Ss_EXEC_SR_2& ss = ssFindSeize<Ss_EXEC_SR_2>(ssId, &found);
if (!found) {
jam();
setMask(ss);
}
ndbrequire(sig->nodeId == getOwnNodeId());
if (ss.m_sigcount == 0) {
jam();
ss.m_gsn = gsn;
ss.m_sig = *sig;
} else {
jam();
ndbrequire(ss.m_gsn == gsn);
ndbrequire(memcmp(&ss.m_sig, sig, sizeof(*sig)) == 0);
}
ss.m_sigcount++;
// reversed roles
recvCONF(signal, ss);
}
开发者ID:ForcerKing,项目名称:ShaoqunXu-mysql5.7,代码行数:31,代码来源:DblqhProxy.cpp
示例2: QWidget
QtCurveSizeGrip::QtCurveSizeGrip(QtCurveClient* client):
QWidget(0),
client_(client)
{
setAttribute(Qt::WA_NoSystemBackground );
setAutoFillBackground(false);
// cursor
setCursor(Qt::SizeFDiagCursor);
// size
setFixedSize(QSize(GRIP_SIZE, GRIP_SIZE));
// mask
QPolygon p;
p << QPoint(0, GRIP_SIZE)
<< QPoint(GRIP_SIZE, 0)
<< QPoint(GRIP_SIZE, GRIP_SIZE)
<< QPoint(0, GRIP_SIZE);
setMask(QRegion(p));
// embed
embed();
updatePosition();
// event filter
client->widget()->installEventFilter(this);
// show
show();
}
开发者ID:KDE,项目名称:qtcurve,代码行数:32,代码来源:qtcurvesizegrip.cpp
示例3: maskPainter
void PopupMessage::dissolveMask()
{
if( m_stage == 1 )
{
//repaint( false );
QPainter maskPainter(&m_mask);
m_mask.fill(Qt::black);
maskPainter.setBrush(Qt::white);
maskPainter.setPen(Qt::white);
maskPainter.drawRect( m_mask.rect() );
m_dissolveSize += m_dissolveDelta;
if( m_dissolveSize > 0 )
{
//maskPainter.setCompositionMode( Qt::EraseROP );
//FIXME: QRubberBand
int x, y, s;
const int size = 16;
for (y = 0; y < height() + size; y += size)
{
x = width();
s = m_dissolveSize * x / 128;
for ( ; x > size; x -= size, s -= 2 )
{
if (s < 0)
break;
maskPainter.drawEllipse(x - s / 2, y - s / 2, s, s);
}
}
}
else if( m_dissolveSize < 0 )
{
m_dissolveDelta = 1;
killTimer( m_timerId );
if( m_timeout )
{
m_timerId = startTimer( 40 );
m_stage = 2;
}
}
setMask(m_mask);
}
else if ( m_stage == 2 )
{
countDown();
}
else
{
deleteLater();
}
}
开发者ID:adaptee,项目名称:qterm-hack,代码行数:60,代码来源:popupMessage.cpp
示例4: b
void ToolButtonTip::updateMask( void )
{
// as this widget has not a rectangular shape AND is a top
// level widget (which doesn't allow painting only particular
// regions), we have to set a mask for it
QBitmap b( size() );
b.clear();
QPainter p( &b );
p.setBrush( Qt::color1 );
p.setPen( Qt::color1 );
p.drawRoundRect( 0, 0, width() - 1, height() - 1,
ROUNDED / width(), ROUNDED / height() );
if( m_toolButton )
{
QPoint pt = m_toolButton->mapToGlobal( QPoint( 0, 0 ) );
const int dx = pt.x()-x();
if( dx < 10 && dx >= 0 )
{
p.fillRect( dx, 0, 10, 10, Qt::color1 );
}
}
setMask( b );
}
开发者ID:EmebedQtsoft,项目名称:italc2,代码行数:26,代码来源:ToolButton.cpp
示例5: ideInitialize
/*
* Initialize the disk driver.
* Read the partition table.
*/
static void ideInitialize(void) {
unsigned int totalSectors;
/* determine disk size */
waitDiskReady();
totalSectors = *DISK_CAP;
if (totalSectors == 0) {
panic("IDE disk not found");
}
/* read partition table */
readPartitionTable();
if (debugIdeDisk) {
printf("IDE disk has %d (0x%X) sectors\n",
totalSectors, totalSectors);
showPartitionTable();
}
/* disk queue is empty */
ideTab.b_actf = NULL;
ideTab.b_actl = NULL;
/* no disk operation in progress, no errors */
ideTab.b_active = 0;
ideTab.b_errcnt = 0;
/* set ISR and enable interrupts */
setISR(DISK_IRQ, ideISR);
setMask(getMask() | (1 << DISK_IRQ));
/* the disk is now initialized */
ideInitialized = TRUE;
}
开发者ID:MartinGeisse,项目名称:vshg01,代码行数:32,代码来源:idedsk.c
示例6: addChild
void MaskingSample::setup()
{
ci::app::getWindow()->getSignalKeyUp().connect(std::bind(&MaskingSample::keyUp, this, std::placeholders::_1));
// Load the mask texture
ci::gl::TextureRef maskTexture = ci::gl::Texture::create(ci::loadImage(ci::app::loadAsset("circle_mask_blurred.jpg")));
// Create the mask shape
//mMask = Shape::create(maskTexture);
mMask = Shape::createRect(100, 100);
mMask->setAlignment(Alignment::CENTER_CENTER);
mMask->setPosition(ci::app::getWindowWidth()/2, ci::app::getWindowHeight()/2);
ci::app::timeline().apply(&mMask->getRotationAnim(), 0.0f, ci::toRadians(360.0f), 1.0f).loop();
ci::app::timeline().apply(&mMask->getScaleAnim(), ci::vec2(1.0f, 1.0f), ci::vec2(4.0f, 4.0f), 1.0f).loop().pingPong();
// Load the image texture
ci::gl::TextureRef texture = ci::gl::Texture::create(ci::loadImage(ci::app::loadAsset("cat.jpg")));
// Create the image shape
mImage = Image::create(texture);
addChild(mImage);
// Set the image mask
setMask(mMask);
// Connect mouse event
getSignal(MouseEvent::MOVE).connect(std::bind(&MaskingSample::onMouseMove, this, std::placeholders::_1));
}
开发者ID:PetrosKataras,项目名称:Cinder-poScene,代码行数:28,代码来源:MaskingSample.cpp
示例7: jam
void
DblqhProxy::execSTART_RECREQ(Signal* signal)
{
if (refToMain(signal->getSendersBlockRef()) == DBLQH) {
jam();
execSTART_RECREQ_2(signal);
return;
}
const StartRecReq* req = (const StartRecReq*)signal->getDataPtr();
Ss_START_RECREQ& ss = ssSeize<Ss_START_RECREQ>();
ss.m_req = *req;
// seize records for sub-ops
Uint32 i;
for (i = 0; i < ss.m_req2cnt; i++) {
Ss_START_RECREQ_2::Req tmp;
tmp.proxyBlockNo = ss.m_req2[i].m_blockNo;
Uint32 ssId2 = getSsId(&tmp);
Ss_START_RECREQ_2& ss2 = ssSeize<Ss_START_RECREQ_2>(ssId2);
ss.m_req2[i].m_ssId = ssId2;
// set wait-for bitmask in SsParallel
setMask(ss2);
}
ndbrequire(signal->getLength() == StartRecReq::SignalLength);
sendREQ(signal, ss);
}
开发者ID:ForcerKing,项目名称:ShaoqunXu-mysql5.7,代码行数:29,代码来源:DblqhProxy.cpp
示例8: QPainterPath
void CCBar::resizeEvent(QResizeEvent *e)
{
m_border = QPainterPath();
m_border.moveTo(m_offset, 0);
m_border.cubicTo(
m_offset, 0,
0, m_mask.height()/2,
m_offset, m_mask.height()
);
m_border.lineTo(m_mask.width()-m_offset, m_mask.height());
m_border.cubicTo(
m_mask.width()-m_offset, m_mask.height(),
m_mask.width(), m_mask.height()/2,
m_mask.width()-m_offset, 0
);
m_border.lineTo(m_offset, 0);
QPainter p(&m_mask);
p.setPen(QPen(Qt::black,1, Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin));
p.setBrush(Qt::red);
p.drawPath(m_border);
setMask(m_mask.mask());
}
开发者ID:BackupTheBerlios,项目名称:adresis-svn,代码行数:26,代码来源:ccbar.cpp
示例9: QDialog
RColorDialog::RColorDialog(QWidget *parent) :
QDialog(parent)
{
setFixedSize(220,300);
QGridLayout *l = new QGridLayout;
l->setSpacing(3);
QList<QColor> colorlist;
colorlist << "#1D48BB" << "#06829E" << "#006600" << "#990000" << "#800080" << "#FFAA00" << "#A6A6A6"<<"#505050" <<"#000000";
for (int i = 0; i < 3; i++)
for (int j = 0; j < 3; j++)
{
RPushButton *bt = new RPushButton;
bt->setFixedSize(60,60);
connect(bt, SIGNAL(clicked()),SLOT(setColor()));
l->addWidget(bt, i, j);
}
RPushButton *closebt = new RPushButton;
closebt->setFixedSize(60,60);
connect(closebt,SIGNAL(clicked()),SLOT(close()));
l->addWidget(closebt,3,2);
setLayout(l);
setMask(geometry());
}
开发者ID:stemuedendron,项目名称:rack-radio-automation-construction-kit,代码行数:31,代码来源:rcolordialog.cpp
示例10: setWindowFlags
TicketPopup::TicketPopup(QWidget *parent, QString text, QPixmap pixmap, int timeToClose)
{
setWindowFlags(Qt::Dialog|Qt::FramelessWindowHint);
setWindowModality(Qt::ApplicationModal);
setObjectName("main");
gridLayout = new QGridLayout(this);
imagelabel = new QLabel(this);
imagelabel->setPixmap(pixmap);
imagelabel->setAlignment(Qt::AlignCenter);
gridLayout->addWidget(imagelabel, 0, 0);
editText = new QTextEdit(this);
editText->setHtml(text);
editText->setReadOnly(true);
gridLayout->addWidget(editText, 1, 0);
gridLayout->setMargin(17);
timer = new QTimer(this);
timer->setInterval(timeToClose);
connect(timer, SIGNAL(timeout()), this, SLOT(closeIt()));
QString path = KStandardDirs::locate("appdata", "images/");
QString filen = path + "/imgPrint.png";
QPixmap pix(filen);
setMask(pix.mask());
QString st;
st = QString("main { background-image: url(%1);}").arg(filen);
setStyleSheet(st);
}
开发者ID:lastprimenumbers,项目名称:lemonpos,代码行数:30,代码来源:ticketpopup.cpp
示例11: m_view
CursorWindow::CursorWindow(const QImage &img, QPoint hot, QWidget* sk)
:QWidget(0),
m_view(0), skin(sk),
hotspot(hot)
{
setWindowFlags( Qt::FramelessWindowHint );
mouseRecipient = 0;
setMouseTracking(true);
#ifndef QT_NO_CURSOR
setCursor(Qt::BlankCursor);
#endif
QPixmap p;
p = QPixmap::fromImage(img);
if (!p.mask()) {
if ( img.hasAlphaChannel() ) {
QBitmap bm;
bm = QPixmap::fromImage(img.createAlphaMask());
p.setMask( bm );
} else {
QBitmap bm;
bm = QPixmap::fromImage(img.createHeuristicMask());
p.setMask( bm );
}
}
QPalette palette;
palette.setBrush(backgroundRole(), QBrush(p));
setPalette(palette);
setFixedSize( p.size() );
if ( !p.mask().isNull() )
setMask( p.mask() );
}
开发者ID:kileven,项目名称:qt5,代码行数:31,代码来源:deviceskin.cpp
示例12: 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
示例13: QWidget
ShapeWidget::ShapeWidget(QWidget *parent)
: QWidget(parent,Qt::FramelessWindowHint)
{
QPixmap pix;
pix.load(":/images/tux.png",0,Qt::AvoidDither|Qt::ThresholdDither|Qt::ThresholdAlphaDither);
resize(pix.size());
setMask(pix.mask());
}
开发者ID:cugxiangzhenwei,项目名称:MySrcCode,代码行数:8,代码来源:shapewidget.cpp
示例14: resizeEvent
void resizeEvent( QResizeEvent* r )
{
QSize s = r->size();
QRegion reg( 0, 0, s.width(), s.height() );
QRegion reg2( 2, 2, s.width() - 4, s.height() - 4 );
QRegion reg3 = reg.subtracted( reg2 );
setMask( reg3 );
}
开发者ID:ACorradini,项目名称:QGIS,代码行数:8,代码来源:qgsmapoverviewcanvas.cpp
示例15: MessageBubble
MessageBubble(QWidget* parent) : QWidget(parent, Qt::Popup | Qt::Window) {
QPolygon poly;
for (int i = 0; i < 5; i++) {
poly << points[i];
}
QRegion reg(poly);
setMask(reg);
}
开发者ID:afester,项目名称:CodeSamples,代码行数:8,代码来源:main.cpp
示例16: maskedRegion
void RotationDialog::resizeEvent(QResizeEvent *)
{
QPainterPath p;
p.addRoundedRect(rect(), 20, 20);
QRegion maskedRegion(p.toFillPolygon().toPolygon());
setMask(maskedRegion);
updatePath();
}
开发者ID:chenhbzl,项目名称:BooxApp,代码行数:8,代码来源:rotation_dialog.cpp
示例17: bfin_interrupt_enable
void bfin_interrupt_enable(bfin_isr_t *isr, bool enable) {
rtems_interrupt_level isrLevel;
rtems_interrupt_disable(isrLevel);
isr->mask = enable ? (1 << isr->source) : 0;
setMask(isr->vector);
rtems_interrupt_enable(isrLevel);
}
开发者ID:epicsdeb,项目名称:rtems,代码行数:8,代码来源:interrupt.c
示例18: MakeRefByID
SingleSampler::SingleSampler()
{
MakeRefByID(FOREVER, 0, CreateParameterBlock(pbDesc, PBLOCK_LENGTH, CURRENT_VERSION));
DbgAssert(pParamBlk);
pParamBlk->SetValue(PB_QUALITY, 0, 0 );
n = 1;
setMask( mask, ALL_ONES );
}
开发者ID:DimondTheCat,项目名称:xray,代码行数:8,代码来源:sampsampler.cpp
示例19: QPixmap
void MainWindow::updateDecoration()
{
m_device = QPixmap(":/device-640x480.png", "png");
QBitmap bitmap = m_device.createHeuristicMask();
setFixedSize(m_device.size());
setMask(bitmap);
update();
}
开发者ID:Crob4,项目名称:HackaGecko,代码行数:8,代码来源:mainwindow.cpp
示例20: main
int main()
{
int n;
char group[3];
std::vector<uint16_t> cards;
scanf("%d", &n);
for (int i = 0; i < n; i++)
{
scanf("%s", &group);
uint16_t card = 0;
card = setMask(card, getMask(group[0]));
card = setMask(card, getMask(group[1]));
cards.push_back(card);
}
printf("%d\n", solve_442a(cards));
return 0;
}
开发者ID:phaser,项目名称:asocssap,代码行数:17,代码来源:problem_442a.cpp
注:本文中的setMask函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论