コード例 #1
0
ファイル: CViewerContainer.cpp プロジェクト: MRPT/mrpt
void CViewerContainer::changedSelected(
	const std::vector<CRobotPose::Ptr>& robotPoses)
{
	std::vector<size_t> indexes;
	for (auto& pose : robotPoses) indexes.push_back(pose->getId());
	emit selectedChanged(indexes);
}
コード例 #2
0
/*!
    \property QGeoMapObject::selected
    \brief whether the map object is selected.
    \since 1.1
*/
void QGeoMapObject::setSelected(bool selected)
{
    if (d_ptr->isSelected != selected) {
        d_ptr->isSelected = selected;
        emit selectedChanged(d_ptr->isSelected);
    }
}
コード例 #3
0
ファイル: reslibrary.cpp プロジェクト: kissthink/moonplayer
ResLibrary::ResLibrary(QWidget *parent) :
    QWidget(parent), ui(new Ui::ResLibrary)
{
    std::cout << "Initialize ResLibrary..." << std::endl;
    initResPlugins();
    if (n_resplugins == 0)
    {
        new QLabel("This function is under development. Please wait!", this);
        return;
    }
    ui->setupUi(this);
    listWidget = new MyListWidget;
    ui->gridLayout->addWidget(listWidget, 0, 1, 1, 4);

    for (int i = 0; i < n_resplugins; i++)
    {
        ResPlugin *plugin = resplugins[i];
        ui->pluginComboBox->addItem(plugin->getName());

        QWidget *page = new QWidget;
        ui->stackedWidget->addWidget(page);
        QBoxLayout *layout = new QBoxLayout(QBoxLayout::TopToBottom);
        layout->setContentsMargins(0, 11, 0, 11);
        page->setLayout(layout);

        layout->addWidget(new QLabel(tr("Tags:")));
        MyButtonGroup *buttonGroup = new MyButtonGroup(plugin->tagsList);
        connect(buttonGroup, SIGNAL(selectedChanged()), this, SLOT(reSearch()));
        layout->addWidget(buttonGroup);

        layout->addWidget(new QLabel(tr("Countries:")));
        buttonGroup = new MyButtonGroup(plugin->countriesList);
        connect(buttonGroup, SIGNAL(selectedChanged()), this, SLOT(reSearch()));
        layout->addWidget(buttonGroup);
    }
    current_plugin = 0;
    current_tag = resplugins[0]->tagsList[0];
    current_country = resplugins[0]->countriesList[0];
    current_page = 1;
    res_library = this;

    connect(ui->pageSpinBox, SIGNAL(valueChanged(int)), this, SLOT(onPageChanged(int)));
    connect(ui->prevPushButton, SIGNAL(clicked()), this, SLOT(onPrevPage()));
    connect(ui->nextPushButton, SIGNAL(clicked()), this, SLOT(onNextPage()));
    connect(ui->keyLineEdit, SIGNAL(returnPressed()), this, SLOT(keySearch()));
    connect(listWidget, SIGNAL(itemDoubleClicked(QListWidgetItem*)), this, SLOT(onItemDoubleClicked(QListWidgetItem*)));
}
コード例 #4
0
//private
void PrivateQGraphicsObject::setMGObj(MapGraphicsObject * mgObj)
{
    _mgObj = mgObj;

    if (_mgObj == 0)
        return;

    //Connect signals/slots for all of the changes in the MapGraphicsObject that we must be able to handle
    connect(_mgObj,
            SIGNAL(enabledChanged()),
            this,
            SLOT(handleEnabledChanged()));
    connect(_mgObj,
            SIGNAL(opacityChanged()),
            this,
            SLOT(handleOpacityChanged()));
    connect(_mgObj,
            SIGNAL(parentChanged()),
            this,
            SLOT(handleParentChanged()));
    connect(_mgObj,
            SIGNAL(posChanged()),
            this,
            SLOT(handlePosChanged()));
    connect(_mgObj,
            SIGNAL(rotationChanged()),
            this,
            SLOT(handleRotationChanged()));
    connect(_mgObj,
            SIGNAL(visibleChanged()),
            this,
            SLOT(handleVisibleChanged()));
    connect(_mgObj,
            SIGNAL(zValueChanged()),
            this,
            SLOT(handleZValueChanged()));
    connect(_mgObj,
            SIGNAL(selectedChanged()),
            this,
            SLOT(handleMGSelectedChanged()));
    connect(_mgObj,
            SIGNAL(flagsChanged()),
            this,
            SLOT(handleMGFlagsChanged()));
    connect(mgObj,
            SIGNAL(keyFocusRequested()),
            this,
            SLOT(handleKeyFocusRequested()));

    //Get all of the info about the MGObject
    this->updateAllFromMG();

    connect(mgObj,
            SIGNAL(destroyed()),
            this,
            SLOT(deleteLater()));
}
コード例 #5
0
void ModelItem::setSelected(bool selected, bool notify)
{
    if(m_selected != selected) {
        m_selected = selected;
        if(notify) {
            emit selectedChanged();
        }
    }
}
コード例 #6
0
void AMDetectorSelector::setDetectorSelected(AMDetector *detector, bool isSelected){
	if(!detectorGroup_ || !detectorGroup_->contains(detector))
		return;

	if(selectedDetectors_.value(detector->name()) != isSelected){
		selectedDetectors_[detector->name()] = isSelected;
		emit selectedChanged(detector);
	}
}
コード例 #7
0
void OSListItem::setSelected(bool isSelected)
{
  if(m_listController)
  {
    QSharedPointer<OSItemSelectionController> selectionController = m_listController->selectionController();

    std::vector<QPointer<OSListItem> >::iterator it = 
      std::find(selectionController->m_selectedItems.begin(),selectionController->m_selectedItems.end(),this);

    bool wasSelected = ( it != selectionController->m_selectedItems.end() );

    if( isSelected )
    {
      if( wasSelected )
      { 
        return; 
      }
      else
      {
        if( ! selectionController->m_allowMultipleSelections )
        {
          selectionController->unselectAllItems();
        }

        selectionController->addSelectedItem(this);

        emit selectedChanged(true);
      }
    }
    else
    {
      if( wasSelected )
      {
        selectionController->removeSelectedItem(this);

        emit selectedChanged(false);
      }
      else
      {
        return;
      }
    }
  }
}
コード例 #8
0
void AMDetectorSelector::setDetectorSelectedByName(const QString &name, bool isSelected){
	if(!detectorGroup_ || !selectedDetectors_.contains(name))
		return;

	if(selectedDetectors_.value(name) != isSelected){
		selectedDetectors_[name] = isSelected;
		AMDetector *detector = detectorGroup_->detectorByName(name);
		emit selectedChanged(detector);
	}
}
コード例 #9
0
ファイル: artworkmetadata.cpp プロジェクト: RostaTasha/xpiks
    bool ArtworkMetadata::setIsSelected(bool value) {
        bool result = getIsSelectedFlag() != value;
        if (result) {
            setIsSelectedFlag(value);
            //emit fileSelectedChanged(m_ArtworkFilepath, value);
            emit selectedChanged(value);
        }

        return result;
    }
