File: chartablesql.h

package info (click to toggle)
tipp10 3.3.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,984 kB
  • sloc: cpp: 8,343; xml: 70; ansic: 60; makefile: 11
file content (73 lines) | stat: -rw-r--r-- 1,601 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
/*
Copyright (c) 2006-2009, Tom Thielicke IT Solutions

SPDX-License-Identifier: GPL-2.0-only
*/

/****************************************************************
**
** Definition of the CharTableSql class
** File name: chartablesql.h
**
****************************************************************/

#include <QHeaderView>
#include <QModelIndex>
#include <QPushButton>
#include <QSqlQueryModel>
#include <QString>
#include <QVariant>
#include <QWidget>

#ifndef CHARSQLMODEL_H
#define CHARSQLMODEL_H

//! The CharSqlModel class provides a table model to format cells.
/*!
        @author Tom Thielicke, s712715
        @version 0.1.9
        @date 21.06.2006
*/
class CharSqlModel : public QSqlQueryModel {
    Q_OBJECT

public:
    CharSqlModel(QWidget* parent = 0);

    QVariant data(const QModelIndex& index, int role) const;
    QWidget* parentWidget;
};

#endif // CHARSQLMODEL_H

#ifndef CHARTABLESQL_H
#define CHARTABLESQL_H

//! The CharTableSql class provides a table widget with all typed chars.
/*!
        @author Tom Thielicke, s712715
        @version 0.1.0
        @date 21.06.2006
*/
class CharTableSql : public QWidget {
    Q_OBJECT

public:
    CharTableSql(QWidget* parent = 0);

private slots:
    void sortColumn(int columnindex);
    void deleteUserChars();

private:
    void setModelHeader();
    CharSqlModel* model;
    QHeaderView* headerview;
    QVariant data(const QModelIndex& item, int role) const;
    void setQueryOrder(QString columnname, bool isdesc);
    int previousColumnIndex;
    QPushButton* buttonReset;
    QString sql;
};

#endif // CHARTABLESQL_H