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


C++ QueryWidget类代码示例

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


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

示例1: queryWidget

    void WorkAreaTabWidget::ui_reloadTabRequested(int index)
    {
        QueryWidget *query = queryWidget(index);

        if (query)
            query->reload();
    }
开发者ID:kewinwang,项目名称:robomongo,代码行数:7,代码来源:WorkAreaTabWidget.cpp

示例2: saveAs

 void MainWindow::saveAs()
 {
     QueryWidget *wid = _workArea->currentQueryWidget();
     if (wid) {
         wid->savebToFileAs();
     }
 }
开发者ID:Dinesh-Ramakrishnan,项目名称:robomongo,代码行数:7,代码来源:MainWindow.cpp

示例3: toggleOrientation

    void MainWindow::toggleOrientation()
    {
        QueryWidget *widget = _workArea->currentQueryWidget();
        if (!widget)
            return;

        widget->toggleOrientation();
    }
开发者ID:Dinesh-Ramakrishnan,项目名称:robomongo,代码行数:8,代码来源:MainWindow.cpp

示例4: stopScript

    void MainWindow::stopScript()
    {
        QueryWidget *widget = _workArea->currentQueryWidget();
        if (!widget)
            return;

        widget->stop();
    }
开发者ID:Dinesh-Ramakrishnan,项目名称:robomongo,代码行数:8,代码来源:MainWindow.cpp

示例5: saveViewMode

    void MainWindow::enterCustomMode()
    {
        saveViewMode(Custom);
        QueryWidget *widget = _workArea->currentQueryWidget();
        if (!widget)
            return;

        widget->enterCustomMode();
    }
开发者ID:Dinesh-Ramakrishnan,项目名称:robomongo,代码行数:9,代码来源:MainWindow.cpp

示例6: queryWidget

void WorkAreaTabWidget::ui_currentChanged(int index)
{
    if (index < 0)
        return;

    QueryWidget *tabWidget = queryWidget(index);

    if (tabWidget)
        tabWidget->activateTabContent();
}
开发者ID:davidau,项目名称:robomongo,代码行数:10,代码来源:WorkAreaTabWidget.cpp

示例7: newQueryTab

void MainWindow::runQuery(const QString &query)
{
	if(query.isEmpty())
		return;

	QueryWidget *qw = qobject_cast<QueryWidget*>(m_tabs->currentWidget());
	if(qw!=0) {
		qw->runQuery(query);
	} else {
		QueryWidget *qw = newQueryTab();
		qw->runQuery(query);
	}
}
开发者ID:callaa,项目名称:KQueryBrowser,代码行数:13,代码来源:mainwindow.cpp

示例8: AllTabsClosedEvent

    void WorkAreaTabWidget::ui_currentChanged(int index)
    {
        if (index == -1) {
            _bus->publish(new AllTabsClosedEvent(this));
        }

        if (index < 0)
            return;

        QueryWidget *tabWidget = queryWidget(index);

        if (tabWidget)
            tabWidget->activateTabContent();
    }
开发者ID:kewinwang,项目名称:robomongo,代码行数:14,代码来源:WorkAreaTabWidget.cpp

示例9: open

 void MainWindow::open()
 {
     QueryWidget *wid = _workArea->currentQueryWidget();
     if (wid) {
         wid->openFile();
     }
     else {
         SettingsManager::ConnectionSettingsContainerType connections = AppRegistry::instance().settingsManager()->connections();
         if (connections.size() == 1) {
             ScriptInfo inf = ScriptInfo(QString());
             if (inf.loadFromFile()) {
                 _app->openShell(connections.at(0), inf);
             }
         }
     }
 }
开发者ID:Dinesh-Ramakrishnan,项目名称:robomongo,代码行数:16,代码来源:MainWindow.cpp

示例10: setUpdatesEnabled

    void WorkAreaWidget::handle(OpeningShellEvent *event)
    {
        const QString &title = event->shell->title();

        QString shellName = title.isEmpty() ? " Loading..." : title;

        setUpdatesEnabled(false);
        QueryWidget *queryWidget = new QueryWidget(event->shell,_tabWidget);

        _tabWidget->addTab(queryWidget, shellName);
        _tabWidget->setCurrentIndex(_tabWidget->count() - 1);
#if !defined(Q_OS_MAC)
        _tabWidget->setTabIcon(_tabWidget->count() - 1, GuiRegistry::instance().mongodbIcon());
#endif
        setUpdatesEnabled(true);
        queryWidget->showProgress();
    }