コード例 #10
0
ファイル: mybuttongroup.cpp プロジェクト: coslyk/moonplayer
void MyButtonGroup::onNewSelected(MyButton *newButton)
{
    selectedButton->setDown(false);
    newButton->setDown(true);
    if (newButton != selectedButton)
    {
        selectedButton = newButton;
        emit selectedChanged();
    }
}
コード例 #11
0
void MapGraphicsObject::setSelected(bool sel)
{
    if (_selected == sel)
        return;
    _selected = sel;

    if (_constructed)
        this->selectedChanged();
    else
        QTimer::singleShot(1, this, SIGNAL(selectedChanged()));
}
コード例 #12
0
ファイル: kitemlistwidget.cpp プロジェクト: stream009/dolphin
void KItemListWidget::setSelected(bool selected)
{
    if (m_selected != selected) {
        m_selected = selected;
        if (m_selectionToggle) {
            m_selectionToggle->setChecked(selected);
        }
        selectedChanged(selected);
        update();
    }
}
コード例 #13
0
ファイル: qstyleitem.cpp プロジェクト: kbenne/Sandbox
QStyleItem::QStyleItem(QQuickPaintedItem *parent)
    : QQuickPaintedItem(parent),
    m_styleoption(0),
    m_itemType(Undefined),
    m_sunken(false),
    m_raised(false),
    m_active(true),
    m_selected(false),
    m_focus(false),
    m_hover(false),
    m_on(false),
    m_horizontal(true),
    m_sharedWidget(false),
    m_minimum(0),
    m_maximum(100),
    m_value(0),
    m_step(0),
    m_paintMargins(0),
    m_contentWidth(0),
    m_contentHeight(0)

