本文整理汇总了C++中setChecked函数的典型用法代码示例。如果您正苦于以下问题:C++ setChecked函数的具体用法?C++ setChecked怎么用?C++ setChecked使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setChecked函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
示例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);
}
示例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());
}
示例4: setChecked
void CheckBoxImpl::toggle()
{
setChecked(!m_checked);
}
示例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(""));
}
}
}
示例6: setChecked
void WAbstractToggleButton::setChecked()
{
prevState_ = state_;
setChecked(true);
}
示例7: setChecked
void FlatCheckbox::onClicked() {
if (_state & StateDisabled) return;
setChecked(!checked());
}
示例8: setChecked
void CheckBox::setValueFromParam(ParamValue val) {
setChecked(val.asBool());
}
示例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 ()));
}
示例10: setChecked
/*! \internal
Makes sure the button isn't pressed when the popup hides.
*/
void QtColorPicker::popupClosed()
{
setChecked(false);
setFocus();
}
示例11: blocker
void MappingBool::ConfigChanged()
{
const QSignalBlocker blocker(this);
setChecked(m_setting.GetValue());
}
示例12: messageButtonSignal
void caMessageButton::buttonhandle(int type)
{
emit messageButtonSignal(type);
if(type == 0) setChecked(true);
else setChecked(false);
}
示例13: Q_UNUSED
void CheckBox::mousePressEvent (QMouseEvent* e) {
Q_UNUSED(e);
setChecked(!checked);
emit onChange();
}
示例14: setChecked
void RazorTaskButton::nextCheckState()
{
setChecked(xfitMan().getActiveAppWindow() == mWindow);
}
示例15: setChecked
void OptionButton::panelClosed()
{
setChecked(false);
minimizePanel();
}