|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r77717 - sandbox/icl/libs/xplore/br1/sqlbrowser
From: afojgo_at_[hidden]
Date: 2012-04-02 12:31:40
Author: jofaber
Date: 2012-04-02 12:31:39 EDT (Mon, 02 Apr 2012)
New Revision: 77717
URL: http://svn.boost.org/trac/boost/changeset/77717
Log:
Insertion into dag 1.
Text files modified:
sandbox/icl/libs/xplore/br1/sqlbrowser/browser.cpp | 27 +++++++++++++++++++++++++--
sandbox/icl/libs/xplore/br1/sqlbrowser/browser.h | 2 ++
sandbox/icl/libs/xplore/br1/sqlbrowser/browserwidget.ui | 11 +++++++++++
sandbox/icl/libs/xplore/br1/sqlbrowser/sqlbrowser4.pro | 10 ++++++----
4 files changed, 44 insertions(+), 6 deletions(-)
Modified: sandbox/icl/libs/xplore/br1/sqlbrowser/browser.cpp
==============================================================================
--- sandbox/icl/libs/xplore/br1/sqlbrowser/browser.cpp (original)
+++ sandbox/icl/libs/xplore/br1/sqlbrowser/browser.cpp 2012-04-02 12:31:39 EDT (Mon, 02 Apr 2012)
@@ -50,13 +50,15 @@
Browser::Browser(QWidget *parent)
: QWidget(parent)
{
+ //JOFA: This seems to execute the generated code
setupUi(this);
+ //JOFA: Hancoded initialization follows here.
ext_table->addAction(insertRowAction);
ext_table->addAction(deleteRowAction);
- ext_tree->addAction(insertRowAction);
- ext_tree->addAction(deleteRowAction);
+ ext_tree->setContextMenuPolicy(Qt::ActionsContextMenu);
+ ext_tree->addAction(insertNodeAction);
if (QSqlDatabase::drivers().isEmpty())
QMessageBox::information(this, tr("No database drivers found"),
@@ -64,6 +66,8 @@
"Please check the documentation how to build the "
"Qt SQL plugins."));
+ connect(insertNodeAction, SIGNAL(triggered()), this, SLOT(insertNode()));
+
emit statusMessage(tr("Ready."));
}
@@ -71,6 +75,25 @@
{
}
+
+void Browser::insertNode()
+{
+ QModelIndex idx = ext_tree->currentIndex();
+ if(!idx.isValid())
+ return;
+
+ //QTreeWidgetItem* curItem = ext_tree->model()->item(idx);
+ QAbstractItemModel* absmo = ext_tree->model();
+ QVariant variDat = absmo->data(idx);
+
+ QMessageBox msgBox;
+ QString msg = "Insertion. ";
+ msg += variDat.toString();
+ msgBox.setText(msg);
+ msgBox.exec();
+}
+
+
void Browser::exec()
{
if(sqlEdit->toPlainText().isEmpty())
Modified: sandbox/icl/libs/xplore/br1/sqlbrowser/browser.h
==============================================================================
--- sandbox/icl/libs/xplore/br1/sqlbrowser/browser.h (original)
+++ sandbox/icl/libs/xplore/br1/sqlbrowser/browser.h 2012-04-02 12:31:39 EDT (Mon, 02 Apr 2012)
@@ -108,6 +108,8 @@
void on_cellClicked(int row, int col);
void on_rowSelectChanged();
+ void insertNode();
+
signals:
void statusMessage(const QString &message);
Modified: sandbox/icl/libs/xplore/br1/sqlbrowser/browserwidget.ui
==============================================================================
--- sandbox/icl/libs/xplore/br1/sqlbrowser/browserwidget.ui (original)
+++ sandbox/icl/libs/xplore/br1/sqlbrowser/browserwidget.ui 2012-04-02 12:31:39 EDT (Mon, 02 Apr 2012)
@@ -686,6 +686,17 @@
</widget>
</item>
</layout>
+ <action name="insertNodeAction">
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="text">
+ <string>&Insert Node</string>
+ </property>
+ <property name="statusTip">
+ <string>Inserts a new Node</string>
+ </property>
+ </action>
<action name="insertRowAction">
<property name="enabled">
<bool>false</bool>
Modified: sandbox/icl/libs/xplore/br1/sqlbrowser/sqlbrowser4.pro
==============================================================================
--- sandbox/icl/libs/xplore/br1/sqlbrowser/sqlbrowser4.pro (original)
+++ sandbox/icl/libs/xplore/br1/sqlbrowser/sqlbrowser4.pro 2012-04-02 12:31:39 EDT (Mon, 02 Apr 2012)
@@ -3,8 +3,8 @@
QT += sql
-#INCLUDEPATH += /NIBuild/3rdparty/boost-1.48.0
-INCLUDEPATH += /cygwin/home/jofa/dev/boost/trunk
+INCLUDEPATH += /NIBuild/3rdparty/boost-1.48.0
+#INCLUDEPATH += /cygwin/home/jofa/dev/boost/trunk
HEADERS = browser.h connectionwidget.h qsqlconnectiondialog.h \
exttableview.h \
@@ -13,11 +13,13 @@
dagmodel.h \
StringVisitor.h \
Dag.h \
- CreatorVisitor.h
+ CreatorVisitor.h \
+ exttreeview.h
SOURCES = main.cpp browser.cpp connectionwidget.cpp qsqlconnectiondialog.cpp \
exttableview.cpp \
dagitem.cpp \
- dagmodel.cpp
+ dagmodel.cpp \
+ exttreeview.cpp
FORMS = browserwidget.ui qsqlconnectiondialog.ui
build_all:!build_pass {
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk