本文整理汇总了C++中setChecked函数的典型用法代码示例。如果您正苦于以下问题:C++ setChecked函数的具体用法?C++ setChecked怎么用?C++ setChecked使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setChecked函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: Q_D
/*!
\fn void QAction::toggle()
This is a convenience function for the \l checked property.
Connect to it to change the checked state to its opposite state.
*/
void QAction::toggle()
{
Q_D(QAction);
setChecked(!d->checked);
}
开发者ID:3163504123,项目名称:phantomjs,代码行数:11,代码来源:qaction.cpp
示例2: init
/**
* Creates a toggle button with the specified image
* and selection state, but no text.
*
* @param icon the image that the button should display
* @param selected if true, the button is initially selected;
* otherwise, the button is initially unselected
*/
/*public*/ JToggleButton::JToggleButton(QIcon icon, bool selected, QWidget *parent) : QPushButton(icon, "", parent)
{
//this(NULL, icon, selected);
init();
setChecked(selected);
}
开发者ID:allenck,项目名称:DecoderPro_app,代码行数:14,代码来源:jtogglebutton.cpp
示例3: itemAt
void GalaGV::onContextMenuRequest(const QPoint &pos)
{
QGraphicsItem *item = itemAt(pos);
QGraphicsEllipseItem *eSystemItem;
ESystem e;
SendMenu menu(ShipTreeWidget::tree());
QMenu *m = menu.menu();
QAction *openSys = m->addAction("openSys");
QAction *openLog = m->addAction("openLog");
QAction *setCheckd = m->addAction("check");
QAction *setWerf = m->addAction("werft");
QAction *clearChecked = m->addAction("clear all checked");
setCheckd->setCheckable(true);
setWerf->setCheckable(true);
const QHash<QString,QGraphicsEllipseItem*> &esysteme = mData->eSysteme.value(mData->showESysteme.first+";"+QString::number(mData->gala));
if(!mData->showESysteme.second || esysteme.size() == 0)
clearChecked->setEnabled(false);
if(item == NULL){
openSys->setEnabled(false);
openLog->setEnabled(false);
setCheckd->setEnabled(false);
setWerf->setEnabled(false);
} else {
if(!mData->mPlayerLogPlanis.contains(item))
openLog->setEnabled(false);
eSystemItem =esysteme.value(item->data(ID).toString());
if(eSystemItem == NULL || !mData->showESysteme.second){
setCheckd->setEnabled(false);
setWerf->setEnabled(false);
}else {
e=eSystemItem->data(Esystem).value<ESystem>();
setCheckd->setChecked(e.isChecked);
setWerf->setChecked(e.isWerft);
}
}
if( eSystemItem == NULL || !mData->showESysteme.second)
menu.setDisable(true);
do {
QAction *ret = m->exec(mapToGlobal(pos));
if(ret == openSys){
emit loadPage("http://www.omega-day.com/game/?op=system&sys="+item->data(Qt::UserRole).toString());
}else if (ret == openLog){
emit loadPage("http://www.omega-day.com/game/"+item->data(Qt::UserRole+1).toString());
} else if(ret == setCheckd){
setChecked(eSystemItem,setCheckd->isChecked());
} else if(ret == clearChecked){
int ret =QMessageBox::warning(this,"muh","wirklich löschen",QMessageBox::Yes,QMessageBox::No);
if(ret == QMessageBox::Yes)
clearAllChecked();
}else if (ret == setWerf) {
setWerft(eSystemItem,setWerf->isChecked());
}else if( menu.checkSendClicked(ret)){
const QStringList & l = menu.checkedID();
const QString &oldID = menu.orbitID();
if(l.size()>0){
QString planiID = eSystemItem->data(Esystem).value<ESystem>().planiID;
if(l.size() == 1)
emit sendShip(l.first(),oldID,planiID);
else
emit sendShips(l,planiID);
}
}
}while(!menu.exit());
}
开发者ID:abho,项目名称:Distanz,代码行数:75,代码来源:galagv.cpp
示例4: setChecked
void CheckBoxImpl::toggle()
{
setChecked(!m_checked);
}
开发者ID:Knarf64,项目名称:flow-pomodoro,代码行数:4,代码来源:checkbox.cpp
示例5: menu
void FieldView::contextMenuEvent(QContextMenuEvent* event)
{
QMenu menu(this);
QModelIndex index = currentIndex();
if(index.isValid())
{
menu.addAction(m_applyValueOnSelection);
menu.addAction(m_applyValueOnAllLines);
menu.addSeparator();
menu.addAction(m_defineCode);
if(nullptr != m_canvasList)
{
menu.addSeparator();
menu.addAction(m_delItem);
}
}
auto showSubMenu = menu.addMenu(tr("Show"));
showSubMenu->addAction(m_showAllGroup);
showSubMenu->addAction(m_showEsteticGroup);
showSubMenu->addAction(m_showIdGroup);
showSubMenu->addAction(m_showValueGroup);
showSubMenu->addAction(m_showGeometryGroup);
auto hideSubMenu = menu.addMenu(tr("Show/Hide"));
auto columnCount = m_model->columnCount(QModelIndex());
for(int i = 0; i < columnCount;++i)
{
auto name = m_model->headerData(i,Qt::Horizontal,Qt::DisplayRole).toString();
auto act = hideSubMenu->addAction(name);
act->setCheckable(true);
act->setChecked(!isColumnHidden(i));
connect(act, SIGNAL(triggered(bool)) , m_mapper, SLOT(map()));
m_mapper->setMapping(act,i);
}
QAction* act = menu.exec(event->globalPos());
if(act == m_delItem)
{
auto itemData = static_cast<Field*>(index.internalPointer());
DeleteFieldCommand* deleteCommand = new DeleteFieldCommand(itemData,m_canvasList->at(*m_currentPage),m_model,*m_currentPage);
m_undoStack->push(deleteCommand);
}
else if( m_applyValueOnAllLines == act)
{
applyValue(index,false);
}
else if(m_applyValueOnSelection == act)
{
applyValue(index,true);
}
else if(m_defineCode == act)
{
defineItemCode(index);
}
else if(m_resetCode == act)
{
if(!index.isValid())
return;
Field* field = m_model->getFieldFromIndex(index);
if(nullptr != field)
{
field->setGeneratedCode(QStringLiteral(""));
}
}
}
开发者ID:Rolisteam,项目名称:rcse,代码行数:73,代码来源:fieldview.cpp
示例6: setChecked
void WAbstractToggleButton::setChecked()
{
prevState_ = state_;
setChecked(true);
}
开发者ID:hhirsch,项目名称:wtim,代码行数:5,代码来源:WAbstractToggleButton.C
示例7: setChecked
void FlatCheckbox::onClicked() {
if (_state & StateDisabled) return;
setChecked(!checked());
}
开发者ID:Freyja-Folkvangr,项目名称:tdesktop,代码行数:4,代码来源:flatcheckbox.cpp
示例8: setChecked
void CheckBox::setValueFromParam(ParamValue val) {
setChecked(val.asBool());
}
开发者ID:k-a-z-u,项目名称:KSynth,代码行数:3,代码来源:CheckBox.cpp
示例9: GetIconThemeManager
void PlaylistWidget::SetSortOrderButton ()
{
auto sortButton = new QToolButton;
sortButton->setIcon (Core::Instance ().GetProxy ()->
GetIconThemeManager ()->GetIcon ("view-sort-ascending"));
sortButton->setPopupMode (QToolButton::InstantPopup);
auto menu = new QMenu (tr ("Sorting"));
sortButton->setMenu (menu);
auto getInts = [] (const QList<SortingCriteria>& crit) -> QVariantList
{
QVariantList result;
std::transform (crit.begin (), crit.end (), std::back_inserter (result),
[] (decltype (crit.front ()) item) { return static_cast<int> (item); });
return result;
};
typedef QPair<QString, QList<SortingCriteria>> SortPair_t;
QList<SortPair_t> stdSorts;
stdSorts << SortPair_t (tr ("Artist / Year / Album / Track number"),
{
SortingCriteria::Artist,
SortingCriteria::Year,
SortingCriteria::Album,
SortingCriteria::TrackNumber
});
stdSorts << SortPair_t (tr ("Artist / Track title"),
{
SortingCriteria::Artist,
SortingCriteria::TrackTitle
});
stdSorts << SortPair_t (tr ("File path"),
{
SortingCriteria::DirectoryPath,
SortingCriteria::FileName
});
stdSorts << SortPair_t (tr ("No sort"), {});
const auto& currentCriteria = Player_->GetSortingCriteria ();
auto sortGroup = new QActionGroup (this);
bool wasChecked = false;
Q_FOREACH (const auto& pair, stdSorts)
{
auto act = menu->addAction (pair.first);
act->setProperty ("SortInts", getInts (pair.second));
act->setCheckable (true);
sortGroup->addAction (act);
if (pair.second == currentCriteria)
{
act->setChecked (true);
wasChecked = true;
}
else
act->setChecked (false);
connect (act,
SIGNAL (triggered ()),
this,
SLOT (handleStdSort ()));
}
开发者ID:zhao07,项目名称:leechcraft,代码行数:62,代码来源:playlistwidget.cpp
示例10: setChecked
/*! \internal
Makes sure the button isn't pressed when the popup hides.
*/
void QtColorPicker::popupClosed()
{
setChecked(false);
setFocus();
}
开发者ID:project-renard-survey,项目名称:utopia-documents-mirror,代码行数:9,代码来源:qtcolorpicker.cpp
示例11: blocker
void MappingBool::ConfigChanged()
{
const QSignalBlocker blocker(this);
setChecked(m_setting.GetValue());
}
开发者ID:AdmiralCurtiss,项目名称:dolphin,代码行数:5,代码来源:MappingNumeric.cpp
示例12: messageButtonSignal
void caMessageButton::buttonhandle(int type)
{
emit messageButtonSignal(type);
if(type == 0) setChecked(true);
else setChecked(false);
}
开发者ID:rorydog1,项目名称:epics,代码行数:6,代码来源:camessagebutton.cpp
示例13: Q_UNUSED
void CheckBox::mousePressEvent (QMouseEvent* e) {
Q_UNUSED(e);
setChecked(!checked);
emit onChange();
}
开发者ID:k-a-z-u,项目名称:KSynth,代码行数:5,代码来源:CheckBox.cpp
示例14: setChecked
void RazorTaskButton::nextCheckState()
{
setChecked(xfitMan().getActiveAppWindow() == mWindow);
}
开发者ID:bwalter,项目名称:razor-qt,代码行数:4,代码来源:razortaskbutton.cpp
示例15: setChecked
void OptionButton::panelClosed()
{
setChecked(false);
minimizePanel();
}
开发者ID:marbl,项目名称:gingr,代码行数:5,代码来源:OptionButton.cpp
示例16: setCentralWidget
void MasterWindow::_setupMasterWindowUI()
{
// add main tab widget
setCentralWidget(new QTabWidget());
// create menus in menu bar
auto fileMenu = menuBar()->addMenu("&File");
auto editMenu = menuBar()->addMenu("&Edit");
auto viewMenu = menuBar()->addMenu("&View");
auto helpMenu = menuBar()->addMenu("&Help");
// create tool bar
auto toolbar = addToolBar("toolbar");
/** FILE menu */
// open content action
auto openContentAction = new QAction("Open Content", this);
openContentAction->setStatusTip("Open content");
connect(openContentAction, &QAction::triggered, this,
&MasterWindow::_openContent);
// open contents directory action
auto openContentsDirectoryAction = new QAction("Open Directory", this);
openContentsDirectoryAction->setStatusTip("Open directory of contents");
connect(openContentsDirectoryAction, &QAction::triggered, this,
&MasterWindow::_openContentsDirectory);
// clear contents action
auto clearContentsAction = new QAction("Clear", this);
clearContentsAction->setStatusTip("Clear all contents");
connect(clearContentsAction, &QAction::triggered,
[this]() { _getActiveGroup().clear(); });
// save session action
auto saveSessionAction = new QAction("Save Session", this);
saveSessionAction->setStatusTip("Save current session");
connect(saveSessionAction, &QAction::triggered, this,
&MasterWindow::_saveSession);
// load session action
auto loadSessionAction = new QAction("Load Session", this);
loadSessionAction->setStatusTip("Load a session");
connect(loadSessionAction, &QAction::triggered, this,
&MasterWindow::_openSession);
#if TIDE_ENABLE_WEBBROWSER_SUPPORT
// Open webbrowser action
auto webbrowserAction = new QAction("Web Browser", this);
webbrowserAction->setStatusTip("Open a web browser");
connect(webbrowserAction, &QAction::triggered, _webbrowserWidget,
&WebbrowserWidget::show);
#endif
// Open whiteboard action
auto whiteboardAction = new QAction("Whiteboard", this);
whiteboardAction->setStatusTip("Open a whiteboard");
connect(whiteboardAction, &QAction::triggered,
[this] { emit openWhiteboard(_getActiveSceneIndex()); });
// quit action
auto quitAction = new QAction("Quit", this);
quitAction->setStatusTip("Quit application");
connect(quitAction, &QAction::triggered, this, &MasterWindow::close);
/** EDIT menu */
// background content action
auto backgroundAction = new QAction("Background", this);
backgroundAction->setStatusTip("Select the background color and content");
connect(backgroundAction, &QAction::triggered, _backgroundWidget,
&BackgroundWidget::show);
connect(static_cast<QTabWidget*>(centralWidget()),
&QTabWidget::currentChanged, _backgroundWidget,
&BackgroundWidget::setActiveSurface);
/** VIEW menu */
// enable alpha blending
auto enableAlphaBlendingAction = new QAction("Alpha Blending", this);
enableAlphaBlendingAction->setStatusTip(
"Enable alpha blending for transparent contents (png, svg, etc..)");
enableAlphaBlendingAction->setCheckable(true);
enableAlphaBlendingAction->setChecked(_options->isAlphaBlendingEnabled());
connect(enableAlphaBlendingAction, &QAction::toggled, _options.get(),
&Options::enableAlphaBlending);
connect(_options.get(), &Options::alphaBlendingEnabledChanged,
enableAlphaBlendingAction, &QAction::setChecked);
// auto focus pixel streams
auto autoFocusStreamersAction = new QAction("Auto-focus streamers", this);
autoFocusStreamersAction->setStatusTip(
"Open the windows of the external streamers in focus mode");
autoFocusStreamersAction->setCheckable(true);
autoFocusStreamersAction->setChecked(_options->getAutoFocusPixelStreams());
connect(autoFocusStreamersAction, &QAction::toggled, _options.get(),
&Options::setAutoFocusPixelStreams);
connect(_options.get(), &Options::autoFocusPixelStreamsChanged,
autoFocusStreamersAction, &QAction::setChecked);
//.........这里部分代码省略.........
开发者ID:ppodhajski,项目名称:Tide,代码行数:101,代码来源:MasterWindow.cpp
示例17: setChecked
void LoopButton::updateButtonIcons( int value )
{
setChecked( value != NORMAL );
setIcon( ( value == REPEAT_ONE ) ? QIcon( ":/buttons/playlist/repeat_one" )
: QIcon( ":/buttons/playlist/repeat_all" ) );
}
开发者ID:371816210,项目名称:vlc_vlc,代码行数:6,代码来源:controller_widget.cpp
示例18: setChecked
void TextFieldCheckBox::setText(const QString &s)
{
setChecked(s == m_trueText);
}
开发者ID:gs93,项目名称:qt-creator,代码行数:4,代码来源:customwizardpage.cpp
示例19: setChecked
void MappingBool::Update()
{
setChecked(m_setting->GetValue());
}
开发者ID:Sintendo,项目名称:dolphin,代码行数:4,代码来源:MappingBool.cpp
示例20: setChecked
void CheckBox::touchUp(ofTouchEventArgs &touch) {
Label::touchUp(touch);
setChecked(!checked);
}
开发者ID:chriskiefer,项目名称:ofxEAVIGUI,代码行数:4,代码来源:EAVIGUI.checkbox.cpp
注:本文中的setChecked函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论