本文整理汇总了C++中setFilter函数的典型用法代码示例。如果您正苦于以下问题:C++ setFilter函数的具体用法?C++ setFilter怎么用?C++ setFilter使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setFilter函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: switch
uint8_t MD_TCS230::readFSM(uint8_t s)
// Finite State Machine to read a value (internal function)
{
static const uint8_t seq[] = { TCS230_RGB_R, TCS230_RGB_G, TCS230_RGB_B };
static uint8_t currCol; // index for seq above
switch(s)
{
case 0: // enable the hardware for reading
DUMPS("\n0");
currCol = 0; // RGB_R but we don't care
setEnable(true);
s++;
// fall through to the next state
case 1: // select a filter and start a reading
DUMPS("\n1");
setFilter(seq[currCol]);
FreqCount.begin(1000/_readDiv);
s++;
break;
case 2: // see if a value is available
DUMPS("2");
if (FreqCount.available())
{
DUMP(" VALUE ", FreqCount.read());
// read the value and save it
_Fo.value[seq[currCol++]] = FreqCount.read() * _readDiv;
if (currCol < RGB_SIZE)
{
// loop around again on next call to available()
s--;
}
else
{
// end this reading session
FreqCount.end();
setEnable(false);
RGBTransformation();
s = 0;
}
}
break;
}
return(s);
}
开发者ID:Gerst20051,项目名称:ArduinoExamples,代码行数:49,代码来源:MD_TCS230.cpp
示例2: setFilter
UIConfig::UIConfig()
{
m_Scale = 1;
m_band = 0;
m_column = 0;
m_row = 0;
debug = 0;
setFilter( NN_FILTER );
setCoordMode( ANA_MODE );
m_delta_treshold = 0;
m_translate = true;
m_sync = true;
m_aim = true;
}
开发者ID:Rollmops,项目名称:lipsia,代码行数:15,代码来源:uiconfig.cpp
示例3: setFilter
Node::~Node()
{
#if FZ_GL_SHADERS
setFilter(NULL);
setGLProgram(nullptr);
#endif
if(p_camera)
delete p_camera;
Node *child;
FZ_LIST_FOREACH_MUTABLE(m_children, child)
{
child->setParent(NULL);
child->release();
}
开发者ID:manucorporat,项目名称:FORZE2D,代码行数:15,代码来源:FZNode.cpp
示例4: sim_bandstack_cb
void sim_bandstack_cb(GtkWidget *widget, gpointer data) {
BANDSTACK_ENTRY *entry;
fprintf(stderr,"sim_bandstack_cb\n");
if(function) {
entry=bandstack_entry_previous();
} else {
entry=bandstack_entry_next();
}
setFrequency(entry->frequencyA);
setMode(entry->mode);
FILTER* band_filters=filters[entry->mode];
FILTER* band_filter=&band_filters[entry->filter];
setFilter(band_filter->low,band_filter->high);
vfo_update(NULL);
}
开发者ID:pa3gsb,项目名称:RadioBerry,代码行数:15,代码来源:toolbar.c
示例5: transformPreview
void LensDistortionTool::preparePreview()
{
double m = d->mainInput->value();
double e = d->edgeInput->value();
double r = d->rescaleInput->value();
double b = d->brightenInput->value();
LensDistortionFilter transformPreview(&d->previewRasterImage, 0, m, e, r, b, 0, 0);
transformPreview.startFilterDirectly();
d->maskPreviewLabel->setPixmap(transformPreview.getTargetImage().convertToPixmap());
ImageIface* const iface = d->previewWidget->imageIface();
setFilter(new LensDistortionFilter(iface->original(), this, m, e, r, b, 0, 0));
}
开发者ID:Match-Yang,项目名称:digikam,代码行数:15,代码来源:lensdistortiontool.cpp
示例6: m_idMatchMethod
Message::Message(const std::string& message)
: m_command (),
m_commandStr (),
m_idPattern (),
m_filterBits (Filter::Global),
m_idMatchMethod (nullptr),
m_tagMatchMethod (nullptr)
{
if (!message.empty())
{
setFilter(message);
std::size_t startPos = message.find_first_of(']');
m_command << (startPos == std::string::npos ? message : message.substr(std::min(message.length() - 1, message.find_first_not_of(' ', startPos + 1))));
}
}
开发者ID:Jopnal,项目名称:Jopnal,代码行数:15,代码来源:Message.cpp
示例7: setFilter
bool MultiQFileDialog::eventFilter(QObject *obj, QEvent *e)
{
if (e->type() == QEvent::KeyPress)
{
QKeyEvent* keyEvent = dynamic_cast<QKeyEvent*>(e);
Qt::KeyboardModifiers modifiers = QApplication::queryKeyboardModifiers();
if (modifiers.testFlag(Qt::ControlModifier) && keyEvent && keyEvent->key() == Qt::Key_H)
{
if (showHidden)
{
if (multiSelect)
{
setFilter(QDir::AllDirs | QDir::AllEntries | QDir::NoDotAndDotDot);
}
else
{
setFilter(QDir::AllDirs | QDir::NoDotAndDotDot);
}
}
else
{
if (multiSelect)
{
setFilter(QDir::AllDirs | QDir::AllEntries | QDir::Hidden | QDir::System | QDir::NoDotAndDotDot);
}
else
{
setFilter(QDir::AllDirs | QDir::Hidden | QDir::System | QDir::NoDotAndDotDot);
}
}
showHidden = !showHidden;
}
}
return QFileDialog::eventFilter(obj, e);
}
开发者ID:Avin15,项目名称:MEGAsync,代码行数:36,代码来源:MultiQFileDialog.cpp
示例8: QDirModel
ImageViewerDirModel::ImageViewerDirModel(QObject *parent /*= 0*/)
: QDirModel(parent) {
//insertColumn(1);
QStringList nameFilterList;
QList<QByteArray> formats = QImageReader::supportedImageFormats();
for (QList<QByteArray>::iterator it = formats.begin();
it != formats.end();
++it) {
QString filter("*.");
filter.append(it->data());
nameFilterList << filter;
}
setNameFilters(nameFilterList);
setFilter(QDir::Files);
}
开发者ID:minyoad,项目名称:fqterm,代码行数:16,代码来源:imageviewer_origin.cpp
示例9: killTimers
void KNoteTip::timerEvent(QTimerEvent *)
{
killTimers();
if(!isVisible())
{
startTimer(15000); // show the tooltip for 15 sec
reposition();
show();
}
else
{
setFilter(false);
hide();
}
}
开发者ID:serghei,项目名称:kde3-kdepim,代码行数:16,代码来源:knotetip.cpp
示例10: dassert
Status ParsedUpdate::parseQueryToCQ() {
dassert(!_canonicalQuery.get());
const ExtensionsCallbackReal extensionsCallback(_opCtx, &_request->getNamespaceString());
// The projection needs to be applied after the update operation, so we do not specify a
// projection during canonicalization.
auto qr = stdx::make_unique<QueryRequest>(_request->getNamespaceString());
qr->setFilter(_request->getQuery());
qr->setSort(_request->getSort());
qr->setCollation(_request->getCollation());
qr->setExplain(_request->isExplain());
// Limit should only used for the findAndModify command when a sort is specified. If a sort
// is requested, we want to use a top-k sort for efficiency reasons, so should pass the
// limit through. Generally, a update stage expects to be able to skip documents that were
// deleted/modified under it, but a limit could inhibit that and give an EOF when the update
// has not actually updated a document. This behavior is fine for findAndModify, but should
// not apply to update in general.
if (!_request->isMulti() && !_request->getSort().isEmpty()) {
qr->setLimit(1);
}
// $expr is not allowed in the query for an upsert, since it is not clear what the equality
// extraction behavior for $expr should be.
MatchExpressionParser::AllowedFeatureSet allowedMatcherFeatures =
MatchExpressionParser::kAllowAllSpecialFeatures;
if (_request->isUpsert()) {
allowedMatcherFeatures &= ~MatchExpressionParser::AllowedFeatures::kExpr;
}
boost::intrusive_ptr<ExpressionContext> expCtx;
auto statusWithCQ = CanonicalQuery::canonicalize(
_opCtx, std::move(qr), std::move(expCtx), extensionsCallback, allowedMatcherFeatures);
if (statusWithCQ.isOK()) {
_canonicalQuery = std::move(statusWithCQ.getValue());
}
if (statusWithCQ.getStatus().code() == ErrorCodes::QueryFeatureNotAllowed) {
// The default error message for disallowed $expr is not descriptive enough, so we rewrite
// it here.
return {ErrorCodes::QueryFeatureNotAllowed,
"$expr is not allowed in the query predicate for an upsert"};
}
return statusWithCQ.getStatus();
}
开发者ID:EvgeniyPatlan,项目名称:percona-server-mongodb,代码行数:47,代码来源:parsed_update.cpp
示例11: glGenTextures
bool Image::loadVolatilePOT()
{
glGenTextures(1,(GLuint *)&texture);
bindTexture(texture);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
float p2width = next_p2(width);
float p2height = next_p2(height);
float s = width/p2width;
float t = height/p2height;
vertices[1].t = t;
vertices[2].t = t;
vertices[2].s = s;
vertices[3].s = s;
glTexImage2D(GL_TEXTURE_2D,
0,
GL_RGBA8,
(GLsizei)p2width,
(GLsizei)p2height,
0,
GL_RGBA,
GL_UNSIGNED_BYTE,
0);
glTexSubImage2D(GL_TEXTURE_2D,
0,
0,
0,
(GLsizei)width,
(GLsizei)height,
GL_RGBA,
GL_UNSIGNED_BYTE,
data->getData());
setMipmapSharpness(mipmapsharpness);
setFilter(filter);
setWrap(wrap);
return true;
}
开发者ID:ascetic85,项目名称:love2d,代码行数:47,代码来源:Image.cpp
示例12: QSqlTableModel
FilmModel::FilmModel(QObject *parent) :
QSqlTableModel(parent)
{
setTable("films");
setEditStrategy(QSqlTableModel::OnManualSubmit);
setSort(0, Qt::AscendingOrder);
setFilter("");
select();
setHeaderData(1, Qt::Horizontal, "Name");
setHeaderData(2, Qt::Horizontal, "Year");
setHeaderData(3, Qt::Horizontal, "Country");
setHeaderData(4, Qt::Horizontal, "Director");
setHeaderData(5, Qt::Horizontal, "Actors");
setHeaderData(6, Qt::Horizontal, "Type");
setHeaderData(7, Qt::Horizontal, "Genre");
setHeaderData(8, Qt::Horizontal, "Score");
}
开发者ID:JuliaCR7,项目名称:ViewedMovies,代码行数:17,代码来源:filmmodel.cpp
示例13: foreach
void ActionEditor::setFormWindow(QDesignerFormWindowInterface *formWindow)
{
if (formWindow != 0 && formWindow->mainContainer() == 0)
formWindow = 0;
// we do NOT rely on this function to update the action editor
if (m_formWindow == formWindow)
return;
if (m_formWindow != 0) {
const ActionList actionList = m_formWindow->mainContainer()->findChildren<QAction*>();
foreach (QAction *action, actionList)
disconnect(action, SIGNAL(changed()), this, SLOT(slotActionChanged()));
}
m_formWindow = formWindow;
m_actionView->model()->clearActions();
m_actionEdit->setEnabled(false);
#ifndef QT_NO_CLIPBOARD
m_actionCopy->setEnabled(false);
m_actionCut->setEnabled(false);
#endif
m_actionDelete->setEnabled(false);
if (!formWindow || !formWindow->mainContainer()) {
m_actionNew->setEnabled(false);
m_filterWidget->setEnabled(false);
return;
}
m_actionNew->setEnabled(true);
m_filterWidget->setEnabled(true);
const ActionList actionList = formWindow->mainContainer()->findChildren<QAction*>();
foreach (QAction *action, actionList)
if (!action->isSeparator() && core()->metaDataBase()->item(action) != 0) {
// Show unless it has a menu. However, listen for change on menu actions also as it might be removed
if (!action->menu())
m_actionView->model()->addAction(action);
connect(action, SIGNAL(changed()), this, SLOT(slotActionChanged()));
}
setFilter(m_filter);
}
开发者ID:KhuramAli,项目名称:GUI_Editor,代码行数:46,代码来源:actioneditor.cpp
示例14: sim_band_cb
void sim_band_cb(GtkWidget *widget, gpointer data) {
BAND* band;
BANDSTACK_ENTRY *entry;
fprintf(stderr,"sim_band_cb\n");
int b=band_get_current();
if(function) {
b--;
if(b<0) {
b=BANDS-1;
}
#ifdef LIMESDR
if(protocol!=LIMESDR_PROTOCOL) {
if(b==band3400) {
b=band6;
}
}
#endif
} else {
b++;
if(b>=BANDS) {
b=0;
}
#ifdef LIMESDR
if(protocol!=LIMESDR_PROTOCOL) {
if(b==band70) {
b=bandGen;
}
}
#endif
}
band=band_set_current(b);
entry=bandstack_entry_get_current();
setFrequency(entry->frequencyA);
setMode(entry->mode);
FILTER* band_filters=filters[entry->mode];
FILTER* band_filter=&band_filters[entry->filter];
setFilter(band_filter->low,band_filter->high);
band=band_get_current_band();
set_alex_rx_antenna(band->alexRxAntenna);
set_alex_tx_antenna(band->alexTxAntenna);
set_alex_attenuation(band->alexAttenuation);
vfo_update(NULL);
}
开发者ID:pa3gsb,项目名称:RadioBerry,代码行数:45,代码来源:toolbar.c
示例15: KFileDialog
RKImportDialog::RKImportDialog (const QString &context_id, QWidget *parent) : KFileDialog (KUrl (), QString (), parent, format_selector=new RKImportDialogFormatSelector ()) {
RK_TRACE (DIALOGS);
setModal (false);
context = RKComponentMap::getContext (context_id);
if (!context) {
KMessageBox::sorry (this, i18n ("No plugins defined for context '%1'", context_id));
return;
}
component_ids = context->components ();
QString formats = "*|" + i18n ("All Files") + " (*)\n";
int format_count = 0;
for (QStringList::const_iterator it = component_ids.constBegin (); it != component_ids.constEnd (); ++it) {
if (format_count++) formats.append ('\n');
RKComponentHandle *handle = RKComponentMap::getComponentHandle (*it);
if (!handle) {
RK_ASSERT (false);
continue;
}
QString filter = handle->getAttributeValue ("format");
QString label = handle->getAttributeLabel ("format");
QString elabel = label;
elabel.replace ('/', "\\/");
elabel.replace ('|', "\\|");
formats.append (filter + '|' + elabel + " (" + filter + ')');
format_labels.append (label);
filters.append (filter);
}
// file format selection box
format_selector->combo->insertItems (0, format_labels);
// initialize
setMode (KFile::File | KFile::ExistingOnly | KFile::LocalOnly);
setFilter (formats);
connect (this, SIGNAL (filterChanged(QString)), this, SLOT (filterWasChanged(QString)));
filterWasChanged (QString ());
show ();
}
开发者ID:KDE,项目名称:rkward,代码行数:45,代码来源:rkimportdialog.cpp
示例16: TEST_F
/**
* Test that hitting the cached plan stage trial period's threshold for work cycles causes the
* query to be replanned. Also verify that the replanning results in a new plan cache entry.
*/
TEST_F(QueryStageCachedPlan, QueryStageCachedPlanHitMaxWorks) {
AutoGetCollectionForReadCommand ctx(&_opCtx, nss);
Collection* collection = ctx.getCollection();
ASSERT(collection);
// Query can be answered by either index on "a" or index on "b".
auto qr = stdx::make_unique<QueryRequest>(nss);
qr->setFilter(fromjson("{a: {$gte: 8}, b: 1}"));
auto statusWithCQ = CanonicalQuery::canonicalize(opCtx(), std::move(qr));
ASSERT_OK(statusWithCQ.getStatus());
const std::unique_ptr<CanonicalQuery> cq = std::move(statusWithCQ.getValue());
// We shouldn't have anything in the plan cache for this shape yet.
PlanCache* cache = collection->infoCache()->getPlanCache();
ASSERT(cache);
ASSERT_EQ(cache->get(*cq).state, PlanCache::CacheEntryState::kNotPresent);
// Get planner params.
QueryPlannerParams plannerParams;
fillOutPlannerParams(&_opCtx, collection, cq.get(), &plannerParams);
// Set up queued data stage to take a long time before returning EOF. Should be long
// enough to trigger a replan.
const size_t decisionWorks = 10;
const size_t mockWorks =
1U + static_cast<size_t>(internalQueryCacheEvictionRatio * decisionWorks);
auto mockChild = stdx::make_unique<QueuedDataStage>(&_opCtx, &_ws);
for (size_t i = 0; i < mockWorks; i++) {
mockChild->pushBack(PlanStage::NEED_TIME);
}
CachedPlanStage cachedPlanStage(
&_opCtx, collection, &_ws, cq.get(), plannerParams, decisionWorks, mockChild.release());
// This should succeed after triggering a replan.
PlanYieldPolicy yieldPolicy(PlanExecutor::NO_YIELD,
_opCtx.getServiceContext()->getFastClockSource());
ASSERT_OK(cachedPlanStage.pickBestPlan(&yieldPolicy));
ASSERT_EQ(getNumResultsForStage(_ws, &cachedPlanStage, cq.get()), 2U);
// This time we expect to find something in the plan cache. Replans after hitting the
// works threshold result in a cache entry.
ASSERT_EQ(cache->get(*cq).state, PlanCache::CacheEntryState::kPresentInactive);
}
开发者ID:louiswilliams,项目名称:mongo,代码行数:49,代码来源:query_stage_cached_plan.cpp
示例17: setLevel
void JConsoleHandler::configure() {
//TODO JLogManager* manager = JLogManager::getLogManager();
//TODO JString cname = getClass()->getName();
setLevel(JLevel::INFO);//TODO manager.getLevelProperty(cname +".level", Level.INFO));
setFilter(NULL);//TODO manager.getFilterProperty(cname +".filter", null));
setFormatter(new JSimpleFormatter());//TODO manager.getFormatterProperty(cname +".formatter", new SimpleFormatter()));
try {
setEncoding("");//TODO manager.getStringProperty(cname +".encoding", null));
} catch (JException* ex) {
delete ex;
try {
setEncoding("");
} catch (JException* ex2) {
delete ex2;
}
}
}
开发者ID:jeffedlund,项目名称:rpc,代码行数:18,代码来源:JConsoleHandler.cpp
示例18: setColors
void Terrain::setup() {
frames = 0;
meshResolution = 128;
dist = 300;
begin.set(18, 3, 194);
end.set(38, 172, 22);
indexLow = 0;
indexHigh = 0;
setColors(begin, end);
gridSurfaceSetup();
setPeeks();
setBands(meshResolution);
setFilter(1.25f);
setSmoothingFactor(0.975f);
cam.setDistance(dist);
cam.enableMouseInput();
ofBackground(0, 0, 0);
}
开发者ID:beasly,项目名称:ViMuc,代码行数:18,代码来源:Terrain.cpp
示例19: switch
int qtMonitor::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QMainWindow::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
if (_c == QMetaObject::InvokeMetaMethod) {
switch (_id) {
case 0: band_160_buttonPressed(); break;
case 1: band_80_buttonPressed(); break;
case 2: band_60_buttonPressed(); break;
case 3: band_40_buttonPressed(); break;
case 4: band_30_buttonPressed(); break;
case 5: band_20_buttonPressed(); break;
case 6: band_17_buttonPressed(); break;
case 7: band_15_buttonPressed(); break;
case 8: band_12_buttonPressed(); break;
case 9: band_10_buttonPressed(); break;
case 10: band_6_buttonPressed(); break;
case 11: band_gen_buttonPressed(); break;
case 12: mode_lsb_buttonPressed(); break;
case 13: mode_usb_buttonPressed(); break;
case 14: mode_dsb_buttonPressed(); break;
case 15: mode_cwl_buttonPressed(); break;
case 16: mode_cwu_buttonPressed(); break;
case 17: mode_am_buttonPressed(); break;
case 18: connect_buttonPressed(); break;
case 19: socketError((*reinterpret_cast< QAbstractSocket::SocketError(*)>(_a[1]))); break;
case 20: connected(); break;
case 21: socketData(); break;
case 22: update(); break;
case 23: setMode((*reinterpret_cast< int(*)>(_a[1]))); break;
case 24: setFilter((*reinterpret_cast< int(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2]))); break;
case 25: setFrequency((*reinterpret_cast< long long(*)>(_a[1]))); break;
case 26: moveFrequency((*reinterpret_cast< int(*)>(_a[1]))); break;
case 27: vfo_dialMoved((*reinterpret_cast< int(*)>(_a[1]))); break;
case 28: afgain_dialMoved((*reinterpret_cast< int(*)>(_a[1]))); break;
case 29: setGain((*reinterpret_cast< int(*)>(_a[1]))); break;
case 30: audioChanged((*reinterpret_cast< int(*)>(_a[1]))); break;
default: ;
}
_id -= 31;
}
return _id;
}
开发者ID:8cH9azbsFifZ,项目名称:ghpsdr3-alex,代码行数:44,代码来源:moc_qtMonitor.cpp
示例20: QWidget
PlaylistWidget::PlaylistWidget(QWidget *parent) :
QWidget(parent),
ui(new Ui::PlaylistWidget)
{
ui->setupUi(this);
m_delegate = new TrackDelegate(this);
ui->listView->setItemDelegate(m_delegate);
ui->listView->setAcceptDrops(true);
m_model = new PlaylistModel(this);
m_model->setTrackCycler(Player::instance()->cycler());
m_model->setMediaLibrary(Player::instance()->media());
m_model->setFavoritesManager(Player::instance()->favorites());
m_favFilterModel = new FavoritesFilterModel(this);
m_favFilterModel->setSourceModel(m_model);
m_favFilterModel->setDynamicSortFilter(true);
connect(ui->listView, SIGNAL(showFavoritesToggled(bool)), this, SLOT(setFavoritesFilterEnabled(bool)));
connect(m_favFilterModel, SIGNAL(enabledChanged(bool)), ui->listView, SLOT(toggleFavorites(bool)));
m_sortModel = new QSortFilterProxyModel(this);
m_sortModel->setSourceModel(m_favFilterModel);
m_sortModel->setFilterRole(PlaylistModel::SearchRole);
m_sortModel->setDynamicSortFilter(true);
m_sortModel->setFilterCaseSensitivity(Qt::CaseInsensitive);
ui->listView->setModel(m_sortModel);
connect(ui->clearButton, SIGNAL(clicked()), ui->filterEdit, SLOT(clear()));
connect(ui->filterEdit, SIGNAL(textChanged(QString)), this, SLOT(setFilter(QString)));
TrackCycler * cycler = Player::instance()->cycler();
if (cycler != 0) {
connect(cycler, SIGNAL(trackChanged(PlayId)), this, SLOT(onTrackChanged(PlayId)));
}
PlaylistHistory *history = Player::instance()->history();
if (history != 0) {
connect(history,SIGNAL(currentChanged(Playlist*)), this, SLOT(setPlaylist(Playlist*)));
connect(history,SIGNAL(countChanged()), this, SLOT(onPlaylistCountChanged()));
setPlaylist(history->current());
}
开发者ID:Okspen,项目名称:okPlayer,代码行数:43,代码来源:playlistwidget.cpp
注:本文中的setFilter函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论