{
    if (!qApp->style()) {
        qWarning("\nError: No widget style available. \n\nQt Desktop Components "
               "currently depend on the widget module to function. \n"
               "Use QApplication when creating standalone executables.\n\n");
        exit(-1);
    }
    m_font = qApp->font();
    setFlag(QQuickItem::ItemHasContents, true);
    setSmooth(false);

    connect(this, SIGNAL(enabledChanged()), this, SLOT(updateItem()));
    connect(this, SIGNAL(infoChanged()), this, SLOT(updateItem()));
    connect(this, SIGNAL(onChanged()), this, SLOT(updateItem()));
    connect(this, SIGNAL(selectedChanged()), this, SLOT(updateItem()));
    connect(this, SIGNAL(activeChanged()), this, SLOT(updateItem()));
    connect(this, SIGNAL(textChanged()), this, SLOT(updateItem()));
    connect(this, SIGNAL(activeChanged()), this, SLOT(updateItem()));
    connect(this, SIGNAL(raisedChanged()), this, SLOT(updateItem()));
    connect(this, SIGNAL(sunkenChanged()), this, SLOT(updateItem()));
    connect(this, SIGNAL(hoverChanged()), this, SLOT(updateItem()));
    connect(this, SIGNAL(maximumChanged()), this, SLOT(updateItem()));
    connect(this, SIGNAL(minimumChanged()), this, SLOT(updateItem()));
    connect(this, SIGNAL(valueChanged()), this, SLOT(updateItem()));
    connect(this, SIGNAL(horizontalChanged()), this, SLOT(updateItem()));
    connect(this, SIGNAL(activeControlChanged()), this, SLOT(updateItem()));
    connect(this, SIGNAL(hasFocusChanged()), this, SLOT(updateItem()));
    connect(this, SIGNAL(activeControlChanged()), this, SLOT(updateItem()));
    connect(this, SIGNAL(elementTypeChanged()), this, SLOT(updateItem()));
    connect(this, SIGNAL(textChanged()), this, SLOT(updateSizeHint()));
    connect(this, SIGNAL(contentWidthChanged(int)), this, SLOT(updateSizeHint()));
    connect(this, SIGNAL(contentHeightChanged(int)), this, SLOT(updateSizeHint()));
}
コード例 #14
0
ファイル: HsWidget.cpp プロジェクト: jamecc/Notee
bool CHsWidget::setSelected(bool bSelected)
{
    if(m_bIsSelectable && m_bSelected != bSelected)
    {
        m_bSelected = bSelected;
        repaint();
        emit selectedChanged();
        return true;
    }

    return false;
}
コード例 #15
0
ファイル: swatch.cpp プロジェクト: jcelerier/Qt-Color-Widgets
void Swatch::setSelected(int selected)
{
    if ( selected < 0 || selected >= p->palette.count() )
        selected = -1;

    if ( selected != p->selected )
    {
        selectedChanged( p->selected = selected );
        if ( selected != -1 )
            colorSelected( p->palette.colorAt(p->selected) );
        update();
    }
}
コード例 #16
0
void MixerTrackPart::setSelected(bool sel)
      {
      if (_selected == sel)
            return;

      _selected = sel;

      emit(selectedChanged(sel));

      if (_selected && _group)
            _group->notifyTrackSelected(this);

      applyStyle();
      }
