• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ setOptions函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中setOptions函数的典型用法代码示例。如果您正苦于以下问题:C++ setOptions函数的具体用法?C++ setOptions怎么用?C++ setOptions使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了setOptions函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: trainBackgroundModel

void trainBackgroundModel(CvCapture* capture)
{
	CvSize frame_size;
	frame_size.height = (int) cvGetCaptureProperty( capture, CV_CAP_PROP_FRAME_HEIGHT );
	frame_size.width = (int) cvGetCaptureProperty( capture, CV_CAP_PROP_FRAME_WIDTH );

	if(background_model != NULL)
		delete background_model;
	background_model = new pixel_data*[frame_size.height];
	for(int i = 0; i < frame_size.height; i++)
		background_model[i] = new pixel_data[frame_size.width];

	const char* title = "Training Background Model";
	std::vector<const char*> lines;

	for(int i = 5; i >= 0; i--)
	{
		char buffer[400];
		sprintf(buffer, "Starting training in %d ...", i);
		lines.clear();
		lines.push_back(buffer);

		setOptions(title, lines);
		cvWaitKey(1000);
	}

	for(int num_frames = 0; num_frames < NUM_BACKGROUND_TRAINING_FRAMES; num_frames++)
	{
        
		char buffer[400];
		sprintf(buffer, "%g%%", ((double)num_frames/NUM_BACKGROUND_TRAINING_FRAMES*100.0));
		lines.clear();
		lines.push_back(buffer);
		setOptions(title, lines);

		/* get a frame */
		IplImage* frame = cvQueryFrame( capture );

		RgbImage img(frame);
		for(int i = 0; i < frame->height; i++)
		{
			for(int j = 0; j < frame->width; j++)
			{
				background_model[i][j].addDataPoint(img[i][j].r, img[i][j].g, img[i][j].b);
			}
		}
 
		/* always check */
		if( !frame ) break;

		cvShowImage(MAIN_WINDOW, frame);
		
		cvWaitKey(10);
    }


	lines.push_back("Done");
	setOptions(title, lines);
	cvWaitKey(3000);
}
开发者ID:cschenck,项目名称:opencv_projects,代码行数:60,代码来源:background_segmentation.cpp


示例2: switch

BOOL SettingsDialog::run_dlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM /*lParam*/)
{
	switch(message)
	{
		case WM_INITDIALOG:
			_hSelf = hWnd;
			initialiseOptions();
			return TRUE;

		case WM_COMMAND:
		{
			switch(LOWORD(wParam))
			{
				case IDOK:
					setOptions();

				case IDCANCEL:
					::EndDialog(hWnd, 0);
			}
			return TRUE;
		}

		default:
			return FALSE;
	}



}
开发者ID:hhypgfadwr,项目名称:nppPluginManager,代码行数:29,代码来源:SettingsDialog.cpp


示例3: setName

GameMode::GameMode(std::string name, std::string description, std::vector<std::string> options)
{
	setName(name);
	setDescription(description);
	setOptions(options);
	setType("multiChoice");
}
开发者ID:yaspo,项目名称:Guessing-game-in-CPP,代码行数:7,代码来源:gameMode.cpp


示例4: main

int main(int argc, char *argv[])
{
  register int n;

  int     Nlambda, result;
  double *lambda;
  FILE   *fp;


  /* --- Read input data and initialize --             -------------- */

  setOptions(argc, argv);
  SetFPEtraps();

  readInput();
  MULTIatmos(&atmos, &geometry);
  readAtomicModels();
  readMolecularModels();

  if ((fp = fopen(CONTR_INPUT_FILE, "r")) == NULL) {
    sprintf(messageStr, "Unable to open inputfile %s", CONTR_INPUT_FILE);
    Error(ERROR_LEVEL_2, argv[0], messageStr);
  }

  result = fscanf(fp, "%d", &Nlambda);
  lambda = (double *) malloc(Nlambda * sizeof(double));
  for (n = 0;  n < Nlambda;  n++)
    result = fscanf(fp, "%lf", &lambda[n]);
  fclose(fp);

  backgrOpac(Nlambda, lambda);

  free(lambda);
}
开发者ID:jorritleenaarts,项目名称:rh,代码行数:34,代码来源:backgrcontr.c


示例5: parseOptions

