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

C++ setDisabled函数代码示例

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

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



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

示例1: setDisabled

void MemoryCache::evictResources()
{
    if (disabled())
        return;

    setDisabled(true);
    setDisabled(false);
}
开发者ID:jbat100,项目名称:webkit,代码行数:8,代码来源:MemoryCache.cpp


示例2: setDisabled

void TowerButton::disable(unsigned int money) {
    // If the amount of money we have is greater than or equal to the cost of the upgrade
    // the upgrade tower button is not disabled
    if(money >= m_cost) {
        setDisabled(false);
        return;
    }
    // If the cost of the upgrade is greater than the amount of money we have the button
    // is disabled
    setDisabled(true);
}
开发者ID:andressbarajas,项目名称:Isla-Vista-Tower-Defense,代码行数:11,代码来源:cTowerButton.cpp


示例3: setDisabled

void FLReportViewer::slotPrintReport()
{
  if (slotsPrintDisabled_)
    return;
  setDisabled(true);
  printing_ = true;
  reportPrinted_ = rptViewer_->printReport();
  if (reportPrinted_ && autoClose_)
    QTimer::singleShot(0, this, SLOT(slotExit()));
  printing_ = false;
  setDisabled(false);
}
开发者ID:Miguel-J,项目名称:eneboo-core,代码行数:12,代码来源:FLReportViewer.cpp


示例4: QMenu

QMenu* TreeWidget::createContextMenu(TreeItem* item)
{
    QMenu* menu = new QMenu(this);
    menu->addAction(item->text(0))->setEnabled(false);
    menu->addSeparator();

    connect(item, SIGNAL(destroyed(TreeItem*)), menu, SLOT(deleteLater()));

    const bool child = item->parentItem();
    const bool connected = item->connection()->isActive();
    const bool waiting = item->connection()->status() == IrcConnection::Waiting;
    const bool active = item->buffer()->isActive();
    const bool channel = item->buffer()->isChannel();

    if (!child) {
        QAction* editAction = menu->addAction(tr("Edit"), this, SLOT(onEditTriggered()));
        editAction->setData(QVariant::fromValue(item));
        menu->addSeparator();

        if (waiting) {
            QAction* stopAction = menu->addAction(tr("Stop"));
            connect(stopAction, SIGNAL(triggered()), item->connection(), SLOT(setDisabled()));
            connect(stopAction, SIGNAL(triggered()), item->connection(), SLOT(close()));
        } else if (connected) {
            QAction* disconnectAction = menu->addAction(tr("Disconnect"));
            connect(disconnectAction, SIGNAL(triggered()), item->connection(), SLOT(setDisabled()));
            connect(disconnectAction, SIGNAL(triggered()), item->connection(), SLOT(quit()));
        } else {
            QAction* reconnectAction = menu->addAction(tr("Reconnect"));
            connect(reconnectAction, SIGNAL(triggered()), item->connection(), SLOT(setEnabled()));
            connect(reconnectAction, SIGNAL(triggered()), item->connection(), SLOT(open()));
        }
    }

    if (connected && child) {
        QAction* action = 0;
        if (!channel)
            action = menu->addAction(tr("Whois"), this, SLOT(onWhoisTriggered()));
        else if (!active)
            action = menu->addAction(tr("Join"), this, SLOT(onJoinTriggered()));
        else
            action = menu->addAction(tr("Part"), this, SLOT(onPartTriggered()));
        action->setData(QVariant::fromValue(item));
    }

    QAction* closeAction = menu->addAction(tr("Close"), this, SLOT(onCloseTriggered()), QKeySequence::Close);
    closeAction->setShortcutContext(Qt::WidgetShortcut);
    closeAction->setData(QVariant::fromValue(item));

    return menu;
}
开发者ID:jpnurmi,项目名称:communi-desktop,代码行数:51,代码来源:treewidget.cpp


示例5: setDisabled

