Пример #1
0
PCLVisualizer::PCLVisualizer(QWidget *parent, Qt::WFlags flags)
	: QMainWindow(parent, flags)
{
	ui.setupUi(this);

	//信号槽连接
	connect(ui.OpenFile,SIGNAL(triggered()),this,SLOT(fileOpenSlot()));
	connect(ui.Exit,SIGNAL(triggered()),this,SLOT(ExitSlot()));
	connect(ui.OpenProjectManage, SIGNAL(triggered()), this, SLOT(OpenProjectManageSlot()));
	
	mPclViewer.reset(new pcl::visualization::PCLVisualizer ("viewer", false));	
	ui.qvtkWidget->update();
}
Пример #2
0
MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    m_item1=0;
    ui->setupUi(this);

    readSettings();

    QString title=QString(APP_NAME);

    setWindowTitle(title);

    // The engine
    m_engine= new slideShowEngine;
    if(m_engine==0)
    {
        qDebug() << "error while creating the engine";
        return;
    }

    // The Model
    m_sequence = new sequenceModel;
    if(m_sequence==0)
    {
        qDebug() << "error while creating the Model";
        return;
    }
    connect(m_sequence,SIGNAL(dataChanged (QModelIndex,QModelIndex)),this,SLOT(modelChanged(QModelIndex,QModelIndex)));

    ui->listView->setModel(m_sequence);
    ui->listView->setContextMenuPolicy(Qt::CustomContextMenu);
    connect(ui->listView,SIGNAL(clicked(QModelIndex)),this,SLOT(listClicked(QModelIndex)));
    connect(ui->listView,SIGNAL(doubleClicked(QModelIndex)),this,SLOT(listDoubleClicked(QModelIndex)));

    connect(ui->actionNew,SIGNAL(triggered()),this,SLOT(fileNewSlot()));
    connect(ui->actionOpen,SIGNAL(triggered()),this,SLOT(fileOpenSlot()));
    connect(ui->actionClose,SIGNAL(triggered()),this,SLOT(fileCloseSlot()));
    connect(ui->actionSave,SIGNAL(triggered()),this,SLOT(fileSaveSlot()));
    connect(ui->actionSave_As,SIGNAL(triggered()),this,SLOT(fileSaveAsSlot()));
    connect(ui->actionExit,SIGNAL(triggered()),this,SLOT(exitSlot()));
    connect(ui->actionExport,SIGNAL(triggered()),this,SLOT(exportToMovie()));
    connect(ui->actionOptions,SIGNAL(triggered()),this,SLOT(movieOptionsSlot()));

    connect(ui->actionManage_Soundtrack,SIGNAL(triggered()),this,SLOT(manageSoundtracks()));

    createListContextMenu();
    connect(ui->listView,SIGNAL(customContextMenuRequested(QPoint)),this,SLOT(listContextMenuRequested(QPoint)));

    connect(ui->actionPreview,SIGNAL(triggered()),this,SLOT(startSlideShowEngine()));
    connect(ui->startButton,SIGNAL(released()),this,SLOT(startSlideShowEngine()));

    // The Delegate
    m_delegate = new delegate;
    ui->listView->setItemDelegate(m_delegate);
    ui->listView->setEditTriggers(QAbstractItemView::DoubleClicked);
      //                             | QAbstractItemView::SelectedClicked);
    ui->listView->setSelectionBehavior(QAbstractItemView::SelectItems);

    // The View
    m_scene=new QGraphicsScene;
    ui->graphicsView->setScene(m_scene);    

    // set filters = all supported file formats. New plugins will automatically add new image formats
    QList <QByteArray> supportedFilters;
    QStringList filters;
    QString extensionFilter;
    QImageReader reader;

    supportedFilters = reader.supportedImageFormats();

    for (int i = 0; i < supportedFilters.size(); ++i)  // fill supported file extensions
    {
        extensionFilter.append("*.");
        extensionFilter.append(supportedFilters[i]);
        filters.append(extensionFilter);
        extensionFilter.clear();

    }

    m_FileSystemModel.setRootPath("");
    m_FileSystemModel.setNameFilters(QStringList(filters));
    ui->dirView->setModel(&m_FileSystemModel);

    connect(ui->dirView,SIGNAL(clicked(QModelIndex)),this,SLOT(dirViewClickSlot(QModelIndex)));
    connect(ui->dirView,SIGNAL(doubleClicked(QModelIndex)),this,SLOT(dirViewDoubleClickSlot(QModelIndex)));

    ui->dirView->setColumnHidden(1,true);
    ui->dirView->setColumnHidden(2,true);
    ui->dirView->setColumnHidden(3,true);
    ui->dirView->setHeaderHidden(true);

    ui->dirView->setAnimated(false);
    ui->dirView->setIndentation(20);
    ui->dirView->setSortingEnabled(true);
    ui->dirView->show();
}