Core::IEditor *ImageViewer::duplicate() { auto other = new ImageViewer(d->file); other->d->imageView->createScene(); other->updateToolButtons(); other->d->ui_toolbar.labelImageSize->setText(d->ui_toolbar.labelImageSize->text()); return other; }
TableEditor::TableEditor(QWidget *parent): Editor(parent) { QVBoxLayout *layout = new QVBoxLayout(this); setLayout(layout); // toolbar _toolbar = new QWidget(this); layout->addWidget(_toolbar); _ui_toolbar = new Ui::TableEditorToolbar; _ui_toolbar->setupUi(_toolbar); _ui_toolbar->firstPageButton->setIcon(QIcon(IconLoader::getIconIdentifier(":/drawable/actions/allLeft"))); _ui_toolbar->previousPageButton->setIcon(QIcon(IconLoader::getIconIdentifier(":/drawable/actions/left"))); _ui_toolbar->nextPageButton->setIcon(QIcon(IconLoader::getIconIdentifier(":/drawable/actions/right"))); _ui_toolbar->lastPageButton->setIcon(QIcon(IconLoader::getIconIdentifier(":/drawable/actions/allRight"))); _ui_toolbar->refreshButton->setIcon(QIcon(IconLoader::getIconIdentifier(":/drawable/actions/refresh"))); _ui_toolbar->addRowButton->setIcon(QIcon(IconLoader::getIconIdentifier(":/drawable/general/add"))); _ui_toolbar->deleteRowButton->setIcon(QIcon(IconLoader::getIconIdentifier(":/drawable/general/remove"))); _ui_toolbar->commitButton->setIcon(QIcon(IconLoader::getIconIdentifier(":/drawable/actions/checked"))); _ui_toolbar->rollbackButton->setIcon(QIcon(IconLoader::getIconIdentifier(":/drawable/actions/rollback"))); _ui_toolbar->dumpDataButton->setIcon(QIcon(IconLoader::getIconIdentifier(":/drawable/actions/export"))); _tableView = new QTableView(this); _tableModel = new QSqlTableModel(_tableView /* TODO database connection */); _tableView->setModel(_tableModel); layout->addWidget(_tableView); // connections connect(_ui_toolbar->commitButton, SIGNAL(clicked()), _tableModel, SLOT(submitAll())); connect(_ui_toolbar->rollbackButton, SIGNAL(clicked()), _tableModel, SLOT(revertAll())); connect(_ui_toolbar->addRowButton, SIGNAL(clicked()), this, SLOT(addRow())); connect(_ui_toolbar->deleteRowButton, SIGNAL(clicked()), this, SLOT(deleteRows())); connect(_ui_toolbar->refreshButton, SIGNAL(clicked()), _tableModel, SLOT(select())); connect(_ui_toolbar->toolButtonExportImage, SIGNAL(clicked()),_imageView, SLOT(exportImage())); connect(_ui_toolbar->toolButtonZoomIn, SIGNAL(clicked()),_imageView,SLOT(zoomIn())); connect(_ui_toolbar->toolButtonZoomOut, SIGNAL(clicked()),_imageView, SLOT(zoomOut())); connect(_ui_toolbar->toolButtonFitToScreen, SIGNAL(clicked()),_imageView, SLOT(fitToScreen())); connect(_ui_toolbar->toolButtonOriginalSize, SIGNAL(clicked()),_imageView, SLOT(resetToOriginalSize())); connect(_ui_toolbar->toolButtonBackground, SIGNAL(toggled()),_imageView, SLOT(setViewBackground())); connect(_ui_toolbar->toolButtonOutline, SIGNAL(toggled()),_imageView, SLOT(setViewOutline())); connect(_ui_toolbar->toolButtonPlayPause, SIGNAL(clicked()),this, SLOT(playToggled())); connect(_file, SIGNAL(imageSizeChanged()),this, SLOT(imageSizeUpdated())); connect(_file, SIGNAL(openFinished()),_imageView, SLOT(createScene())); connect(_file, SIGNAL(openFinished()),this, SLOT(updateToolButtons())); connect(_file, SIGNAL(aboutToReload()),_imageView, SLOT(reset())); connect(_file, SIGNAL(reloadFinished()),_imageView, SLOT(createScene())); connect(_file, SIGNAL(isPausedChanged()),this, SLOT(updatePauseAction())); connect(_imageView, SIGNAL(scaleFactorChanged()),this, SLOT(scaleFactorUpdate())); }
void PrefsDialog::init() { setupUi(this); connect(buttonBox, SIGNAL(clicked(QAbstractButton*)), this, SLOT(buttonClicked(QAbstractButton*))); connect(binPathList, SIGNAL(itemSelectionChanged()), this, SLOT(updatePathButtons())); connect(pathUp, SIGNAL(clicked()), this, SLOT(movePathUp())); connect(pathDown, SIGNAL(clicked()), this, SLOT(movePathDown())); connect(pathAdd, SIGNAL(clicked()), this, SLOT(addPath())); connect(pathRemove, SIGNAL(clicked()), this, SLOT(removePath())); connect(toolList, SIGNAL(itemSelectionChanged()), this, SLOT(updateToolButtons())); connect(toolList, SIGNAL(itemDoubleClicked(QListWidgetItem*)), this, SLOT(editTool(QListWidgetItem*))); connect(toolUp, SIGNAL(clicked()), this, SLOT(moveToolUp())); connect(toolDown, SIGNAL(clicked()), this, SLOT(moveToolDown())); connect(toolAdd, SIGNAL(clicked()), this, SLOT(addTool())); connect(toolRemove, SIGNAL(clicked()), this, SLOT(removeTool())); connect(toolEdit, SIGNAL(clicked()), this, SLOT(editTool())); connect(tabWidget, SIGNAL(currentChanged(int)), this, SLOT(changedTabPanel(int))); pathsChanged = toolsChanged = false; }