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


C++ QAction::setWhatsThis方法代码示例

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


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

示例1: QMainWindow

MainWindow::MainWindow(QWidget *parent, const char *name, WFlags) : QMainWindow(parent, name, WStyle_ContextHelp) {
    setCaption(tr("IRC Client"));
    m_tabWidget = new IRCTabWidget(this);
    QWhatsThis::add(m_tabWidget, tr("Server connections, channels, queries and other things will be placed here"));
    connect(m_tabWidget, SIGNAL(currentChanged(QWidget*)), this, SLOT(selected(QWidget*)));
    setCentralWidget(m_tabWidget);
    setToolBarsMovable(FALSE);
    QMenuBar *menuBar = new QMenuBar(this);
    QPopupMenu *irc = new QPopupMenu(this);
    menuBar->insertItem(tr("IRC"), irc);
    QAction *a = new QAction( tr("New connection"),
                              Opie::Core::OResource::loadPixmap( "pass", Opie::Core::OResource::SmallIcon ),
                              QString::null, 0, this, 0 );
    connect(a, SIGNAL(activated()), this, SLOT(newConnection()));
    a->setWhatsThis(tr("Create a new connection to an IRC server"));
    a->addTo(irc);
    a = new QAction( tr("Settings"),
                     Opie::Core::OResource::loadPixmap( "SettingsIcon", Opie::Core::OResource::SmallIcon ),
                     QString::null, 0, this, 0 );
    a->setWhatsThis(tr("Configure OpieIRC's behavior and appearance"));
    connect(a, SIGNAL(activated()), this, SLOT(settings()));
    a->addTo(irc);
    m_dccTab = 0;
    loadSettings();
}
开发者ID:opieproject,项目名称:opie,代码行数:25,代码来源:mainwindow.cpp

示例2: setupActions

void UrlCatcher::setupActions()
{
    m_toolBar = new KToolBar(this, true, true);
    m_contextMenu = new QMenu(this);

    QAction* action;

    action = m_toolBar->addAction(QIcon::fromTheme(QStringLiteral("window-new")), i18nc("open url", "&Open"), this, SLOT(openSelectedUrls()));
    m_itemActions.append(action);
    m_contextMenu->addAction(action);
    action->setStatusTip(i18n("Open URLs in external browser."));
    action->setWhatsThis(i18n("<p>Select one or several <b>URLs</b> below, then click this button to launch the application associated with the mimetype of the URL.</p>-<p>In the <b>Settings</b>, under <b>Behavior</b> | <b>General</b>, you can specify a custom web browser for web URLs.</p>"));
    action->setEnabled(false);

    action = m_toolBar->addAction(QIcon::fromTheme(QStringLiteral("document-save")), i18n("&Save..."), this, SLOT(saveSelectedUrls()));
    m_itemActions.append(action);
    m_contextMenu->addAction(action);
    action->setStatusTip(i18n("Save selected URLs to the disk."));
    action->setEnabled(false);

    action = m_toolBar->addAction(QIcon::fromTheme(QStringLiteral("bookmark-new")), i18n("Add Bookmark..."), this, SLOT (bookmarkSelectedUrls()));
    m_itemActions.append(action);
    m_contextMenu->addAction(action);
    action->setEnabled(false);

    m_toolBar->addSeparator();
    m_contextMenu->addSeparator();

    action = m_toolBar->addAction(QIcon::fromTheme(QStringLiteral("edit-copy")), i18nc("copy url","&Copy"), this, SLOT(copySelectedUrls()));
    m_itemActions.append(action);
    m_contextMenu->addAction(action);
    action->setStatusTip(i18n("Copy URLs to the clipboard."));
    action->setWhatsThis(i18n("Select one or several <b>URLs</b> above, then click this button to copy them to the clipboard."));
    action->setEnabled(false);

    action = m_toolBar->addAction(QIcon::fromTheme(QStringLiteral("edit-delete")), i18nc("delete url","&Delete"), this, SLOT(deleteSelectedUrls()));
    m_itemActions.append(action);
    m_contextMenu->addAction(action);
    action->setWhatsThis(i18n("Select one or several <b>URLs</b> above, then click this button to delete them from the list."));
    action->setStatusTip(i18n("Delete selected link."));
    action->setEnabled(false);

    m_toolBar->addSeparator();
    m_contextMenu->addSeparator();

    action = m_toolBar->addAction(QIcon::fromTheme(QStringLiteral("document-save")), i18nc("save url list", "&Save List..."), this, SLOT(saveUrlModel()));
    m_listActions.append(action);
    action->setStatusTip(i18n("Save list."));
    action->setWhatsThis(i18n("Click to save the entire list to a file."));
    action->setEnabled(false);

    action = m_toolBar->addAction(QIcon::fromTheme(QStringLiteral("edit-clear-list")), i18nc("clear url list","&Clear List"), this, SLOT(clearUrlModel()));
    m_listActions.append(action);
    action->setStatusTip(i18n("Clear list."));
    action->setWhatsThis(i18n("Click to erase the entire list."));
    action->setEnabled(false);

    updateListActionStates();
}
开发者ID:KDE,项目名称:konversation,代码行数:59,代码来源:urlcatcher.cpp

