本文整理汇总了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();
}
示例2: saveAs
void MainWindow::saveAs()
{
QueryWidget *wid = _workArea->currentQueryWidget();
if (wid) {
wid->savebToFileAs();
}
}
示例3: toggleOrientation
void MainWindow::toggleOrientation()
{
QueryWidget *widget = _workArea->currentQueryWidget();
if (!widget)
return;
widget->toggleOrientation();
}
示例4: stopScript
void MainWindow::stopScript()
{
QueryWidget *widget = _workArea->currentQueryWidget();
if (!widget)
return;
widget->stop();
}
示例5: saveViewMode
void MainWindow::enterCustomMode()
{
saveViewMode(Custom);
QueryWidget *widget = _workArea->currentQueryWidget();
if (!widget)
return;
widget->enterCustomMode();
}
示例6: queryWidget
void WorkAreaTabWidget::ui_currentChanged(int index)
{
if (index < 0)
return;
QueryWidget *tabWidget = queryWidget(index);
if (tabWidget)
tabWidget->activateTabContent();
}
示例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);
}
}
示例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();
}
示例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);
}
}
}
}
示例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();
}
示例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();
}
}
示例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);
}
示例13: toggleOrientation
void WorkAreaWidget::toggleOrientation()
{
QueryWidget *currentWidget = (QueryWidget *)_tabWidget->currentWidget();
if (currentWidget)
currentWidget->toggleOrientation();
}
示例14: stopScript
void WorkAreaWidget::stopScript()
{
QueryWidget *currentWidget = (QueryWidget *)_tabWidget->currentWidget();
if (currentWidget)
currentWidget->stop();
}
示例15: enterCustomMode
void WorkAreaWidget::enterCustomMode()
{
QueryWidget *currentWidget = (QueryWidget *)_tabWidget->currentWidget();
if (currentWidget)
currentWidget->enterCustomMode();
}