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


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

本文整理汇总了C++中QToolButton::setToolTip方法的典型用法代码示例。如果您正苦于以下问题:C++ QToolButton::setToolTip方法的具体用法?C++ QToolButton::setToolTip怎么用?C++ QToolButton::setToolTip使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在QToolButton的用法示例。


在下文中一共展示了QToolButton::setToolTip方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: QToolButton

QList<QToolButton *> TestNavigationWidget::createToolButtons()
{
    QList<QToolButton *> list;

    m_filterButton = new QToolButton(m_view);
    m_filterButton->setIcon(Core::Icons::FILTER.icon());
    m_filterButton->setToolTip(tr("Filter Test Tree"));
    m_filterButton->setProperty("noArrow", true);
    m_filterButton->setAutoRaise(true);
    m_filterButton->setPopupMode(QToolButton::InstantPopup);
    m_filterMenu = new QMenu(m_filterButton);
    initializeFilterMenu();
    connect(m_filterMenu, &QMenu::triggered, this, &TestNavigationWidget::onFilterMenuTriggered);
    m_filterButton->setMenu(m_filterMenu);

    m_sortAlphabetically = true;
    m_sort = new QToolButton(this);
    m_sort->setIcon(Icons::SORT_NATURALLY.icon());
    m_sort->setToolTip(tr("Sort Naturally"));

    QToolButton *expand = new QToolButton(this);
    expand->setIcon(Core::Icons::EXPAND_TOOLBAR.icon());
    expand->setToolTip(tr("Expand All"));

    QToolButton *collapse = new QToolButton(this);
    collapse->setIcon(Core::Icons::COLLAPSE_TOOLBAR.icon());
    collapse->setToolTip(tr("Collapse All"));

    connect(expand, &QToolButton::clicked, m_view, &TestTreeView::expandAll);
    connect(collapse, &QToolButton::clicked, m_view, &TestTreeView::collapseAll);
    connect(m_sort, &QToolButton::clicked, this, &TestNavigationWidget::onSortClicked);

    list << m_filterButton << m_sort << expand << collapse;
    return list;
}
开发者ID:C-sjia,项目名称:qt-creator,代码行数:35,代码来源:testnavigationwidget.cpp

示例2: createWidget

Core::NavigationView TestNavigationWidgetFactory::createWidget()
{
    Core::NavigationView view;
    TestSelector *ptw = new TestSelector();
    ptw->rescan();
    view.widget = ptw;

    QToolButton *filter = new QToolButton;
    filter->setIcon(QIcon(Core::Constants::ICON_FILTER));
    filter->setToolTip(tr("Filter tree"));
    filter->setPopupMode(QToolButton::InstantPopup);

    QMenu *filterMenu = new QMenu(filter);
    filterMenu->addAction(ptw->m_componentViewMode);
    filterMenu->addAction(ptw->m_showUnitTests);
    filterMenu->addAction(ptw->m_showIntegrationTests);
    filterMenu->addAction(ptw->m_showPerformanceTests);
    filterMenu->addAction(ptw->m_showSystemTests);
    filter->setMenu(filterMenu);

    QToolButton *newTest = new QToolButton;
    newTest->setIcon(QIcon(":/core/images/filenew.png"));
    newTest->setToolTip(tr("New test"));
    newTest->setPopupMode(QToolButton::InstantPopup);
    QObject::connect(newTest, SIGNAL(clicked()), ptw,
        SLOT(testInsertUnitOrSystemTest()), Qt::DirectConnection);

    view.dockToolBarWidgets << filter << newTest;
    return view;
}
开发者ID:anchowee,项目名称:QtCreator,代码行数:30,代码来源:qttestplugin.cpp

示例3: QTabWidget

