|  | Home · All Namespaces · All Classes · Main Classes · Grouped Classes · Modules · Functions |

# connectionwidget.h Example File
demos/sqlbrowser/connectionwidget.h

     /****************************************************************************
     **
     ** Copyright (C) 2004-$THISYEAR$ $TROLLTECH$. All rights reserved.
     **
     ** This file is part of the $MODULE$ of the Qt Toolkit.
     **
     ** $TROLLTECH_DUAL_LICENSE$
     **
     ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
     ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
     **
     ****************************************************************************/

     #ifndef CONNECTIONWIDGET_H
     #define CONNECTIONWIDGET_H

     #include <QWidget>

     QT_FORWARD_DECLARE_CLASS(QTreeWidget)
     QT_FORWARD_DECLARE_CLASS(QTreeWidgetItem)
     QT_FORWARD_DECLARE_CLASS(QSqlDatabase)
     QT_FORWARD_DECLARE_CLASS(QMenu)

     class ConnectionWidget: public QWidget
     {
         Q_OBJECT
     public:
         ConnectionWidget(QWidget *parent = 0);
         virtual ~ConnectionWidget();

         QSqlDatabase currentDatabase() const;

     signals:
         void tableActivated(const QString &table);
         void metaDataRequested(const QString &tableName);

     public slots:
         void refresh();
         void showMetaData();
         void on_tree_itemActivated(QTreeWidgetItem *item, int column);
         void on_tree_currentItemChanged(QTreeWidgetItem *current, QTreeWidgetItem *previous);

     private:
         void setActive(QTreeWidgetItem *);

         QTreeWidget *tree;
         QAction *metaDataAction;
         QString activeDb;
     };

     #endif