void FrameInfoWidget::onCurrentAnimationChanged(int iIndex)
{
	if (iIndex == -1)
	{
		setDisabled(true);
		return;
	}
	else
	{
		m_dataMapper.setCurrentIndex(iIndex);
		AniPreviewWnd* pWnd = FS()->m_pPreviewWnd;
		connect(this, SIGNAL(previewAnimation(AnimationInfo*)), pWnd, SLOT(onActionChanged(AnimationInfo*)));
		setDisabled(false);
	}
}
开发者ID:MichaelMiao,项目名称:Totem,代码行数:15,代码来源:frameinfowidget.cpp


示例6: QGraphicsView

myGraphicsView::myGraphicsView(QWidget *parent) : QGraphicsView(parent)
{
    setRenderHints(QPainter::Antialiasing | QPainter::SmoothPixmapTransform);
    this->installEventFilter(this);
    this->setTransformationAnchor(QGraphicsView::AnchorUnderMouse);
    this->setResizeAnchor( QGraphicsView::AnchorUnderMouse );
    origin = QPoint(0,0);
    mTL = new QLabel(this);
    scene = new QGraphicsScene(this);
    scene->addText("No Images Available. Please browse to a folder containing appropriate images.");
    setScene(scene);
    setCursor(Qt::CrossCursor);
    setDisabled(true);
    mBR = new QLabel(this);
    mTL->setStyleSheet("QLabel { background-color : white; color : black;}");
    mBR->setStyleSheet("QLabel { background-color : white; color : black;}");
    mTL->hide();
    mBR->hide();
    rubberBandActive = false;

    rubberBand = new QRubberBand(QRubberBand::Rectangle, this);
    QPalette palette;
    QColor highlight(Qt::green);
    highlight.setAlpha(100);
    palette.setBrush(QPalette::Highlight, QBrush(highlight));
    palette.setBrush(QPalette::Shadow, QColor(Qt::red));
    rubberBand->setPalette(palette);
    rubberBand->setGeometry(20, 20, 200, 100);
}
开发者ID:sairyuva,项目名称:MiscProjects,代码行数:29,代码来源:mygraphicsview.cpp


示例7: setDisabled

void ByteSourceGuiButton::refreshState()
{
    gui = byteSource->getGui();

    if (gui != nullptr) {
        setDisabled(false);
        setVisible(true);
        connect(localAction, &QAction::toggled, this, &ByteSourceGuiButton::onToggle, Qt::UniqueConnection);
        connect(this, &ByteSourceGuiButton::toggled, this, &ByteSourceGuiButton::onToggle, Qt::UniqueConnection);
    } else {
        qDebug() << tr("No gui available for this source %1").arg(byteSource->metaObject()->className());
        setDisabled(true);
        setVisible(false);
    }

}
开发者ID:metrodango,项目名称:pip3line,代码行数:16,代码来源:bytesourceguibutton.cpp


示例8: shopsPath

void AdamantShopPlugin::loadShops(const QStringList &currentLeagues) {
    _shops.clear();

    QStringList leagues = currentLeagues;

    // NOTE(rory): Load leagues
    auto list = shopsPath().entryInfoList({"*.shop"});
    for (QFileInfo info : list) {
        if (leagues.contains(info.baseName())) continue;
        leagues.append(info.baseName());
    }

    // NOTE(rory):
    for (const QString& league : leagues) {
        if (_shops.contains(league)) continue;
        bool disabled = !currentLeagues.contains(league);

        auto shop = loadShop(shopsPath().absoluteFilePath(QString("%1.shop").arg(league)));

        if (!shop)  {
            shop = new Shop(league);
            shop->setUnused();
        }
        shop->setDisabled(disabled);

        _shops.insert(shop->league(), shop);
        _viewer->addShop(shop);
    }
}
开发者ID:Novynn,项目名称:Adamant,代码行数:29,代码来源:adamantshopplugin.cpp


示例9: QPushButton