QTabWidget *OptionDialog::createTabs() {
  tabs = new QTabWidget(this);
  for (int i = 0; i < myFractal->_funcCount; ++i)
    tabs->addTab(new FunctionTab(myFractal->_functions[i]),
                 QString::number(i + 1));
  QToolButton *newTabButton = new QToolButton(tabs);
  newTabButton->setCursor(Qt::ArrowCursor);
  newTabButton->setAutoRaise(true);
  newTabButton->setIcon(QIcon(":/images/plus_16.png"));
  newTabButton->setToolTip(tr("Add function"));
  tabs->setCornerWidget(newTabButton, Qt::TopLeftCorner);

  QToolButton *closeTabButton = new QToolButton(tabs);
  closeTabButton->setCursor(Qt::ArrowCursor);
  closeTabButton->setAutoRaise(true);
  closeTabButton->setIcon(QIcon(":/images/delete_16.png"));
  closeTabButton->setToolTip(tr("Remove function"));
  tabs->setCornerWidget(closeTabButton, Qt::TopRightCorner);

  tabs->repaint();
  connect(closeTabButton, SIGNAL(clicked()), this, SLOT(remFunc()));
  connect(newTabButton, SIGNAL(clicked()), this, SLOT(addFunc()));
  // connect(tabs,SIGNAL(currentChanged(int)),this,SLOT(tabChange(false)));
  return tabs;
}
开发者ID:jvesely,项目名称:ignitor,代码行数:25,代码来源:optionDialog.cpp

示例4: QWidget

VLCProfileSelector::VLCProfileSelector( QWidget *_parent ): QWidget( _parent )
{
    QHBoxLayout *layout = new QHBoxLayout( this );

    QLabel *prLabel = new QLabel( qtr( "Profile"), this );
    layout->addWidget( prLabel );

    profileBox = new QComboBox( this );
    layout->addWidget( profileBox );

    QToolButton *editButton = new QToolButton( this );
    editButton->setIcon( QIcon( ":/menu/preferences" ) );
    editButton->setToolTip( qtr( "Edit selected profile" ) );
    layout->addWidget( editButton );

    QToolButton *deleteButton = new QToolButton( this );
    deleteButton->setIcon( QIcon( ":/toolbar/clear" ) );
    deleteButton->setToolTip( qtr( "Delete selected profile" ) );
    layout->addWidget( deleteButton );

    QToolButton *newButton = new QToolButton( this );
    newButton->setIcon( QIcon( ":/new" ) );
    newButton->setToolTip( qtr( "Create a new profile" ) );
    layout->addWidget(newButton);

    BUTTONACT( newButton, newProfile() );
    BUTTONACT( editButton, editProfile() );
    BUTTONACT( deleteButton, deleteProfile() );
    fillProfilesCombo();

    CONNECT( profileBox, activated( int ),
             this, updateOptions( int ) );
    updateOptions( 0 );
}
开发者ID:BloodExecutioner,项目名称:vlc,代码行数:34,代码来源:profile_selector.cpp

示例5: 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

示例6: QDockWidget

