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


C++ setupActions函数代码示例

本文整理汇总了C++中setupActions函数的典型用法代码示例。如果您正苦于以下问题:C++ setupActions函数的具体用法?C++ setupActions怎么用?C++ setupActions使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: QSplitter

KateViewManager::KateViewManager (QWidget *parentW, KateMainWindow *parent)
    : QSplitter  (parentW)
    , m_mainWindow(parent)
    , m_blockViewCreationAndActivation (false)
    , m_activeViewRunning (false)
{
  // while init
  m_init = true;

  // important, set them up, as we use them in other methodes
  setupActions ();

  guiMergedView = 0;

  // resize mode
  setOpaqueResize( KGlobalSettings::opaqueResize() );

  KateViewSpace* vs = new KateViewSpace( this, 0 );
  addWidget (vs);

  vs->setActive( true );
  m_viewSpaceList.append(vs);

  connect( this, SIGNAL(viewChanged()), this, SLOT(slotViewChanged()) );
  connect(KateDocManager::self(), SIGNAL(initialDocumentReplaced()), this, SIGNAL(viewChanged()));

  connect(KateDocManager::self(), SIGNAL(documentCreated(KTextEditor::Document *)), this, SLOT(documentCreated(KTextEditor::Document *)));
  connect(KateDocManager::self(), SIGNAL(documentDeleted(KTextEditor::Document *)), this, SLOT(documentDeleted(KTextEditor::Document *)));

  // init done
  m_init = false;
}
开发者ID:rtaycher,项目名称:kate,代码行数:32,代码来源:kateviewmanager.cpp

示例2: QMainWindow

TimerWindow::TimerWindow(QWidget *parent) : QMainWindow(parent) {
    qDebug("TimerWindow::TimerWindow");

    setAllowClose( false );

    setupUi(this);

    libkiIcon = QIcon(":images/libki_clock.png");

    this->setWindowIcon(libkiIcon);

    setFixedSize(width(), height()); // Prevent the window from being resized
    setWindowFlags( (windowFlags() | Qt::CustomizeWindowHint) & ~Qt::WindowMaximizeButtonHint); // Remove the maximize window button
    setWindowFlags( (windowFlags() | Qt::CustomizeWindowHint) & ~Qt::WindowSystemMenuHint); // Remove the close window button

    setupActions();
    setupTrayIcon();

    trayIconPopupTimer = new QTimer(this);
    connect(trayIconPopupTimer, SIGNAL(timeout()), this, SLOT(showSystemTrayIconTimeLeftMessage()) );


    // Disable unused features
    pauseButton->hide();

    this->move(QApplication::desktop()->screen()->rect().center()-this->rect().center());

    this->hide();
}
开发者ID:Libki,项目名称:libki-client,代码行数:29,代码来源:timerwindow.cpp

示例3: QTreeWidget

akuTreeWidget::akuTreeWidget(QWidget *parent) : QTreeWidget(parent)
{
  setDragEnabled(false);
  setDragDropOverwriteMode(false);
  setDragDropMode(QAbstractItemView::NoDragDrop);
  setAlternatingRowColors(true);
  setSelectionMode(QAbstractItemView::ExtendedSelection);
  setAutoExpandDelay(-1);
  setRootIsDecorated(true);
  setUniformRowHeights(false);
  setSortingEnabled(true);
  setAnimated(true);
  setAllColumnsShowFocus(true);
  headerItem()->setText(0, i18n("File Name", 0));
  headerItem()->setText(1, i18n("Size", 0));
  headerItem()->setText(2, i18n("Packed Size", 0));
  headerItem()->setText(3, i18n("Ratio", 0));
  headerItem()->setText(4, i18n("Modified", 0));
  headerItem()->setText(5, i18n("Attributes", 0));
  headerItem()->setText(6, i18n("CRC", 0));
  headerItem()->setText(7, i18n("Method", 0));
  headerItem()->setText(8, i18n("Version", 0));
  headerItem()->setText(9, i18n("MIME Type", 0));
  headerItem()->setText(10,"");
  headerItem()->setIcon(10,KIcon("document-properties"));
  headerItem()->setToolTip(10, i18n("Status: a key is shown if the file is crypted"));
  header() -> moveSection(10,0);
  header() -> setResizeMode(10,QHeaderView::ResizeToContents);
  header() -> setResizeMode(4,QHeaderView::ResizeToContents);
  setupActions();
}
开发者ID:alediaferia,项目名称:aku,代码行数:31,代码来源:akutreewidget.cpp