ByteSourceGuiButton::ByteSourceGuiButton(ByteSourceAbstract *bytesource, GuiHelper *nguiHelper, QWidget *parent) :
    QPushButton(parent)
{
    byteSource = bytesource;
    guiHelper = nguiHelper;

    guidia = nullptr;
    localAction = nullptr;


    localAction = new(std::nothrow) QAction(tr(""), this);
    if (localAction == nullptr) {
        qFatal("Cannot allocate memory for QAction X{");
    }
    localAction->setCheckable(true);
    setCheckable(true);
    setToolTip(tr("Configuration panel"));
    setIcon(QIcon(":/Images/icons/configure-5.png"));
    setMaximumWidth(25);
    //setDefaultAction(localAction);

    setFlat(true);
    gui = byteSource->getGui();
    if (gui != nullptr) {
        connect(localAction, &QAction::toggled, this, &ByteSourceGuiButton::onToggle,Qt::UniqueConnection);
        connect(this, &ByteSourceGuiButton::toggled, this, &ByteSourceGuiButton::onToggle,Qt::UniqueConnection);
    } else {
        localAction->setToolTip(tr("No settings available for this source"));
        setDisabled(true);
        setVisible(false);
    }
}
开发者ID:metrodango,项目名称:pip3line,代码行数:32,代码来源:bytesourceguibutton.cpp


示例10: QTreeWidget

InterfaceTree::InterfaceTree(QWidget *parent) :
    QTreeWidget(parent)
#ifdef HAVE_LIBPCAP
    ,stat_cache_(NULL)
    ,stat_timer_(NULL)
#endif // HAVE_LIBPCAP
{
    QTreeWidgetItem *ti;

    qRegisterMetaType< PointList >("PointList");

    header()->setVisible(false);
    setRootIsDecorated(false);
    setUniformRowHeights(true);
    /* Seems to have no effect, still the default value (2) is being used, as it
     * was set in the .ui file. But better safe, then sorry. */
    resetColumnCount();
    setSelectionMode(QAbstractItemView::ExtendedSelection);
    setAccessibleName(tr("Welcome screen list"));

    setItemDelegateForColumn(IFTREE_COL_STATS, new SparkLineDelegate(this));
    setDisabled(true);

    ti = new QTreeWidgetItem();
    ti->setText(IFTREE_COL_NAME, tr("Waiting for startup%1").arg(UTF8_HORIZONTAL_ELLIPSIS));
    addTopLevelItem(ti);
    resizeColumnToContents(IFTREE_COL_NAME);

    connect(wsApp, SIGNAL(appInitialized()), this, SLOT(getInterfaceList()));
    connect(wsApp, SIGNAL(localInterfaceListChanged()), this, SLOT(interfaceListChanged()));
    connect(this, SIGNAL(itemSelectionChanged()), this, SLOT(updateSelectedInterfaces()));
}
开发者ID:velichkov,项目名称:wireshark,代码行数:32,代码来源:interface_tree.cpp


示例11: updateState

void Playback::updateState(const AudioPlaybackState &playbackState) {
	qint64 position = 0, duration = playbackState.duration;

	auto wasDisabled = _slider->isDisabled();
	if (wasDisabled) setDisabled(false);

	_playing = !(playbackState.state & AudioPlayerStoppedMask);
	if (_playing || playbackState.state == AudioPlayerStopped) {
		position = playbackState.position;
	} else if (playbackState.state == AudioPlayerStoppedAtEnd) {
		position = playbackState.duration;
	} else {
		position = 0;
	}

	float64 progress = 0.;
	if (position > duration) {
		progress = 1.;
	} else if (duration) {
		progress = duration ? snap(float64(position) / duration, 0., 1.) : 0.;
	}
	if (duration != _duration || position != _position || wasDisabled) {
		auto animated = (duration && _duration && progress > _slider->value());
		_slider->setValue(progress, animated);
		_position = position;
		_duration = duration;
	}
	_slider->update();
}
开发者ID:2asoft,项目名称:tdesktop,代码行数:29,代码来源:media_clip_playback.cpp


示例12: disconnect

void AMControlMoveButton::setControl(AMControl *control)
{
	if(control == control_)
		return;

	// in the future: if we wanted to be slightly more efficient, could update the context menu to give it an editor for the new control instead of just deleting it and letting a new one be created.
	if(contextMenu_) {
		contextMenu_->deleteLater();
		contextMenu_ = 0;
	}

	if(control_) {
		disconnect(control_, 0, this, 0);
	}

	control_ = control;
	if(control_) {
		connect(control_, SIGNAL(destroyed()), this, SLOT(onControlDestroyed()));
		connect(control_, SIGNAL(connected(bool)), this, SLOT(setEnabled(bool)));
	}

	setText(QString::number(currentStepSize()) % (control_ ? control_->units() : QString()));
	if(control_ && toolTip().isEmpty())
		setToolTip(control_->description().isEmpty() ? control_->name() : control_->description());

	// enabled / disabled:
	if(control_ && control->isConnected())
		setEnabled(true);
	else
		setDisabled(true);
}
开发者ID:acquaman,项目名称:acquaman,代码行数:31,代码来源:AMControlMoveButton.cpp


