本文整理汇总了C++中pm函数的典型用法代码示例。如果您正苦于以下问题:C++ pm函数的具体用法?C++ pm怎么用?C++ pm使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了pm函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: pm
// Channel display background effect.
void ChannelStrip::setDisplayEffect ( bool bDisplayEffect )
{
QPalette pal;
pal.setColor(QPalette::Foreground, Qt::yellow);
pal.setColor(QPalette::ButtonText, Qt::yellow);
m_ui.EngineNameTextLabel->setPalette(pal);
m_ui.MidiPortChannelTextLabel->setPalette(pal);
pal.setColor(QPalette::Foreground, Qt::green);
pal.setColor(QPalette::ButtonText, Qt::green);
if (bDisplayEffect) {
QPixmap pm(":/images/displaybg1.png");
pal.setBrush(QPalette::Background, QBrush(pm));
} else {
pal.setColor(QPalette::Background, Qt::black);
}
m_ui.ChannelInfoFrame->setPalette(pal);
m_ui.InstrumentNamePushButton->setPalette(pal);
m_ui.StreamVoiceCountTextLabel->setPalette(pal);
}
示例2: pm
/*static*/
void MongoFile::closeAllFiles( stringstream &message ) {
static int closingAllFiles = 0;
if ( closingAllFiles ) {
message << "warning closingAllFiles=" << closingAllFiles << endl;
return;
}
++closingAllFiles;
LockMongoFilesExclusive lk;
ProgressMeter pm( mmfiles.size() , 2 , 1 );
set<MongoFile*> temp = mmfiles;
for ( set<MongoFile*>::iterator i = temp.begin(); i != temp.end(); i++ ) {
(*i)->close(); // close() now removes from mmfiles
pm.hit();
}
message << "closeAllFiles() finished";
--closingAllFiles;
}
示例3: zzpy__pyDFMenu_get
tp_obj zzpy__pyDFMenu_get(tp_vm *vm)
{
tp_obj self = tp_getraw(vm);
IScriptEngine *engine = (IScriptEngine*)tp_get(vm, vm->builtins, tp_string("userdata")).data.val;
IEditor *editor = engine->editor();
TinyParams pm(vm);
ADM_scriptDFMenuHelper *me=(ADM_scriptDFMenuHelper *)pm.asThis(&self, ADM_PYID_DF_INTEGER);
char const *key = pm.asString();
if (!strcmp(key, "index"))
{
if(!me) pm.raise("pyDFMenu:No this!");
return tp_number(me->index());
}
if (!strcmp(key, "addItem"))
{
return tp_method(vm, self, zzpy_addItem);
}
return tp_get(vm, self, tp_string(key));
}
示例4: files
void LightboxWidget::print()
{
QString fn = QFileDialog::getSaveFileName("screenshot.png",
"PNG files (*.png)", this,
"Screenshot dialog",
"Select a filename for saving");
if(!fn.isNull())
{
QPixmap pm(centralWidget()->size());
bitBlt(&pm, 0, 0, centralWidget());
// QImage im = pm.convertToImage();
// int dpm( (72.0 / 2.54) * 100.0 );
// im.setDotsPerMeterX(dpm);
// im.setDotsPerMeterY(dpm);
pm.save(fn, "PNG", 100);
}
}
示例5: framr_notify
void framr_notify(actor_t *actor, message_t *message)
{
int size;
framr_t *self;
struct core_vector *spawners;
self = thorium_actor_concrete_actor(actor);
spawners = &self->spawners;
size = core_vector_size(spawners);
pm("Boss received NOTIFY\n");
++self->completed;
if (self->completed == size) {
thorium_actor_send_range_empty(actor, spawners, ACTION_ASK_TO_STOP);
}
}
示例6: pm
ProperClassMethods::ProperClassMethods(shared_ptr<Class> const &clazz)
{
for(std::size_t m=0;m<clazz->get_methods_count();++m)
{
proper_method pm(clazz->get_method(m));
if(!m_methods.push_back(pm).second)
{
std::size_t n(1);
do
{
format fmtName("%1%_%2%");
fmtName % clazz->get_method(m)->get_name();
fmtName % n++;
pm.m_proper_name=fmtName.str();
}
while(!m_methods.push_back(pm).second);
}
}
}
示例7: pm
// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
int QFilterParametersWriter::WritePipelineToFile(FilterPipeline::Pointer pipeline, const QString& filePath, const QString& name, QSettings::Format format, IObserver* obs)
{
if(NULL == pipeline.get())
{
if(NULL != obs)
{
PipelineMessage pm(QFilterParametersWriter::ClassName(), "FilterPipeline Object was NULL for writing", -1, PipelineMessage::Error);
obs->processPipelineMessage(pm);
}
return -1;
}
FilterPipeline::FilterContainerType& filters = pipeline->getFilterContainer();
QFilterParametersWriter::Pointer writer = QFilterParametersWriter::New();
// This will open the file, and write/update the initial group of settings like the name and DREAM3D Version
writer->openFile(filePath, format);
// Loop over each filter and write it's input parameters to the file
int count = filters.size();
int index = 0;
for(qint32 i = 0; i < count; ++i)
{
AbstractFilter::Pointer filter = filters.at(i);
if(NULL != filter.get())
{
index = filter->writeFilterParameters(writer.get(), index);
}
else
{
AbstractFilter::Pointer badFilter = AbstractFilter::New();
writer->openFilterGroup(badFilter.get(), i);
writer->writeValue("Unkown Filter", "ERROR: Filter instance was NULL within the PipelineFilterWidget instance. Report this error to the DREAM3D Developers");
writer->closeFilterGroup();
}
}
writer->setNumberOfFilters(index);
writer->setPipelineName(name);
writer->closeFile(); // Close the file
return 0;
}
示例8: pm
void ComputeMgr::updateLocalComputes()
{
ComputeMap *computeMap = ComputeMap::Object();
CProxy_ProxyMgr pm(CkpvAccess(BOCclass_group).proxyMgr);
ProxyMgr *proxyMgr = pm.ckLocalBranch();
LdbCoordinator *ldbCoordinator = LdbCoordinator::Object();
computeFlag.resize(0);
const int nc = computeMap->numComputes();
for (int i=0; i<nc; i++) {
if ( computeMap->node(i) == CkMyPe() &&
computeMap->newNumPartitions(i) > 1 ) {
Compute *c = computeMap->compute(i);
ldbCoordinator->Migrate(c->ldObjHandle,CkMyPe());
delete c;
computeMap->registerCompute(i,NULL);
if ( computeMap->newNode(i) == CkMyPe() ) computeFlag.add(i);
} else
if (computeMap->newNode(i) == CkMyPe() && computeMap->node(i) != CkMyPe())
{
computeFlag.add(i);
for (int n=0; n < computeMap->numPids(i); n++)
{
proxyMgr->createProxy(computeMap->pid(i,n));
}
}
else if (computeMap->node(i) == CkMyPe() &&
(computeMap->newNode(i) != -1 && computeMap->newNode(i) != CkMyPe() ))
{
// CkPrintf("delete compute %d on pe %d\n",i,CkMyPe());
delete computeMap->compute(i);
computeMap->registerCompute(i,NULL);
}
}
if (!CkMyPe())
{
CkStartQD(CkIndex_ComputeMgr::updateLocalComputes2((CkQdMsg*)0), &thishandle);
}
}
示例9: TEST
TEST(UnitsTest, UnitsPair) {
// Test basic construction via multiplication
using grams = units::grams<float>;
using yards = units::yards<float>;
auto gy = grams{5} * yards{3};
EXPECT_FLOAT_EQ(15.f, gy.amount());
// Test basic construction via division
using stones = units::stones<float>;
using inches = units::inches<float>;
auto si = stones{10} / inches{2};
EXPECT_FLOAT_EQ(5.f, si.amount());
// Test manual conversion
using pounds = units::pounds<float>;
using meters = units::meters<float>;
using poundmeters = units::units_pair<pounds, meters>;
poundmeters pm(grams{5}, yards{3});
EXPECT_FLOAT_EQ(0.0302386280, pm.amount());
}
示例10: pm
bool BaseFileManager::hasFile(const Common::String &filename) {
if (scumm_strnicmp(filename.c_str(), "savegame:", 9) == 0) {
BasePersistenceManager pm(BaseEngine::instance().getGameId());
if (filename.size() <= 9) {
return false;
}
int slot = atoi(filename.c_str() + 9);
return pm.getSaveExists(slot);
}
if (diskFileExists(filename)) {
return true;
}
if (_packages.hasFile(filename)) {
return true; // We don't bother checking if the file can actually be opened, something bigger is wrong if that is the case.
}
if (BaseResources::hasFile(filename)) {
return true;
}
return false;
}
示例11: invert
ublas::matrix<double> invert(ublas::matrix<double> input) {
typedef ublas::permutation_matrix<std::size_t> pmatrix;
ublas::matrix<double> tmp(input);
ublas::permutation_matrix<std::size_t> pm(tmp.size1());
int res = ublas::lu_factorize(tmp,pm);
if (res == 0) {
ublas::matrix<double> inverse = ublas::identity_matrix<double>(tmp.size1());
ublas::lu_substitute(tmp, pm, inverse);
return inverse;
} else {
// Easy check for singularity, as nothing inverted = 0.
// In the future, exceptions would be more prudent.
return ublas::zero_matrix<double>(1, 1);
}
}
示例12: v
QSObject QSPixmapClass::construct( const QSList &args ) const
{
if ( args.size() > 0 ) {
QSObject v( args[ 0 ] );
if ( v.isA( "Pixmap" ) ) {
return v;
} else if ( v.isString() ) {
QPixmap pm( v.toString() );
return construct( pm );
} else {
QVariant var = v.toVariant(QVariant::ByteArray);
if (var.type() == QVariant::ByteArray) {
QPixmap pm;
pm.loadFromData( v.toVariant(QVariant::ByteArray).toByteArray() );
return construct( pm );
}
}
}
return construct( QPixmap() );
}
示例13: painter
void WorkPlaceWidget::paintEvent(QPaintEvent *){
QPainter painter(this);
QRect r2(0,0,this->size().width()-1,this->size().height()-1);
QPixmap pm(":Images/Map.png");
painter.drawPixmap(0,0,this->size().width()-1,this->size().height()-1,pm);
painter.drawRect(r2);
if(this->curX<10){
this->curX=10;
}
if(this->curY<10){
this->curY=10;
}
if(this->curX>max_width-10){
this->curX=max_width-10;
}
if(this->curY>max_height-10){
this->curY=max_height-10;
}
this->paintDesk();
}
示例14: fname
void KexiDBImageBox::updatePixmap()
{
if (!(designMode() && pixmap().isNull()))
return;
if (!KexiDBImageBox_static->pixmap) {
const QString fname(KStandardDirs::locate("data", QLatin1String("kexi/pics/imagebox.png")));
QPixmap pm( KIconLoader::global()->loadMimeTypeIcon(
koIconNameCStr("image-x-generic"), KIconLoader::NoGroup, KIconLoader::SizeLarge, KIconLoader::DisabledState) );
if (!pm.isNull()) {
KIconEffect::semiTransparent(pm);
KIconEffect::semiTransparent(pm);
}
KexiDBImageBox_static->pixmap = new QPixmap(pm);
KexiDBImageBox_static->small = new QPixmap(
KexiDBImageBox_static->pixmap->scaled(
KexiDBImageBox_static->pixmap->width() / 2, KexiDBImageBox_static->pixmap->height() / 2,
Qt::KeepAspectRatio, Qt::SmoothTransformation) );
}
}
示例15: pages
QImage Score::createThumbnail()
{
Page* page = pages().at(0);
QRectF fr = page->abbox();
qreal mag = 256.0 / qMax(fr.width(), fr.height());
int w = int(fr.width() * mag);
int h = int(fr.height() * mag);
QImage pm(w, h, QImage::Format_ARGB32_Premultiplied);
pm.setDotsPerMeterX(lrint((mag * 1000) / INCH));
pm.setDotsPerMeterY(lrint((mag * 1000) / INCH));
pm.fill(0xffffffff);
QPainter p(&pm);
p.setRenderHint(QPainter::Antialiasing, true);
p.setRenderHint(QPainter::TextAntialiasing, true);
p.scale(mag, mag);
print(&p, 0);
p.end();
return pm;
}