示例3: KexiView

KexiReportView::KexiReportView(QWidget *parent)
        : KexiView(parent)
{
    m_preRenderer = 0;
    setObjectName("KexiReportDesigner_DataView");
    m_scrollArea = new QScrollArea(this);
    m_scrollArea->setBackgroundRole(QPalette::Dark);
    m_scrollArea->viewport()->setAutoFillBackground(true);

    m_pageSelector = new KexiRecordNavigator(this, 0);
    layout()->addWidget(m_scrollArea);
    layout()->addWidget(m_pageSelector);

    m_pageSelector->setRecordCount(0);
    m_pageSelector->setInsertingButtonVisible(false);
    m_pageSelector->setLabelText(i18n("Page"));


    // -- setup local actions
    QList<QAction*> viewActions;
    QAction* a;
    viewActions << (a = new KAction(KIcon("printer"), i18n("Print"), this));
    a->setObjectName("pgzkexirpt_print_report");
    a->setToolTip(i18n("Print Report"));
    a->setWhatsThis(i18n("Prints the current report."));
    connect(a, SIGNAL(triggered()), this, SLOT(slotPrintReport()));

    viewActions << (a = new KAction(KIcon("kword"), i18n("Open in KWord"), this));
    a->setObjectName("pgzkexirpt_open_kword");
    a->setToolTip(i18n("Open the report in KWord"));
    a->setWhatsThis(i18n("Opens the current report in KWord."));
    a->setEnabled(false);
//! @todo connect(a, SIGNAL(triggered()), this, SLOT(slotRenderKWord()));

#ifdef HAVE_KSPREAD
    viewActions << (a = new KAction(KIcon("kspread"), i18n("Open in KSpread"), this));
    a->setObjectName("pgzkexirpt_open_kspread");
    a->setToolTip(i18n("Open the report in KSpread"));
    a->setWhatsThis(i18n("Opens the current report in KSpread."));
    a->setEnabled(true);
    connect(a, SIGNAL(triggered()), this, SLOT(slotRenderKSpread()));
#endif

    viewActions << (a = new KAction(KIcon("text-html"), i18n("Export to HTML"), this));
    a->setObjectName("pgzkexirpt_export_html");
    a->setToolTip(i18n("Export the report to HTML"));
    a->setWhatsThis(i18n("Exports the report to a HTML file."));
    a->setEnabled(true);
    connect(a, SIGNAL(triggered()), this, SLOT(slotExportHTML()));

    setViewActions(viewActions);


    connect(m_pageSelector, SIGNAL(nextButtonClicked()), this, SLOT(nextPage()));
    connect(m_pageSelector, SIGNAL(prevButtonClicked()), this, SLOT(prevPage()));
    connect(m_pageSelector, SIGNAL(firstButtonClicked()), this, SLOT(firstPage()));
    connect(m_pageSelector, SIGNAL(lastButtonClicked()), this, SLOT(lastPage()));

}
开发者ID:JeremiasE,项目名称:KFormula,代码行数:59,代码来源:kexireportview.cpp