示例13: QTreeWidget

InterfaceTree::InterfaceTree(QWidget *parent) :
    QTreeWidget(parent)
#ifdef HAVE_LIBPCAP
    ,stat_cache_(NULL)
    ,stat_timer_(NULL)
#endif // HAVE_LIBPCAP
{
    QTreeWidgetItem *ti;

    header()->setVisible(false);
    setRootIsDecorated(false);
    setUniformRowHeights(true);
    setColumnCount(2);
    setSelectionMode(QAbstractItemView::ExtendedSelection);
    setAccessibleName(tr("Welcome screen list"));

    setItemDelegateForColumn(1, new SparkLineDelegate());
    setDisabled(true);

    ti = new QTreeWidgetItem();
    ti->setText(0, tr("Waiting for startup" UTF8_HORIZONTAL_ELLIPSIS));
    addTopLevelItem(ti);
    resizeColumnToContents(0);

    connect(wsApp, SIGNAL(appInitialized()), this, SLOT(getInterfaceList()));
    connect(this, SIGNAL(itemSelectionChanged()), this, SLOT(updateSelectedInterfaces()));
}
开发者ID:lubing521,项目名称:wireshark,代码行数:27,代码来源:interface_tree.cpp


示例14: setDisabled

void NifBlockEditor::nifDestroyed()
{
	nif = 0;
	setDisabled( true );
	if ( testAttribute( Qt::WA_DeleteOnClose ) )
		close();
}
开发者ID:CobaltBlues,项目名称:nifskope,代码行数:7,代码来源:nifeditors.cpp


示例15: setDisabled

void LLPanelNearByMedia::onClickSelectedMediaPlay()
{
	LLUUID selected_media_id = mMediaList->getValue().asUUID();
	
	// First enable it
	setDisabled(selected_media_id, false);
	
	// Special code to make play "unpause" if time-based and playing
	if (selected_media_id != PARCEL_AUDIO_LIST_ITEM_UUID)
	{
		LLViewerMediaImpl *impl = (selected_media_id == PARCEL_MEDIA_LIST_ITEM_UUID) ?
			((LLViewerMediaImpl*)LLViewerParcelMedia::getParcelMedia()) : LLViewerMedia::getMediaImplFromTextureID(selected_media_id);
		if (NULL != impl)
		{
			if (impl->isMediaTimeBased() && impl->isMediaPaused())
			{
				// Aha!  It's really time-based media that's paused, so unpause
				impl->play();
				return;
			}
			else if (impl->isParcelMedia())
			{
				LLViewerParcelMedia::play(LLViewerParcelMgr::getInstance()->getAgentParcel());
			}
		}
	}	
}
开发者ID:1234-,项目名称:SingularityViewer,代码行数:27,代码来源:llpanelnearbymedia.cpp