コード例 #17
0
ファイル: moc_geoquest.cpp プロジェクト: Hrehory/EnigameQt
int GeoQuest::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QGeoMapPixmapObject::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: selectedChanged((*reinterpret_cast< bool(*)>(_a[1]))); break;
        default: ;
        }
        _id -= 1;
    }
    return _id;
}
コード例 #18
0
void ModelItem::sendAttributeChanges()
{
    emit valueChanged();

    emit enabledChanged();
    emit selectedChanged();
    emit opacityChanged();
    emit visibilityChanged();

    emit brushChanged();
    emit fontChanged();
    emit penChanged();

    emit posChanged(true, true);
}
コード例 #19
0
ファイル: qglcubeitem.cpp プロジェクト: OEMBureau/QtQuickVcp
void QGLCubeItem::selectDrawable(void *pointer)
{
    bool selected;

    if (m_cubePointer == NULL)
    {
        return;
    }

    selected = (pointer == m_cubePointer);

    if (selected != m_selected)
    {
        m_selected = selected;
        emit selectedChanged(m_selected);
    }
}
コード例 #20
0
void GLCylinderItem::selectDrawable(void *pointer)
{
    bool selected;

    if (m_cylinderPointer == nullptr)
    {
        return;
    }

    selected = (pointer == m_cylinderPointer);

    if (selected != m_selected)
    {
        m_selected = selected;
        emit selectedChanged(m_selected);
    }
}
コード例 #21
0
ファイル: DCTableWidget.cpp プロジェクト: jamecc/Notee
void CDCTableWidget::setNoteItemList(const QList<CNoteItem*>& lstNoteItems)
{
    clearContent();

    m_lstNoteItems = lstNoteItems;
    foreach(CNoteItem* pNoteItem, m_lstNoteItems)
    {
        connect(pNoteItem, SIGNAL(dataChanged()), this, SLOT(onNoteItemDataChanged()));
        connect(pNoteItem, SIGNAL(selectedChanged()), this, SLOT(onNoteItemSelectedChanged()));
        connect(pNoteItem, SIGNAL(itemStateChanged()), this, SLOT(onNoteItemStateChanged()));

        int nRowIdx = rowCount();
        insertRow(nRowIdx);

        QTableWidgetItem* pTypeWidgetItem = new QTableWidgetItem(pNoteItem->getIcon(), QString());
        pTypeWidgetItem->setData(Qt::UserRole, (qulonglong)pNoteItem);
        pTypeWidgetItem->setTextAlignment(Qt::AlignCenter);
        setItem(nRowIdx, 0, pTypeWidgetItem);

        if(pNoteItem->isNote())
        {
            pTypeWidgetItem->setData(Qt::ToolTipRole, tr("Note"));

            QTableWidgetItem* pDateWidgetItem = new QTableWidgetItem(pNoteItem->getSetAt().toString(DATE_FORMAT));
            pDateWidgetItem->setData(Qt::ToolTipRole, pNoteItem->getSetAt().toString(DATE_FORMAT));
            setItem(nRowIdx, 1, pDateWidgetItem);
        }
        else
        {
            pTypeWidgetItem->setData(Qt::ToolTipRole, tr("Schedule"));

            QTableWidgetItem* pDateWidgetItem = new QTableWidgetItem(pNoteItem->getSetAt().toString(DATE_TIME_FORMAT));
            pDateWidgetItem->setData(Qt::ToolTipRole, pNoteItem->getSetAt().toString(DATE_TIME_FORMAT));
            setItem(nRowIdx, 1, pDateWidgetItem);
        }

        QTableWidgetItem* pTitleWidgetItem = new QTableWidgetItem(pNoteItem->getTitle());
        pTitleWidgetItem->setData(Qt::ToolTipRole, pNoteItem->getTitle());
        setItem(nRowIdx, 2, pTitleWidgetItem);
    }
コード例 #22
0
QStyleItem::QStyleItem(QDeclarativeItem *parent)
    : QDeclarativeItem(parent),
    m_dummywidget(0),
    m_styleoption(0),
    m_type(Undefined),
    m_sunken(false),
    m_raised(false),
    m_active(true),
    m_selected(false),
    m_focus(false),
    m_on(false),
    m_horizontal(true),
    m_sharedWidget(false),
    m_minimum(0),
    m_maximum(100),
    m_value(0),
    m_paintMargins(0)
{
    setFlag(QGraphicsItem::ItemHasNoContents, false);
    setCacheMode(QGraphicsItem::DeviceCoordinateCache);
    setSmooth(true);

    connect(this, SIGNAL(infoChanged()), this, SLOT(updateItem()));
    connect(this, SIGNAL(onChanged()), this, SLOT(updateItem()));
    connect(this, SIGNAL(selectedChanged()), this, SLOT(updateItem()));
    connect(this, SIGNAL(activeChanged()), this, SLOT(updateItem()));
    connect(this, SIGNAL(textChanged()), this, SLOT(updateItem()));
    connect(this, SIGNAL(activeChanged()), this, SLOT(updateItem()));
    connect(this, SIGNAL(raisedChanged()), this, SLOT(updateItem()));
    connect(this, SIGNAL(sunkenChanged()), this, SLOT(updateItem()));
    connect(this, SIGNAL(hoverChanged()), this, SLOT(updateItem()));
    connect(this, SIGNAL(maximumChanged()), this, SLOT(updateItem()));
    connect(this, SIGNAL(minimumChanged()), this, SLOT(updateItem()));
    connect(this, SIGNAL(valueChanged()), this, SLOT(updateItem()));
    connect(this, SIGNAL(horizontalChanged()), this, SLOT(updateItem()));
    connect(this, SIGNAL(activeControlChanged()), this, SLOT(updateItem()));
    connect(this, SIGNAL(focusChanged()), this, SLOT(updateItem()));
    connect(this, SIGNAL(activeControlChanged()), this, SLOT(updateItem()));
    connect(this, SIGNAL(elementTypeChanged()), this, SLOT(updateItem()));
}
コード例 #23
0
ファイル: UIEditor.hpp プロジェクト: mp3butcher/osg4noob
        Q_INVOKABLE void setOperand(pmoc::QQModel*m){if(m){cur_operand=m;
emit selectedChanged(m);}}
コード例 #24
0
/*
 *  Constructs a ProcAttachBase as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 *
 *  The dialog will by default be modeless, unless you set 'modal' to
 *  TRUE to construct a modal dialog.
 */
ProcAttachBase::ProcAttachBase( QWidget* parent, const char* name, bool modal, WFlags fl )
    : QDialog( parent, name, modal, fl )
{
    if ( !name )
	setName( "ProcAttachBase" );
    setSizeGripEnabled( TRUE );
    ProcAttachBaseLayout = new QHBoxLayout( this, 10, 6, "ProcAttachBaseLayout"); 

    layout7 = new QVBoxLayout( 0, 0, 6, "layout7"); 

    layout6 = new QHBoxLayout( 0, 0, 6, "layout6"); 

    filterLabel = new QLabel( this, "filterLabel" );
    layout6->addWidget( filterLabel );

    filterEdit = new QLineEdit( this, "filterEdit" );
    filterEdit->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)5, 0, 0, filterEdit->sizePolicy().hasHeightForWidth() ) );
    filterEdit->setMaxLength( 20 );
    layout6->addWidget( filterEdit );

    filterClear = new QToolButton( this, "filterClear" );
    layout6->addWidget( filterClear );
    layout7->addLayout( layout6 );

    processList = new QListView( this, "processList" );
    processList->addColumn( tr2i18n( "Command" ) );
    processList->addColumn( tr2i18n( "PID" ) );
    processList->addColumn( tr2i18n( "PPID" ) );
    processList->setMinimumSize( QSize( 300, 200 ) );
    processList->setAllColumnsShowFocus( TRUE );
    layout7->addWidget( processList );

    layout3 = new QHBoxLayout( 0, 0, 6, "layout3"); 

    buttonRefresh = new QPushButton( this, "buttonRefresh" );
    buttonRefresh->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)0, 0, 0, buttonRefresh->sizePolicy().hasHeightForWidth() ) );
    layout3->addWidget( buttonRefresh );
    spacingBtns = new QSpacerItem( 242, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
    layout3->addItem( spacingBtns );

    buttonOk = new QPushButton( this, "buttonOk" );
    buttonOk->setEnabled( FALSE );
    buttonOk->setAutoDefault( TRUE );
    buttonOk->setDefault( TRUE );
    layout3->addWidget( buttonOk );

    buttonCancel = new QPushButton( this, "buttonCancel" );
    buttonCancel->setAutoDefault( TRUE );
    layout3->addWidget( buttonCancel );
    layout7->addLayout( layout3 );
    ProcAttachBaseLayout->addLayout( layout7 );
    languageChange();
    resize( QSize(560, 416).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( buttonOk, SIGNAL( clicked() ), this, SLOT( accept() ) );
    connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) );
    connect( buttonRefresh, SIGNAL( clicked() ), this, SLOT( refresh() ) );
    connect( filterEdit, SIGNAL( textChanged(const QString&) ), this, SLOT( filterEdited(const QString&) ) );
    connect( filterClear, SIGNAL( clicked() ), filterEdit, SLOT( clear() ) );
    connect( processList, SIGNAL( selectionChanged() ), this, SLOT( selectedChanged() ) );

    // tab order
    setTabOrder( filterEdit, processList );
    setTabOrder( processList, buttonRefresh );
    setTabOrder( buttonRefresh, buttonOk );
    setTabOrder( buttonOk, buttonCancel );

    // buddies
    filterLabel->setBuddy( filterEdit );
}
コード例 #25
0
void QReportPage::mousePressEvent(QGraphicsSceneMouseEvent *event)
{
    event->ignore();
    emit selectedChanged();
}
コード例 #26
0
ファイル: itemlistattached.hpp プロジェクト: xylosper/koboman
	void setSelected(bool s) { if (_Change(m_selected, s)) emit selectedChanged(); }
コード例 #27
0
ファイル: yigsynthgraphic.cpp プロジェクト: ChadMcKinney/Yig
QVariant YigSynthGraphic::itemChange(GraphicsItemChange change, const QVariant &value)
{
    //QVariant variant = QGraphicsEllipseItem::itemChange(change, value);
    //QVariant variant = QVariant(value);

    if(change == QGraphicsItem::ItemPositionChange || change == QGraphicsItem::ItemPositionHasChanged)
    {
        // Preventing bug with synths ending up in the corner
        /*
        QPoint newPoint = value.toPoint();

        bool changed = false;
        if(newPoint.x() < 5)
        {
            //newPoint.setX(5);
            changed = true;
        }

        else if(newPoint.y() < 5)
        {
            //newPoint.setY(5);
            changed = true;
        }

        if(changed)
            return QVariant();*/

        updateCablePositions();


        if(autoCableCounter >= (19+(selectedSynthKeys.size()*3)))
        {
            autoCable();
            autoCableCounter = 0;
        }

        else
        {
            autoCableCounter++;
        }
        //QList<QGraphicsItem*> collidingItems = scene()->collidingItems(modField1);
    }

    else if(change == QGraphicsItem::ItemSelectedChange || change == QGraphicsItem::ItemSelectedHasChanged)
    {
        if(value.toBool())
        {
            selectingUser = USER_NAME;
            if(ONLINE)
            {
                emit selectedChanged(mMapKey, 1);
            }
        }

        else
        {
            selectingUser = "******";
            if(ONLINE)
            {
                emit selectedChanged(mMapKey, 0);
                modField1->update(modField1->boundingRect());
                modField2->update(modField2->boundingRect());
            }
        }
    }

    return QGraphicsEllipseItem::itemChange(change, value);
}
コード例 #28
0
ファイル: tabmodel.cpp プロジェクト: VincentBeltman/IlwisCore
void TabModel::setSelected(bool yesno)
{
    _selected = yesno;
    emit selectedChanged();
}