bool parseOptions(int ac, char** av, ProgramOptions& options) {
    po::positional_options_description positional_options;
    po::options_description desc;

    positional_options.add("compress", 1);

    desc.add_options()
            ("help,h", "this help message")
            ("output,o", po::value<std::string>(),
                    "for compression: output file (default is 'output.arch'), for extraction: output directory (current directory by default).")
            ("extract,x", po::value<std::string>(), "extract archive")
            ("compress", po::value<std::string>(), "compress file or folder");

    std::stringstream ss;
    ss << desc;
    options.setHelpString(ss.str());

    po::variables_map vm;

    try {
        po::store(
                po::command_line_parser(ac, av).options(desc).positional(
                        positional_options).run(), vm);
        po::notify(vm);

        return setOptions(vm, options);
    } catch (std::exception & ex) {
        std::cerr << ex.what() << std::endl;
        return false;
    }

}
开发者ID:milohoffman,项目名称:simple_tar,代码行数:32,代码来源:options.cpp


示例6: QWizard

GeneratedObjectsWizard::GeneratedObjectsWizard(
		GeneratedObjectsWizardPage * page, QWidget * parent):
				QWizard(parent), page_(page) {

	setWindowTitle(
		tr("Generated") +" "+ page_->objectTypePlural() +
			" | " + MAIN_WINDOW->windowTitle() );
	page_->setTitle(tr("Random generated")+" "+
		page_->objectTypePlural() );
	page_->setSubTitle(
		tr( "Change count of generated objects of some kinds and"
			" confirm the settings. If there is not the object"
			" you want, try load new object, but remember that"
			" in this page are viewed only")+" "+
		 page_->objectTypePlural() +".");

	setOptions( QWizard::NoBackButtonOnStartPage |
		QWizard::HaveCustomButton1);
	setButtonText(QWizard::CustomButton1, tr("Load new map object"));
	connect(this, SIGNAL(customButtonClicked(int)),
		this, SLOT(loadMapObject()) );


	addPage(page);
	connect(this, SIGNAL(accepted()),
		page, SLOT(setCountInMap()) );
}
开发者ID:jirkadanek,项目名称:bombic2,代码行数:27,代码来源:generated_objects_wizard.cpp


示例7: optionInit

void optionInit(int *pArgc, char *argv[], struct optionSpec *optionSpecs)
/* Read options in command line into options hash.
 * Options come in three forms:
 *      -option         words starting with dash
 *      option=val      words with = in the middle
 *      -option=val     combining the two.
 * The resulting hash will be keyed by the option name with the val
 * string for value.  For '-option' types the value is 'on'.
 * The words in argv are parsed in assending order.  If a word of
 * "--" is encountered, argument parsing stops.
 * If optionSpecs is not NULL, it is an array of optionSpec that are
 * used to validate the options.  An option must exist in the array
 * and the value must be convertable to the type specified in flags.
 * Boolean options must no value, all other options must have one.
 * Array is terminated by a optionSpec with a NULL name.
 * If array NULL, no validation is done.
 */
{
if (options == NULL)
    {
    struct hash *hash = parseOptions(pArgc, argv, FALSE, optionSpecs);
    setOptions(hash);
    optionSpecification = optionSpecs;
    }
}
开发者ID:Puneet-Shivanand,项目名称:zinba,代码行数:25,代码来源:options.c


示例8: QMediaPlayer

PlanetC_VideoPlayer::PlanetC_VideoPlayer(QGraphicsView* p_view)
	: QMediaPlayer(0, QMediaPlayer::VideoSurface)
{
	posX = 0;
	posY = 0;
	sizeW = 100;
	sizeH = 100;
	rotationAngle = 0.;

	//Create a QGraphicsVideoItem object to display the videow
	video = new QGraphicsVideoItem();
	video->setVisible(true);
	video->setAspectRatioMode(Qt::KeepAspectRatio);

	//Add QGraphicsVideoItem object to the main scene
	view = p_view;
	view->scene()->addItem(video);

	//Connect the player to the video item
	setVideoOutput(video);
	video->setVisible(true);

	//Once geometry properties are available (width, height) set the GraphicsVideoItem geometry
	connect(this, SIGNAL(metaDataChanged(QString,QVariant)), this, SLOT(setOptions(QString,QVariant)));
}
开发者ID:gcalderone,项目名称:PlanetC,代码行数:25,代码来源:PlanetC_VideoPlayer.cpp


示例9: m_type