示例4: Plugin

 SyndicationPlugin::SyndicationPlugin(QObject* parent, const QStringList& args): Plugin(parent), add_feed(0)
 {
     Q_UNUSED(args);
     setupActions();
     //  setXMLFile("ktsyndicationpluginui.rc");
     LogSystemManager::instance().registerSystem(i18n("Syndication"), SYS_SYN);
 }
开发者ID:dreamsxin,项目名称:ktorrent,代码行数:7,代码来源:syndicationplugin.cpp

示例5: QWidget

Player::Player(  QWidget * parent, Qt::WindowFlags f)
    : QWidget(parent, f)
{
    m_current =NULL;
    last=NULL;

#ifdef REPEAT
    m_repeatCheck = false;
#endif
    m_mediaPlayer = new QMediaPlayer();
    connect(m_mediaPlayer,SIGNAL(stateChanged(QMediaPlayer::State)),this,SLOT(playerStatusChanged(QMediaPlayer::State)));
    connect(m_mediaPlayer,SIGNAL(mediaStatusChanged(QMediaPlayer::MediaStatus)),this,SLOT(statusChanged(QMediaPlayer::MediaStatus)));

    connect(m_mediaPlayer,SIGNAL(currentMediaChanged(QMediaContent)),this,SLOT(sourceChanged(QMediaContent)));
    mypreference = Preference_data::getInstance();
    myPlaylist = Playlist::getInstance();
    m_listposition = -1;
    position = 0;
    selectedReadMode = mypreference->getSelectedReadMode();

    setupActions();

    //readSettings();
    setupUi();
    m_seekSlider->setMaximum(0);

}
开发者ID:obiwankennedy,项目名称:audioPlayer,代码行数:27,代码来源:player.cpp

示例6: TorrentActivityInterface

    TorrentActivity::TorrentActivity(Core* core, GUI* gui, QWidget* parent)
        : TorrentActivityInterface(i18n("Torrents"), QStringLiteral("ktorrent"), parent),
          core(core),
          gui(gui)
    {
        setXMLGUIFile(QStringLiteral("kttorrentactivityui.rc"));
        QWidget* view_part = new QWidget(this);
        view = new View(core, gui, view_part);
        connect(view, &View::currentTorrentChanged, this, &TorrentActivity::currentTorrentChanged);
        search_bar = new TorrentSearchBar(view, view_part);
        search_bar->setHidden(true);

        QVBoxLayout* layout = new QVBoxLayout(this);
        layout->setSpacing(0);
        layout->setMargin(0);
        vsplit = new QSplitter(Qt::Vertical, this);
        layout->addWidget(vsplit);
        hsplit = new QSplitter(Qt::Horizontal, vsplit);

        group_switcher = new GroupSwitcher(view, core->getGroupManager(), this);
        connect(core->getQueueManager(), SIGNAL(queueOrdered()), this, SLOT(queueOrdered()));

        QVBoxLayout* vlayout = new QVBoxLayout(view_part);
        vlayout->setSpacing(0);
        vlayout->setMargin(0);
        vlayout->addWidget(group_switcher);
        vlayout->addWidget(search_bar);
        vlayout->addWidget(view);

        group_view = new GroupView(core->getGroupManager(), view, core, gui, hsplit);
        group_view->setupActions(part()->actionCollection());
        connect(group_view, &GroupView::currentGroupChanged, group_switcher, &GroupSwitcher::currentGroupChanged);
        connect(group_view, &GroupView::openTab, group_switcher, &GroupSwitcher::addTab);

        setupActions();

        hsplit->addWidget(group_view);
        hsplit->addWidget(view_part);
        hsplit->setStretchFactor(0, 1);
        hsplit->setStretchFactor(1, 3);
        vsplit->addWidget(hsplit);
        tool_views = new TabBarWidget(vsplit, this);
        vsplit->setStretchFactor(0, 3);
        vsplit->setStretchFactor(1, 1);
        layout->addWidget(tool_views);

        qm = new QueueManagerWidget(core->getQueueManager(), this);
        connect(core, &Core::torrentAdded, qm, &QueueManagerWidget::onTorrentAdded);
        connect(core, &Core::torrentRemoved, qm, &QueueManagerWidget::onTorrentRemoved);
        tool_views->addTab(qm, i18n("Queue Manager"), QStringLiteral("kt-queue-manager"), i18n("Widget to manage the torrent queue"));

        magnet_view = new MagnetView(core->getMagnetManager(), this);
        tool_views->addTab(magnet_view, i18n("Magnet Downloader"), QStringLiteral("kt-magnet"),
                           i18n("Displays the currently downloading magnet links"));

        QueueManager* qman = core->getQueueManager();
        connect(qman, &QueueManager::suspendStateChanged, this, &TorrentActivity::onSuspendedStateChanged);

        queue_suspend_action->setChecked(core->getSuspendedState());
    }
