本文整理汇总了C++中checked函数的典型用法代码示例。如果您正苦于以下问题:C++ checked函数的具体用法?C++ checked怎么用?C++ checked使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了checked函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: hasCheckedFiles
bool SubmitFileModel::hasCheckedFiles() const
{
for (int i = 0; i < rowCount(); ++i) {
if (checked(i))
return true;
}
return false;
}
开发者ID:CNOT,项目名称:julia-studio,代码行数:8,代码来源:submitfilemodel.cpp
示例2: checked
void UiCommand::setChecked(bool b)
{
if(b != m_checked)
{
m_checked = b;
emit checked(b);
}
}
开发者ID:BackupTheBerlios,项目名称:sim-im,代码行数:8,代码来源:uicommand.cpp
示例3: main
int main(int argc, char **argv) {
pthread_t threads[2];
threadata_t *td;
xmalloc(td, sizeof(*td), return 0);
srand(time(NULL));
log_init();
prog = argv[0];
rwlock_wrlock(&td->lock);
checked(pthread_create(&threads[0], NULL, writethread, td));
checked(pthread_create(&threads[1], NULL, readthread, td));
pthread_exit(NULL);
fatal("rwlock tests done!\n");
}
开发者ID:RazielZ,项目名称:csnippets,代码行数:17,代码来源:rwlock_test.c
示例4: flood
void flood(Cell maze[][16],Queue *q,int n) {
int d = 0;
int x = 0;
int y = 0;
int n1 = n;
int n2 = 0;
while (!empty(q)) {
floodLevel(n1,d,q);
d++;
n2 = n1;
n1 = 0;
for (;n2 > 0;n2--) { /* Check neighbors of each cell in queue */
x = getx(qfront(q));
y = gety(qfront(q));
if (!(savingPath && !visited(&maze[x][y + 1])) &&
openNorth(maze,x,y) && getDist(&maze[x][y + 1]) == 255 &&
!checked(&maze[x][y + 1])) {
in(q,&maze[x][y + 1]);
n1++;
}
if (!(savingPath && !visited(&maze[x + 1][y])) &&
openEast(maze,x,y) && getDist(&maze[x + 1][y]) == 255 &&
!checked(&maze[x + 1][y])) {
in(q,&maze[x + 1][y]);
n1++;
}
if (!(savingPath && !visited(&maze[x][y - 1])) &&
openSouth(maze,x,y) && getDist(&maze[x][y - 1]) == 255 &&
!checked(&maze[x][y - 1])) {
in(q,&maze[x][y - 1]);
n1++;
}
if (!(savingPath && !visited(&maze[x - 1][y])) &&
openWest(maze,x,y) && getDist(&maze[x - 1][y]) == 255 &&
!checked(&maze[x - 1][y])) {
in(q,&maze[x - 1][y]);
n1++;
}
out(q);
}
}
}
开发者ID:dmaricon,项目名称:Micromouse,代码行数:46,代码来源:mouse.c
示例5: checked
void ConsoleChannel::slotChecked(bool state)
{
emit checked(m_fixture, m_channel, state);
// Emit the current value also when turning the channel back on
if (state == true)
emit valueChanged(m_fixture, m_channel, m_slider->value());
}
开发者ID:Boudewijn26,项目名称:qlcplus,代码行数:8,代码来源:consolechannel.cpp
示例6: parse_set_timer
static void parse_set_timer(void) {
checked(uint8_t id = parse_int());
#ifdef COMMANDLINE_DEBUG
if ( id >= N_TIMESWITCHES ) {
parse_fail = 1;
return;
}
#endif
checked(time_t on = parse_time());
checked(time_t off = parse_time());
checked(uint8_t output = parse_int());
checked(uint8_t enabled = parse_int());
timeswitch_set(id, on, off, output, enabled);
}
开发者ID:mru00,项目名称:terracontrol,代码行数:18,代码来源:commandline.c
示例7: checked
void SpellCheckerWidget::reloadDictionaries()
{
QStringList dictionaries = checked();
if (dictionaries.isEmpty())
dictionaries.append(LS("null"));
ChatCore::settings()->setValue(LS("SpellChecker/Dictionaries"), dictionaries);
SpellChecker::reload();
}
开发者ID:johnbolia,项目名称:schat,代码行数:9,代码来源:SpellCheckerWidget.cpp
示例8: switch
QVariant QuickTestTreeItem::data(int column, int role) const
{
switch (role) {
case Qt::DisplayRole:
if (type() == TestCase && name().isEmpty())
return QObject::tr(Constants::UNNAMED_QUICKTESTS);
break;
case Qt::ToolTipRole:
if (type() == TestCase && name().isEmpty())
return QObject::tr("<p>Give all test cases a name to ensure correct behavior "
"when running test cases and to be able to select them.</p>");
break;
case Qt::CheckStateRole:
switch (type()) {
case Root:
case TestDataFunction:
case TestSpecialFunction:
case TestDataTag:
return QVariant();
case TestCase:
return name().isEmpty() ? QVariant() : checked();
case TestFunctionOrSet:
return (parentItem() && !parentItem()->name().isEmpty()) ? checked() : QVariant();
default:
return checked();
}
case ItalicRole:
switch (type()) {
case TestDataFunction:
case TestSpecialFunction:
return true;
case TestCase:
return name().isEmpty();
case TestFunctionOrSet:
return parentItem() ? parentItem()->name().isEmpty() : false;
default:
return false;
}
default:
break;
}
return TestTreeItem::data(column, role);
}
开发者ID:DuinoDu,项目名称:qt-creator,代码行数:44,代码来源:testtreeitem.cpp
示例9: checked
bool AMBeamConfigurationWizard::allChecked() const
{
bool checkedSet = true;
for(int i = 0; i < numberOfPages()/2; i++)
{
checkedSet *= checked(pageSet(i));
}
return checkedSet;
}
开发者ID:acquaman,项目名称:acquaman,代码行数:10,代码来源:AMBeamConfigurationWizard.cpp
示例10: do_delete_item
/**
* Delete an item from the cache
* @param trx the transaction to use
* @param key the key of the item to delete
* @param nkey the length of the key
* @return true if we should go ahead and commit the transaction
* or false if we should roll back (if the key didn't exists)
*/
static bool do_delete_item(ib_trx_t trx, const void* key, size_t nkey) {
ib_crsr_t cursor= NULL;
bool retval= false;
if (do_locate_item(trx, key, nkey, &cursor))
{
checked(ib_cursor_lock(cursor, IB_LOCK_X));
checked(ib_cursor_delete_row(cursor));
retval= true;
}
/* Release resources */
/* FALLTHROUGH */
error_exit:
if (cursor != NULL)
ib_cursor_close(cursor);
return retval;
}
开发者ID:athomason,项目名称:perl-Memcached-libmemcached,代码行数:27,代码来源:storage_innodb.c
示例11: do_locate_item
/**
* Try to locate an item in the database. Return a cursor and the tuple to
* the item if I found it in the database.
*
* @param trx the transaction to use
* @param key the key of the item to look up
* @param nkey the size of the key
* @param cursor where to store the cursor (OUT)
* @param tuple where to store the tuple (OUT)
* @return true if I found the object, false otherwise
*/
static bool do_locate_item(ib_trx_t trx,
const void* key,
size_t nkey,
ib_crsr_t *cursor)
{
int res;
ib_tpl_t tuple= NULL;
*cursor= NULL;
checked(ib_cursor_open_table(tablename, trx, cursor));
tuple= ib_clust_search_tuple_create(*cursor);
if (tuple == NULL)
{
fprintf(stderr, "Failed to allocate tuple object\n");
goto error_exit;
}
checked(ib_col_set_value(tuple, key_col_idx, key, nkey));
ib_err_t err= ib_cursor_moveto(*cursor, tuple, IB_CUR_GE, &res);
if (err == DB_SUCCESS && res == 0)
{
ib_tuple_delete(tuple);
return true;
}
else if (err != DB_SUCCESS &&
err != DB_RECORD_NOT_FOUND &&
err != DB_END_OF_INDEX)
{
fprintf(stderr, "ERROR: ib_cursor_moveto(): %s\n", ib_strerror(err));
}
/* FALLTHROUGH */
error_exit:
if (tuple != NULL)
ib_tuple_delete(tuple);
if (*cursor != NULL)
ib_cursor_close(*cursor);
*cursor= NULL;
return false;
}
开发者ID:athomason,项目名称:perl-Memcached-libmemcached,代码行数:53,代码来源:storage_innodb.c
示例12: branchAndBound
/* While there is one unchecked node :
* We take the most promising.
* If its z value is lower than vUp (constructed solution) :
* if this is an integer solution, we keep it
* else,
* we create its sons with a new constraint.
*/
node* branchAndBound (glp_prob * prob)
{
node* root = (node *) malloc (sizeof(node));
create_node(root, prob, NULL, 0, 0);
node* res = construction(prob);
double vUp = res->z;
node* node_ptr = checked(root);
while (node_ptr != NULL)
{
if (node_ptr->z != 0)
{
if (!(node_ptr->z >= vUp))
{
int y = allYinteger(node_ptr->x, glp_get_num_cols(node_ptr->prob));
if ( y == -1)
{
vUp = node_ptr->z;
res = node_ptr;
}
else
{
node* left = (node *) malloc (sizeof(node));
node* right = (node *) malloc (sizeof(node));
create_node(left, prob, node_ptr, y, 0);
create_node(right, prob, node_ptr, y, 1);
node_ptr->leftSon = left;
node_ptr->rightSon = right;
}
}
}
node_ptr->check = 1;
node_ptr = checked(root);
}
return res;
}
开发者ID:Shakit,项目名称:IP2015TP2,代码行数:49,代码来源:ULS.c
示例13: setChecked
void
CheckBox::toggleChecked()
{
if (checkable())
{
if (_buttonFlag & Tristate)
{
if (checked())
{
setChecked(false);
_buttonFlag = (ButtonFlags) (_buttonFlag | Partial);
update();
sigCheckStateChanged(Partial);
} else if (partial())
{
_buttonFlag = (ButtonFlags) (_buttonFlag & ~Partial);
update();
sigCheckStateChanged(Unchecked);
} else
{
setChecked(true);
update();
sigCheckStateChanged(Checked);
}
} else
{
if (checked())
{
setChecked(false);
update();
sigCheckChanged(false);
sigCheckStateChanged(Unchecked);
} else
{
setChecked(true);
update();
sigCheckChanged(true);
sigCheckStateChanged(Checked);
}
}
}
}
开发者ID:91yuan,项目名称:ilixi,代码行数:42,代码来源:CheckBox.cpp
示例14: QObject
VersionChecker::VersionChecker(QObject *parent) :
QObject(parent)
{
p = new VersionCheckerPrivate;
p->downloader = new Downloader(this);
p->recheck_timer = startTimer(21600000);
connect( p->downloader, SIGNAL(finished(QByteArray)), SLOT(checked(QByteArray)) );
check();
}
开发者ID:silberzwiebel,项目名称:sigram,代码行数:11,代码来源:versionchecker.cpp
示例15: checked
void WPushButton::toggled()
{
// FIXME: later, make it a true EventSignal
flags_.set(BIT_IS_CHECKED, !isChecked());
if (isChecked())
checked().emit();
else
unChecked().emit();
}
开发者ID:bend,项目名称:wt,代码行数:11,代码来源:WPushButton.C
示例16: findOrder
vector<int> findOrder(int numCourses, vector<pair<int, int>>& prerequisites) {
unordered_map<int,vector<int>> preq;
for(auto i:prerequisites) preq[i.first].push_back(i.second);
vector<int> rec;
vector<bool> checked(numCourses,false);
for(int i = 0; i < numCourses; ++i)
{
if(!bfs(preq,checked,i,0,numCourses,rec)) return {};
}
return rec;
}
开发者ID:FeibHwang,项目名称:OJ-Leetcode,代码行数:11,代码来源:210_Course_Schedule_II.cpp
示例17: checked
void WAbstractToggleButton::setChecked(bool how)
{
checked_ = how;
checkedChanged_ = true;
if (how)
emit checked();
else
emit unChecked();
repaint();
}
开发者ID:SiteView,项目名称:ecc82Server,代码行数:12,代码来源:WAbstractToggleButton.Cpp
示例18: shoot
/* Task c: Ask coordinates (two integers) from user, and shoot the location.
* Returns -1 if user gave invalid input or coordinates, 0 if there was no ship
* at the given location; and 1 if there was a ship hit at the location.
*/
int shoot(void)
{
int x, y;
scanf("%d %d", &x, &y);
if (x < 0 || x >= xsize || y < 0 || y >= ysize) return -1;
checked(x, y);
if (is_ship(x, y) == '+') {
hit_ship(x, y);
return 1;
}
return 0;
}
开发者ID:quanganhtran,项目名称:aalto-c-2016-solution,代码行数:16,代码来源:ships.c
示例19: setChecked
void ButtonLabel::setChecked(bool stat)
{
if (checked() == stat)
return;
if (stat)
state = Checked;
else
state = Normal;
emit stateChanged(state);
}
开发者ID:sbwtw,项目名称:DoubanFM,代码行数:12,代码来源:buttonlabel.cpp
示例20: setMode
void BinaryDigit::changeMode()
{
if (isNormal()) {
setMode(BinaryDigit::Checked);
setIcon(QIcon(UNIT_IMG_FILE_CHKED));
emit checked();
} else {
setMode(BinaryDigit::Normal);
setIcon(QIcon(UNIT_IMG_FILE_NORMAL));
emit normal();
}
}
开发者ID:Zex,项目名称:BinClockReader,代码行数:12,代码来源:binarydigit.cpp
注:本文中的checked函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论