QMathMLFileViewer::QMathMLFileViewer( QWidget *parent )
    : QDockWidget( tr("MathML Documents Explorer"), parent )
{
	m_iconSize = QSize(16, 16);
	m_isRecursiveSearch = true;

	m_currentDir.setPath( QDir::currentPath() );

	directoryComboBox = createComboBox( m_currentDir.absolutePath() );
	directoryComboBox->setMinimumWidth(150);
	QDirModel *dirModelCompleter = new QDirModel(this);
	dirModelCompleter->setFilter( QDir::AllDirs/*QDir::Dirs*/ );
	QCompleter *completer = new QCompleter( this );
    completer->setModel( dirModelCompleter );
    directoryComboBox->setCompleter( completer );
	connect(directoryComboBox, SIGNAL(currentIndexChanged(const QString&)), this, SLOT(changeDir(const QString&)));

	QToolButton *btnBrowse = new QToolButton();
	btnBrowse->setIcon(QIcon(":/images/folderopen.png"));
	//btnBrowse->setIconSize( m_iconSize );
	btnBrowse->setToolTip(tr("Select a new folder"));
	connect(btnBrowse, SIGNAL(clicked()), this, SLOT(browse()));

	QToolButton *btnBrowseUp = new QToolButton();
	btnBrowseUp->setIcon(QIcon(":/images/up.png"));
	//btnBrowseUp->setIconSize( m_iconSize );
	btnBrowseUp->setToolTip(tr("Navagate one level up"));
	connect(btnBrowseUp, SIGNAL(clicked()), this, SLOT(browseUp()));

	QHBoxLayout *dirLayout = new QHBoxLayout();
	dirLayout->addWidget(directoryComboBox);
	dirLayout->addWidget(btnBrowseUp);
	dirLayout->addWidget(btnBrowse);
	dirLayout->addStretch(1);

	createFilesTree();
	createFilesTable();
	foundMessage = new QLabel(tr("No search results"));

	QHBoxLayout *toolLayout = setupToolLayout();
    QVBoxLayout *mainLayout = new QVBoxLayout();
    mainLayout->addLayout(toolLayout);
    mainLayout->addLayout(dirLayout);
    mainLayout->addWidget(m_dirTree);
    mainLayout->addWidget(filesTable);
	mainLayout->addWidget(foundMessage);

	QDialog *centralDlg = new QDialog();
	centralDlg->setModal( false );
	centralDlg->setLayout( mainLayout );
	setWidget( centralDlg );
}
开发者ID:Nilis640,项目名称:formulator-mathml,代码行数:52,代码来源:mmlfileviewerwidget.cpp

示例7: QFrame

ListLayoutRow::ListLayoutRow(QWidget *widget, QWidget *parent, const bool &moveEnabled)
    : QFrame(parent)
{

    m_widget = widget;
    m_upButton = m_downButton = 0;

    setMidLineWidth(0);
    setLineWidth(1);
    setFrameStyle(QFrame::Box);
    setFrameShadow(QFrame::Sunken);    

    setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);

    QToolButton *removeButton = new QToolButton(this);
    removeButton->setIcon(KIcon("list-remove"));
    removeButton->setText(i18n("Remove"));
    removeButton->setToolTip(i18n("Remove"));
    connect(removeButton, SIGNAL(clicked()), this, SLOT(removeClicked()));

    KSeparator *separator = new KSeparator(Qt::Vertical);
    
    QHBoxLayout *layout = new QHBoxLayout;
    
    if (moveEnabled) {
        QToolButton *upButton = new QToolButton(this);
        upButton->setIcon(KIcon("go-up"));
        upButton->setText(i18n("Move up"));
        upButton->setToolTip(i18n("Move up"));
    
        QToolButton *downButton = new QToolButton(this);
        downButton->setIcon(KIcon("go-down"));
        downButton->setText(i18n("Move down"));
        downButton->setToolTip(i18n("Move down"));
    
        connect(upButton, SIGNAL(clicked()), this, SLOT(upClicked()));
        connect(downButton, SIGNAL(clicked()), this, SLOT(downClicked()));
        
        layout->addWidget(upButton);
        layout->addWidget(downButton);
    
        m_upButton = upButton;
        m_downButton = downButton;
    }
    
    layout->addWidget(removeButton);
    layout->addWidget(separator);
    layout->addWidget(m_widget);
    setLayout(layout);
    
}
开发者ID:hippich,项目名称:recorditnow,代码行数:51,代码来源:listlayoutrow.cpp

示例8: createPlayWidgetActions

