本文整理汇总了C++中QToolButton::setObjectName方法的典型用法代码示例。如果您正苦于以下问题:C++ QToolButton::setObjectName方法的具体用法?C++ QToolButton::setObjectName怎么用?C++ QToolButton::setObjectName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QToolButton
的用法示例。
在下文中一共展示了QToolButton::setObjectName方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: createFiltersDock
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);
}
示例2: if
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++;
}
示例3: InitTitleBar
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);
}
示例4: listPlugins
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);
}
示例5: QIcon
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();
}
示例6: sl_addName
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();
}
示例7: QFrame
//====================================================================================================
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);
};
示例8: AppendMoreBtn
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);
}
示例9: AppendDecisionBtn
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);
}
示例10: QToolButton
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;
}
示例11: QToolButton
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;
}
示例12: setupMoveButtons
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()));
}
}
}
示例13: QToolButton
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;
}
示例14: setupMenus
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"));
}
示例15: QWidget
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);
}