new SQLTableWidget::debugEnabled property
This commit is contained in:
@@ -334,7 +334,7 @@ SQLTableWidget::SQLTableWidget(QWidget * parent): QWidget(parent), filters_group
|
|||||||
model = 0;
|
model = 0;
|
||||||
timer = 0;
|
timer = 0;
|
||||||
connection_name = QSqlDatabase::defaultConnection;
|
connection_name = QSqlDatabase::defaultConnection;
|
||||||
filters_active = first_update = true;
|
filters_active = first_update = debug = true;
|
||||||
table_opened = read_only = false;
|
table_opened = read_only = false;
|
||||||
ui->labelNew->setFixedSize(preferredIconSize(1.2, this));
|
ui->labelNew->setFixedSize(preferredIconSize(1.2, this));
|
||||||
ui->labelFilter->setFixedSize(preferredIconSize(1.2, this));
|
ui->labelFilter->setFixedSize(preferredIconSize(1.2, this));
|
||||||
@@ -463,7 +463,7 @@ void SQLTableWidget::setTableName(const QString & t) {
|
|||||||
first_update = true;
|
first_update = true;
|
||||||
table_ = t;
|
table_ = t;
|
||||||
if (!QSqlDatabase::database(connection_name).isOpen()) {
|
if (!QSqlDatabase::database(connection_name).isOpen()) {
|
||||||
qDebug() << "[setTableName] Database in not opened!";
|
if (debug) qDebug() << "[setTableName] Database in not opened!";
|
||||||
setTableVisible(false);
|
setTableVisible(false);
|
||||||
timer = startTimer(1000);
|
timer = startTimer(1000);
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -17,8 +17,8 @@
|
|||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef MYSQLTABLE_H
|
#ifndef SQL_TABLE_WIDGET_H
|
||||||
#define MYSQLTABLE_H
|
#define SQL_TABLE_WIDGET_H
|
||||||
|
|
||||||
#include <QSqlDatabase>
|
#include <QSqlDatabase>
|
||||||
#include <QSqlQuery>
|
#include <QSqlQuery>
|
||||||
@@ -226,6 +226,7 @@ class QAD_SQL_TABLE_EXPORT SQLTableWidget: public QWidget
|
|||||||
Q_PROPERTY(bool lineNewVisible READ lineNewVisible WRITE setLineNewVisible)
|
Q_PROPERTY(bool lineNewVisible READ lineNewVisible WRITE setLineNewVisible)
|
||||||
Q_PROPERTY(bool lineFilterVisible READ lineFilterVisible WRITE setLineFilterVisible)
|
Q_PROPERTY(bool lineFilterVisible READ lineFilterVisible WRITE setLineFilterVisible)
|
||||||
Q_PROPERTY(bool readOnly READ readOnly WRITE setReadOnly)
|
Q_PROPERTY(bool readOnly READ readOnly WRITE setReadOnly)
|
||||||
|
Q_PROPERTY(bool debugEnabled READ isDebugEnabled WRITE setDebugEnabled)
|
||||||
friend class SQLItemDelegate;
|
friend class SQLItemDelegate;
|
||||||
friend class SQLUniEdit;
|
friend class SQLUniEdit;
|
||||||
public:
|
public:
|
||||||
@@ -238,6 +239,9 @@ public:
|
|||||||
QTableView * tableView();
|
QTableView * tableView();
|
||||||
bool readOnly() const {return read_only;}
|
bool readOnly() const {return read_only;}
|
||||||
|
|
||||||
|
void setDebugEnabled(bool on) {debug = on;}
|
||||||
|
bool isDebugEnabled() const {return debug;}
|
||||||
|
|
||||||
const ColumnProperties * columnProperty(int index) const {if (index < 0 || index >= column_props.count()) return 0; return &(column_props[index]);}
|
const ColumnProperties * columnProperty(int index) const {if (index < 0 || index >= column_props.count()) return 0; return &(column_props[index]);}
|
||||||
const ColumnProperties * columnProperty(const QString & name) const {return columnProperty(columnByName(name));}
|
const ColumnProperties * columnProperty(const QString & name) const {return columnProperty(columnByName(name));}
|
||||||
const QList<ColumnProperties> & columnProperties() const {return column_props;}
|
const QList<ColumnProperties> & columnProperties() const {return column_props;}
|
||||||
@@ -319,7 +323,7 @@ private:
|
|||||||
QMap<QString, QPair<QString, QString> > translates, fixed_translates;
|
QMap<QString, QPair<QString, QString> > translates, fixed_translates;
|
||||||
QMap<QString, bool> col_vis;
|
QMap<QString, bool> col_vis;
|
||||||
int timer;
|
int timer;
|
||||||
bool filters_active, table_opened, read_only, first_update;
|
bool filters_active, table_opened, read_only, first_update, debug;
|
||||||
static QString _dir;
|
static QString _dir;
|
||||||
QPoint pp;
|
QPoint pp;
|
||||||
QString connection_name;
|
QString connection_name;
|
||||||
|
|||||||
Reference in New Issue
Block a user