void MusicSystemTrayMenu::createPlayWidgetActions()
{
    m_widgetAction = new QWidgetAction(this);
    QWidget *widgetActionContainer = new QWidget(this);
    QVBoxLayout *vbox = new QVBoxLayout(widgetActionContainer);
    vbox->setMargin(0);

    QWidget *widgetContainer = new QWidget(widgetActionContainer);
    QHBoxLayout *box = new QHBoxLayout(widgetContainer);
    box->setMargin(0);

    QToolButton *previousPlay = new QToolButton(widgetContainer);
    QToolButton *nextPlay = new QToolButton(widgetContainer);
    m_PlayOrStop = new QToolButton(widgetContainer);

    previousPlay->setIcon(QIcon(QString::fromUtf8(":/contextMenu/sysprevious")));
    nextPlay->setIcon(QIcon(QString::fromUtf8(":/contextMenu/sysnext")));
    m_PlayOrStop->setIcon(QIcon(QString::fromUtf8(":/contextMenu/sysplay")));

    previousPlay->setIconSize(QSize(40, 40));
    nextPlay->setIconSize(QSize(40, 40));
    m_PlayOrStop->setIconSize(QSize(45, 45));

    previousPlay->setStyleSheet(MusicUIObject::MToolButtonStyle01);
    nextPlay->setStyleSheet(MusicUIObject::MToolButtonStyle01);
    m_PlayOrStop->setStyleSheet(MusicUIObject::MToolButtonStyle01);

    previousPlay->setCursor(QCursor(Qt::PointingHandCursor));
    nextPlay->setCursor(QCursor(Qt::PointingHandCursor));
    m_PlayOrStop->setCursor(QCursor(Qt::PointingHandCursor));

    previousPlay->setToolTip(tr("Previous"));
    nextPlay->setToolTip(tr("Next"));
    m_PlayOrStop->setToolTip(tr("Play"));

    box->addWidget(previousPlay);
    box->addWidget(m_PlayOrStop);
    box->addWidget(nextPlay);

    m_showText = new QLabel(widgetActionContainer);
    m_showText->setAlignment(Qt::AlignCenter);
    m_showText->setStyleSheet(MusicUIObject::MCustomStyle12);
    vbox->addWidget(widgetContainer);
    vbox->addWidget(m_showText);
    widgetActionContainer->setLayout(vbox);
    m_widgetAction->setDefaultWidget(widgetActionContainer);

    connect(previousPlay, SIGNAL(clicked()), parent(), SLOT(musicPlayPrevious()));
    connect(nextPlay, SIGNAL(clicked()), parent(), SLOT(musicPlayNext()));
    connect(m_PlayOrStop, SIGNAL(clicked()), parent(), SLOT(musicStatePlay()));
}
开发者ID:AndyQsmart,项目名称:TTKMusicplayer,代码行数:51,代码来源:musicsystemtraymenu.cpp

示例9: 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);
	}
开发者ID:eta-im-dev,项目名称:eta-im-snapshots,代码行数:50,代码来源:opt_plugins.cpp

示例10: _CreateToolBarPointerType

void CIndicatorEditorMainWindow::_CreateToolBarPointerType()
{
	//
	QToolButton *pToolButtonPointer = NULL;
	QToolButton *pToolButtonLinePointer = NULL;

	m_pToolBarPointer = this->addToolBar(QObject::tr("Pointer type"));

	m_pButtonGroupPointerType = new QButtonGroup(this);
	pToolButtonPointer = new QToolButton();
	pToolButtonLinePointer = new QToolButton();


	pToolButtonPointer->setCheckable(true);
	pToolButtonPointer->setChecked(true);
	pToolButtonPointer->setIcon(QIcon(":/images/pointer.png"));
	pToolButtonPointer->setToolTip(QObject::tr("SelectItem"));

	pToolButtonLinePointer->setCheckable(true);
	pToolButtonLinePointer->setIcon(QIcon(":/images/linepointer.png"));
	pToolButtonLinePointer->setToolTip(QObject::tr("InsertLine"));

	m_pButtonGroupPointerType->addButton(pToolButtonPointer, int(ActionType_MoveItem));
	m_pButtonGroupPointerType->addButton(pToolButtonLinePointer, int(ActionType_Insert_CInformationRectItemEdge));
	//connect(m_pButtonGroupPointerType, SIGNAL(buttonClicked(int)), this, SLOT(slotPointerGroupClicked(int)));//DiagramScene::Mode_MoveItem DiagramScene::Mode_InsertLine


	//connect(m_pComboBoxSceneScale, SIGNAL(currentIndexChanged(QString)), this, SLOT(sceneScaleChanged(QString)));

	QGroupBox* pGroupBoxScale = NULL;
	QVBoxLayout* pGroupLayoutScale = NULL;
	QSize nScaleSliderSize = QSize(400, 40);

	pGroupBoxScale = new QGroupBox(this);
	pGroupBoxScale->setTitle(tr("Scale"));
	m_pSliderScale = new QSlider(Qt::Horizontal, pGroupBoxScale);
	m_pSliderScale->setRange(1, 4000);
	m_pSliderScale->setValue(1000);
	//scaleSlider->setMaximumSize(nScaleSliderSize);
	//scaleSlider->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
	pGroupLayoutScale = new QVBoxLayout(pGroupBoxScale);
	pGroupLayoutScale->addWidget(m_pSliderScale);


	m_pToolBarPointer->addWidget(pToolButtonPointer);
	m_pToolBarPointer->addWidget(pToolButtonLinePointer);
	m_pToolBarPointer->addWidget(pGroupBoxScale);

}
开发者ID:shenglonglinapple,项目名称:slin_code,代码行数:49,代码来源:IndicatorEditorMainWindow.cpp