示例4: KexiView

KexiReportView::KexiReportView(QWidget *parent)
        : KexiView(parent), m_preRenderer(0), m_reportDocument(0), m_kexi(0), m_functions(0)
{   
    setObjectName("KexiReportDesigner_DataView");
    m_scrollArea = new QScrollArea(this);
    m_scrollArea->setBackgroundRole(QPalette::Dark);
    m_scrollArea->viewport()->setAutoFillBackground(true);

    layout()->addWidget(m_scrollArea);
    
#ifndef KEXI_MOBILE
    m_pageSelector = new KexiRecordNavigator(this, 0);
    layout()->addWidget(m_pageSelector);
    m_pageSelector->setRecordCount(0);
    m_pageSelector->setInsertingButtonVisible(false);
    m_pageSelector->setLabelText(i18n("Page"));
#endif
    
    // -- setup local actions
    QList<QAction*> viewActions;
    QAction* a;
    viewActions << (a = new KAction(KIcon("printer"), i18n("Print"), this));
    a->setObjectName("print_report");
    a->setToolTip(i18n("Print Report"));
    a->setWhatsThis(i18n("Prints the current report."));
    connect(a, SIGNAL(triggered()), this, SLOT(slotPrintReport()));

    viewActions << (a = new KAction(KIcon("kword"), i18n("Save to KWord"), this));
    a->setObjectName("save_to_kword");
    a->setToolTip(i18n("Save the report to a KWord document"));
    a->setWhatsThis(i18n("Save the report to a KWord document"));
    a->setEnabled(true);
    connect(a, SIGNAL(triggered()), this, SLOT(slotRenderODT()));

    viewActions << (a = new KAction(KIcon("kspread"), i18n("Save to KSpread"), this));
    a->setObjectName("save_to_kspread");
    a->setToolTip(i18n("Save the report to a KSpread document"));
    a->setWhatsThis(i18n("Saves the current report to a KSpread document."));
    a->setEnabled(true);
    connect(a, SIGNAL(triggered()), this, SLOT(slotRenderKSpread()));

    viewActions << (a = new KAction(KIcon("text-html"), i18n("Export as Web Page"), this));
    a->setObjectName("export_as_web_page");
    a->setToolTip(i18n("Export the report as web page"));
    a->setWhatsThis(i18n("Exports the report to a web page file."));
    a->setEnabled(true);
    connect(a, SIGNAL(triggered()), this, SLOT(slotExportHTML()));

    setViewActions(viewActions);

#ifndef KEXI_MOBILE
    connect(m_pageSelector, SIGNAL(nextButtonClicked()), this, SLOT(nextPage()));
    connect(m_pageSelector, SIGNAL(prevButtonClicked()), this, SLOT(prevPage()));
    connect(m_pageSelector, SIGNAL(firstButtonClicked()), this, SLOT(firstPage()));
    connect(m_pageSelector, SIGNAL(lastButtonClicked()), this, SLOT(lastPage()));
#endif
}
开发者ID:KDE,项目名称:calligra-history,代码行数:57,代码来源:kexireportview.cpp

示例5: setupActions

