本文整理汇总了C++中setEnabled函数的典型用法代码示例。如果您正苦于以下问题:C++ setEnabled函数的具体用法?C++ setEnabled怎么用?C++ setEnabled使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setEnabled函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: RendererBase
GridRenderer::GridRenderer(RenderBackend* renderbackend, int position):
RendererBase(renderbackend, position) {
setEnabled(false);
}
示例2: setEnabled
void ScrollList::enableGame()
{
setEnabled( true );
}
示例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);
}
示例4: setEnabled
void RenderPlugin::applyItemState()
{
setEnabled( d->m_item.checkState() == Qt::Checked );
}
示例5: setEnabled
void BtOpenWorkAction::slotModelChanged() {
setEnabled(m_menu->postFilterModel()->rowCount() > 0);
}
示例6: setEnabled
void CAntiFlashhack::unload() {
setEnabled(false);
if( m_flFlashTill != NULL )
delete[] m_flFlashTill;
m_flFlashTill = NULL;
}
示例7: setEnabled
DdeFaceTracker::~DdeFaceTracker() {
setEnabled(false);
}
示例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));
}
示例9: QObject
/*!
Constructor
\param parent Widget to be magnified
*/
QwtMagnifier::QwtMagnifier( QWidget *parent ):
QObject( parent )
{
d_data = new PrivateData();
setEnabled( true );
}
示例10: toggleEnabled
void toggleEnabled(void) { setEnabled(! enabled_); }
示例11: setEnabled
//-----------------------------------------------------------------------
void ParticleEmitter::setStartTime(Real startTime)
{
setEnabled(false);
mStartTime = startTime;
}
示例12: setEnabled
void ChatControllerBase::setOnline(bool online) {
setEnabled(online);
}
示例13: handleUpdateFinished
void handleUpdateFinished(void) {setEnabled(true);}
示例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;
}
}
示例15: setEnabled
QSocketNotifier::~QSocketNotifier()
{
setEnabled( FALSE );
}