本文整理汇总了C++中populate函数的典型用法代码示例。如果您正苦于以下问题:C++ populate函数的具体用法?C++ populate怎么用?C++ populate使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了populate函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: gdu_change_passphrase_dialog_show
void
gdu_change_passphrase_dialog_show (GduWindow *window,
UDisksObject *object)
{
ChangePassphraseData *data;
data = g_new0 (ChangePassphraseData, 1);
data->window = g_object_ref (window);
data->object = g_object_ref (object);
data->block = udisks_object_get_block (object);
g_assert (data->block != NULL);
data->encrypted = udisks_object_get_encrypted (object);
g_assert (data->encrypted != NULL);
data->has_passphrase_in_configuration = has_passphrase_in_configuration (data);
data->dialog = GTK_WIDGET (gdu_application_new_widget (gdu_window_get_application (window),
"change-passphrase-dialog.ui",
"change-passphrase-dialog",
&data->builder));
data->infobar_vbox = GTK_WIDGET (gtk_builder_get_object (data->builder, "infobar-vbox"));
if (data->has_passphrase_in_configuration)
{
GtkWidget *infobar;
infobar = gdu_utils_create_info_bar (GTK_MESSAGE_INFO,
_("Changing the passphrase for this device, will also update the passphrase referenced by the <i>/etc/crypttab</i> file"),
NULL);
gtk_box_pack_start (GTK_BOX (data->infobar_vbox), infobar, TRUE, TRUE, 0);
}
data->existing_passphrase_entry = GTK_WIDGET (gtk_builder_get_object (data->builder, "existing-passphrase-entry"));
g_signal_connect (data->existing_passphrase_entry, "notify::text", G_CALLBACK (on_property_changed), data);
data->passphrase_entry = GTK_WIDGET (gtk_builder_get_object (data->builder, "passphrase-entry"));
g_signal_connect (data->passphrase_entry, "notify::text", G_CALLBACK (on_property_changed), data);
data->confirm_passphrase_entry = GTK_WIDGET (gtk_builder_get_object (data->builder, "confirm-passphrase-entry"));
g_signal_connect (data->confirm_passphrase_entry, "notify::text", G_CALLBACK (on_property_changed), data);
data->show_passphrase_checkbutton = GTK_WIDGET (gtk_builder_get_object (data->builder, "show-passphrase-checkbutton"));
g_signal_connect (data->show_passphrase_checkbutton, "notify::active", G_CALLBACK (on_property_changed), data);
data->passphrase_strengh_box = GTK_WIDGET (gtk_builder_get_object (data->builder, "passphrase-strength-box"));
data->passphrase_strengh_widget = gdu_password_strength_widget_new ();
gtk_widget_set_tooltip_markup (data->passphrase_strengh_widget,
_("The strength of the passphrase"));
gtk_box_pack_start (GTK_BOX (data->passphrase_strengh_box), data->passphrase_strengh_widget,
TRUE, TRUE, 0);
gtk_window_set_transient_for (GTK_WINDOW (data->dialog), GTK_WINDOW (window));
gtk_dialog_set_default_response (GTK_DIALOG (data->dialog), GTK_RESPONSE_OK);
populate (data);
update (data);
/* Retrieve the passphrase from system-level configuration, if applicable */
if (data->has_passphrase_in_configuration)
{
udisks_block_call_get_secret_configuration (data->block,
g_variant_new ("a{sv}", NULL), /* options */
NULL, /* cancellable */
on_get_secret_configuration_cb,
data);
}
else
{
run_dialog (data);
}
}
示例2: populate
void SysSettingsForm::show()
{
populate();
QDialog::show();
}
示例3: QStackedWidget
void MainWindow::start()
{
mainScreen=new QStackedWidget();
widget=new QWidget(this);
widgetKeys=new QWidget(this);
widget2=new QWidget(this);
widgetTop=new QWidget(this);
// camera=new QCameraControllerWidget(this);
layout=new QGridLayout();
layout2=new QGridLayout();
layoutTop=new QGridLayout();
amount=new QTextEdit(this);
price=new QTextEdit(this);
go=new QPushButton(this);
buy=new QRadioButton(this);
sell=new QRadioButton(this);
market = new QComboBox(this);
exchange = new QComboBox(this);
exchange->addItem(tr("Bitmarket"));
exchange->addItem(tr("Bitmaszyna"));
widget->setLayout(layout);
widgetTop->setLayout(layoutTop);
mainScreen->addWidget(widget);
mainScreen->addWidget(widgetKeys);
// mainScreen->addWidget(camera);
mainScreen->setCurrentIndex(0);
setCentralWidget(mainScreen);
// setCentralWidget(camera);
//qview = new QQuickView();
//qview->setResizeMode(QQuickView::SizeRootObjectToView);
//qview->rootContext()->setContextProperty("closeView", closeView());
//qview->setSource(QUrl("qrc:///camera.qml"));
/*Table model;
MyModel model2;
model2.setData(model2.index(0,0), "Data 1", MyModel::price);
model2.setData(model2.index(0,0), "Data 1", MyModel::amount);
model2.setData(model2.index(1,0), "Data 2", MyModel::price);
model2.setData(model2.index(1,0), "Data 2", MyModel::amount);
qview->engine()->rootContext()->setContextProperty("theModel", &model);
qview->engine()->rootContext()->setContextProperty("themodel2", &model2);
qview->setSource(QUrl("qrc:///main.qml"));
if ((width()==200)||(width()==640)) {
resize(360,600);
qview->resize(360,600);
}*/
/*QWidget *container = QWidget::createWindowContainer(qview);
QSize ss;
ss.setWidth(width());
ss.setHeight(height());
container->setMinimumSize(ss);
container->setMaximumSize(ss);
container->setFocusPolicy(Qt::TabFocus);
mainScreen->addWidget(container);*/
//widgetLayout->addWidget(container);
//log(QString::number(width()).toStdString());
//view->show();
scalex=width()/480.0;
scaley=height()/800.0;
font.setPixelSize(12*scaley);
font2.setPixelSize(16*scaley);
buy->setChecked(true);
buy->setText("Kup");
buy->setFont(font2);
sell->setText("Sprzedaj");
sell->setFont(font2);
go->setText("Wykonaj");
go->setFont(font2);
bidtable=makeTable();
asktable=makeTable();
populate();
layout->setContentsMargins(0,0,0,0);
layout2->setContentsMargins(0,0,0,0);
layoutTop->setContentsMargins(0,0,0,0);
widget2->setLayout(layout2);
widget2->setFixedHeight(70*scaley);
widgetTop->setFixedHeight(50*scaley);
buy->setFixedWidth(120*scalex);
sell->setFixedWidth(120*scalex);
amount->setFixedWidth(100*scalex);
amount->setFixedHeight(36*scalex);
price->setFixedWidth(100*scalex);
price->setFixedHeight(36*scalex);
go->setFixedWidth(100*scalex);
layoutTop->addWidget(exchange,0,0);
layoutTop->addWidget(market,0,1);
layout2->addWidget(buy,0,0);
layout2->addWidget(sell,1,0);
layout2->addWidget(amount,0,1,2,1);
layout2->addWidget(price,0,2,2,1);
layout2->addWidget(go,0,3,2,1);
layout->addWidget(widgetTop,0,1);
layout->addWidget(asktable,1,1);
layout->addWidget(widget2,2,0,1,3);
layout->addWidget(bidtable,3,1);
connect(exchange,SIGNAL(currentIndexChanged(int)),this,SLOT(changeEx(int)));
connect(market,SIGNAL(currentIndexChanged(int)),this,SLOT(changeMarket(int)));
menu=menuBar()->addMenu(tr("Menu"));
trade = new QAction(tr("&Trade"), this);
trade->setStatusTip(tr("Trade"));
connect(trade, SIGNAL(triggered()), this, SLOT(tradeWindow()));
//.........这里部分代码省略.........
示例4: populate
enum SetResponse characteristic::set(const ParameterList &pParams)
{
XSqlQuery characteristicet;
XDialog::set(pParams);
QVariant param;
bool valid;
param = pParams.value("char_id", &valid);
if (valid)
{
_charid = param.toInt();
populate();
}
param = pParams.value("mode", &valid);
if (valid)
{
if (param.toString() == "new")
{
_mode = cNew;
characteristicet.exec("SELECT NEXTVAL('char_char_id_seq') AS char_id;");
if (characteristicet.first())
_charid = characteristicet.value("char_id").toInt();
sFillList();
}
else if (param.toString() == "edit")
{
_mode = cEdit;
// TODO
// _mask->setEnabled(FALSE);
// _validator->setEnabled(FALSE);
}
else if (param.toString() == "view")
{
_mode = cView;
_name->setEnabled(false);
_search->setEnabled(false);
_useGroup->setEnabled(false);
_order->setEnabled(false);
_mask->setEnabled(false);
_validator->setEnabled(false);
_items->setEnabled(false);
_customers->setEnabled(false);
_lotSerial->setEnabled(false);
_addresses->setEnabled(false);
_crmaccounts->setEnabled(false);
_contacts->setEnabled(false);
_opportunity->setEnabled(false);
_employees->setEnabled(false);
_incidents->setEnabled(false);
_quotes->setEnabled(false);
_salesorders->setEnabled(false);
_invoices->setEnabled(false);
_vendors->setEnabled(false);
_purchaseorders->setEnabled(false);
_vouchers->setEnabled(false);
_buttonBox->clear();
_buttonBox->addButton(QDialogButtonBox::Close);
}
}
return NoError;
}
示例5: main
/**
* @brief Inizializzazione del nucleo.
* @return void.
*/
int main(void)
{
pcb_t *init;
int i;
/* Popolazione delle 4 nuove aree nella ROM Reserved Frame */
/* SYS/BP Exception Handling */
populate(SYSBK_NEWAREA, (memaddr) sysBpHandler);
/* PgmTrap Exception Handling */
populate(PGMTRAP_NEWAREA, (memaddr) pgmTrapHandler);
/* TLB Exception Handling */
populate(TLB_NEWAREA, (memaddr) tlbHandler);
/* Interrupt Exception Handling */
populate(INT_NEWAREA, (memaddr) intHandler);
/* Inizializzazione delle strutture dati del livello 2 (phase1) */
initPcbs();
initSemd();
/* Inizializzazione delle variabili globali */
mkEmptyProcQ(&readyQueue);
currentProcess = NULL;
processCount = softBlockCount = pidCount = 0;
timerTick = 0;
/* Inizializzazione della tabella dei pcb utilizzati */
for(i=0; i<MAXPROC; i++)
{
pcbused_table[i].pid = 0;
pcbused_table[i].pcb = NULL;
}
/* Inizializzazione dei semafori dei device */
for(i=0; i<DEV_PER_INT; i++)
{
sem.disk[i] = 0;
sem.tape[i] = 0;
sem.network[i] = 0;
sem.printer[i] = 0;
sem.terminalR[i] = 0;
sem.terminalT[i] = 0;
}
/* Inizializzazione del semaforo dello pseudo-clock */
pseudo_clock = 0;
/* Inizializzazione del primo processo (init) */
/* Se il primo processo (init) non viene creato, PANIC() */
if((init = allocPcb()) == NULL)
PANIC();
/* Interrupt attivati e smascherati, Memoria Virtuale spenta, Kernel-Mode attivo */
init->p_state.status = (init->p_state.status | STATUS_IEp | STATUS_INT_UNMASKED | STATUS_KUc) & ~STATUS_VMp;
/* Il registro SP viene inizializzato a RAMTOP-FRAMESIZE */
init->p_state.reg_sp = RAMTOP - FRAME_SIZE;
/* PC inizializzato all'indirizzo di test() */
init->p_state.pc_epc = init->p_state.reg_t9 = (memaddr)test;
/* Il PID impostato per init è 1 */
pidCount++;
init->p_pid = pidCount;
/* Aggiorna la tabella dei pcb utilizzati, assegnando il giusto pid e il puntatore al pcb di init */
pcbused_table[0].pid = init->p_pid;
pcbused_table[0].pcb = init;
/* Inserisce init nella coda di processi Ready */
insertProcQ(&readyQueue, init);
processCount++;
/* Avvio il tempo per il calcolo dello pseudo-clock tick */
startTimerTick = GET_TODLOW;
scheduler();
return 0;
}
示例6: main
//
// main
//
// Run a game of life simulation.
//
int main() {
int i, g, rows, cols;
int div;
// The first several lines take input parameters
// for the game.
//
printf("Welcome to the Game of Life.\n");
printf("How many generations would you like to watch? ");
scanf("%d", &g);
printf("Enter the width of the board: ");
scanf("%d", &cols);
printf("Enter the height of the board: ");
scanf("%d", &rows);
// Define our grids: G is our main grid, and T is our
// temp grid. We also print the initial state of the grid
// before actually running the simulation.
//
grid *G = initGrid(rows, cols);
grid *T = initGrid(rows, cols);
populate(G);
printGrid(G);
mgridUpdate(T, G, G->rows, 0);
// Gets the desired number of threads from the user -- we repeatedly
// ask for a number until we get a divisor of rows. Once we know how
// many threads there will be, we initialize the barrier.
//
printf("Please enter a divisor of %d to determine the number of threads: ", rows);
scanf("%d", &div);
while (rows % div != 0) {
printf("I'm sorry, %d does not divide %d. Please choose a divisor of %d: ", div, rows, rows);
scanf("%d", &div);
}
barrier_init(&barr, div);
// Creates an array of tinfo structs and
// pthreads. We then place the necessary
// info into each tinfo struct.
//
tinfo **I = malloc(div*sizeof(tinfo));
pthread_t threads[div];
for (i=0; i<div; i++) {
I[i] = initTinfo();
I[i]->in = G;
I[i]->out = T;
I[i]->section = i;
I[i]->divide = div;
I[i]->gen = g;
}
// Initialize a number of threads. Each thread works on a portion of our
// grid -- which portion it works on is decided by the I[i] tinfo struct.
//
for (i=0; i<div; i++) {
pthread_create(&threads[i], NULL, &mFunc, (void *)I[i]);
}
// My implementation requires join, because the main thread
// must wait for all of the child threads to complete before
// destroying the barrier and printing the final grid.
//
for (i=0; i<div; i++) {
pthread_join(threads[i], NULL);
}
// Destroy the barrier, print the final generation.
//
barrier_destroy(&barr);
printGrid(G);
return 0;
}
示例7: populate
void __fastcall TfrmRetrieveMain::CmbAliquot2DropDown( TObject *Sender ) {
populate( CmbAliquot2, CmbAliquot1 );
}
示例8: browse
void
browse(const char *ipath, const char *ifilter)
{
int r, fd;
regex_t re;
char *newpath;
struct stat sb;
char *name, *bin, *dir, *tmp, *run, *env;
int nowtyping = 0;
FILE *fp;
oldpath = NULL;
path = xstrdup(ipath);
fltr = xstrdup(ifilter);
begin:
/* Path and filter should be malloc(3)-ed strings at all times */
r = populate();
if (r == -1) {
if (!nowtyping) {
printwarn();
goto nochange;
}
}
for (;;) {
redraw();
/* Handle filter-as-you-type mode */
if (nowtyping)
goto moretyping;
nochange:
switch (nextsel(&run, &env)) {
case SEL_QUIT:
free(path);
free(fltr);
dentfree(dents, n);
return;
case SEL_BACK:
/* There is no going back */
if (strcmp(path, "/") == 0 ||
strcmp(path, ".") == 0 ||
strchr(path, '/') == NULL)
goto nochange;
dir = xdirname(path);
if (canopendir(dir) == 0) {
free(dir);
printwarn();
goto nochange;
}
/* Save history */
oldpath = path;
path = dir;
/* Reset filter */
free(fltr);
fltr = xstrdup(ifilter);
goto begin;
case SEL_GOIN:
/* Cannot descend in empty directories */
if (n == 0)
goto nochange;
name = dents[cur].name;
newpath = mkpath(path, name);
DPRINTF_S(newpath);
/* Get path info */
fd = open(newpath, O_RDONLY | O_NONBLOCK);
if (fd == -1) {
printwarn();
free(newpath);
goto nochange;
}
r = fstat(fd, &sb);
if (r == -1) {
printwarn();
close(fd);
free(newpath);
goto nochange;
}
close(fd);
DPRINTF_U(sb.st_mode);
switch (sb.st_mode & S_IFMT) {
case S_IFDIR:
if (canopendir(newpath) == 0) {
printwarn();
free(newpath);
goto nochange;
}
free(path);
path = newpath;
/* Reset filter */
free(fltr);
fltr = xstrdup(ifilter);
goto begin;
case S_IFREG:
bin = openwith(newpath);
if (bin == NULL) {
printmsg("No association");
free(newpath);
//.........这里部分代码省略.........