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

C++ setEnabled函数代码示例

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

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



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

示例1: RendererBase

	GridRenderer::GridRenderer(RenderBackend* renderbackend, int position):
		RendererBase(renderbackend, position) {
		setEnabled(false);
	}
开发者ID:m64,项目名称:PEG,代码行数:4,代码来源:gridrenderer.cpp


示例2: setEnabled

void ScrollList::enableGame()
{
	setEnabled( true );
}
开发者ID:q4a,项目名称:attal,代码行数:4,代码来源:gameControl.cpp


示例3: QFileInfo

/**
 * Generate scez file menu slot function.
 */
void CreateSceFile::generateCompressedFileSlot()
{
    bool success = false;
    QString sceFileName = ui->fileLineEdit->text() + "/" + QFileInfo(ui->fileLineEdit->text()).fileName() + ".sce";
    ScriptFile fileHelper(this, sceFileName, false);
    QStringList copiedFiles;

    if(!isExecutableScriptInFilesTable())
    {
        QMessageBox::information(this, "could not start generation", "No executable script defined.");
        return;
    }

    setEnabled(false);

    ui->progressBar->setValue(0);
    ui->progressBar->setMinimum(0);
    ui->progressBar->setMaximum(ui->filesTableWidget->rowCount() * 2);

    statusBar()->showMessage("generating scez file", 0);

    generateSlot(&copiedFiles, ui->progressBar, &success);
    if(success)
    {
        copiedFiles << sceFileName;
        QString zipFileName = ui->fileLineEdit->text() + ".scez";

        (void)fileHelper.deleteFile(zipFileName, false);

        QList<QStringList> fileList;
        QString rootDir = QDir(QFileInfo(sceFileName).path()).absolutePath();
        for(auto el : copiedFiles)
        {
            QStringList entry;
            entry << el;
            entry << QFileInfo(el).filePath().remove(0, rootDir.length() + 1);
            fileList << entry;
        }

        success = ScriptFile::zipFiles(zipFileName, fileList, ui->progressBar);
        if(!success)
        {
            (void)QFile::remove(zipFileName);
        }
        else
        {
            QFile inFile;
            inFile.setFileName(zipFileName);

            success = inFile.open(QIODevice::ReadOnly);
            if(success)
            {
                QCryptographicHash hashObject(QCryptographicHash::Sha512);
                success = hashObject.addData(&inFile);
                if(success)
                {   inFile.close();
                    success = inFile.open(QIODevice::Append);
                    if(success)
                    {
                        (void)inFile.seek(inFile.size());
                        QByteArray hash = hashObject.result();
                        success = (inFile.write(hash) == hash.length()) ? true : false;
                    }
                }

                inFile.close();
            }
        }
    }

    //Delete the sce folder.
    (void)QDir(ui->fileLineEdit->text()).removeRecursively();

    if(success)
    {
        QMessageBox::information(this, "information", "scez file creation succeeded");
        statusBar()->showMessage("scez file created", 5000);
    }
    else
    {
        statusBar()->showMessage("scez file creation failed", 5000);
    }

    setEnabled(true);
}
开发者ID:szieke,项目名称:ScriptCommunicator_serial-terminal,代码行数:88,代码来源:createSceFile.cpp


示例4: setEnabled

void RenderPlugin::applyItemState()
{
    setEnabled( d->m_item.checkState() == Qt::Checked );
}
开发者ID:PayalPradhan,项目名称:marble,代码行数:4,代码来源:RenderPlugin.cpp


示例5: setEnabled

void BtOpenWorkAction::slotModelChanged() {
    setEnabled(m_menu->postFilterModel()->rowCount() > 0);
}
开发者ID:kalemas,项目名称:bibletime,代码行数:3,代码来源:btopenworkaction.cpp


示例6: setEnabled

void CAntiFlashhack::unload() {
	setEnabled(false);
	if( m_flFlashTill != NULL )
		delete[] m_flFlashTill;
	m_flFlashTill = NULL;
}
开发者ID:live141,项目名称:SBGuardian,代码行数:6,代码来源:AntiFlashhack.cpp


