File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -107,6 +107,7 @@ void MainWindow::init()
107107 popupTableMenu->addAction (ui->editModifyTableAction );
108108 popupTableMenu->addAction (ui->editDeleteObjectAction );
109109 popupTableMenu->addSeparator ();
110+ popupTableMenu->addAction (ui->actionEditCopyCreateStatement );
110111 popupTableMenu->addAction (ui->actionExportCsvPopup );
111112
112113 popupSaveSqlFileMenu = new QMenu (this );
@@ -2095,3 +2096,16 @@ void MainWindow::on_buttonClearFilters_clicked()
20952096{
20962097 ui->dataTable ->filterHeader ()->clearFilters ();
20972098}
2099+
2100+ void MainWindow::copyCurrentCreateStatement ()
2101+ {
2102+ // Cancel if no field is currently selected
2103+ if (!ui->dbTreeWidget ->selectionModel ()->hasSelection ())
2104+ return ;
2105+
2106+ // Get the CREATE statement from the Schema column
2107+ QString stmt = ui->dbTreeWidget ->model ()->data (ui->dbTreeWidget ->currentIndex ().sibling (ui->dbTreeWidget ->currentIndex ().row (), 3 )).toString ();
2108+
2109+ // Copy the statement to the global application clipboard
2110+ QApplication::clipboard ()->setText (stmt);
2111+ }
Original file line number Diff line number Diff line change @@ -176,6 +176,7 @@ private slots:
176176 void editEncryption ();
177177 void switchToBrowseDataTab ();
178178 void on_buttonClearFilters_clicked ();
179+ void copyCurrentCreateStatement ();
179180};
180181
181182#endif
Original file line number Diff line number Diff line change 324324 <rect >
325325 <x >0</x >
326326 <y >0</y >
327- <width >311 </width >
328- <height >531 </height >
327+ <width >294 </width >
328+ <height >444 </height >
329329 </rect >
330330 </property >
331331 <layout class =" QFormLayout" name =" formLayout" >
810810 <x >0</x >
811811 <y >0</y >
812812 <width >1000</width >
813- <height >25 </height >
813+ <height >19 </height >
814814 </rect >
815815 </property >
816816 <widget class =" QMenu" name =" fileMenu" >
16211621 <string >& Browse Table</string >
16221622 </property >
16231623 </action >
1624+ <action name =" actionEditCopyCreateStatement" >
1625+ <property name =" icon" >
1626+ <iconset resource =" icons/icons.qrc" >
1627+ <normaloff >:/icons/copy</normaloff >:/icons/copy</iconset >
1628+ </property >
1629+ <property name =" text" >
1630+ <string >Copy Create statement</string >
1631+ </property >
1632+ <property name =" toolTip" >
1633+ <string >Copy the CREATE statement of the item to the clipboard</string >
1634+ </property >
1635+ </action >
16241636 </widget >
16251637 <customwidgets >
16261638 <customwidget >
25082520 </hint >
25092521 </hints >
25102522 </connection >
2523+ <connection >
2524+ <sender >actionEditCopyCreateStatement</sender >
2525+ <signal >triggered()</signal >
2526+ <receiver >MainWindow</receiver >
2527+ <slot >copyCurrentCreateStatement()</slot >
2528+ <hints >
2529+ <hint type =" sourcelabel" >
2530+ <x >-1</x >
2531+ <y >-1</y >
2532+ </hint >
2533+ <hint type =" destinationlabel" >
2534+ <x >499</x >
2535+ <y >314</y >
2536+ </hint >
2537+ </hints >
2538+ </connection >
25112539 </connections >
25122540 <slots >
25132541 <slot >fileOpen()</slot >
25622590 <slot >editEncryption()</slot >
25632591 <slot >saveSqlFileAs()</slot >
25642592 <slot >switchToBrowseDataTab()</slot >
2593+ <slot >copyCurrentCreateStatement()</slot >
25652594 </slots >
25662595</ui >
Original file line number Diff line number Diff line change 4545 <file alias="function">chart_curve.png</file>
4646 <file alias="keyword">cog.png</file>
4747 <file alias="clear_filters">clear_filters.png</file>
48+ <file alias="copy">page_copy.png</file>
4849 </qresource>
4950</RCC>
You can’t perform that action at this time.
0 commit comments