void KWrite::setupActions()
{
    m_closeAction = actionCollection()->addAction(KStandardAction::Close, QStringLiteral("file_close"), this, SLOT(slotFlush()));
    m_closeAction->setWhatsThis(i18n("Use this command to close the current document"));
    m_closeAction->setDisabled(true);

    // setup File menu
    actionCollection()->addAction(KStandardAction::New, QStringLiteral("file_new"), this, SLOT(slotNew()))
    ->setWhatsThis(i18n("Use this command to create a new document"));
    actionCollection()->addAction(KStandardAction::Open, QStringLiteral("file_open"), this, SLOT(slotOpen()))
    ->setWhatsThis(i18n("Use this command to open an existing document for editing"));

    m_recentFiles = KStandardAction::openRecent(this, SLOT(slotOpen(QUrl)), this);
    actionCollection()->addAction(m_recentFiles->objectName(), m_recentFiles);
    m_recentFiles->setWhatsThis(i18n("This lists files which you have opened recently, and allows you to easily open them again."));

    QAction *a = actionCollection()->addAction(QStringLiteral("view_new_view"));
    a->setIcon(QIcon::fromTheme(QStringLiteral("window-new")));
    a->setText(i18n("&New Window"));
    connect(a, SIGNAL(triggered()), this, SLOT(newView()));
    a->setWhatsThis(i18n("Create another view containing the current document"));

    actionCollection()->addAction(KStandardAction::Quit, this, SLOT(close()))
    ->setWhatsThis(i18n("Close the current document view"));

    // setup Settings menu
    setStandardToolBarMenuEnabled(true);

    m_paShowMenuBar = KStandardAction::showMenubar(this, SLOT(toggleMenuBar()), actionCollection());

    m_paShowStatusBar = KStandardAction::showStatusbar(this, SLOT(toggleStatusBar()), this);
    actionCollection()->addAction(m_paShowStatusBar->objectName(), m_paShowStatusBar);
    m_paShowStatusBar->setWhatsThis(i18n("Use this command to show or hide the view's statusbar"));

    m_paShowPath = new KToggleAction(i18n("Sho&w Path in Titlebar"), this);
    actionCollection()->addAction(QStringLiteral("set_showPath"), m_paShowPath);
    connect(m_paShowPath, SIGNAL(triggered()), this, SLOT(documentNameChanged()));
    m_paShowPath->setWhatsThis(i18n("Show the complete document path in the window caption"));

    a = actionCollection()->addAction(KStandardAction::KeyBindings, this, SLOT(editKeys()));
    a->setWhatsThis(i18n("Configure the application's keyboard shortcut assignments."));

    a = actionCollection()->addAction(KStandardAction::ConfigureToolbars, QStringLiteral("options_configure_toolbars"),
                                      this, SLOT(editToolbars()));
    a->setWhatsThis(i18n("Configure which items should appear in the toolbar(s)."));

    a = actionCollection()->addAction(QStringLiteral("help_about_editor"));
    a->setText(i18n("&About Editor Component"));
    connect(a, SIGNAL(triggered()), this, SLOT(aboutEditor()));
}
开发者ID:cmacq2,项目名称:kate,代码行数:50,代码来源:kwrite.cpp

示例6: createAction

void CSVImportExportPluginInterface::createAction(KActionCollection *ac)
{
    QAction *action = ac->addAction(QStringLiteral("file_export_csv"));
    action->setText(i18n("Export CSV file..."));
    action->setWhatsThis(i18n("Export contacts to a file in comma separated value format."));
    setExportActions(QList<QAction *>() << action);
    connect(action, &QAction::triggered, this, &CSVImportExportPluginInterface::slotExportCVS);

    action = ac->addAction(QStringLiteral("file_import_csv"));
    action->setText(i18n("Import CSV file..."));
    action->setWhatsThis(i18n("Import contacts from a file in comma separated value format."));
    setImportActions(QList<QAction *>() << action);
    connect(action, &QAction::triggered, this, &CSVImportExportPluginInterface::slotImportCVS);
}
开发者ID:KDE,项目名称:kdepim-addons,代码行数:14,代码来源:csvimportexportplugininterface.cpp

示例7: entryPoint

int entryPoint ( BlMainWindow *bges )
{
    BL_FUNC_DEBUG

    /// Inicializa el sistema de traducciones 'gettext'.
    setlocale ( LC_ALL, "" );
    blBindTextDomain ( "pluginbl_importcsv", g_confpr->value( CONF_DIR_TRADUCCION ).toLatin1().constData() );

    g_pluginbl_importcsv = bges;

    PluginBl_ImportCSV *mcont = new PluginBl_ImportCSV;

    /// Creamos el men&uacute;.
    QAction *accion = new QAction ( _ ( "&Importacion CSV" ), 0 );
    accion->setStatusTip ( _ ( "Importacion CSV" ) );
    accion->setWhatsThis ( _ ( "Importacion CSV" ) );
    accion->setIcon ( QIcon ( QString::fromUtf8 ( ":/Images/document-import.png" ) ) );
	
    mcont->connect ( accion, SIGNAL ( activated() ), mcont, SLOT ( elslot() ) );
    
    /// Miramos si existe un menu Herramientas
    QMenu *pPluginMenu = bges->newMenu ( _("&Herramientas"), "menuHerramientas", "menuAcerca_de" );

    pPluginMenu->addSeparator();
    pPluginMenu->addAction ( accion );


    
    return 0;
}
开发者ID:JustDevZero,项目名称:bulmages,代码行数:30,代码来源:pluginbl_importcsv.cpp