示例7: setEnabled

DdeFaceTracker::~DdeFaceTracker() {
    setEnabled(false);
}
开发者ID:robertflesch,项目名称:hifi,代码行数:3,代码来源:DdeFaceTracker.cpp


示例8: CC_CALLBACK_1

//------------------------------------------------------------------
//
// MenuLayer4
//
//------------------------------------------------------------------
MenuLayer4::MenuLayer4()
{
    MenuItemFont::setFontName("American Typewriter");
    MenuItemFont::setFontSize(18);
    auto title1 = MenuItemFont::create("Sound");
    title1->setEnabled(false);
    MenuItemFont::setFontName( "fonts/Marker Felt.ttf" );
    MenuItemFont::setFontSize(34);
    auto item1 = MenuItemToggle::createWithCallback( CC_CALLBACK_1(MenuLayer4::menuCallback, this),
                 MenuItemFont::create( "On" ),
                 MenuItemFont::create( "Off"),
                 nullptr );

    MenuItemFont::setFontName( "American Typewriter" );
    MenuItemFont::setFontSize(18);
    auto title2 = MenuItemFont::create( "Music" );
    title2->setEnabled(false);
    MenuItemFont::setFontName( "fonts/Marker Felt.ttf" );
    MenuItemFont::setFontSize(34);
    auto item2 = MenuItemToggle::createWithCallback(CC_CALLBACK_1(MenuLayer4::menuCallback, this),
                 MenuItemFont::create( "On" ),
                 MenuItemFont::create( "Off"),
                 nullptr );

    MenuItemFont::setFontName( "American Typewriter" );
    MenuItemFont::setFontSize(18);
    auto title3 = MenuItemFont::create( "Quality" );
    title3->setEnabled( false );
    MenuItemFont::setFontName( "fonts/Marker Felt.ttf" );
    MenuItemFont::setFontSize(34);
    auto item3 = MenuItemToggle::createWithCallback(CC_CALLBACK_1(MenuLayer4::menuCallback, this),
                 MenuItemFont::create( "High" ),
                 MenuItemFont::create( "Low" ),
                 nullptr );

    MenuItemFont::setFontName( "American Typewriter" );
    MenuItemFont::setFontSize(18);
    auto title4 = MenuItemFont::create( "Orientation" );
    title4->setEnabled(false);
    MenuItemFont::setFontName( "fonts/Marker Felt.ttf" );
    MenuItemFont::setFontSize(34);
    auto item4 = MenuItemToggle::createWithCallback(CC_CALLBACK_1(MenuLayer4::menuCallback, this),
                 MenuItemFont::create( "Off" ),
                 nullptr );

    // TIP: you can manipulate the items like any other MutableArray
    item4->getSubItems().pushBack( MenuItemFont::create( "33%" ) );
    item4->getSubItems().pushBack( MenuItemFont::create( "66%" ) );
    item4->getSubItems().pushBack( MenuItemFont::create( "100%" ) );

    // you can change the one of the items by doing this
    item4->setSelectedIndex( 2 );

    MenuItemFont::setFontName( "fonts/Marker Felt.ttf" );
    MenuItemFont::setFontSize( 34 );

    auto label = Label::createWithBMFont("fonts/bitmapFontTest3.fnt",  "go back");
    auto back = MenuItemLabel::create(label, CC_CALLBACK_1(MenuLayer4::backCallback, this) );

    auto menu = Menu::create(
                    title1, title2,
                    item1, item2,
                    title3, title4,
                    item3, item4,
                    back, nullptr ); // 9 items.

    menu->alignItemsInColumns(2, 2, 2, 2, 1, NULL);

    addChild( menu );

    auto s = Director::getInstance()->getWinSize();
    menu->setPosition(Vec2(s.width/2, s.height/2));
}
开发者ID:zengzhining,项目名称:cocos2d-x,代码行数:78,代码来源:MenuTest.cpp


示例9: QObject

