2022-05-10 10:06:48 +00:00
|
|
|
// Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
|
2011-04-27 10:05:43 +00:00
|
|
|
|
|
|
|
#ifndef CONNECTIONWIDGET_H
|
|
|
|
#define CONNECTIONWIDGET_H
|
|
|
|
|
|
|
|
#include <QWidget>
|
|
|
|
|
|
|
|
QT_FORWARD_DECLARE_CLASS(QTreeWidget)
|
|
|
|
QT_FORWARD_DECLARE_CLASS(QTreeWidgetItem)
|
|
|
|
QT_FORWARD_DECLARE_CLASS(QSqlDatabase)
|
|
|
|
|
2024-01-12 21:25:23 +00:00
|
|
|
class ConnectionWidget : public QWidget
|
2011-04-27 10:05:43 +00:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2024-12-31 09:03:41 +00:00
|
|
|
explicit ConnectionWidget(QWidget *parent = nullptr);
|
|
|
|
~ConnectionWidget() override;
|
2011-04-27 10:05:43 +00:00
|
|
|
|
|
|
|
QSqlDatabase currentDatabase() const;
|
|
|
|
|
|
|
|
signals:
|
|
|
|
void tableActivated(const QString &table);
|
|
|
|
void metaDataRequested(const QString &tableName);
|
|
|
|
|
|
|
|
public slots:
|
|
|
|
void refresh();
|
|
|
|
void showMetaData();
|
2024-01-12 21:25:23 +00:00
|
|
|
void onItemActivated(QTreeWidgetItem *item);
|
|
|
|
void onCurrentItemChanged(QTreeWidgetItem *current);
|
2011-04-27 10:05:43 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
void setActive(QTreeWidgetItem *);
|
|
|
|
|
|
|
|
QTreeWidget *tree;
|
|
|
|
QAction *metaDataAction;
|
|
|
|
QString activeDb;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|