开发者ID:biwin,项目名称:ktorrent,代码行数:60,代码来源:torrentactivity.cpp

示例7: QObject

DiscoverMainWindow::DiscoverMainWindow(CompactMode mode)
    : QObject()
    , m_collection(this)
    , m_engine(new QQmlApplicationEngine)
    , m_mode(mode)
{
    ResourcesModel *m = ResourcesModel::global();
    m->integrateActions(actionCollection());

    setObjectName(QStringLiteral("DiscoverMain"));
    KDeclarative::KDeclarative kdeclarative;
    kdeclarative.setDeclarativeEngine(m_engine);
    kdeclarative.setupBindings();
    
    qmlRegisterType<UnityLauncher>("org.kde.discover.app", 1, 0, "UnityLauncher");
    qmlRegisterType<PaginateModel>("org.kde.discover.app", 1, 0, "PaginateModel");
    qmlRegisterType<IconColors>("org.kde.discover.app", 1, 0, "IconColors");
    qmlRegisterType<KConcatenateRowsProxyModel>("org.kde.discover.app", 1, 0, "KConcatenateRowsProxyModel");

    qmlRegisterSingletonType<SystemFonts>("org.kde.discover.app", 1, 0, "SystemFonts", ([](QQmlEngine*, QJSEngine*) -> QObject* { return new SystemFonts; }));
    qmlRegisterSingletonType(QUrl(QStringLiteral("qrc:/qml/DiscoverSystemPalette.qml")), "org.kde.discover.app", 1, 0, "DiscoverSystemPalette");
    qmlRegisterSingletonType(QUrl(QStringLiteral("qrc:/qml/Helpers.qml")), "org.kde.discover.app", 1, 0, "Helpers");
    qmlRegisterType<QQuickView>();
    qmlRegisterType<QActionGroup>();
    qmlRegisterType<QAction>();
    qmlRegisterUncreatableType<DiscoverMainWindow>("org.kde.discover.app", 1, 0, "DiscoverMainWindow", QStringLiteral("don't do that"));
    setupActions();
    
    //Here we set up a cache for the screenshots
    m_engine->rootContext()->setContextProperty(QStringLiteral("app"), this);

    connect(m_engine, &QQmlApplicationEngine::objectCreated, this, &DiscoverMainWindow::integrateObject);
    m_engine->load(QUrl(QStringLiteral("qrc:/qml/DiscoverWindow.qml")));
}
开发者ID:KDE,项目名称:discover,代码行数:34,代码来源:DiscoverMainWindow.cpp

示例8: QMainWindow

ClintWindow::ClintWindow(QWidget *parent) :
  QMainWindow(parent) {

  QString filename;
  QStringList args = qApp->arguments();
  for (int i = 0; i < args.size(); i++) {
    if (!args[i].startsWith("--") && !args[i].endsWith("clint")) {
      if (filename.length() != 0) {
        QMessageBox::warning(this, "Multiple files to open", "Extra file to open is ignored", QMessageBox::Ok, QMessageBox::Ok);
        continue;
      }
      filename = args[i];
    }
  }

  QFont monospacefont("PT Mono");
  m_scriptEditor = new QTextEdit;
  m_codeEditor = new QTextEdit;
  m_codeEditor->setFont(monospacefont);
  m_scriptEditor->setFont(monospacefont);

  m_reparseCodeButton = new QPushButton("<");
  m_reparseScriptButton = new QPushButton("<");
  connect(m_reparseCodeButton, &QPushButton::clicked, this, &ClintWindow::reparseCode);
  connect(m_reparseScriptButton, &QPushButton::clicked, this, &ClintWindow::reparseScript);

  setWindowTitle("Clint: Chunky Loop INTerface");
  setupActions();
  setupMenus();
  if (filename.length() != 0) {
    openFileByName(filename);
  }
}
开发者ID:ftynse,项目名称:clint,代码行数:33,代码来源:clintwindow.cpp

示例9: KXmlGuiWindow