/*!
   Constructor
   \param parent Widget to be magnified
*/
QwtMagnifier::QwtMagnifier( QWidget *parent ):
    QObject( parent )
{
    d_data = new PrivateData();
    setEnabled( true );
}
开发者ID:albore,项目名称:pandora,代码行数:10,代码来源:qwt_magnifier.cpp


示例10: toggleEnabled

 void toggleEnabled(void) { setEnabled(! enabled_); }
开发者ID:suominen,项目名称:Karabiner,代码行数:1,代码来源:RemapClass.hpp


示例11: setEnabled

 //-----------------------------------------------------------------------
 void ParticleEmitter::setStartTime(Real startTime)
 {
     setEnabled(false);
     mStartTime = startTime;
 }
开发者ID:akadjoker,项目名称:gmogre3d,代码行数:6,代码来源:OgreParticleEmitter.cpp


示例12: setEnabled

void ChatControllerBase::setOnline(bool online) {
	setEnabled(online);
}
开发者ID:trungtran0689,项目名称:swift,代码行数:3,代码来源:ChatControllerBase.cpp


示例13: handleUpdateFinished

 void handleUpdateFinished(void) {setEnabled(true);}
开发者ID:BillTheBest,项目名称:realopinsight-workstation,代码行数:1,代码来源:MainWindow.hpp


示例14: QMenu

Menu::Menu(MenuRole role, QWidget *parent) : QMenu(parent),
	m_actionGroup(NULL),
	m_bookmark(NULL),
	m_role(role)
{
	switch (role)
	{
		case BookmarksMenuRole:
		case BookmarkSelectorMenuRole:
		case NotesMenuRole:
			{
				installEventFilter(this);

				Menu *parentMenu = qobject_cast<Menu*>(parent);

				if (!parentMenu || parentMenu->getRole() != m_role)
				{
					if (m_role == NotesMenuRole)
					{
						connect(NotesManager::getModel(), SIGNAL(modelModified()), this, SLOT(clearModelMenu()));
					}
					else
					{
						connect(BookmarksManager::getModel(), SIGNAL(modelModified()), this, SLOT(clearModelMenu()));
					}
				}

				connect(this, SIGNAL(aboutToShow()), this, SLOT(populateModelMenu()));
			}

			break;
		case CharacterEncodingMenuRole:
			connect(this, SIGNAL(aboutToShow()), this, SLOT(populateCharacterEncodingMenu()));
			connect(this, SIGNAL(triggered(QAction*)), this, SLOT(selectCharacterEncoding(QAction*)));

			break;
		case ClosedWindowsMenu:
			{
				setIcon(Utils::getIcon(QLatin1String("user-trash")));

				MainWindow *mainWindow = MainWindow::findMainWindow(parent);

				if (mainWindow)
				{
					setEnabled(!SessionsManager::getClosedWindows().isEmpty() || !mainWindow->getWindowsManager()->getClosedWindows().isEmpty());

					connect(mainWindow->getWindowsManager(), SIGNAL(closedWindowsAvailableChanged(bool)), this, SLOT(updateClosedWindowsMenu()));
				}

				connect(SessionsManager::getInstance(), SIGNAL(closedWindowsChanged()), this, SLOT(updateClosedWindowsMenu()));
				connect(this, SIGNAL(aboutToShow()), this, SLOT(populateClosedWindowsMenu()));
			}

			break;
		case ImportExportMenuRole:
			QMenu::addAction(tr("Import Opera Bookmarks…"))->setData(QLatin1String("OperaBookmarks"));
			QMenu::addAction(tr("Import HTML Bookmarks…"))->setData(QLatin1String("HtmlBookmarks"));
			QMenu::addSeparator();
			QMenu::addAction(tr("Import Opera Notes…"))->setData(QLatin1String("OperaNotes"));

			connect(this, SIGNAL(triggered(QAction*)), this, SLOT(openImporter(QAction*)));

			break;
		case SessionsMenuRole:
			connect(this, SIGNAL(aboutToShow()), this, SLOT(populateSessionsMenu()));
			connect(this, SIGNAL(triggered(QAction*)), this, SLOT(openSession(QAction*)));

			break;
		case ToolBarsMenuRole:
			connect(this, SIGNAL(aboutToShow()), this, SLOT(populateToolBarsMenu()));

			break;
		case UserAgentMenuRole:
			connect(this, SIGNAL(aboutToShow()), this, SLOT(populateUserAgentMenu()));
			connect(this, SIGNAL(triggered(QAction*)), this, SLOT(selectUserAgent(QAction*)));

			break;
		case WindowsMenuRole:
			connect(this, SIGNAL(aboutToShow()), this, SLOT(populateWindowsMenu()));
			connect(this, SIGNAL(triggered(QAction*)), this, SLOT(selectWindow(QAction*)));

			break;
		default:
			break;
	}
}
开发者ID:sietse,项目名称:otter-browser,代码行数:86,代码来源:Menu.cpp