示例16: resize

    MainWindow::MainWindow()
    {
        resize(640, 640);

        scroll = new QScrollArea();
        scroll->setWidgetResizable(true);
        setCentralWidget(scroll);

        editor = new EditorWidget();
        scroll->setWidget(editor);

        statusBar()->showMessage(tr("%1 - by Overkill.").arg(AppName), 2000);
        statusBar()->setStyleSheet(
            "QStatusBar {"
            "   border-top: 1px solid #CCCCCC;"
            "   background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #DADBDE, stop: 1 #F6F7FA);"
            "   padding: 4px;"
            "   color: #777777;"
            "}"
        );

#ifdef Q_WS_WIN
        QKeySequence quitSequence(Qt::ALT + Qt::Key_F4);
#else
        QKeySequence quitSequence(QKeySequence::Quit);
#endif

        fileMenu = menuBar()->addMenu(tr("&File"));
        newAction = createAction(fileMenu, tr("&New"), tr("Create a new CHR."), QKeySequence::New);
        openAction = createAction(fileMenu, tr("&Open..."), tr("Open an existing CHR."), QKeySequence::Open);
        createSeparator(fileMenu);
        saveAction = createAction(fileMenu, tr("&Save..."), tr("Save the current CHR."), QKeySequence::Save);
        saveAsAction = createAction(fileMenu, tr("Save &As..."), tr("Save a copy of the current CHR."), QKeySequence::SaveAs);
        createSeparator(fileMenu);
        for(int i = 0; i < MaxRecentCount; ++i)
        {
            auto action = createAction(fileMenu, QKeySequence(Qt::ALT + Qt::Key_1 + i));
            action->setDisabled(true);
            recentFileActions[i] = action;
            connect(action, SIGNAL(triggered()), this, SLOT(openRecentFile()));
        }
        clearRecentAction = createAction(fileMenu, tr("Clear &Recent Files"), tr("Clear all recently opened files."), QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_Delete));
        updateRecentFiles();
        createSeparator(fileMenu);
        exitAction = createAction(fileMenu, tr("E&xit"), tr("Exit the program."), quitSequence);

        helpMenu = menuBar()->addMenu(tr("&Help"));
        aboutAction = createAction(helpMenu, tr("&About..."), tr("About %1.").arg(AppName), QKeySequence::HelpContents);

        connect(newAction, SIGNAL(triggered()), this, SLOT(newFile()));
        connect(openAction, SIGNAL(triggered()), this, SLOT(openFile()));
        connect(saveAction, SIGNAL(triggered()), this, SLOT(saveFile()));
        connect(saveAsAction, SIGNAL(triggered()), this, SLOT(saveFileAs()));
        connect(clearRecentAction, SIGNAL(triggered()), this, SLOT(clearRecentFiles()));
        connect(exitAction, SIGNAL(triggered()), this, SLOT(close()));
        connect(aboutAction, SIGNAL(triggered()), this, SLOT(about()));

        QTimer::singleShot(0, this, SLOT(newFile()));
    }
开发者ID:Bananattack,项目名称:overbrew,代码行数:59,代码来源:mainwindow.cpp


示例17: QTreeWidgetItem

KatePluginListItem::KatePluginListItem(bool checked, KatePluginInfo *info)
    : QTreeWidgetItem()
    , mInfo(info)
{
  setCheckState(0, checked ? Qt::Checked : Qt::Unchecked);
  // skip plugins that will be loaded always!
  setDisabled (info->alwaysLoad);
}
开发者ID:rtaycher,项目名称:kate,代码行数:8,代码来源:kateconfigplugindialogpage.cpp


示例18: Q_ASSERT

void ShopViewer::updateShopListItem(const Shop* shop) {
    auto item = _shopListItems.value(shop);
    Q_ASSERT(item);
    auto widget = ui->listWidget->itemWidget(item);

    widget->setDisabled(shop->isDisabled());
    ui->listWidget->repaint();
}
开发者ID:Novynn,项目名称:Adamant,代码行数:8,代码来源:shopviewer.cpp


示例19: setDisabled

void NewsItem::deleteNews()
{
  QFont font = textLabel_->font();
  font.setBold(false);
  textLabel_->setFont(font);
  setDisabled(true);
  emit signalDeleteNews(feedId_, newsId_);
}
开发者ID:Nikoli,项目名称:quite-rss,代码行数:8,代码来源:notificationsnewsitem.cpp


示例20: setDisabled

void VlcWidgetVolumeSlider::setMute(const bool &enabled)
{
    if (!(_vlcMediaPlayer->state() == Vlc::Buffering ||
        _vlcMediaPlayer->state() == Vlc::Playing ||
        _vlcMediaPlayer->state() == Vlc::Paused))
        return;

    if (!enabled) {
        _timer->start(100);
        setDisabled(false);
    } else {
        _timer->stop();
        setDisabled(true);
    }

    _vlcAudio->toggleMute();
}
开发者ID:Buhenvald,项目名称:vlc-qt,代码行数:17,代码来源:WidgetVolumeSlider.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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