From 054ca360536b33c05eb54a143a5cf9c0cd70eb19 Mon Sep 17 00:00:00 2001 From: Peter Mash Morgan Date: Tue, 5 Oct 2010 11:04:14 +0100 Subject: [PATCH] dbTree ridy --- README.txt | 29 +++++++++++++++++++++++++++ sqlitebrowser/sqlitebrowser/form1.cpp | 7 +++++-- sqlitebrowser/sqlitebrowser/form1.h | 4 +++- 3 files changed, 37 insertions(+), 3 deletions(-) create mode 100644 README.txt diff --git a/README.txt b/README.txt new file mode 100644 index 00000000..ae4d4491 --- /dev/null +++ b/README.txt @@ -0,0 +1,29 @@ +sqlitebrowser. + +This is a fork from the SF project which seems to be stagnant. + +Website: + http://sqlitebrowser.sourceforge.net + +Project: + https://sourceforge.net/projects/sqlitebrowser/ + +Have emailed devs and no reply yet. +https://sourceforge.net/projects/sqlitebrowser/forums/forum/301848/topic/3878502 + +---------------------------------------- +Hacking + +I'm progressing throught removing Qt3 +Adding icons and contect menu +Generally clearing up + +Problesm? +Dont get the transactions part.. + +Help Wanted +Tester co dev (not a qt expert); + + +contact: +pedromorgan AT gmail DOT com diff --git a/sqlitebrowser/sqlitebrowser/form1.cpp b/sqlitebrowser/sqlitebrowser/form1.cpp index c58c75c5..279f4d70 100644 --- a/sqlitebrowser/sqlitebrowser/form1.cpp +++ b/sqlitebrowser/sqlitebrowser/form1.cpp @@ -181,6 +181,7 @@ void mainForm::fileNew() } } +//** Populate DbTree Structure void mainForm::populateStructure() { dbTreeWidget->model()->removeRows(0, dbTreeWidget->model()->rowCount()); @@ -211,6 +212,8 @@ void mainForm::populateStructure() fldItem->setText( 2, fit.data().gettype() ); fldItem->setIcon(0, QIcon(":/icons/field")); } + // TODO make an options/setting autoexpand + dbTreeWidget->setItemExpanded(tableItem, true); } indexMap::Iterator it2; indexMap imap = db.idxmap; @@ -1200,13 +1203,13 @@ void mainForm::updatePreferences() editWin->setTextFormat(prefForm->defaulttext); } - +//** Db Tree Context Menu void mainForm::on_tree_context_menu(const QPoint &qPoint){ - qDebug("CONTEXT"); if( !dbTreeWidget->selectionModel()->hasSelection() ){ return; } QTreeWidgetItem *cItem = dbTreeWidget->currentItem(); + if(cItem->text(1) == "table"){ editDeleteTableActionPopup->setDisabled(false); editModifyTableActionPopup->setDisabled(false); diff --git a/sqlitebrowser/sqlitebrowser/form1.h b/sqlitebrowser/sqlitebrowser/form1.h index a8ff9970..edc08477 100644 --- a/sqlitebrowser/sqlitebrowser/form1.h +++ b/sqlitebrowser/sqlitebrowser/form1.h @@ -319,6 +319,8 @@ public: headerItem->setText(1, QApplication::translate("mainForm", "Object", 0, QApplication::UnicodeUTF8)); headerItem->setText(2, QApplication::translate("mainForm", "Type", 0, QApplication::UnicodeUTF8)); headerItem->setText(3, QApplication::translate("mainForm", "Schema", 0, QApplication::UnicodeUTF8)); + dbTreeWidget->setColumnHidden(1, true); + dbTreeWidget->setColumnWidth(0, 300); dbTreeWidget->setAlternatingRowColors(true); dbTreeWidget->setRootIsDecorated(true); dbTreeWidget->setAnimated(true); @@ -623,7 +625,7 @@ public: QObject::connect(fileImportSQLAction, SIGNAL(activated()), mainForm, SLOT(importDatabaseFromSQL())); QObject::connect(editPreferencesAction, SIGNAL(activated()), mainForm, SLOT(openPreferences())); - QObject::connect(dbTreeWidget, SIGNAL(customContextMenuRequested(QPoint)), mainForm, SLOT(on_tree_context_menu(QPoint))); + QObject::connect(dbTreeWidget, SIGNAL(customContextMenuRequested(const QPoint &)), mainForm, SLOT(on_tree_context_menu(const QPoint &))); QMetaObject::connectSlotsByName(mainForm); } // setupUi