本文整理汇总了C++中QToolButton::setToolButtonStyle方法的典型用法代码示例。如果您正苦于以下问题:C++ QToolButton::setToolButtonStyle方法的具体用法?C++ QToolButton::setToolButtonStyle怎么用?C++ QToolButton::setToolButtonStyle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QToolButton
的用法示例。
在下文中一共展示了QToolButton::setToolButtonStyle方法的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: QDockWidget
QgsBrowserDockWidget::QgsBrowserDockWidget( QWidget * parent ) :
QDockWidget( parent ), mModel( NULL )
{
setWindowTitle( tr( "Browser" ) );
mBrowserView = new QgsBrowserTreeView( this );
QToolButton* refreshButton = new QToolButton( this );
refreshButton->setIcon( QgsApplication::getThemeIcon( "mActionDraw.png" ) );
// remove this to save space
refreshButton->setToolButtonStyle( Qt::ToolButtonTextBesideIcon );
refreshButton->setText( tr( "Refresh" ) );
refreshButton->setToolTip( tr( "Refresh" ) );
refreshButton->setAutoRaise( true );
connect( refreshButton, SIGNAL( clicked() ), this, SLOT( refresh() ) );
QToolButton* addLayersButton = new QToolButton( this );
addLayersButton->setIcon( QgsApplication::getThemeIcon( "mActionAddLayer.png" ) );
// remove this to save space
addLayersButton->setToolButtonStyle( Qt::ToolButtonTextBesideIcon );
addLayersButton->setText( tr( "Add Selection" ) );
addLayersButton->setToolTip( tr( "Add Selected Layers" ) );
addLayersButton->setAutoRaise( true );
connect( addLayersButton, SIGNAL( clicked() ), this, SLOT( addSelectedLayers() ) );
QToolButton* collapseButton = new QToolButton( this );
collapseButton->setIcon( QgsApplication::getThemeIcon( "mActionCollapseTree.png" ) );
collapseButton->setToolTip( tr( "Collapse All" ) );
collapseButton->setAutoRaise( true );
connect( collapseButton, SIGNAL( clicked() ), mBrowserView, SLOT( collapseAll() ) );
QVBoxLayout* layout = new QVBoxLayout();
QHBoxLayout* hlayout = new QHBoxLayout();
layout->setContentsMargins( 0, 0, 0, 0 );
layout->setSpacing( 0 );
hlayout->setContentsMargins( 0, 0, 0, 0 );
hlayout->setSpacing( 5 );
hlayout->setAlignment( Qt::AlignLeft );
hlayout->addSpacing( 5 );
hlayout->addWidget( refreshButton );
hlayout->addSpacing( 5 );
hlayout->addWidget( addLayersButton );
hlayout->addStretch( );
hlayout->addWidget( collapseButton );
layout->addLayout( hlayout );
layout->addWidget( mBrowserView );
QWidget* innerWidget = new QWidget( this );
innerWidget->setLayout( layout );
setWidget( innerWidget );
connect( mBrowserView, SIGNAL( customContextMenuRequested( const QPoint & ) ), this, SLOT( showContextMenu( const QPoint & ) ) );
connect( mBrowserView, SIGNAL( doubleClicked( const QModelIndex& ) ), this, SLOT( addLayerAtIndex( const QModelIndex& ) ) );
}
示例3: genReset
void SettingsWindow::genReset()
{
QLabel *textView = new QLabel;
textView->setWordWrap(true);
textView->setText(tr("If you click \"Start Reset\", you accept close browser (loose all opened tabs) and delete :<ul><li>Account</li><li>Color background</li><li>Home Page</li><li>Elements of Interface</li><li>Account</li></ul>Do you continue ?"));
textView->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Minimum);
QToolButton *btnReset = new QToolButton;
btnReset->setIcon(QIcon(":/img/forward.png"));
btnReset->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
btnReset->setText(tr("Start Reset"));
btnReset->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Minimum);
connect(btnReset,SIGNAL(clicked()),this,SLOT(reset()));
// --------------------------
QWidget *spacer = new QWidget;
spacer->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding);
QGridLayout *mainLayout = new QGridLayout;
mainLayout->setSpacing(10);
mainLayout->setContentsMargins(0,10,0,0);
mainLayout->addWidget(textView);
mainLayout->addWidget(btnReset);
mainLayout->addWidget(spacer);
tabReset = new SettingsPanel;
tabReset->setTitle(tr("Reset"));
tabReset->setMainLayout(mainLayout);
}
示例4: genOptions
void SettingsWindow::genOptions()
{
QCheckBox *checkPlugins = new QCheckBox(tr("Enable Plugins"));
QCheckBox *checkJava = new QCheckBox(tr("Enable Java"));
QCheckBox *checkJavaScript = new QCheckBox(tr("Enable JavaScript"));
QCheckBox *checkJavascriptCanOpenWindows = new QCheckBox(tr("JavaScript can open windows"));
QCheckBox *checkJavascriptCanAccessClipboard = new QCheckBox(tr("JavaScript can access clipboard"));
QToolButton *btnCheckAll = new QToolButton;
btnCheckAll->setIcon(QIcon(":/img/menu.png"));
btnCheckAll->setIconSize(QSize(0,0));
btnCheckAll->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
btnCheckAll->setText(tr("Select all"));
btnCheckAll->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Minimum);
// --------------------------
QWidget *spacer = new QWidget;
spacer->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding);
QGridLayout *mainLayout = new QGridLayout;
mainLayout->setSpacing(10);
mainLayout->setContentsMargins(0,10,0,0);
mainLayout->addWidget(checkPlugins);
mainLayout->addWidget(checkJava);
mainLayout->addWidget(checkJavaScript);
mainLayout->addWidget(checkJavascriptCanOpenWindows);
mainLayout->addWidget(checkJavascriptCanAccessClipboard);
mainLayout->addWidget(btnCheckAll);
mainLayout->addWidget(spacer);
tabOptions = new SettingsPanel;
tabOptions->setTitle(tr("Options"));
tabOptions->setMainLayout(mainLayout);
}
示例5: QToolButton
QWidget* ToolAction::createWidget( QWidget *parent )
{
QToolBar *toolBar = qobject_cast< QToolBar * >( parent );
if ( !toolBar )
return 0;
QToolButton *button = new QToolButton( toolBar );
button->setAutoRaise( true );
button->setFocusPolicy( Qt::NoFocus );
button->setIconSize( toolBar->iconSize() );
button->setToolButtonStyle( toolBar->toolButtonStyle() );
button->setPopupMode( QToolButton::DelayedPopup );
button->setMenu( new QMenu( button ) );
button->setCheckable( true );
connect(toolBar, &QToolBar::iconSizeChanged, button, &QToolButton::setIconSize);
connect(toolBar, &QToolBar::toolButtonStyleChanged, button, &QToolButton::setToolButtonStyle);
connect(button, &QToolButton::triggered, toolBar, &QToolBar::actionTriggered);
connect( button->menu(), &QMenu::triggered, this, &ToolAction::slotNewDefaultAction );
m_buttons.append( button );
if ( !m_actions.isEmpty() )
{
button->setDefaultAction( m_actions.first() );
foreach ( QAction *action, m_actions )
{
button->menu()->addAction( action );
if ( action->isChecked() )
button->setDefaultAction( action );
}
示例6: build
void BookmarksToolBar::build()
{
clear();
for (int i = 0; i < m_bookmarksModel->rowCount(m_root); ++i) {
QModelIndex idx = m_bookmarksModel->index(i, 0, m_root);
if (m_bookmarksModel->hasChildren(idx)) {
QToolButton *button = new QToolButton(this);
button->setPopupMode(QToolButton::InstantPopup);
button->setArrowType(Qt::DownArrow);
button->setText(idx.data().toString());
ModelMenu *menu = new ModelMenu(this);
connect(menu, SIGNAL(activated(QModelIndex)),
this, SLOT(activated(QModelIndex)));
menu->setModel(m_bookmarksModel);
menu->setRootIndex(idx);
menu->addAction(new QAction(menu));
button->setMenu(menu);
button->setToolButtonStyle(Qt::ToolButtonTextOnly);
QAction *a = addWidget(button);
a->setText(idx.data().toString());
} else {
QAction *action = addAction(idx.data().toString());
action->setData(idx.data(BookmarksModel::UrlRole));
}
}
}
示例7: parseROSParameters
EmptyServiceCallInterfaceAction::EmptyServiceCallInterfaceAction( QWidget* parent )
: rviz::Panel( parent )
{
parseROSParameters();
QHBoxLayout* h_layout = new QHBoxLayout;
h_layout->setAlignment(Qt::AlignLeft);
layout = new QVBoxLayout();
signal_mapper = new QSignalMapper(this);
for(size_t i = 0; i < service_call_button_infos_.size();i++){
ServiceCallButtonInfo target_button = service_call_button_infos_[i];
QToolButton* tbutton = new QToolButton(this);
tbutton->setText(target_button.text.c_str());
tbutton->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
tbutton->setIconSize(QSize(100, 100));
tbutton->setIcon(QIcon(QPixmap(QString(target_button.icon_file_path.c_str()))));
connect(tbutton, SIGNAL(clicked()), signal_mapper, SLOT(map()));
signal_mapper->setMapping(tbutton, i);
h_layout->addWidget(tbutton);
};
connect(signal_mapper, SIGNAL(mapped(int)),
this, SLOT(callRequestEmptyCommand(int)));
layout->addLayout(h_layout);
setLayout( layout );
}
示例8: QMainWindow
MainWindow::MainWindow( QWidget *parent ):
QMainWindow( parent )
{
d_plot = new Plot( this );
setCentralWidget( d_plot );
QToolBar *toolBar = new QToolBar( this );
QComboBox *typeBox = new QComboBox( toolBar );
typeBox->addItem( "Bars" );
typeBox->addItem( "CandleSticks" );
typeBox->setCurrentIndex( 1 );
typeBox->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed );
QToolButton *btnExport = new QToolButton( toolBar );
btnExport->setText( "Export" );
btnExport->setToolButtonStyle( Qt::ToolButtonTextUnderIcon );
connect( btnExport, SIGNAL( clicked() ), d_plot, SLOT( exportPlot() ) );
toolBar->addWidget( typeBox );
toolBar->addWidget( btnExport );
addToolBar( toolBar );
d_plot->setMode( typeBox->currentIndex() );
connect( typeBox, SIGNAL( currentIndexChanged( int ) ),
d_plot, SLOT( setMode( int ) ) );
}
示例9: QMainWindow
Plot3D::Plot3D(QWidget *parent, Data *dat) : QMainWindow(parent)
{
// pointers
data = dat;
// create 3D surface
setData();
// design widget
QToolBar *toolBar = new QToolBar(this);
QToolButton *btnSpectrogram = new QToolButton(toolBar);
QToolButton *btnContour = new QToolButton(toolBar);
QToolButton *btnPrint = new QToolButton(toolBar);
btnPrint->setText("Print");
btnPrint->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
toolBar->addWidget(btnPrint);
addToolBar(toolBar);
connect(btnPrint, SIGNAL(clicked()), this, SLOT(printPlot()));
btnSpectrogram->setChecked(true);
btnContour->setChecked(false);
}
示例10: QToolButton
QWidget *KToolBarPopupAction::createWidget(QWidget *_parent)
{
QToolBar *parent = qobject_cast<QToolBar *>(_parent);
if (!parent) {
return QWidgetAction::createWidget(_parent);
}
QToolButton *button = new QToolButton(parent);
button->setAutoRaise(true);
button->setFocusPolicy(Qt::NoFocus);
button->setIconSize(parent->iconSize());
button->setToolButtonStyle(parent->toolButtonStyle());
button->setDefaultAction(this);
connect(parent, &QToolBar::iconSizeChanged,
button, &QAbstractButton::setIconSize);
connect(parent, &QToolBar::toolButtonStyleChanged,
button, &QToolButton::setToolButtonStyle);
connect(button, &QToolButton::triggered,
parent, &QToolBar::actionTriggered);
if (d->delayed)
if (d->stickyMenu) {
button->setPopupMode(QToolButton::MenuButtonPopup);
} else {
button->setPopupMode(QToolButton::DelayedPopup);
}
else {
button->setPopupMode(QToolButton::InstantPopup);
}
return button;
}
示例11: button
QToolButton* PanIconWidget::button()
{
QToolButton* btn = new QToolButton;
btn->setToolButtonStyle(Qt::ToolButtonIconOnly);
btn->setIcon(SmallIcon("transform-move"));
btn->hide();
btn->setToolTip( i18n("Pan the image to a region"));
return btn;
}
示例12: QToolButton
QToolButton *ToolBarChanger::insertAction(Action *AAction, int AGroup)
{
QToolButton *button = new QToolButton(FToolBar);
button->setToolButtonStyle(FToolBar->toolButtonStyle());
button->setDefaultAction(AAction);
FButtons.insert(AAction, button);
insertWidget(button, AGroup);
return button;
}
示例13: QToolButton
static QToolButton *createToolButton(const QIcon &icon, const QString &text, QWidget *parent = 0)
{
QToolButton *result = new QToolButton(parent);
result->setIcon(icon);
result->setText(text);
result->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
result->setAutoRaise(true);
return result;
}
示例14: QMainWindow
MainWindow::MainWindow( QWidget *parent ):
QMainWindow( parent )
{
d_plot = new Plot( this );
setCentralWidget( d_plot );
QToolBar *toolBar = new QToolBar( this );
#ifndef QT_NO_PRINTER
QToolButton *btnPrint = new QToolButton( toolBar );
btnPrint->setText( "Print" );
btnPrint->setToolButtonStyle( Qt::ToolButtonTextUnderIcon );
toolBar->addWidget( btnPrint );
connect( btnPrint, SIGNAL( clicked() ),
d_plot, SLOT( printPlot() ) );
toolBar->addSeparator();
#endif
toolBar->addWidget( new QLabel("Color Map " ) );
QComboBox *mapBox = new QComboBox( toolBar );
mapBox->addItem( "RGB" );
mapBox->addItem( "Indexed Colors" );
mapBox->addItem( "Hue" );
mapBox->addItem( "Alpha" );
mapBox->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed );
toolBar->addWidget( mapBox );
connect( mapBox, SIGNAL( currentIndexChanged( int ) ),
d_plot, SLOT( setColorMap( int ) ) );
toolBar->addWidget( new QLabel( " Opacity " ) );
QSlider *slider = new QSlider( Qt::Horizontal );
slider->setRange( 0, 255 );
slider->setValue( 255 );
connect( slider, SIGNAL( valueChanged( int ) ),
d_plot, SLOT( setAlpha( int ) ) );
toolBar->addWidget( slider );
toolBar->addWidget( new QLabel(" " ) );
QCheckBox *btnSpectrogram = new QCheckBox( "Spectrogram", toolBar );
toolBar->addWidget( btnSpectrogram );
connect( btnSpectrogram, SIGNAL( toggled( bool ) ),
d_plot, SLOT( showSpectrogram( bool ) ) );
QCheckBox *btnContour = new QCheckBox( "Contour", toolBar );
toolBar->addWidget( btnContour );
connect( btnContour, SIGNAL( toggled( bool ) ),
d_plot, SLOT( showContour( bool ) ) );
addToolBar( toolBar );
btnSpectrogram->setChecked( true );
btnContour->setChecked( false );
}
示例15: getButton
QToolButton* ProcessingManager::getButton(const QString& icon, const QString& text, const QString& tooltip) {
QToolButton* button = new QToolButton();
button->setIcon(ApplicationData::icon(icon));
button->setText(text);
button->setIconSize(QSize(32, 32));
button->setFixedHeight(60);
button->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
button->setToolTip("Remove all images from queue");
return button;
}