From 7d1ddbd7177338aae94fe288f3154af71c180203 Mon Sep 17 00:00:00 2001 From: mgrojo Date: Thu, 18 Jan 2018 20:59:02 +0100 Subject: [PATCH] Preserve format in Copy Create Statement The original Create statement formatting is preserved when the menu option "Copy Create statement" is selected, regardless of the setting that removes the line breaks in the schema view. The Edit Role is requested to the model for getting the original text data. See issue #1300 --- src/MainWindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index cb7aea68..5d9c0483 100644 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -2391,7 +2391,7 @@ void MainWindow::copyCurrentCreateStatement() return; // Get the CREATE statement from the Schema column - QString stmt = ui->dbTreeWidget->model()->data(ui->dbTreeWidget->currentIndex().sibling(ui->dbTreeWidget->currentIndex().row(), 3)).toString(); + QString stmt = ui->dbTreeWidget->model()->data(ui->dbTreeWidget->currentIndex().sibling(ui->dbTreeWidget->currentIndex().row(), 3), Qt::EditRole).toString(); // Copy the statement to the global application clipboard QApplication::clipboard()->setText(stmt);