in the direction of a plugin system. DatabaseWindow now passes a Context to QueryTab and other pages that give those pages an API for passing information up the system without knowing anything about the sytem.
36 lines
735 B
C++
36 lines
735 B
C++
#ifndef CODEGENERATOR_H
|
|
#define CODEGENERATOR_H
|
|
|
|
#include <QWidget>
|
|
#include "PluginContentWidget.h"
|
|
#include "Pgsql_declare.h"
|
|
|
|
namespace Ui {
|
|
class CodeGenerator;
|
|
}
|
|
|
|
class PgDatabaseCatalog;
|
|
|
|
class CodeGenerator : public PluginContentWidget
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
CodeGenerator(IPluginContentWidgetContext *context, QWidget *parent = nullptr);
|
|
~CodeGenerator();
|
|
|
|
void Init(std::shared_ptr<PgDatabaseCatalog> catalog, QString query, std::shared_ptr<const Pgsql::Result> dbres);
|
|
private slots:
|
|
void on_updateCodeButton_clicked();
|
|
|
|
private:
|
|
Ui::CodeGenerator *ui;
|
|
|
|
std::shared_ptr<PgDatabaseCatalog> m_catalog;
|
|
QString m_query;
|
|
std::shared_ptr<const Pgsql::Result> m_dbres;
|
|
|
|
void generateCode();
|
|
};
|
|
|
|
#endif // CODEGENERATOR_H
|