void TabDeckEditor::createFiltersDock() { filterModel = new FilterTreeModel(); filterModel->setObjectName("filterModel"); databaseDisplayModel->setFilterTree(filterModel->filterTree()); databaseDisplayModel->setObjectName("databaseDisplayModel"); filterView = new QTreeView; filterView->setObjectName("filterView"); filterView->setModel(filterModel); filterView->setUniformRowHeights(true); filterView->setHeaderHidden(true); filterView->setContextMenuPolicy(Qt::CustomContextMenu); connect(filterModel, SIGNAL(layoutChanged()), filterView, SLOT(expandAll())); connect(filterView, SIGNAL(customContextMenuRequested(const QPoint &)),this, SLOT(filterViewCustomContextMenu(const QPoint &))); FilterBuilder *filterBuilder = new FilterBuilder; filterBuilder->setObjectName("filterBuilder"); connect(filterBuilder, SIGNAL(add(const CardFilter *)), filterModel, SLOT(addFilter(const CardFilter *))); QToolButton *filterDelOne = new QToolButton(); filterDelOne->setObjectName("filterDelOne"); filterDelOne->setDefaultAction(aClearFilterOne); filterDelOne->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); QToolButton *filterDelAll = new QToolButton(); filterDelAll->setObjectName("filterDelAll"); filterDelAll->setDefaultAction(aClearFilterAll); filterDelAll->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); QGridLayout *filterLayout = new QGridLayout; filterLayout->setObjectName("filterLayout"); filterLayout->setContentsMargins(0,0,0,0); filterLayout->addWidget(filterBuilder, 0, 0, 1, 3); filterLayout->addWidget(filterView, 1, 0, 1, 3); filterLayout->addWidget(filterDelOne, 2, 0, 1, 1); filterLayout->addWidget(filterDelAll, 2, 2, 1, 1); filterBox = new QWidget(); filterBox->setObjectName("filterBox"); filterBox->setLayout(filterLayout); QVBoxLayout *filterFrame = new QVBoxLayout; filterFrame->setObjectName("filterFrame"); filterFrame->addWidget(filterBox); filterDock = new QDockWidget(MainWindow); filterDock->setObjectName("filterDock"); filterDock->setFeatures(QDockWidget::DockWidgetClosable|QDockWidget::DockWidgetFloatable|QDockWidget::DockWidgetMovable); QWidget *filterDockContents = new QWidget(MainWindow); filterDockContents->setObjectName("filterDockContents"); filterDockContents->setLayout(filterFrame); filterDock->setWidget(filterDockContents); connect(btnFilter,SIGNAL(toggled(bool)),filterDock,SLOT(setVisible(bool))); filterDock->installEventFilter(this); }
UBToolbarButtonGroup::UBToolbarButtonGroup(QToolBar *toolBar, const QList<QAction*> &actions) : QWidget(toolBar) , mActions(actions) , mCurrentIndex(-1) , mDisplayLabel(true) , mActionGroup(0) { Q_ASSERT(actions.size() > 0); mToolButton = qobject_cast<QToolButton*>(toolBar->layout()->itemAt(0)->widget()); Q_ASSERT(mToolButton); QVBoxLayout *verticalLayout = new QVBoxLayout(this); QHBoxLayout *horizontalLayout = new QHBoxLayout(); horizontalLayout->setSpacing(0); verticalLayout->addStretch(); verticalLayout->addLayout(horizontalLayout); verticalLayout->addStretch(); mActionGroup = new QActionGroup(this); mActionGroup->setExclusive(true); QSize buttonSize; int i = 0; foreach(QAction *action, actions) { mActionGroup->addAction(action); QToolButton *button = new QToolButton(this); mButtons.append(button); button->setDefaultAction(action); button->setCheckable(true); if(i == 0) { button->setObjectName("ubButtonGroupLeft"); } else if (i == actions.size() - 1) { button->setObjectName("ubButtonGroupRight"); } else { button->setObjectName("ubButtonGroupCenter"); } connect(button, SIGNAL(triggered(QAction*)), this, SLOT(selected(QAction*))); horizontalLayout->addWidget(button); mLabel = action->text(); buttonSize = button->sizeHint(); i++; }
void FramelessDlg::InitTitleBar() { QVBoxLayout* layout = qobject_cast<QVBoxLayout*>(this->layout()); m_closeBtn = new QToolButton(this); QToolButton* minBtn = new QToolButton(this); QToolButton* menuBtn = new QToolButton(this); m_subTitle = new QLabel(this); m_subTitle->setAlignment(Qt::AlignRight | Qt::AlignVCenter); m_closeBtn->setObjectName("closeBtn"); minBtn->setObjectName("minBtn"); menuBtn->setObjectName("menuBtn"); m_subTitle->setObjectName("subTitle"); menuBtn->setPopupMode(QToolButton::InstantPopup); m_menu = new QMenu(this); menuBtn->setMenu(m_menu); m_closeBtn->setFixedSize(27, 22); minBtn->setFixedSize(27, 22); menuBtn->setFixedSize(27, 22); m_subTitle->setFixedSize(400, 25); connect(m_closeBtn, SIGNAL(clicked()), this, SLOT(reject())); connect(m_closeBtn, SIGNAL(clicked()), this, SLOT(close())); connect(minBtn, SIGNAL(clicked()), this, SLOT(showMinimized())); QFrame* tb = new QFrame(this); tb->setObjectName("titleBar"); QHBoxLayout* tbLayout = new QHBoxLayout; m_title = new QLabel(this); m_title->setObjectName("label_title"); m_title->setFixedSize(300, 25); tbLayout->addWidget(m_title); tbLayout->addSpacerItem(new QSpacerItem(20, 40, QSizePolicy::Expanding, QSizePolicy::Fixed)); if ( m_flag & SUB_TITLE ) tbLayout->addWidget(m_subTitle); if ( m_flag & MENU_BUTTON ) tbLayout->addWidget(menuBtn); if ( m_flag & MIN_BUTTON ) tbLayout->addWidget(minBtn); if ( m_flag & CLOSE_BUTTON ) tbLayout->addWidget(m_closeBtn); tb->setLayout(tbLayout); layout->addWidget(tb); }
void OptionsTabPlugins::listPlugins() { if ( !w ) return; OptPluginsUI *d = (OptPluginsUI *)w; d->tw_Plugins->clear(); PluginManager *pm=PluginManager::instance(); QStringList plugins = pm->availablePlugins(); plugins.sort(); const QSize buttonSize = QSize(21,21); foreach ( const QString& plugin, plugins ){ QIcon icon = pm->icon(plugin); bool enabled = pm->isEnabled(plugin); const QString path = pm->pathToPlugin(plugin); QString toolTip = tr("Plugin Path:\n%1").arg(path); Qt::CheckState state = enabled ? Qt::Checked : Qt::Unchecked; QTreeWidgetItem *item = new QTreeWidgetItem(d->tw_Plugins, QTreeWidgetItem::Type); item->setFlags(item->flags() | Qt::ItemIsUserCheckable); item->setText(C_NAME, plugin); item->setText(C_VERSION, pm->version(plugin)); item->setTextAlignment(C_VERSION, Qt::AlignHCenter); item->setToolTip(C_NAME, toolTip); item->setCheckState(C_NAME, state); if ( !enabled ) { icon = QIcon(icon.pixmap(icon.availableSizes().at(0), QIcon::Disabled)); } item->setIcon(C_NAME,icon); QString shortName = PluginManager::instance()->shortName(plugin); QToolButton *aboutbutton = new QToolButton(d->tw_Plugins); aboutbutton->setIcon(QIcon(IconsetFactory::iconPixmap("psi/info"))); aboutbutton->resize(buttonSize); aboutbutton->setObjectName("ab_" + shortName); aboutbutton->setToolTip(tr("Show information about plugin")); connect(aboutbutton, SIGNAL(clicked()), this, SLOT(showPluginInfo())); d->tw_Plugins->setItemWidget(item, C_ABOUT, aboutbutton); QToolButton *settsbutton = new QToolButton(d->tw_Plugins); settsbutton->setIcon(QIcon(IconsetFactory::iconPixmap("psi/options"))); settsbutton->resize(buttonSize); settsbutton->setObjectName("sb_" + shortName); settsbutton->setToolTip(tr("Open plugin settings dialog")); connect(settsbutton, SIGNAL(clicked()), this, SLOT(settingsClicked())); settsbutton->setEnabled(enabled); d->tw_Plugins->setItemWidget(item, C_SETTS, settsbutton); }
DetailedLabeledComboBoxWidget::DetailedLabeledComboBoxWidget(QWidget* parent, StringPropertyBasePtr adapter, QGridLayout* gridLayout, int row) : LabeledComboBoxWidget(parent, adapter, gridLayout, row) { //Add detailed button QAction* detailsAction = this->createAction(this, QIcon(":/icons/open_icon_library/system-run-5.png"), "Details", "Toggle Details", SLOT(toggleDetailsSlot()), NULL); QToolButton* detailsButton = new QToolButton(); detailsButton->setObjectName("DetailedButton"); detailsButton->setDefaultAction(detailsAction); if (gridLayout) // add to input gridlayout { gridLayout->addWidget(detailsButton, row, 2); } else // add directly to this { mTopLayout->addWidget(detailsButton, 2); } this->setModified(); }
void CollocationsDialogController::sl_addName() { QString name = ((QAction*)sender())->text(); assert(allNames.contains(name)); assert(!usedNames.contains(name)); bool remove = false; //UGENE-2318 inserting and removed unused item because of QT bug if(annotationsTree->topLevelItemCount() == 1) remove = true; usedNames.insert(name); AnnotationSettingsRegistry* asr = AppContext::getAnnotationsSettingsRegistry(); QColor c = asr->getAnnotationSettings(name)->color; QTreeWidgetItem* item = new QTreeWidgetItem(); item->setText(0, name); item->setIcon(0, GUIUtils::createSquareIcon(c, 10)); QToolButton* minusButton = new QToolButton(annotationsTree); minusButton->setMinimumSize(plusButton->size()); minusButton->setText("-"); minusButton->setObjectName(name); annotationsTree->insertTopLevelItem(annotationsTree->topLevelItemCount()-1, item); annotationsTree->setItemWidget(item, 1, minusButton); //UGENE-2318 if(remove){ QTreeWidgetItem* ii = new QTreeWidgetItem(); int index = annotationsTree->topLevelItemCount()-1; annotationsTree->insertTopLevelItem(index, ii); annotationsTree->takeTopLevelItem(index); delete ii; } connect(minusButton, SIGNAL(clicked()), SLOT(sl_minusClicked())); updateState(); }
//==================================================================================================== FillSelector::FillSelector(QWidget *parent) : QFrame(parent){ for (int i=0; i<FILL_BUTTONS; i++){ QToolButton *tb = new QToolButton(this); tb->setMaximumSize(FILL_BUTTON_SIZE); tb->setObjectName(QString("fillButton").append(QString::number(i))); tb->setCheckable(true); buttongroup.addButton(tb); buttongroup.setId(tb, i); buttons.push_back(tb); } buttongroup.button(0)->setChecked(true); layout = new QGridLayout(this); layout->setSpacing(3); layout->setObjectName(QStringLiteral("fillLayout")); layout->setContentsMargins(1, 1, 1, 1); int r = 0; int c = 0; for (QToolButton *tb : buttons){ layout->addWidget(tb, r, c, 1, 1); c++; if (c==FILL_COLUMNS){ c = 0; r++; } } createIcons(); //this->setFixedSize(FILL_FRAME_SIZE); };
void FreyaMessageDialog::AppendMoreBtn(const QString &name, const FreyaBaseData &freyaData) { QToolButton *tempBtn = new QToolButton(this); tempBtn->setObjectName("MsgMoreBtn"); tempBtn->setText(name); m_BtnHLay->addWidget(tempBtn); connect(tempBtn, SIGNAL(clicked()), this, SLOT(OnOtherBtnClicked())); m_BtnMap.insert(tempBtn, freyaData); }
void FreyaMessageDialog::AppendDecisionBtn(const QString &name, const FreyaBaseData &freyaData) { QToolButton *decisionBtn = new QToolButton(this); decisionBtn->setObjectName("MsgDecBtn"); decisionBtn->setText(name); decisionBtn->setFixedSize(80, 26); m_BtnHLay->addWidget(decisionBtn); connect(decisionBtn, SIGNAL(clicked()), this, SLOT(OnDecisionBtnClicked())); m_DecisionBtnMap.insert(decisionBtn, freyaData); }
QToolButton * KviWindow::createToolButton(QWidget * pPar, const char * pcName, KviIconManager::SmallIcon eIcon, const QString & szToolTip, bool bOn) { QToolButton * pTool = new QToolButton(pPar); pTool->setObjectName(pcName); pTool->setIcon(QIcon(*(g_pIconManager->getSmallIcon(eIcon)))); pTool->setAutoRaise(true); pTool->setChecked(bOn); KviTalToolTip::add(pTool, szToolTip); return pTool; }
QToolButton * PlayerWidget::createToolButton(QWidget *parent, const char *name, int size) { QToolButton *toolButton = new QToolButton(parent); toolButton->setObjectName(name); toolButton->setMinimumSize(size, size); toolButton->setIconSize(size >= 32 ? QSize(size - 6, size - 6) : QSize(size, size)); toolButton->setAutoRaise(true); toolButton->setFocusPolicy(Qt::NoFocus); return toolButton; }
void MyTabBar::setupMoveButtons() { for (int i = 0; i < count(); i++) { QFrame *leftFrame = new QFrame(this); QHBoxLayout *leftSide = new QHBoxLayout; leftSide->setContentsMargins(0, 0, 0, 0); leftSide->setSpacing(2); MyCheckBox *chActive = new MyCheckBox(this); chActive->setObjectName(QString("checkBox_fractal_enable_%1").arg(i + 1)); leftSide->addWidget(chActive); connect(chActive, SIGNAL(stateChanged(int)), this, SLOT(slotToggleActive(int))); chActive->setChecked(i == 0); if (i > 0) { QToolButton *tbMoveLeft = new QToolButton(this); QIcon arrowLeft = this->style()->standardIcon(QStyle::SP_ArrowLeft); tbMoveLeft->setIcon(arrowLeft); tbMoveLeft->setIconSize(QSize(10, 10)); tbMoveLeft->setObjectName(QString::number(i)); connect(tbMoveLeft, SIGNAL(clicked()), this, SLOT(slotMoveLeft())); leftSide->addWidget(tbMoveLeft); } leftFrame->setLayout(leftSide); setTabButton(i, QTabBar::LeftSide, leftFrame); if (i < count() - 1) { QToolButton *tbMoveRight = new QToolButton(this); QIcon arrowRight = this->style()->standardIcon(QStyle::SP_ArrowRight); tbMoveRight->setIcon(arrowRight); tbMoveRight->setIconSize(QSize(10, 10)); tbMoveRight->setObjectName(QString::number(i)); setTabButton(i, QTabBar::RightSide, tbMoveRight); connect(tbMoveRight, SIGNAL(clicked()), this, SLOT(slotMoveRight())); } } }
QT_BEGIN_NAMESPACE static QToolButton *createToolButton(QWidget *parent, Qt::ArrowType at, const QString &name) { QToolButton *rc = new QToolButton(); rc->setAttribute(Qt::WA_NoChildEventsForParent, true); rc->setParent(parent); rc->setObjectName(name); rc->setArrowType(at); rc->setAutoRaise(true); rc->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed)); rc->setFixedSize(QSize(15, 15)); return rc; }
void FiltersWidget::addDetailedButton(QHBoxLayout* filterLayout) { QAction* detailsAction = this->createAction(this, QIcon(":/icons/open_icon_library/system-run-5.png"), "Details", "Toggle Details", SLOT(toggleDetailsSlot()), NULL); QToolButton* detailsButton = new QToolButton(); detailsButton->setObjectName("DetailedButton"); detailsButton->setDefaultAction(detailsAction); filterLayout->addWidget(detailsButton); }
void AudioLevelsWidget::setupMenus() { this->contextMenuAudioLevelsDropdown = new QMenu(this); this->contextMenuAudioLevelsDropdown->setTitle("Dropdown"); this->expandCollapseAction = this->contextMenuAudioLevelsDropdown->addAction(/*QIcon(":/Graphics/Images/Collapse.png"),*/ "Collapse", this, SLOT(toggleExpandCollapse())); QToolButton* toolButtonAudioLevelsDropdown = new QToolButton(this); toolButtonAudioLevelsDropdown->setObjectName("toolButtonAudioLevelsDropdown"); toolButtonAudioLevelsDropdown->setMenu(this->contextMenuAudioLevelsDropdown); toolButtonAudioLevelsDropdown->setPopupMode(QToolButton::InstantPopup); this->tabWidgetAudioLevels->setCornerWidget(toolButtonAudioLevelsDropdown); //this->tabWidgetPreview->setTabIcon(0, QIcon(":/Graphics/Images/TabSplitter.png")); }
PositionSelector::PositionSelector(QWidget* p, qint64 s, qint64 e, bool fixedSize) : QWidget(p), rangeStart(s), rangeEnd(e), posEdit(NULL), autoclose(false), dialog(NULL) { init(fixedSize); QToolButton* goButton = new QToolButton(this); goButton->setText(tr("Go!")); goButton->setToolTip(tr("Go to position")); goButton->setObjectName("Go!"); connect(goButton, SIGNAL(clicked(bool)), SLOT(sl_onButtonClicked(bool))); layout()->addWidget(goButton); }
void FreyaMessageDialog::showEvent(QShowEvent *e) { if(m_BtnHLay->count() == 0) { QToolButton *tempOKBtn = new QToolButton(this); tempOKBtn->setObjectName("MessageOKBtn"); tempOKBtn->setFixedSize(80, 26); tempOKBtn->setText(tr("OK")); m_BtnHLay->addWidget(tempOKBtn); connect(tempOKBtn, SIGNAL(clicked()), this, SLOT(accept())); } resize(qMax(m_BtnHLay->minimumSize().width(), m_ContentLab->width()) + 20, m_ContentLab->height() + 60); FreyaBackWindow::showEvent(e); }
/*! * Constructs a numpad widget with a given \a parent. */ QwwNumPad::QwwNumPad(QWidget *parent) : QWidget(parent), QwwPrivatable(new QwwNumPadPrivate(this)) { QGridLayout *l = new QGridLayout(this); l->setSpacing(2); l->setMargin(2); QButtonGroup *group = new QButtonGroup(this); for (int i=0;i<9;i++) { QToolButton *b = new QToolButton; b->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); b->setObjectName(QString("b%1").arg(i+1)); b->setText(QString::number(i+1)); l->addWidget(b, i/3, i%3); group->addButton(b, i+1); } QToolButton *b = new QToolButton; b->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); b->setObjectName("b0"); b->setText("0"); l->addWidget(b, 3, 1); group->addButton(b, 0); b = new QToolButton; b->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); b->setObjectName("bAster"); b->setText("*"); l->addWidget(b, 3, 0); group->addButton(b, 10); b = new QToolButton; b->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); b->setText("#"); b->setObjectName("bHash"); l->addWidget(b, 3, 2); group->addButton(b, 11); connect(group, SIGNAL(buttonClicked(int)), SLOT(_q_clicked(int))); setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); }
void DlgCustomToolbarsImp::setActionGroup(QAction* action, const QList<QAction*>& group) { // See also ActionGroup::addTo() QList<QWidget*> widgets = action->associatedWidgets(); for (QList<QWidget*>::iterator it = widgets.begin(); it != widgets.end(); ++it) { QToolButton* tb = qobject_cast<QToolButton*>(*it); if (tb) { QMenu* menu = tb->menu(); if (!menu) { tb->setPopupMode(QToolButton::MenuButtonPopup); tb->setObjectName(QString::fromLatin1("qt_toolbutton_menubutton")); QMenu* menu = new QMenu(tb); menu->addActions(group); tb->setMenu(menu); } } } }
void DistroMesas::on_mui_nuevapantalla_clicked() { bool ok; QString text = QInputDialog::getText(this, tr("QInputDialog::getText()"), tr("Nombre Pantalla:"), QLineEdit::Normal, "", &ok); if (ok && !text.isEmpty()) m_listapantallas.append(text); QToolButton *but = new QToolButton(this); but->setObjectName("p_" + text); but->setText(text); but->setCheckable(TRUE); but->setMinimumHeight(42); but->setMinimumWidth(42); mui_espaciopantallas->addWidget(but); connect(but, SIGNAL(clicked()), this, SLOT(cambiarPantalla())); repaint(); }
QWidget* DashLabel::getSettingsWidget(int setting){ QToolButton* btn; QLineEdit *line; QSpinBox *spin; switch(setting){ case 0: line = new QLineEdit; line->setObjectName("Nome"); line->setText(item->text(0)); line->setMaxLength(14); connect(line, SIGNAL(textChanged(QString)), this, SLOT(setName(QString))); return line; case 2: spin = new QSpinBox; spin->setObjectName("X"); spin->setMinimum(0); spin->setMaximum(1920); spin->setValue(x); connect(spin, SIGNAL(valueChanged(int)), this, SLOT(setX(int))); return spin; case 3: spin = new QSpinBox; spin->setObjectName("Y"); spin->setMinimum(0); spin->setMaximum(1920); spin->setValue(y); connect(spin, SIGNAL(valueChanged(int)), this, SLOT(setY(int))); return spin; case 4: line = new QLineEdit; line->setObjectName("Testo"); line->setText(text); connect(line, SIGNAL(textChanged(QString)), this, SLOT(setText(QString))); return line; case 5: btn = new QToolButton; btn->setObjectName("Font"); btn->setText("..."); connect(btn, SIGNAL(clicked()), this, SLOT(setFont())); return btn; default: return DashWidget::getSettingsWidget(setting); } }
QToolButton* QuickButtonDisplay::actionButton(const char* objName, const char* icon, QString value) { QToolButton* toolButton = new QToolButton(); toolButton->setIconSize(QSize(32, 32)); toolButton->setObjectName(objName); toolButton->setIcon(QIcon(icon)); toolButton->setText(value); toolButton->setToolTip(value); toolButton->setCursor(Qt::PointingHandCursor); toolButton->setContextMenuPolicy(Qt::CustomContextMenu); toolButton->setStyleSheet("QToolButton {" "background: #242024;" "}"); connect(toolButton, SIGNAL(clicked()), toolBar, SLOT(quickButtonAction())); return toolButton; }
void ActionListWidget::addToolButtonForAction(QAction* action, QToolButton* before) { Q_ASSERT(action); QToolButton* button = new ForcedIconToolButton(); button->setDefaultAction(action); button->setObjectName(action->objectName() + "ToolButton"); button->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed); button->setAutoRaise(true); button->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); int index; if (before == 0) { index = layout()->count() - 1; } else { index = layout()->indexOf(before); } static_cast<QVBoxLayout*>(layout())->insertWidget(index, button); }
DatasetsListWidget::DatasetsListWidget(DatasetsController *_ctrl) : QWidget(), ctrl(_ctrl) { QVBoxLayout *l = new QVBoxLayout(this); l->setMargin(0); tabs = new DatasetsTabWidget(this); l->addWidget(tabs); QToolButton *newTabButton = new QToolButton(this); tabs->setCornerWidget(newTabButton, Qt::TopRightCorner); newTabButton->setCursor(Qt::ArrowCursor); newTabButton->setAutoRaise(true); newTabButton->setText("+"); newTabButton->setObjectName("+"); newTabButton->setToolTip(tr("Add dataset")); QIcon addIcon = QIcon(QString(":U2Designer/images/add.png")); newTabButton->setIcon(addIcon); connect(newTabButton, SIGNAL(clicked()), SLOT(sl_newDataset())); connect(tabs, SIGNAL(tabCloseRequested(int)), SLOT(sl_deleteDataset(int))); connect(tabs, SIGNAL(si_contextMenu(const QPoint &, int)), SLOT(sl_contextMenu(const QPoint &, int))); }
QWidget* PropertyEditor::createWidgetForFlags(const QString& name, const QVariant& value, QMetaEnum me, const QString &detail, QWidget* parent) { mProperties[name] = value; QToolButton *btn = new QToolButton(parent); if (!detail.isEmpty()) btn->setToolTip(detail); btn->setObjectName(name); btn->setText(QObject::tr(name.toUtf8().constData())); btn->setPopupMode(QToolButton::InstantPopup); ClickableMenu *menu = new ClickableMenu(btn); menu->setObjectName(name); btn->setMenu(menu); for (int i = 0; i < me.keyCount(); ++i) { QAction * a = menu->addAction(QString::fromLatin1(me.key(i))); a->setCheckable(true); a->setData(me.value(i)); a->setChecked(value.toInt() & me.value(i)); } connect(menu, SIGNAL(triggered(QAction*)), SLOT(onFlagChange(QAction*))); return btn; }
void ItemsWidget::createItems(int categoryId) { // Remove pervious buttons from grid layout this->removeItems(); // Get all items QList<Model::Item> items = Services::Item::getByCategoryId(categoryId); int i=0, col = 0, row = 1; for(QList<Model::Item>::iterator p = items.begin(); p != items.end(); ++p ) { QToolButton* button = new QToolButton; button->setObjectName(QString("%1_itemButton").arg(p->id())); button->setText((Settings::Language::getCurrentLanguage() == Settings::Language::Arabic) ? p->arabicName() : p->englishName()); if ( Settings::Language::getCurrentLanguage() == Settings::Language::English ) { if ( p->id() == 2 || p->id() == 29) button->setFont(QFont("Hacen Liner Screen Bd", 10, QFont::Normal)); else button->setFont(QFont("Hacen Liner Screen Bd", 13, QFont::Normal)); } else button->setFont(QFont("Hacen Liner Screen Bd", 13, QFont::Normal)); button->setIconSize(QSize(128,128)); //button->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred); button->setToolTip(button->text()); button->setStatusTip(button->text()); connect(button, SIGNAL(clicked()), signalMapper, SLOT(map())); this->signalMapper->setMapping(button, p->id()); layout->addWidget(button, row, col); col++; i++; if ( col % ButtonsPerLine == 0) { row++; col = 0; } } }
void LiveWidget::setupMenus() { this->contextMenuLiveDropdown = new QMenu(this); this->contextMenuLiveDropdown->setTitle("Dropdown"); this->audioTrackMenu = new QMenu(this); this->audioTrackMenu->setTitle("Audio Track"); this->audioMenu = new QMenu(this); this->audioMenu->setTitle("Audio"); this->audioTrackMenuAction = this->audioMenu->addMenu(this->audioTrackMenu); this->audioMenu->addSeparator(); this->muteAction = this->audioMenu->addAction(/*QIcon(":/Graphics/Images/MuteSound.png"),*/ "Mute"); this->muteAction->setCheckable(true); this->streamMenu = new QMenu(this); this->streamMenu->setTitle("Connect to"); this->streamMenuAction = this->contextMenuLiveDropdown->addMenu(this->streamMenu); this->contextMenuLiveDropdown->addSeparator(); this->contextMenuLiveDropdown->addMenu(this->audioMenu); this->contextMenuLiveDropdown->addSeparator(); this->windowModeAction = this->contextMenuLiveDropdown->addAction(/*QIcon(":/Graphics/Images/WindowMode.png"),*/ "Window Mode", this, SLOT(toggleWindowMode())); this->windowModeAction->setCheckable(true); this->contextMenuLiveDropdown->addSeparator(); this->expandCollapseAction = this->contextMenuLiveDropdown->addAction(/*QIcon(":/Graphics/Images/Collapse.png"),*/ "Collapse", this, SLOT(toggleExpandCollapse())); QObject::connect(this->streamMenuAction, SIGNAL(hovered()), this, SLOT(streamMenuHovered())); QObject::connect(this->audioTrackMenuAction, SIGNAL(hovered()), this, SLOT(audioTrackMenuHovered())); QObject::connect(this->streamMenu, SIGNAL(triggered(QAction*)), this, SLOT(streamMenuActionTriggered(QAction*))); QObject::connect(this->audioTrackMenu, SIGNAL(triggered(QAction*)), this, SLOT(audioMenuActionTriggered(QAction*))); QObject::connect(this->muteAction, SIGNAL(toggled(bool)), this, SLOT(muteAudio(bool))); QToolButton* toolButtonLiveDropdown = new QToolButton(this); toolButtonLiveDropdown->setObjectName("toolButtonLiveDropdown"); toolButtonLiveDropdown->setMenu(this->contextMenuLiveDropdown); toolButtonLiveDropdown->setPopupMode(QToolButton::InstantPopup); this->tabWidgetLive->setCornerWidget(toolButtonLiveDropdown); //this->tabWidgetPreview->setTabIcon(0, QIcon(":/Graphics/Images/TabSplitter.png")); }
void AxisDetailsWidget::addLed(int row, int column) { Led* led = iAnimation.ledAt(Position(row, column)); if(led == NULL) { throw IllegalArgumentException("AnimationDetailsWidget::addLed : NULL led"); } if(!iLedDetails.contains(led->number())) { int count = iLedDetails.count(); qDebug("add new led, %d, %d", row, column); QLabel* ledNumberLabel = new QLabel(this); ledNumberLabel->setMaximumWidth(LED_LABEL_WIDTH); ledNumberLabel->setMinimumWidth(LED_LABEL_WIDTH); FrameListWidget* framesListWidget = new FrameListWidget(this, axisData(*led), *this);//, count); QToolButton* closeButton = new QToolButton(this); closeButton->setObjectName(QString::fromUtf8("detailsClose")); closeButton->setIcon(QIcon(":/images/delete.png")); iGridLayout->addWidget(closeButton, count, 0); iGridLayout->addWidget(ledNumberLabel, count, 1); iGridLayout->addWidget(framesListWidget, count, 2); // iGridLayout->setColumnStretch(1, 1); // iGridLayout->addWidget(new QWidget(), count, 3); // iGridLayout->setColumnStretch(3, 2); iLedDetails.insert(led->number(), new LedDetails(*this, *led, *ledNumberLabel, *framesListWidget, *closeButton)); iCloseAll->setEnabled(true); iScrollAreaWidgetContents->setShowCurrentFrameLine(true); doResize(); layout()->invalidate(); } }
GraphHierarchiesEditor::GraphHierarchiesEditor(QWidget *parent): QWidget(parent), _ui(new Ui::GraphHierarchiesEditorData), _contextGraph(NULL), _model(NULL) { _ui->setupUi(this); _ui->hierarchiesTree->addAction(_ui->actionDelete_All); _ui->actionDelete_All->setShortcutContext(Qt::WidgetWithChildrenShortcut); QToolButton* linkButton = new QToolButton(); linkButton->setObjectName("linkButton"); linkButton->setIcon(QIcon(":/tulip/gui/icons/16/link.png")); linkButton->setToolTip("Click here to disable the synchronization with workspace active panel.\nWhen synchronization is enabled, the graph currently displayed\nin the active panel, becomes the current one in the Graphs panel."); linkButton->setIconSize(QSize(22,22)); linkButton->setMinimumSize(25,25); linkButton->setMaximumSize(25,25); linkButton->setCheckable(true); linkButton->setChecked(true); _ui->header->insertWidget(linkButton); _linkButton = linkButton; connect(linkButton, SIGNAL(toggled(bool)), this, SLOT(toggleSynchronization(bool))); _ui->hierarchiesTree->installEventFilter(this); connect(_ui->hierarchiesTree, SIGNAL(clicked(const QModelIndex &)), this, SLOT(clicked(const QModelIndex &))); }
RundownWidget::RundownWidget(QWidget* parent) : QWidget(parent) { setupUi(this); setupMenus(); QToolButton* toolButtonRundownDropdown = new QToolButton(this); toolButtonRundownDropdown->setObjectName("toolButtonRundownDropdown"); toolButtonRundownDropdown->setMenu(this->contextMenuRundownDropdown); toolButtonRundownDropdown->setPopupMode(QToolButton::InstantPopup); this->tabWidgetRundown->setCornerWidget(toolButtonRundownDropdown); //this->tabWidgetRundown->setTabIcon(0, QIcon(":/Graphics/Images/TabSplitter.png")); RundownTreeWidget* widget = new RundownTreeWidget(this); int index = this->tabWidgetRundown->addTab(widget/*, QIcon(":/Graphics/Images/TabSplitter.png")*/, Rundown::DEFAULT_NAME); this->tabWidgetRundown->setTabToolTip(index, Rundown::DEFAULT_NAME); this->tabWidgetRundown->setCurrentIndex(index); QObject::connect(&EventManager::getInstance(), SIGNAL(newRundownMenu(const NewRundownMenuEvent&)), this, SLOT(newRundownMenu(const NewRundownMenuEvent&))); QObject::connect(&EventManager::getInstance(), SIGNAL(openRundownMenu(const OpenRundownMenuEvent&)), this, SLOT(openRundownMenu(const OpenRundownMenuEvent&))); QObject::connect(&EventManager::getInstance(), SIGNAL(openRundownFromUrlMenu(const OpenRundownFromUrlMenuEvent&)), this, SLOT(openRundownFromUrlMenu(const OpenRundownFromUrlMenuEvent&))); QObject::connect(&EventManager::getInstance(), SIGNAL(newRundown(const NewRundownEvent&)), this, SLOT(newRundown(const NewRundownEvent&))); QObject::connect(&EventManager::getInstance(), SIGNAL(allowRemoteTriggeringMenu(const AllowRemoteTriggeringMenuEvent&)), this, SLOT(allowRemoteTriggeringMenu(const AllowRemoteTriggeringMenuEvent&))); QObject::connect(&EventManager::getInstance(), SIGNAL(closeRundown(const CloseRundownEvent&)), this, SLOT(closeRundown(const CloseRundownEvent&))); QObject::connect(&EventManager::getInstance(), SIGNAL(deleteRundown(const DeleteRundownEvent&)), this, SLOT(deleteRundown(const DeleteRundownEvent&))); QObject::connect(&EventManager::getInstance(), SIGNAL(openRundown(const OpenRundownEvent&)), this, SLOT(openRundown(const OpenRundownEvent&))); QObject::connect(&EventManager::getInstance(), SIGNAL(openRundownFromUrl(const OpenRundownFromUrlEvent&)), this, SLOT(openRundownFromUrl(const OpenRundownFromUrlEvent&))); QObject::connect(&EventManager::getInstance(), SIGNAL(saveRundown(const SaveRundownEvent&)), this, SLOT(saveRundown(const SaveRundownEvent&))); QObject::connect(&EventManager::getInstance(), SIGNAL(activeRundownChanged(const ActiveRundownChangedEvent&)), this, SLOT(activeRundownChanged(const ActiveRundownChangedEvent&))); QObject::connect(&EventManager::getInstance(), SIGNAL(reloadRundown(const ReloadRundownEvent&)), this, SLOT(reloadRundown(const ReloadRundownEvent&))); QObject::connect(&EventManager::getInstance(), SIGNAL(markItemAsUsed(const MarkItemAsUsedEvent&)), this, SLOT(markItemAsUsed(const MarkItemAsUsedEvent&))); QObject::connect(&EventManager::getInstance(), SIGNAL(markItemAsUnused(const MarkItemAsUnusedEvent&)), this, SLOT(markItemAsUnused(const MarkItemAsUnusedEvent&))); QObject::connect(&EventManager::getInstance(), SIGNAL(markAllItemsAsUsed(const MarkAllItemsAsUsedEvent&)), this, SLOT(markAllItemsAsUsed(const MarkAllItemsAsUsedEvent&))); QObject::connect(&EventManager::getInstance(), SIGNAL(markAllItemsAsUnused(const MarkAllItemsAsUnusedEvent&)), this, SLOT(markAllItemsAsUnused(const MarkAllItemsAsUnusedEvent&))); }