示例8: setupFileMenu

///////////////////////////////////////////////////////////
//                                                       //
// File Menu                                             //
//                                                       //
///////////////////////////////////////////////////////////
void WinImage::setupFileMenu()
{
  // Actions
  QAction* open = new QAction( "&Open", this );
  open->setShortcut( Qt::CTRL + Qt::Key_O );
  open->setStatusTip( "This will open a file");
  connect( open, SIGNAL( triggered() ), this, SLOT( slotOpen() ) );

  //QAction* save = new QAction( "&Save", this );
  //connect( save, SIGNAL( triggered() ), this, SLOT( save() ) );

  QAction* saveAs = new QAction( "Save &As", this );
  saveAs->setShortcut( Qt::CTRL + Qt::Key_A );
  connect( saveAs, SIGNAL( triggered() ), this, SLOT( slotSaveAs() ) );

  QAction* quit = new QAction( "&Quit", this );
  quit->setShortcut( Qt::CTRL + Qt::Key_Q );
  quit->setStatusTip("This will quit the application unconditionally");
  quit->setWhatsThis("This is a button, stupid!");
  connect( quit, SIGNAL( triggered() ), qApp, SLOT( quit() ) );

  // Menubarvoid Test::paintEvent( QPaintEvent* )

  QMenu* file = new QMenu( "&File", menuBar());
  menuBar()->addMenu( file);
  file->addAction( open);
  //file->addAction( save);
  file->addAction( saveAs);
  file->addAction( quit);
}
开发者ID:chenx77,项目名称:MyCodeLab,代码行数:35,代码来源:winimage.cpp

示例9: QDialog

ThemeDialog::ThemeDialog(QWidget *parent, LPlugins *plugs, QString themeFilePath) : QDialog(parent), ui(new Ui::ThemeDialog){
  ui->setupUi(this); //load the designer file
  filepath = themeFilePath;
  this->setWindowIcon( LXDG::findIcon("preferences-desktop-theme","") );
  ui->line_name->setText( themeFilePath.section("/",-1).section(".qss",0,0) );
  //Load the icons for the window
  ui->push_cancel->setIcon( LXDG::findIcon("dialog-cancel","") );
  ui->push_save->setIcon( LXDG::findIcon("document-save","") );
  ui->push_apply->setIcon( LXDG::findIcon("dialog-ok","") );
  ui->tool_color->setIcon( LXDG::findIcon("color-picker","") );
  //Now create entries for the available colors in the database
  QStringList colors = plugs->colorItems();
  colors.sort();
  colormenu = new QMenu(this);
  for(int i=0; i<colors.length(); i++){
    LPI info = plugs->colorInfo(colors[i]);
    QAction *act = new QAction(info.name, this);
	act->setWhatsThis("%%"+info.ID+"%%");
	act->setToolTip(info.description);
    colormenu->addAction(act);
  }
  ui->tool_color->setMenu(colormenu);
  //Now load the given file
  loadTheme();
  connect(colormenu, SIGNAL(triggered(QAction*)),this, SLOT(menuTriggered(QAction*)) );
  connect(ui->text_file, SIGNAL(textChanged()), this, SLOT(themeChanged()) );
  
  //Now center the window on the parent
  QPoint cen = parent->geometry().center();
  this->move( cen.x() - (this->width()/2) , cen.y() - (this->height()/2) );
}
开发者ID:Nanolx,项目名称:lumina,代码行数:31,代码来源:ThemeDialog.cpp