开发者ID:eugenkr,项目名称:robomongo,代码行数:17,代码来源:WorkAreaWidget.cpp

示例11: QueryWidget

void WorkAreaTabWidget::handle(OpeningShellEvent *event)
{
    const QString &title = event->shell->title();

    QString shellName = title.isEmpty() ? " Loading..." : title;

    QueryWidget *queryWidget = new QueryWidget(event->shell,this);
    VERIFY(connect(queryWidget, SIGNAL(titleChanged(const QString &)), this, SLOT(tabTextChange(const QString &))));
    VERIFY(connect(queryWidget, SIGNAL(toolTipChanged(const QString &)), this, SLOT(tooltipTextChange(const QString &))));

    addTab(queryWidget, shellName);

    setCurrentIndex(count() - 1);
#if !defined(Q_OS_MAC)
    setTabIcon(count() - 1, GuiRegistry::instance().mongodbIcon());
#endif
    if (event->shell->isExecutable()) {
        queryWidget->showProgress();
    }
}
开发者ID:davidau,项目名称:robomongo,代码行数:20,代码来源:WorkAreaTabWidget.cpp

示例12: currentIndex

/**
 * @brief Overrides QTabWidget::keyPressEvent() in order to intercept
 * tab close key shortcuts (Ctrl+F4 and Ctrl+W)
 */
void WorkAreaTabWidget::keyPressEvent(QKeyEvent *keyEvent)
{
    if ((keyEvent->modifiers() & Qt::ControlModifier) &&
            (keyEvent->key()==Qt::Key_F4 || keyEvent->key()==Qt::Key_W))
    {
        int index = currentIndex();
        closeTab(index);
        return;
    }
    QueryWidget *widget = currentQueryWidget();

    if (KeyboardManager::isPreviousTabShortcut(keyEvent)) {
        previousTab();
        return;
    } else if (KeyboardManager::isNextTabShortcut(keyEvent)) {
        nextTab();
        return;
    } else if (KeyboardManager::isNewTabShortcut(keyEvent) && widget) {
        widget->openNewTab();
        return;
    } else if (KeyboardManager::isDuplicateTabShortcut(keyEvent) && widget) {
        widget->duplicate();
        return;
    } else if (KeyboardManager::isSetFocusOnQueryLineShortcut(keyEvent) && widget) {
        widget->setScriptFocus();
        return;
    } else if (KeyboardManager::isExecuteScriptShortcut(keyEvent) && widget) {
        widget->execute();
        return;
    } else if (KeyboardManager::isAutoCompleteShortcut(keyEvent) && widget) {
        widget->showAutocompletion();
        return;
    } else if (KeyboardManager::isHideAutoCompleteShortcut(keyEvent) && widget) {
        widget->hideAutocompletion();
        return;
    }

    QTabWidget::keyPressEvent(keyEvent);
}
开发者ID:davidau,项目名称:robomongo,代码行数:43,代码来源:WorkAreaTabWidget.cpp

示例13: toggleOrientation

 void WorkAreaWidget::toggleOrientation()
 {
     QueryWidget *currentWidget = (QueryWidget *)_tabWidget->currentWidget();
     if (currentWidget)
         currentWidget->toggleOrientation();
 }
开发者ID:eugenkr,项目名称:robomongo,代码行数:6,代码来源:WorkAreaWidget.cpp

示例14: stopScript

 void WorkAreaWidget::stopScript()
 {
     QueryWidget *currentWidget = (QueryWidget *)_tabWidget->currentWidget();
     if (currentWidget)
         currentWidget->stop();
 }
开发者ID:eugenkr,项目名称:robomongo,代码行数:6,代码来源:WorkAreaWidget.cpp

示例15: enterCustomMode

 void WorkAreaWidget::enterCustomMode()
 {
     QueryWidget *currentWidget = (QueryWidget *)_tabWidget->currentWidget();
     if (currentWidget)
         currentWidget->enterCustomMode();
 }
开发者ID:eugenkr,项目名称:robomongo,代码行数:6,代码来源:WorkAreaWidget.cpp


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