UIWizard::UIWizard(QWidget *pParent, UIWizardType type, UIWizardMode mode)
    : QIWithRetranslateUI<QWizard>(pParent)
    , m_type(type)
    , m_mode(mode == UIWizardMode_Auto ? loadModeForType(m_type) : mode)
{
#ifdef Q_WS_WIN
    /* Hide window icon: */
    setWindowIcon(QIcon());
#endif /* Q_WS_WIN */

#ifdef Q_WS_MAC
    /* Since wizards are now represented as Mac OS X Sheets
     * we would like to have possibility to cancel them. */
    setOption(QWizard::NoCancelButton, false);
    /* I'm really not sure why there shouldn't be any default button on Mac OS X.
     * This prevents the using of Enter to jump to the next page. */
    setOptions(options() ^ QWizard::NoDefaultButton);
#endif /* Q_WS_MAC */

    /* All our wizards would like to have window-modality,
     * Under Mac OS it will be represented as Mac OS Sheet. */
    setWindowModality(Qt::WindowModal);

    /* Setup connections: */
    connect(this, SIGNAL(currentIdChanged(int)), this, SLOT(sltCurrentIdChanged(int)));
    connect(this, SIGNAL(customButtonClicked(int)), this, SLOT(sltCustomButtonClicked(int)));
}
开发者ID:bayasist,项目名称:vbox,代码行数:27,代码来源:UIWizard.cpp


示例10: setOptions

void LayerListDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
{
	QStyleOptionViewItem opt = setOptions(index, option);
	painter->save();

	const auto &layer = index.data().value<paintcore::LayerInfo>();

	const int myId = static_cast<const canvas::LayerListModel*>(index.model())->myId();
	if(layer.isLockedFor(myId))
		opt.state &= ~QStyle::State_Enabled;

	drawBackground(painter, option, index);

	QRect textrect = opt.rect;

	// Draw layer opacity glyph
	QRect stylerect(opt.rect.topLeft() + QPoint(0, opt.rect.height()/2-12), QSize(24,24));
	drawOpacityGlyph(stylerect, painter, layer.opacity, layer.hidden);

	// Draw layer name
	textrect.setLeft(stylerect.right());

	QString title;
	if(m_showNumbers)
		title = QString("%1 - %2").arg(index.model()->rowCount() - index.row() - 1).arg(layer.title);
	else
		title = layer.title;

	drawDisplay(painter, opt, textrect, title);

	painter->restore();
}
开发者ID:Rambo2015,项目名称:Drawpile,代码行数:32,代码来源:layerlistdelegate.cpp


示例11: setOptions

void SslContext::updateProtocol(int method)
{
    setOptions(SSL_OP_NO_SSLv2);
    if (!(method & SSL_v3))
        setOptions(SSL_OP_NO_SSLv3);
    if (!(method & SSL_TLSv1))
        setOptions(SSL_OP_NO_TLSv1);
#ifdef SSL_OP_NO_TLSv1_1
    if (!(method & SSL_TLSv11))
        setOptions(SSL_OP_NO_TLSv1_1);
#endif
#ifdef SSL_OP_NO_TLSv1_2
    if (!(method & SSL_TLSv12))
        setOptions(SSL_OP_NO_TLSv1_2);
#endif
}
开发者ID:Acidburn0zzz,项目名称:openlitespeed,代码行数:16,代码来源:sslcontext.cpp


示例12: setOptions

void AVFilterSubtitle::onPlayerStart()
{
    setOptions(QString());
    if (!autoLoad())
        return;
    findAndSetFile(m_player->file());
}
开发者ID:151706061,项目名称:QtAV,代码行数:7,代码来源:AVFilterSubtitle.cpp


示例13: main

/*
 * Main function
 */
int main(int argc, char* argv[])
{
    cout << "          Producers-Consumers demo running" << endl
         << "          --------------------------------" << endl << endl;

    // create an object to store and handle options
    run_options opt;

    // default parameters are set here
    opt.num_of_producers = 10;      // threads
    opt.num_of_consumers = 10;      // threads
    opt.production_duration = 500;  // milliseconds
    opt.consumption_duration = 500; // milliseconds
    opt.market_buffer_size = 1000;  // integers

    // parse and assign user-defined options (if any)
    setOptions(argc, argv, &opt);

    // display options
    showOptions(&opt);

    // create an object to simulate the producers-consumers problem
    Market MyMarket(&opt);

    // trigger the simulation
    MyMarket.run();

    return 0;
}
开发者ID:Dim-Sal,项目名称:short,代码行数:32,代码来源:main.cpp


示例14: main

int main(int argc, char **argv)
{
	// Statup wx
	wxInitialize();

	wxString executable;
	executable = wxString::FromAscii(argv[0]);

	if (argc < 2)
	{
		usage(executable);
		return 1;
	}

	argc--;
	argv++;

	setOptions(argc, argv, executable);

	if (!runInForeground)
		daemonize();

	MainLoop();

	return 0;
}
开发者ID:vahe-evoyan,项目名称:pgagent,代码行数:26,代码来源:unix.cpp


