当前位置: 首页>>代码示例>>C++>>正文


C++ QToolButton::setToolButtonStyle方法代码示例

本文整理汇总了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);
}
开发者ID:JFLEKY,项目名称:Cockatrice,代码行数:57,代码来源:tab_deck_editor.cpp

示例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& ) ) );

}
开发者ID:carsonfarmer,项目名称:Quantum-GIS,代码行数:56,代码来源:qgsbrowserdockwidget.cpp

示例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);
}
开发者ID:gustawho,项目名称:dooscape,代码行数:30,代码来源:settingswindow.cpp

示例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);
}
开发者ID:gustawho,项目名称:dooscape,代码行数:35,代码来源:settingswindow.cpp

示例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 );
        }
开发者ID:KDE,项目名称:okular,代码行数:30,代码来源:toolaction.cpp

示例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));
        }
    }
}
开发者ID:RobinWuDev,项目名称:Qt,代码行数:26,代码来源:bookmarks.cpp

示例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 );
  }
开发者ID:AtsushiSakai,项目名称:jsk_visualization,代码行数:26,代码来源:empty_service_call_interface.cpp

示例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 ) ) );
}
开发者ID:iclosure,项目名称:jdataanalyse,代码行数:27,代码来源:main.cpp

示例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);
}
开发者ID:piotrbetlej,项目名称:hexplorer,代码行数:26,代码来源:plot3d.cpp

示例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;
}
开发者ID:SpiritSPb,项目名称:kwidgetsaddons,代码行数:32,代码来源:ktoolbarpopupaction.cpp

示例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;
}
开发者ID:rosedu,项目名称:digikam,代码行数:9,代码来源:paniconwidget.cpp

示例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;
}
开发者ID:Rambler-ru,项目名称:Contacts,代码行数:9,代码来源:toolbarchanger.cpp

示例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;
}
开发者ID:Monthy,项目名称:gr-lida,代码行数:9,代码来源:editorwidget.cpp

示例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 );

}
开发者ID:CalciferLorain,项目名称:Qwt,代码行数:57,代码来源:main.cpp

示例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;
}
开发者ID:C-CINA,项目名称:2dx,代码行数:10,代码来源:ProcessingManager.cpp


注:本文中的QToolButton::setToolButtonStyle方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。