示例15: setEnabled

QSocketNotifier::~QSocketNotifier()
{
    setEnabled( FALSE );
}
开发者ID:aroraujjwal,项目名称:qt3,代码行数:4,代码来源:qsocketnotifier.cpp


示例16: setEnabled

void Menu::updateClosedWindowsMenu()
{
	MainWindow *mainWindow = MainWindow::findMainWindow(parent());

	setEnabled((mainWindow && mainWindow->getWindowsManager()->getClosedWindows().count() > 0) || SessionsManager::getClosedWindows().count() > 0);
}
开发者ID:sietse,项目名称:otter-browser,代码行数:6,代码来源:Menu.cpp


示例17: _tcstol

void controlUC::setAttribute(PCWSTR pstrName, PCWSTR pstrValue)
{
	if( _tcscmp(pstrName, L"pos") == 0 ) {
		RECT rcPos = { 0 };
		PWSTR pstr = NULL;
		rcPos.left = _tcstol(pstrValue, &pstr, 10);  assert(pstr);    
		rcPos.top = _tcstol(pstr + 1, &pstr, 10);    assert(pstr);    
		rcPos.right = _tcstol(pstr + 1, &pstr, 10);  assert(pstr);    
		rcPos.bottom = _tcstol(pstr + 1, &pstr, 10); assert(pstr);    
		SIZE szXY = {rcPos.left >= 0 ? rcPos.left : rcPos.right, rcPos.top >= 0 ? rcPos.top : rcPos.bottom};
		setFixedXY(szXY);
		setFixedWidth(rcPos.right - rcPos.left);
		setFixedHeight(rcPos.bottom - rcPos.top);
	}
	else if( _tcscmp(pstrName, L"relativepos") == 0 ) {
		SIZE szMove,szZoom;
		PWSTR pstr = NULL;
		szMove.cx = _tcstol(pstrValue, &pstr, 10);  assert(pstr);    
		szMove.cy = _tcstol(pstr + 1, &pstr, 10);    assert(pstr);    
		szZoom.cx = _tcstol(pstr + 1, &pstr, 10);  assert(pstr);    
		szZoom.cy = _tcstol(pstr + 1, &pstr, 10); assert(pstr); 
		setRelativePos(szMove,szZoom);
	}
	else if( _tcscmp(pstrName, L"padding") == 0 ) {
		RECT rcPadding = { 0 };
		PWSTR pstr = NULL;
		rcPadding.left = _tcstol(pstrValue, &pstr, 10);  assert(pstr);    
		rcPadding.top = _tcstol(pstr + 1, &pstr, 10);    assert(pstr);    
		rcPadding.right = _tcstol(pstr + 1, &pstr, 10);  assert(pstr);    
		rcPadding.bottom = _tcstol(pstr + 1, &pstr, 10); assert(pstr);    
		setPadding(rcPadding);
	}
	else if( _tcscmp(pstrName, L"bkcolor") == 0 || _tcscmp(pstrName, L"bkcolor1") == 0 ) {
		while( *pstrValue > L'\0' && *pstrValue <= L' ')  pstrValue = ::CharNext(pstrValue);
		if( *pstrValue == L'#') pstrValue = ::CharNext(pstrValue);
		PWSTR pstr = NULL;
		DWORD clrColor = _tcstoul(pstrValue, &pstr, 16);
		setBkColor(clrColor);
	}
	else if( _tcscmp(pstrName, L"bordercolor") == 0 ) {
		if( *pstrValue == L'#') pstrValue = ::CharNext(pstrValue);
		PWSTR pstr = NULL;
		DWORD clrColor = _tcstoul(pstrValue, &pstr, 16);
		setBorderColor(clrColor);
	}
	else if( _tcscmp(pstrName, L"focusbordercolor") == 0 ) {
		if( *pstrValue == L'#') pstrValue = ::CharNext(pstrValue);
		PWSTR pstr = NULL;
		DWORD clrColor = _tcstoul(pstrValue, &pstr, 16);
		setFocusBorderColor(clrColor);
	}
	else if( _tcscmp(pstrName, L"bordersize") == 0 ) setBorderSize(_ttoi(pstrValue));
	else if( _tcscmp(pstrName, L"borderround") == 0 ) {
		SIZE cxyRound = { 0 };
		PWSTR pstr = NULL;
		cxyRound.cx = _tcstol(pstrValue, &pstr, 10);  assert(pstr);    
		cxyRound.cy = _tcstol(pstr + 1, &pstr, 10);    assert(pstr);     
		setBorderRound(cxyRound);
	}
	else if( _tcscmp(pstrName, L"width") == 0 ) setFixedWidth(_ttoi(pstrValue));
	else if( _tcscmp(pstrName, L"height") == 0 ) setFixedHeight(_ttoi(pstrValue));
	else if( _tcscmp(pstrName, L"minwidth") == 0 ) setMinWidth(_ttoi(pstrValue));
	else if( _tcscmp(pstrName, L"minheight") == 0 ) setMinHeight(_ttoi(pstrValue));
	else if( _tcscmp(pstrName, L"maxwidth") == 0 ) setMaxWidth(_ttoi(pstrValue));
	else if( _tcscmp(pstrName, L"maxheight") == 0 ) setMaxHeight(_ttoi(pstrValue));
	else if( _tcscmp(pstrName, L"name") == 0 ) setName(pstrValue);
	else if( _tcscmp(pstrName, L"text") == 0 ) setText(pstrValue);
	else if( _tcscmp(pstrName, L"tooltip") == 0 ) setToolTip(pstrValue);
	else if( _tcscmp(pstrName, L"userdata") == 0 ) setUserData(pstrValue);
	else if( _tcscmp(pstrName, L"enabled") == 0 ) setEnabled(_tcscmp(pstrValue, L"true") == 0);
	else if( _tcscmp(pstrName, L"mouse") == 0 ) setMouseEnabled(_tcscmp(pstrValue, L"true") == 0);
	else if( _tcscmp(pstrName, L"visible") == 0 ) setVisible(_tcscmp(pstrValue, L"true") == 0);
	else if( _tcscmp(pstrName, L"float") == 0 ) setFloat(_tcscmp(pstrValue, L"true") == 0);
	else if( _tcscmp(pstrName, L"shortcut") == 0 ) setShortcut(pstrValue[0]);
	else if( _tcscmp(pstrName, L"menu") == 0 ) setContextMenuUsed(_tcscmp(pstrValue, L"true") == 0);
}
开发者ID:madsen-git,项目名称:NTools,代码行数:76,代码来源:UCcontrol.cpp


