示例#1
0
void InputWidget::setRelatedScene(Scene * scene) {

    //-- Disconnection
    if (this->getRelatedScene() != NULL) {
        QObject::disconnect(this->getRelatedScene(),
                            SIGNAL(selectionChanged()), this, SLOT(selectionUpdated()));
    }

    //-- Set Scene
    SceneRelatedObject::setRelatedScene(scene);

    if (this->getRelatedScene() != NULL) {
        //-- Connection
        this->connect(this->getRelatedScene(), SIGNAL(selectionChanged()),
                      SLOT(selectionUpdated()));
    }

    //-- Propagate
    dynamic_cast<SceneRelatedObject*> (this->model())->setRelatedScene(scene);
    dynamic_cast<SceneRelatedObject*> (this->itemDelegate())->setRelatedScene(
        scene);

    //-- No selection to startup
    this->selectionUpdated();


    //-- Update
    this->doItemsLayout();


}
// ******************************************************************************************
// Constructor
// ******************************************************************************************
PassiveJointsWidget::PassiveJointsWidget( QWidget *parent, moveit_setup_assistant::MoveItConfigDataPtr config_data )
  : SetupScreenWidget( parent ), config_data_(config_data)
{
  // Basic widget container
  QVBoxLayout *layout = new QVBoxLayout( );

  // Top Header Area ------------------------------------------------

  HeaderWidget *header = new HeaderWidget( "Passive Joints",
                                           "Specify the set of passive joints (not actuated). Joint state is not expected to be published for these joints.",
                                           this);
  layout->addWidget( header );

  // Joints edit widget
  joints_widget_ = new DoubleListWidget( this, config_data_, "Joint Collection", "Joint", false);
  connect( joints_widget_, SIGNAL( selectionUpdated() ), this, SLOT( selectionUpdated() ) );

  // Set the title
  joints_widget_->title_->setText( "" );
  
  joints_widget_->setColumnNames("Active Joints", "Passive Joints");
  
  layout->addWidget( joints_widget_ );
  
  // Finish Layout --------------------------------------------------
  this->setLayout(layout);
}
ObjectInspectorTable::ObjectInspectorTable(Map *map)
    : m_map(map), m_graphicsObjectEditor(0)
{

    QStringList tableHeadersLabel;
    tableHeadersLabel << "Nom" << "Type";
    setColumnCount(2);
    setHeaderLabels(tableHeadersLabel);

    setAlternatingRowColors(true);

    setAnimated(true);

    setSelectionMode(QAbstractItemView::ExtendedSelection);

    clear();
    addDefaultLayout();

    connect(this, SIGNAL(itemSelectionChanged()), SLOT(selectionUpdated()));
    connect(this, SIGNAL(itemDoubleClicked(QTreeWidgetItem*,int)), SLOT(itemWasDoubleClicked(QTreeWidgetItem*,int)));

    // connexion pour gérer les layouts
    connect(this, SIGNAL(itemChanged(QTreeWidgetItem*,int)), SLOT(LayoutItemModified(QTreeWidgetItem*,int)));

    setDragDropMode(QAbstractItemView::DragDrop);
}
void SelectionController::subSelection(const sf::IntRect& rect, const sf::Image& image, const std::vector<nSet::o_line>& conf_l) {
	if (isSelected()) {
		sumSelection(rect, &image, false);

		pos_lines = new nSet::positionned_olines(*pos_lines);
		pos_lines->lines.insert(pos_lines->lines.end(), conf_l.begin(), conf_l.end());
		pos_lines->pos = getPosition();

		if (!reline()) {
			UNDO->push(*new SelecUpdated(this, *image_selec, pos_lines->pos, *pos_lines, inverted));
			emit selectionUpdated(2);
		}
	}
}
void NickListWidget::currentChanged(const QModelIndex &current, const QModelIndex &previous) {
  BufferInfo::Type bufferType = (BufferInfo::Type)current.data(NetworkModel::BufferTypeRole).toInt();
  BufferId newBufferId = current.data(NetworkModel::BufferIdRole).value<BufferId>();
  BufferId oldBufferId = previous.data(NetworkModel::BufferIdRole).value<BufferId>();

  if(bufferType != BufferInfo::ChannelBuffer) {
    ui.stackedWidget->setCurrentWidget(ui.emptyPage);
    emit nickSelectionChanged(QModelIndexList());
    return;
  }

  // See NickListDock::NickListDock() below
//   if(bufferType != BufferInfo::ChannelBuffer) {
//     ui.stackedWidget->setCurrentWidget(ui.emptyPage);
//     QDockWidget *dock_ = dock();
//     if(dock_) {
//       dock_->close();
//     }
//     return;
//   } else {
//     QDockWidget *dock_ = dock();
//     if(dock_ && dock_->toggleViewAction()->isChecked()) {
//       dock_->show();
//     }
//   }

  if(newBufferId == oldBufferId)
    return;

  NickView *view;
  if(nickViews.contains(newBufferId)) {
    view = nickViews.value(newBufferId);
    ui.stackedWidget->setCurrentWidget(view);
  } else {
    view = new NickView(this);
    NickViewFilter *filter = new NickViewFilter(newBufferId, Client::networkModel());
    view->setModel(filter);
    QModelIndex source_current = Client::bufferModel()->mapToSource(current);
    view->setRootIndex(filter->mapFromSource(source_current));
    nickViews[newBufferId] = view;
    ui.stackedWidget->addWidget(view);
    ui.stackedWidget->setCurrentWidget(view);
    connect(view, SIGNAL(selectionUpdated()), SLOT(nickSelectionChanged()));
  }
  emit nickSelectionChanged(view->selectedIndexes());
}
///////////////
// INTERSECT //
///////////////
void SelectionController::intersectSelection(const sf::IntRect& rect, const std::vector<nSet::o_line>& conf_l) {
	if (isSelected()) {
		intersectSelection(rect, static_cast<sf::Image*>(NULL));
		setInverted(false);

		pos_lines = new nSet::positionned_olines(*pos_lines);
		FOR_I_INV (pos_lines->lines.size())
			if (!rect.contains(pos_lines->lines[i].x, pos_lines->lines[i].y))
				pos_lines->lines.erase(pos_lines->lines.begin() + i);
		pos_lines->lines.insert(pos_lines->lines.end(), conf_l.begin(), conf_l.end());
		pos_lines->pos = getPosition();
	
		if (!reline()) {
			UNDO->push(*new SelecUpdated(this, *image_selec, pos_lines->pos, *pos_lines, inverted));
			emit selectionUpdated(3);
		}
	}
	else
void MainWindow::createThreads()
{
    //-------------------Pointers for objects------------------------
    pt_improcThread = new QThread(this); // Make an own QThread for opencv interface
    pt_opencvProcessor = new QOpencvProcessor();
    std::string cascadeFilename = std::string("haarcascades/haarcascade_frontalface_alt.xml");
    #ifdef HAARCASCADES_PATH
        //cascadeFilename = std::string(HAARCASCADES_PATH) + std::string("haarcascade_frontalface_alt.xml");
        cascadeFilename = std::string(LBPCASCADES_PATH) + std::string("lbpcascade_frontalface.xml");
    #endif
    bool loadResult = pt_opencvProcessor->loadClassifier( cascadeFilename );
    qWarning("Haarcascade %s was %s", cascadeFilename.c_str(), loadResult ? "loaded" : "not loadeded");
    pt_opencvProcessor->moveToThread( pt_improcThread );
    connect(pt_improcThread, SIGNAL(finished()), pt_opencvProcessor, SLOT(deleteLater()));

    //--------------------QVideoCapture------------------------------
    pt_videoThread = new QThread(this);
    pt_videoCapture = new QVideoCapture();
    pt_videoCapture->moveToThread(pt_videoThread);
    connect(pt_videoThread, SIGNAL(started()), pt_videoCapture, SLOT(initializeTimer()));
    connect(pt_videoThread, SIGNAL(finished()), pt_videoCapture, SLOT(close()));
    connect(pt_videoThread, SIGNAL(finished()), pt_videoCapture, SLOT(deleteLater()));

    //----------Register openCV types in Qt meta-type system---------
    qRegisterMetaType<cv::Mat>("cv::Mat");
    qRegisterMetaType<cv::Rect>("cv::Rect");

    //----------------------Connections------------------------------
    //connect(pt_videoCapture, SIGNAL(frame_was_captured(cv::Mat)), pt_opencvProcessor, SLOT(custom_algorithm(cv::Mat)),Qt::BlockingQueuedConnection);
    connect(pt_videoCapture, SIGNAL(frame_was_captured(cv::Mat)), pt_opencvProcessor, SLOT(searchFace(cv::Mat)),Qt::BlockingQueuedConnection);
    connect(pt_opencvProcessor, SIGNAL(frame_was_processed(cv::Mat,double)), pt_display, SLOT(updateImage(cv::Mat,double)), Qt::BlockingQueuedConnection);
    connect(pt_display, SIGNAL(selectionUpdated(cv::Rect)), pt_opencvProcessor, SLOT(setRect(cv::Rect)));

    //----------------------Thread start-----------------------------
    pt_improcThread->start();
    pt_videoThread->start();
}
void SimpleTreeView::selectionChanged(const QItemSelection& selected,
		const QItemSelection& deselected)
{
	QTreeView::selectionChanged(selected, deselected);
	emit selectionUpdated(selected, deselected);
}
示例#9
0
文件: nickview.cpp 项目: AlD/quassel
void NickView::init()
{
    if (!model())
        return;

    for (int i = 1; i < model()->columnCount(); i++)
        setColumnHidden(i, true);

    connect(selectionModel(), SIGNAL(currentChanged(QModelIndex, QModelIndex)), SIGNAL(selectionUpdated()));
    connect(selectionModel(), SIGNAL(selectionChanged(QItemSelection, QItemSelection)), SIGNAL(selectionUpdated()));
}
示例#10
0
void ListView::selectionChanged(const QItemSelection &selected, const QItemSelection &deselected)
{
	QListView::selectionChanged(selected, deselected);
	selectionUpdated();
}
示例#11
0
void TableView::selectionChanged(const QItemSelection &selected, const QItemSelection &deselected)
{
	QTableView::selectionChanged(selected, deselected);
	selectionUpdated();
}