void PluginManagerWidget::registerNewPlugin(QString pluginName) { qDebug() << " " << "PluginManagerWidget::registerNewPlugin "<< pluginName; PluginFrame* pf = new PluginFrame(pluginName, pluginFramesContainer) ; connect( pf , SIGNAL( needToRemove(QString)), this, SIGNAL( removeRequested(QString) ) ); pluginFramesLayout->addWidget(pf); }
/** * Przechwytuje zdarzenie naciśnięcia klawisza. * * Reaguje na naciśnięcie klawiszy Delete i Enter, odpowiednio żądając * usunięcia albo załadowania aktualnie zaznaczonego elementu. * * @param event obiekt informacji o zdarzeniu */ void WorkspaceTreeView::keyPressEvent(QKeyEvent* event) { if (event->key() == Qt::Key_Delete) { emit removeRequested(); } else if (event->key() == Qt::Key_Return) { emit doubleClicked(currentIndex()); } QTreeView::keyPressEvent(event); }
DataViewWidget::DataViewWidget (QWidget *parent) : QWidget (parent) { Ui_.setupUi (this); connect (Ui_.Add_, SIGNAL (released ()), this, SIGNAL (addRequested ())); connect (Ui_.Remove_, SIGNAL (released ()), this, SIGNAL (removeRequested ())); }
/** * Tworzy obiekt widoku drzewa katalogu. * * Tworzy akcje widoku, które będą przypisane do menu kontekstowego. * * @param parent obiekt rodzica */ WorkspaceTreeView::WorkspaceTreeView( QWidget* parent): QTreeView(parent) { actionExpandOrCollapse = new QAction(tr("Expand"), this); connect(actionExpandOrCollapse, SIGNAL(triggered()), SLOT(expandOrCollapse())); actionLoad = new QAction(QIcon(":/icons/page_next.png"), tr("Load selected file"), this); connect(actionLoad, SIGNAL(triggered()), SLOT(load())); actionRemove = new QAction(QIcon(":/icons/page_remove.png"), tr("Remove selected"), this); connect(actionRemove, SIGNAL(triggered()), this, SIGNAL(removeRequested())); actionRefresh = new QAction(QIcon(":/icons/repeat.png"), tr("Refresh view"), this); connect(actionRefresh, SIGNAL(triggered()), this, SIGNAL(refreshRequested())); }
PropertyMultiValueWidget::PropertyMultiValueWidget(PartProperty* prop, QWidget* parent, QObject* keyEventFilter) : QWidget(parent), cat(prop->getPartCategory()), prop(prop), state(Enabled), flags(0) { PartProperty::Type type = prop->getType(); flags_t flags = prop->getFlags(); QVBoxLayout* topLayout = new QVBoxLayout(this); setLayout(topLayout); QSplitter* splitter = new QSplitter(Qt::Horizontal, this); topLayout->addWidget(splitter); QWidget* listContWidget = new QWidget(splitter); splitter->addWidget(listContWidget); QVBoxLayout* listContLayout = new QVBoxLayout(listContWidget); listContWidget->setLayout(listContLayout); listWidget = new QListWidget(listContWidget); listWidget->installEventFilter(keyEventFilter); connect(listWidget, SIGNAL(currentItemChanged(QListWidgetItem*, QListWidgetItem*)), this, SLOT(currentItemChanged(QListWidgetItem*, QListWidgetItem*))); listContLayout->addWidget(listWidget); QWidget* buttonWidget = new QWidget(listContWidget); listContLayout->addWidget(buttonWidget); QHBoxLayout* buttonLayout = new QHBoxLayout(buttonWidget); buttonWidget->setLayout(buttonLayout); buttonLayout->addStretch(1); listAddButton = new QPushButton("", buttonWidget); listAddButton->setIcon(QIcon::fromTheme("list-add", QIcon(":/icons/list-add.png"))); connect(listAddButton, SIGNAL(clicked()), this, SLOT(addRequested())); buttonLayout->addWidget(listAddButton); listRemoveButton = new QPushButton("", buttonWidget); listRemoveButton->setIcon(QIcon::fromTheme("list-remove", QIcon(":/icons/list-remove.png"))); connect(listRemoveButton, SIGNAL(clicked()), this, SLOT(removeRequested())); buttonLayout->addWidget(listRemoveButton); buttonLayout->addStretch(1); QWidget* detailWidget = new QWidget(splitter); splitter->addWidget(detailWidget); QVBoxLayout* detailLayout = new QVBoxLayout(detailWidget); detailWidget->setLayout(detailLayout); QWidget* detailFormWidget = new QWidget(detailWidget); detailLayout->addWidget(detailFormWidget); QFormLayout* detailFormLayout = new QFormLayout(detailFormWidget); detailFormLayout->setSizeConstraint(QFormLayout::SetMinimumSize); detailFormLayout->setHorizontalSpacing(20); detailFormLayout->setVerticalSpacing(10); detailFormWidget->setLayout(detailFormLayout); if (type != PartProperty::PartLink) { if (type == PartProperty::Boolean) { boolBox = new QCheckBox(prop->getUserReadableName(), detailFormWidget); boolBox->installEventFilter(keyEventFilter); connect(boolBox, SIGNAL(toggled(bool)), this, SLOT(boolFieldToggled(bool))); detailFormLayout->addRow(boolBox); } else if (type == PartProperty::File) {
void ListLayoutRow::removeClicked() { emit removeRequested(this); }