当前位置: 首页>>代码示例>>C++>>正文


C++ setEnabled函数代码示例

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


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


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