示例10: home

QMenu *
ViewLightGL::createToolsMenu(QWidget * parent)
{
	QMenu * menu = new QMenu(parent);
    QPixmap home(ViewerIcon::getPixmap(ViewerIcon::home));
    QPixmap _light(ViewerIcon::getPixmap(ViewerIcon::light));
	menu->addAction(home,tr("&Home"),this,SLOT(home()),Qt::CTRL+Qt::SHIFT+Qt::Key_H);
    menu->addAction(tr("on X axis"),this,SLOT(XAxis()),Qt::CTRL+Qt::SHIFT+Qt::Key_X);
    menu->addAction(tr("on Y axis"),this,SLOT(YAxis()),Qt::CTRL+Qt::SHIFT+Qt::Key_Y);
    menu->addAction(tr("on Z axis"),this,SLOT(ZAxis()),Qt::CTRL+Qt::SHIFT+Qt::Key_Z);
    menu->addSeparator();
    QAction * idVisibility = menu->addAction(_light,tr("Visible"),this,SLOT(changeVisibility()),Qt::CTRL+Qt::SHIFT+Qt::Key_S);
    idVisibility->setCheckable( TRUE );
    idVisibility->setChecked( isVisible() );
    QObject::connect(this,SIGNAL(visibilityChanged( bool)),idVisibility,SLOT(setChecked(bool)));
    menu->addSeparator();
    QAction * idLight = menu->addAction(_light,     tr("&Enabled"),     this, SLOT(toggleEnabled()));
	idLight->setCheckable(true);
	idLight->setChecked(isEnabled());
    idLight->setWhatsThis(tr("<b>Light Rendering</b><br><br>"
	"Set <b>Light Rendering</b> enable/disable.<br><br>"
	"The Rendering will (not) take into account ligth source.<br><br>"
	"You can also use Menu <br><b>Tools > Renderer > Light</b><br>"));
	return menu;
}
开发者ID:kkremitzki,项目名称:plantgl,代码行数:25,代码来源:light.cpp

示例11: setupActions

void QuantaProjectPart::setupActions()
{
  // create XMLGUI actions here
  QAction *action;
  action = actionCollection()->addAction("insert_files");
  action->setText(i18n("&Insert Files...")); 
  connect(action, SIGNAL(triggered(bool)), SLOT(slotInsertFiles()));
  action->setToolTip( i18n( "Insert Files" ) );
  action->setWhatsThis( i18n( "Insert Files - Insert new files into the project." ) );

  action =  actionCollection()->addAction("insert_folder");
  action->setText(i18n("&Insert Folder..."));
  connect(action, SIGNAL(triggered(bool)), SLOT(slotInsertFolder()));
  action->setToolTip( i18n( "Insert Folder" ) );
  action->setWhatsThis( i18n( "Insert Folder - Insert a new folder into the project." ) );
}
开发者ID:KDE,项目名称:quanta,代码行数:16,代码来源:quantaprojectpart.cpp

示例12: QVBoxLayout

PopupButton::PopupButton(QWidget* parent)
{
	//	this->setFrameStyle(QFrame::Box);

	QVBoxLayout* layout = new QVBoxLayout(this);
	layout->setMargin(0);
	this->setLayout(layout);

	//	QToolButton* expandButton = new QToolButton(this);
	QToolButton* expandButton = new CXSmallToolButton(this);
	mShowHeaderButton = expandButton;
	this->setFixedSize(expandButton->sizeHint());

	QAction* action = new QAction(QIcon(":icons/open_icon_library/layer-lower-3.png"), "Controls", this);
	QString tip = "Show Controls";
	action->setStatusTip(tip);
	action->setWhatsThis(tip);
	action->setToolTip(tip);
	connect(action, SIGNAL(triggered()), this, SLOT(onTriggered()));
	mAction = action;

	mShowHeaderButton->setDefaultAction(action);
	layout->addWidget(mShowHeaderButton);

	action->setCheckable(true);
}
开发者ID:c0ns0le,项目名称:CustusX,代码行数:26,代码来源:cxPopupToolbarWidget.cpp