示例11: getProgram

void
MidiProgramsEditor::slotKeyMapMenuItemSelected(int i)
{
    if (!m_device)
        return ;

    const KeyMappingList &kml = m_device->getKeyMappings();
    if (kml.empty())
        return ;

    MidiProgram *program = getProgram(*getCurrentBank(), m_currentMenuProgram);
    if (!program)
        return ;

    std::string newMapping;

    if (i == 0) { // no key mapping
        newMapping = "";
    } else {
        --i;
        if (i < (int)kml.size()) {
            newMapping = kml[i].getName();
        }
    }

    m_device->setKeyMappingForProgram(*program, newMapping);
//     QString pixmapDir = KGlobal::dirs()->findResource("appdata", "pixmaps/");
    IconLoader il;
    QIcon icon;

    bool haveKeyMappings = (m_device->getKeyMappings().size() > 0);  //@@@ JAS restored from before port/
    QToolButton *btn = getKeyMapButton(m_currentMenuProgram);

    if (newMapping.empty()) {
        icon = il.load( "key-white" );
        if( ! icon.isNull() ) {
            btn->setIcon( icon );
        }
        // QToolTip::remove(btn);
        btn->setToolTip(QString(""));       //@@@ Usefull ?
    } else {
        icon = il.load( "key-green" );
        if( ! icon.isNull() ){
            btn->setIcon( icon );
        }
        btn->setToolTip(tr("Key Mapping: %1").arg(strtoqstr(newMapping)));
    }
    btn->setEnabled(haveKeyMappings);
}
开发者ID:UIKit0,项目名称:rosegarden,代码行数:49,代码来源:MidiProgramsEditor.cpp

示例12: QWidget

FilterBar::FilterBar(QWidget* parent) :
    QWidget(parent)
{
    // Create close button
    QToolButton *closeButton = new QToolButton(this);
    closeButton->setAutoRaise(true);
    closeButton->setIcon(KIcon("dialog-close"));
    closeButton->setToolTip(i18nc("@info:tooltip", "Hide Filter Bar"));
    connect(closeButton, SIGNAL(clicked()), this, SIGNAL(closeRequest()));

    // Create label
    QLabel* filterLabel = new QLabel(i18nc("@label:textbox", "Filter:"), this);

    // Create filter editor
    m_filterInput = new KLineEdit(this);
    m_filterInput->setLayoutDirection(Qt::LeftToRight);
    m_filterInput->setClearButtonShown(true);
    connect(m_filterInput, SIGNAL(textChanged(QString)),
            this, SIGNAL(filterChanged(QString)));
    setFocusProxy(m_filterInput);

    // Apply layout
    QHBoxLayout* hLayout = new QHBoxLayout(this);
    hLayout->setMargin(0);
    hLayout->addWidget(closeButton);
    hLayout->addWidget(filterLabel);
    hLayout->addWidget(m_filterInput);

    filterLabel->setBuddy(m_filterInput);
}
开发者ID:theunbelievablerepo,项目名称:dolphin2.1,代码行数:30,代码来源:filterbar.cpp