KTutorialEditor::KTutorialEditor(): KXmlGuiWindow(0),
    mTutorial(0) {

    mTreeView = new AutoExpandableTreeView();
    mTreeView->setObjectName("centralTreeView");
    mTreeView->setWordWrap(true);
    setCentralWidget(mTreeView);

    setupDocks();

    setupActions();

    connect(mEditActions, SIGNAL(cleanChanged(bool)),
            this, SIGNAL(cleanChanged(bool)));
    connect(this, SIGNAL(cleanChanged(bool)),
            this, SLOT(handleUndoStackCleanChanged(bool)));

    //The actions can not be added in setupDocks because setupActions() needs
    //the docks to be created (to get their toggleAction), so it can be called
    //before setupDocks().
    setupActionListWidgets();

    mFileActions->newTutorial();

    ktutorial::KTutorial::self()->setup(this);

    setupGUI();
}
开发者ID:KDE,项目名称:ktutorial,代码行数:28,代码来源:KTutorialEditor.cpp

示例10: QSortFilterProxyModel

UProcessView::UProcessView(QWidget *parent /*= 0*/)
:QTableView(parent)
,killProcessAction_(0)
,selectColumnAction_(0)
{
    //设置Model。
    QSortFilterProxyModel *proxyModel = new QSortFilterProxyModel(this);
    UProcessModel *processModel = new UProcessModel(this);
    connect(this,SIGNAL(processTerminated(unsigned int)),processModel,SLOT(refresh()));

    proxyModel->setSourceModel(processModel);
    proxyModel->setDynamicSortFilter(true);
    proxyModel->setSortCaseSensitivity(Qt::CaseInsensitive);
    setModel(proxyModel);
    setSortingEnabled(true);
    
    setSelectionBehavior(QAbstractItemView::SelectRows);
    horizontalHeader()->setStretchLastSection(true);
    verticalHeader()->hide();
    setSelectionMode(QAbstractItemView::SingleSelection);

    setContextMenuPolicy(Qt::ActionsContextMenu);
    setupActions();

    setupConnections();
}
开发者ID:gauldoth,项目名称:UniCore,代码行数:26,代码来源:UProcessView.cpp

示例11: KXmlGuiWindow

StorageServiceManagerMainWindow::StorageServiceManagerMainWindow()
    : KXmlGuiWindow()
{
    StorageServiceManagerSettingsJob *settingsJob = new StorageServiceManagerSettingsJob;
    PimCommon::StorageServiceJobConfig *configJob = PimCommon::StorageServiceJobConfig::self();
    configJob->registerConfigIf(settingsJob);

    mStorageManager = new PimCommon::StorageServiceManager(this);
    connect(mStorageManager, &PimCommon::StorageServiceManager::servicesChanged, this, &StorageServiceManagerMainWindow::slotServicesChanged);
    mStorageServiceMainWidget = new StorageServiceManagerMainWidget;
    connect(mStorageServiceMainWidget, &StorageServiceManagerMainWidget::configureClicked, this, &StorageServiceManagerMainWindow::slotConfigure);
    connect(mStorageServiceMainWidget->storageServiceTabWidget(), &QTabWidget::currentChanged, this, &StorageServiceManagerMainWindow::slotUpdateActions);
    connect(mStorageServiceMainWidget->storageServiceTabWidget(), &StorageServiceTabWidget::updateStatusBarMessage, this, &StorageServiceManagerMainWindow::slotSetStatusBarMessage);
    connect(mStorageServiceMainWidget->storageServiceTabWidget(), &StorageServiceTabWidget::listFileWasInitialized, this, &StorageServiceManagerMainWindow::slotUpdateActions);
    connect(mStorageServiceMainWidget->storageServiceTabWidget(), &StorageServiceTabWidget::selectionChanged, this, &StorageServiceManagerMainWindow::slotUpdateActions);
    setCentralWidget(mStorageServiceMainWidget);

    mNetworkConfigurationManager = new QNetworkConfigurationManager();
    connect(mNetworkConfigurationManager, &QNetworkConfigurationManager::onlineStateChanged, this, &StorageServiceManagerMainWindow::slotSystemNetworkOnlineStateChanged);

    setupActions();
    setupGUI(Keys | StatusBar | Save | Create);
    readConfig();
    mStorageServiceMainWidget->storageServiceTabWidget()->setListStorageService(mStorageManager->listService());
    slotUpdateActions();
    initStatusBar();
    slotSystemNetworkOnlineStateChanged(mNetworkConfigurationManager->isOnline());
}
开发者ID:KDE,项目名称:kdepim,代码行数:28,代码来源:storageservicemanagermainwindow.cpp

示例12: k

PencilTool::PencilTool() : k(new Private)
{
    k->configurator = 0;
    k->item = 0;

    setupActions();
}
开发者ID:hpsaturn,项目名称:tupi,代码行数:7,代码来源:penciltool.cpp

示例13: TupToolPlugin

PencilTool::PencilTool() : TupToolPlugin(), k(new Private)
{
    k->configurator = 0;
    k->item = 0;

    setupActions();
}
开发者ID:xtingray,项目名称:tupi,代码行数:7,代码来源:penciltool.cpp

示例14: QMainWindow

Kaqtoos::Kaqtoos()
	: QMainWindow(),
	  downloadManager(this),
	  isOAuthUserConnected(false)
{
	oauthRequest = new KQOAuthRequest();
	oauthManager = new KQOAuthManager(this);

	setupUi();
	setupActions();
	setupConnections();
	
	publicXmlUrls <<
		QString("http://api.kactoos.com/br/api/products/get-product-list/format/xml/oauth_consumer_key/%1/limit/30/orderby/new-products").arg(consumerKey) <<
		QString("http://api.kactoos.com/br/api/products/get-product-list/format/xml/oauth_consumer_key/%1/limit/30/orderby/popular").arg(consumerKey) <<
		QString("http://api.kactoos.com/br/api/products/get-product-list/format/xml/oauth_consumer_key/%1/limit/30/orderby/economic").arg(consumerKey);

	// start downloading
	downloadManager.append(publicXmlUrls);

	// NOTE: just for test
	QGraphicsScene *scene = new QGraphicsScene();

	ProductItem *item = new ProductItem();
	item->setImage("http://www.kactoos.com/libraries/thumb/?src=/images/products/5791_3556942391.jpg");
	
	scene->addItem(item);
	allProductsView->setScene(scene);

	setWindowTitle(tr("KaQToos"));
	resize(QSize(600, 480));
}
开发者ID:ftonello,项目名称:KaQToos,代码行数:32,代码来源:kaqtoos.cpp

示例15: QMainWindow

MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent)

{
    /* Window Title */
    setWindowTitle(tr(APPLICATION_NAME));

    /* Set sticky places for dockwidgets */
    setCorner(Qt::TopLeftCorner, Qt::TopDockWidgetArea);
    setCorner(Qt::TopRightCorner, Qt::RightDockWidgetArea);
    setCorner(Qt::BottomLeftCorner, Qt::BottomDockWidgetArea);
    setCorner(Qt::BottomRightCorner, Qt::BottomDockWidgetArea);

    /*
     * Create Mastercontroller (zone -1)
     * Controls all zones on all bridges.
     */
    master = new SingleController("Master", -1, this);
    masterDockWidget = new QDockWidget(tr("Master Controller"), this);
    masterDockWidget->setWidget(master);
    masterDockWidget->setMaximumWidth(200);
    addDockWidget(Qt::TopDockWidgetArea, masterDockWidget);

    /* Audio Controller */
    audio = new audioController(this);
    addDockWidget(Qt::TopDockWidgetArea, audio);

    /* Connect Audio to Master .*/
    connect(audio, SIGNAL(setRandomSame()), master, SLOT(setRandomExt()));
    connect(audio, SIGNAL(flash()), master, SLOT(flash()));
    connect(audio, SIGNAL(flashRandom()), master, SLOT(flashRandom()));
    connect(audio, SIGNAL(fade10()), master, SLOT(fade10Ext()));
    connect(audio, SIGNAL(fade20()), master, SLOT(fade20Ext()));

    presetController = new PresetController(this);
    presetController->setMinimumWidth(230);
    addDockWidget(Qt::TopDockWidgetArea, presetController);
    connect(presetController, SIGNAL(createPreset()), this, SLOT(getPreset()));
    connect(this, SIGNAL(presetAvailable(Preset*)), presetController, SLOT(addPreset(Preset*)));
    connect(presetController, SIGNAL(setPreset(Preset*)), this, SLOT(setPreset(Preset*)));

    /* Center the window. */
    QWidget *w = window();
    w->setGeometry(QStyle::alignedRect(Qt::LeftToRight, Qt::AlignCenter, w->size(), qApp->desktop()->availableGeometry()));

    /* Create Bridge Discovery Dialog. */
    MiLightDiscover *d = new MiLightDiscover(this);
    connect(d, SIGNAL(selectedDevices(QStringList, bool)), this, SLOT(setupControllers(QStringList, bool)));
    d->exec();

    setupActions();
    setupToolBar();
    setupMenuBar();
    setupStatusBar();

    loadSettings();

    delete d;

}
开发者ID:nzhome,项目名称:lightcontroller,代码行数:60,代码来源:mainwindow.cpp


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