示例18: setEnabled

//-----------------------------------------------------------------------
void PUObserver::notifyStart (void)
{
    _eventHandlersExecuted = false;
    _observe = true;
    setEnabled(_originalEnabled);
}
开发者ID:DominicD,项目名称:Hyperdrive,代码行数:7,代码来源:CCPUObserver.cpp


示例19: switch


//.........这里部分代码省略.........

  std::string sensor1_device_id = "device_id : " + ss.str();
  ss.clear();
  p_text_sensor_id->setContentSize(Size(400, 150));
  p_text_sensor_id->setPositionX(220);
  p_text_sensor_id->setString(sensor1_device_id);

  auto p_text_city = p_panel_record->getChildByName<ui::Text *>("textCity");
  p_text_city->setString(location_item.name_en);

  int cpm = location_item.recent_value;
  std::stringstream ss1, ss2, ss3;
  ss1 << cpm;
  auto p_text_recent_cpm =
      p_panel_record->getChildByName<ui::Text *>("textRecentCpm");
  p_text_recent_cpm->setString(ss1.str());
  ss1.clear();
  double usv =
      lib::Util::round((double)cpm / (double)location_item.conversion_rate, 3);
  ss2 << usv;
  auto p_text_recent_usv =
      p_panel_record->getChildByName<ui::Text *>("textRecentuSv");
  p_text_recent_usv->setString(ss2.str());

  auto p_text_sensor_status =
      p_panel_record->getChildByName<ui::Text *>("txtSensorStatus");
  std::string status_str;
  cocos2d::Color4B color;
  switch (location_item.sensor_status) {
  case 1: {
    status_str = "Online";
    color = Color4B(91, 192, 222, 255);
    break;
  }
  case 2: {
    status_str = "Offline";
    color = Color4B(217, 83, 79, 255);
    break;
  }
  case 3: {
    status_str = "Offline long";
    color = Color4B(217, 83, 79, 255);
    break;
  }
  }

  p_text_sensor_status->setString(status_str);
  p_text_sensor_status->setTextColor(color);

  p_text_recent_usv->setString(ss2.str());

  auto p_txt_recent_datetime =
      p_panel_record->getChildByName<ui::Text *>("txtRecentDatetime");
  std::string captured_at = location_item.recent_captured_at;
  p_txt_recent_datetime->setString(captured_at);

  // aggregations
  std::stringstream ss4, ss5, ss6;

  double avg_value = static_cast<double>(location_item.yesterday_average_value /
                                         location_item.conversion_rate);
  double peak_value = static_cast<double>(location_item.yesterday_peak_value /
                                          location_item.conversion_rate);

  // @note round method
  avg_value = lib::Util::round(avg_value, 3);
  peak_value = lib::Util::round(peak_value, 3);

  ss4 << avg_value << " μSv/hour";
  ss5 << peak_value << " μSv/hour";

  CCLOG("peak_value : %s, avg_value : %s", ss5.str().c_str(),
        ss4.str().c_str());

  auto p_text_avg_value =
      p_panel_record->getChildByName<ui::Text *>("txtYesterdayAverage");
  p_text_avg_value->setString(ss4.str());
  auto p_text_peak_value =
      p_panel_record->getChildByName<ui::Text *>("txtYesterdayPeak");
  p_text_peak_value->setString(ss5.str());

  // favorite
  auto p_button_favorite =
      p_panel_record->getChildByName<ui::Button *>("btnFavorite");

  auto flag = lib::Util::getFavorite(location_item.m_sensor_main_id);
  if (flag) {
    // enabled
    p_button_favorite->loadTextures("res/icon/menu/star_orange.png",
                                    "res/icon/menu/star_orange.png",
                                    "res/icon/menu/star_orange.png");
  } else {
    // disabled
    p_button_favorite->loadTextures("res/icon/menu/star_gray.png",
                                    "res/icon/menu/star_gray.png",
                                    "res/icon/menu/star_gray.png");
  }

  p_button_favorite->setEnabled(false);
}
开发者ID:OkadaMitsuo,项目名称:pointcast_client,代码行数:101,代码来源:Sensors.cpp


示例20: QTableView

ThingRulesView::ThingRulesView(QWidget* parent) :
	QTableView(parent),
	thingRulesTableModel(NULL)
{
	setEnabled(false);
}
开发者ID:sofgame-plugin,项目名称:psiplus-plugin,代码行数:6,代码来源:thingfview.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ setEncodedSize函数代码示例发布时间:2022-05-30
下一篇:
C++ setElementStringAttr函数代码示例发布时间: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