示例15: sizeof

bool Socket::getTCPNoDelay( bool &noDelay ) {
	bool result;
	int tcpNoDelay=noDelay;
	result=setOptions( IPPROTO_TCP, TCP_NODELAY, &tcpNoDelay, sizeof(int));
	noDelay=tcpNoDelay ? true : false;
	return result;
}
开发者ID:jgrande,项目名称:ginga,代码行数:7,代码来源:socket.cpp


示例16: QWidget

/*!
 * Constructor is responsible for allocating memory for all the GUI,
 * arranging and connecting them in the right order.
 */
OptionsForm::OptionsForm(QWidget *aParent)
    : QWidget(aParent)
{
    setWindowTitle(tr("Options"));

    PASCALpath_ = 0;

    layout_v_ = new QVBoxLayout(this);
    layout_PASCAL_root_ = new QHBoxLayout;
    layout_h_ = new QHBoxLayout;

    auto_color_generation_box_ = new QCheckBox(this);
    auto_color_generation_box_->setText(tr("Automatic label color generation"));
    button_set_PASCAL_root_ = new QPushButton(this);
    button_set_PASCAL_root_->setText(tr("set PASCAL root path"));
    edit_PASCAL_root_ = new QLineEdit("", this);
    edit_PASCAL_root_->setMinimumWidth(180);
    button_ok_ = new QPushButton(this);
    button_ok_->setText(tr("OK"));
    button_cancel_ = new QPushButton(this);
    button_cancel_->setText(tr("Cancel"));

    layout_v_->addWidget(auto_color_generation_box_);
    layout_v_->addLayout(layout_PASCAL_root_);
    layout_v_->addLayout(layout_h_);

    layout_PASCAL_root_->addWidget(button_set_PASCAL_root_);
    layout_PASCAL_root_->addWidget(edit_PASCAL_root_);

    layout_h_->addWidget(button_ok_);
    layout_h_->addWidget(button_cancel_);

    connect(
        button_set_PASCAL_root_,
        SIGNAL(clicked()),
        this,
        SLOT(newPascalPath())
    );
    connect(
        button_ok_,
        SIGNAL(clicked()),
        this,
        SLOT(setOptions())
    );
    connect(
        button_cancel_,
        SIGNAL(clicked()),
        this,
        SLOT(hide())
    );
    connect(
        edit_PASCAL_root_,
        SIGNAL(editingFinished()),
        this,
        SLOT(onPathEditing())
    );

    /* moving it to the center of the screen */
    move(QApplication::desktop()->screen()->rect().center() - rect().center());
}
开发者ID:gavlig,项目名称:Image-labeling-tool,代码行数:64,代码来源:OptionsForm.cpp


示例17: setOptions

void LayerListDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
{
    QStyleOptionViewItem opt = setOptions(index, option);
    painter->save();

    drawBackground(painter, option, index);

    QRect textrect = opt.rect;

    const net::LayerListItem &layer = index.data().value<net::LayerListItem>();

    const QSize locksize = _lockicon.size();

    // Draw layer opacity glyph
    QRect stylerect(opt.rect.topLeft() + QPoint(0, opt.rect.height()/2-12), QSize(24,24));
    drawOpacityGlyph(stylerect, painter, layer.opacity, layer.hidden);

    // Draw layer name
    textrect.setLeft(stylerect.right());
    textrect.setWidth(textrect.width() - locksize.width());
    drawDisplay(painter, opt, textrect, layer.title);

    // Draw lock button
    if(layer.isLockedFor(_client->myId()))
        painter->drawPixmap(
            opt.rect.topRight()-QPoint(locksize.width(), -opt.rect.height()/2+locksize.height()/2),
            _lockicon
        );

    painter->restore();
}
开发者ID:GreenReaper,项目名称:Drawpile,代码行数:31,代码来源:layerlistdelegate.cpp


示例18: procOpts