示例13: updateAppList

//===========
//  PRIVATE
//===========
void AppMenu::updateAppList(){
  this->clear();
  APPS.clear();
  APPS = LXDG::sortDesktopCats( LXDG::systemDesktopFiles() );
  //Now fill the menu
  bool ok; //for checking inputs
    //--Look for the app store
    XDGDesktop store = LXDG::loadDesktopFile(appstorelink, ok);
    if(ok){ 
      this->addAction( LXDG::findIcon(store.icon, ""), tr("Get Applications"), this, SLOT(launchStore()) );
      this->addSeparator(); 
    }
    //--Now create the sub-menus
    QStringList cats = APPS.keys();
    cats.sort(); //make sure they are alphabetical
    for(int i=0; i<cats.length(); i++){
      //QString cat, icon;
      //if(cats[i] == ""){ name = tr(""); icon = ""; }
      QMenu *menu = new QMenu(cats[i], this);
      connect(menu, SIGNAL(triggered(QAction*)), this, SLOT(launchApp(QAction*)) );
      QList<XDGDesktop> appL = APPS.value(cats[i]);
      for( int a=0; a<appL.length(); a++){
        QAction *act = new QAction(LXDG::findIcon(appL[a].icon, ""), appL[a].name, this);
        act->setToolTip(appL[a].comment);
        act->setWhatsThis(appL[a].filePath);
        menu->addAction(act);
      }
      this->addMenu(menu);
    }
}
开发者ID:TetragrammatonHermit,项目名称:external-projects,代码行数:33,代码来源:AppMenu.cpp

示例14: WindowAction

Action * StdCmdWindowsMenu::createAction(void)
{
    // Allow to show 10 menu items in the 'Window' menu and one separator.
    // If we have more windows then the user can use the 'Windows...' item.
    WindowAction *pcAction;
    pcAction = new WindowAction(this, getMainWindow());
    for ( int i=0; i<10; i++ ) {
        QAction* window = pcAction->addAction(QObject::tr(sToolTipText));
        window->setCheckable(true);
        window->setToolTip(QCoreApplication::translate(
            this->className(), sToolTipText, 0,
            QCoreApplication::CodecForTr));
        window->setStatusTip(QCoreApplication::translate(
            this->className(), sStatusTip, 0,
            QCoreApplication::CodecForTr));
        window->setWhatsThis(QCoreApplication::translate(
            this->className(), sWhatsThis, 0,
            QCoreApplication::CodecForTr));
    }

    QAction* sep = pcAction->addAction(QLatin1String(""));
    sep->setSeparator(true);

    return pcAction;
}
开发者ID:mvancompernolle,项目名称:ai_project,代码行数:25,代码来源:CommandWindow.cpp

示例15: RebuildBookmarksMenu

void MainUI::RebuildBookmarksMenu(){
  //Create the bookmarks menu
  ui->menuBookmarks->clear();
    ui->menuBookmarks->addAction(ui->actionManage_Bookmarks);
    ui->menuBookmarks->addSeparator();
  QStringList BM = settings->value("bookmarks", QStringList()).toStringList();
  ui->menuBookmarks->clear();
    ui->menuBookmarks->addAction(ui->actionManage_Bookmarks);
    ui->menuBookmarks->addSeparator();
  bool changed = false;
  BM.sort(); //Sort alphabetically
  for(int i=0; i<BM.length(); i++){
    if(QFile::exists(BM[i].section("::::",1,1)) ){
      QAction *act = new QAction(BM[i].section("::::",0,0),this);
        act->setWhatsThis(BM[i].section("::::",1,1));
      ui->menuBookmarks->addAction(act);
    }else{
      //Invalid directory - remove the bookmark
      BM.removeAt(i);
      i--;
      changed = true;
    }
  }
  if(changed){ settings->setValue("bookmarks",BM); }
  ui->actionManage_Bookmarks->setEnabled(BM.length()>0);
}
开发者ID:draringi,项目名称:lumina,代码行数:26,代码来源:MainUI.cpp


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