示例13: QToolButton

WNavigationTreeCaption::WNavigationTreeCaption()
	{
	QToolButton * pwButtonUndock = new QToolButton(this);
	pwButtonUndock->setToolTip("Float / Unfloat");
	#if 1
	pwButtonUndock->setStyleSheet("QToolButton { border: none; padding: 3px; }");
	#else
	pwButtonUndock->setStyleSheet("QToolButton { border: none; padding: 0px; }");
	#endif
	QPixmap oPixmap = style()->standardPixmap(QStyle::SP_TitleBarNormalButton);
	pwButtonUndock->setIcon(oPixmap);
//	pwButtonUndock->setMaximumSize(oPixmap.size());
	pwButtonUndock->setCursor(Qt::ArrowCursor);
	pwButtonUndock->setFocusPolicy(Qt::ClickFocus);

	QHBoxLayout * layout = new QHBoxLayout(this);
	layout->setMargin(0);
//	layout->setSpacing(10);
//	layout->addStretch();
	#if 0
	layout->addWidget(g_pwButtonStatusOfNavigationTree, Qt::AlignLeft | Qt::AlignHCenter);
	#endif
	layout->addWidget(g_pwButtonSwitchProfile); // , Qt::AlignLeft | Qt::AlignHCenter);
	//layout->addWidget(new QWidget);
	layout->addStretch();
	//layout->addWidget(pwButtonUndock, Qt::AlignRight | Qt::AlignHCenter);
	layout->addWidget(pwButtonUndock);
	setLayout(layout);
	connect(pwButtonUndock, SIGNAL(clicked()), g_pwNavigationTree, SLOT(SL_ToggleDocking()));
	setCursor(Qt::OpenHandCursor);		// This cursor shows to the user he/she may drag the widget to undock the Navigation Tree
	}
开发者ID:voodoo-chile,项目名称:Cambrian-src,代码行数:31,代码来源:WNavigationTree.cpp

示例14: addToolBar

void
new_mail_widget::make_toolbars()
{
  QToolBar* toolbar = addToolBar(tr("Message Operations"));
  toolbar->addAction(m_action_send_msg);
  toolbar->addAction(m_action_attach_file);
  toolbar->addAction(m_action_edit_note);
  toolbar->addAction(m_action_add_header);
  toolbar->addAction(m_action_open_notepad);

  m_toolbar_html1 = m_toolbar_html2 = NULL;

  if (m_html_edit) {
    QList<QToolBar*> toolbars = m_html_edit->create_toolbars();
    for (int i=0; i<toolbars.size(); i++) {
      if (i==0) m_toolbar_html1 = toolbars[i];
      if (i==1) {
	addToolBarBreak();
	m_toolbar_html2 = toolbars[i];
      }
      addToolBar(toolbars[i]);
    }
    // Add our own toggle button to the second HTML toolbar
    if (m_toolbar_html2 != NULL) {
      QToolButton* source = new QToolButton();
      source->setIcon(HTML_ICON("stock_view-html-source.png"));
      source->setToolTip(tr("Toggle between HTML source edit and visual edit"));
      source->setCheckable(true);
      connect(source, SIGNAL(toggled(bool)), this, SLOT(toggle_edit_source(bool)));
      m_toolbar_html2->addWidget(source);
    }
  }
开发者ID:albancrommer,项目名称:manitou-mail-ui,代码行数:32,代码来源:newmailwidget.cpp

示例15: QToolButton

	QToolButton *make_button(const QString &toolTip, const QIcon &icon, QWidget *parent) {
		QToolButton *button = new QToolButton(parent);
		button->setIcon(icon);
		button->setToolTip(toolTip);
		button->setCheckable(true);
		return button;
	}
开发者ID:akhilo,项目名称:cmplayer,代码行数:7,代码来源:widgets.cpp


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