static MRESULT EXPENTRY procOpts(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
{
    ULONG   ret ;

    switch (msg) {

    case WM_INITDLG :
        if (SessDlgCenter) {
            dialogAtCenter(hwnd) ;
        } else {
            dialogAtMouse(hwnd, DID_OK) ;
        }
        setOptions(hwnd)   ;
        return (MRESULT) 0 ;

    case WM_COMMAND :
        switch (ret = SHORT1FROMMP(mp1)) {
        case DID_OK :
        case DID_CANCEL :
            if (getOptions(hwnd) != TRUE) {
                return (MRESULT) 0 ;
            }
            saveParam() ;
            WinDismissDlg(hwnd, ret) ;
            return (MRESULT) 0 ;
        default :
            return (MRESULT) 0 ;
        }
    }
    return WinDefDlgProc(hwnd, msg, mp1, mp2) ;
}
开发者ID:OS2World,项目名称:APP-INTERNET-PMVNC-Client,代码行数:31,代码来源:sess.c


示例19: QLabel

	void ToolConfig::setupGeneral()
	{
		m_configWidget->m_stackBasic->insertWidget(GBS_None, new QLabel(i18n("Use the \"Advanced\" tab to configure this tool."), this));

		m_ptcw = new ProcessToolConfigWidget(m_configWidget->m_stackBasic);
		m_configWidget->m_stackBasic->insertWidget(GBS_Process, m_ptcw);
		connect(m_ptcw->m_command, SIGNAL(textChanged(const QString &)), this, SLOT(setCommand(const QString &)));
		connect(m_ptcw->m_options, SIGNAL(textChanged()), this, SLOT(setOptions()));

		m_ltcw = new LibraryToolConfigWidget(m_configWidget->m_stackBasic);
		m_configWidget->m_stackBasic->insertWidget(GBS_Library, m_ltcw);
		connect(m_ltcw->m_library, SIGNAL(textChanged(const QString &)), this, SLOT(setLibrary(const QString &)));
		connect(m_ltcw->m_class, SIGNAL(textChanged(const QString &)), this, SLOT(setClassName(const QString &)));
		connect(m_ltcw->m_options, SIGNAL(textChanged(const QString &)), this, SLOT(setLibOptions(const QString &)));

		m_qtcw = new QuickToolConfigWidget(m_configWidget->m_stackBasic);
		m_configWidget->m_stackBasic->insertWidget(GBS_Sequence, m_qtcw);
		connect(m_qtcw, SIGNAL(sequenceChanged(const QString &)), this, SLOT(setSequence(const QString &)));

		m_configWidget->m_stackBasic->insertWidget(GBS_Error, new QLabel(i18n("Unknown tool type; your configuration data is malformed.\nPerhaps it is a good idea to restore the default settings."), this));

		m_configWidget->m_stackExtra->insertWidget(GES_None, new QWidget(this));

		m_LaTeXtcw = new LaTeXToolConfigWidget(m_configWidget->m_stackExtra);
		m_configWidget->m_stackExtra->insertWidget(GES_LaTeX, m_LaTeXtcw);
		connect(m_LaTeXtcw->m_ckRootDoc, SIGNAL(toggled(bool)), this, SLOT(setLaTeXCheckRoot(bool)));
		connect(m_LaTeXtcw->m_ckJump, SIGNAL(toggled(bool)), this, SLOT(setLaTeXJump(bool)));
		connect(m_LaTeXtcw->m_ckAutoRun, SIGNAL(toggled(bool)), this, SLOT(setLaTeXAuto(bool)));

	}
开发者ID:KDE,项目名称:kile,代码行数:30,代码来源:toolconfigwidget.cpp


示例20: QWizard

AddFeedWizard::AddFeedWizard(QWidget *parent, int curFolderId)
  : QWizard(parent),
    curFolderId_(curFolderId)
{
  setWindowFlags (windowFlags() & ~Qt::WindowContextHelpButtonHint);
  setWindowTitle(tr("Add Feed"));
  setWizardStyle(QWizard::ModernStyle);
  setOptions(QWizard::HaveFinishButtonOnEarlyPages |
             QWizard::NoBackButtonOnStartPage);

  addPage(createUrlFeedPage());
  addPage(createNameFeedPage());

  updateFeeds_ = new UpdateFeeds(this, true);

  connect(button(QWizard::BackButton), SIGNAL(clicked()),
          this, SLOT(backButtonClicked()));
  connect(button(QWizard::NextButton), SIGNAL(clicked()),
          this, SLOT(nextButtonClicked()));
  connect(button(QWizard::FinishButton), SIGNAL(clicked()),
          this, SLOT(finishButtonClicked()));
  connect(this, SIGNAL(currentIdChanged(int)),
          SLOT(slotCurrentIdChanged(int)),
          Qt::QueuedConnection);
  resize(400, 300);

  Settings settings;
  restoreGeometry(settings.value("addFeedWizard/geometry").toByteArray());
}
开发者ID:Nikoli,项目名称:quite-rss,代码行数:29,代码来源:addfeedwizard.cpp



注:本文中的setOptions函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ setOrganizationName函数代码示例发布时间:2022-05-30
下一篇:
C++ setOption函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap