You are not logged in.

1

Sunday, May 9th 2010, 5:58pm

Core dump Qstring

Hi,

we have development knowledge but not about QT. We modified a french invoicing open source program to adapt it to latest mandatory rules. We are close to the goal except that we get a core dump in some cases, when creating an item family or a customer. Creating an item or an invoice is working well.

This is the result of an <gdb kinvoice_ae core>. 64 bits binaries where build on a Debian SID, 32 bits on Ubuntu.

Source code

1
2
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff797d120 in QString::QString(QString const&) () from /usr/lib/libqt-mt.so.3


Sources and binaries can be found here http://www.tootai.net/downloads/kinvoice-0.2.tar.gz

From what we understood, art.h is generated from art.ui which is an xml (or something like). There is also art.ui.h which contains:

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
**************************************************
** ui.h extension file, included from the uic-generated form implementation.
**
** If you wish to add, delete or rename functions or slots use
** Qt Designer which will update this file, preserving your code. Create an
** init() function in place of a constructor, and a destroy() function in
** place of a destructor.
**************************************************/
 
#include "data.h"
#include <qcombobox.h>
#include <qvalidator.h>

void Art::init() {
    for (uint i = 0; i < Cats.count(); ++i)
        ArtCat->insertItem( Cats.at(i)->name );
 
    ArtPuht->setValidator( new QDoubleValidator(0.0, 9999999.0, 2, ArtPuht) );
    ArtStock->setValidator(new QIntValidator(1, 9999999, ArtStock));
    ArtVendu->setValidator(new QIntValidator(1, 9999999, ArtVendu));
 
}

and data.h

Source code

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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
#include <qstring.h>
#include <qptrlist.h>
#include <qdatetime.h>

#ifndef __DATA_H__
#define __DATA_H__
 
class hArt {
    public: 
    QString ref;
    QString desc;
    float puht;  
    uint stock;  
    uint vendu;  
    hArt() : puht(0.0), stock(0), vendu(0) {};
    hArt(QString r, QString d, QString p, QString s, QString v) {
        ref=r;                                                   
        desc=d;                                                  
        puht=p.toFloat();                                        
        stock=s.toUInt();                                        
        vendu=v.toUInt();                                        
    };                                                           
    ~hArt() {};                                                  
};                                                               
 
class hCat {
    public: 
    QString name;
    QString desc;
    QPtrList articles;
    hCat() {};              
    hCat(QString n, QString d) : name(n), desc(d) {};
    ~hCat() { articles.clear(); };                   
};                                                   
 
class hAchat {
    public:   
    QString ref;
    QString desc;
    uint quantite;
    float puht;   
    float pht;    
    int remise;   
    hAchat() : quantite(0), puht(0.0), pht(0.0), remise(0) {};
    ~hAchat() {};                                             
};                                                            
 
class hFacture {
    public:     
    QDate date; 
    QString ref;
    QString intitule;
    QString client;  
    QPtrList achats;
                            
    int paiement;           
    enum typePaiement {     
        ESPECE,             
        CHEQUE,             
        CB,                 
        AUTRE               
    };                      
                            
    QString comment;        
    float sumHT;            
    float tva;              
    float sumTVA;
    float sumTTC;
    hFacture() :
            sumHT(0.0),tva(0.0),sumTVA(0.0),sumTTC(0.0) {
        date = QDate::currentDate ();
    };
    ~hFacture() {};
};
 
 
class hClient {
    public:
    enum clientTypeInfo {
        NOM=0,
        ADRESSE,
        CP,
        VILLE,
        PAYS,
        TEL,
        FAX,
        MOBILE,
        EMAIL,
        SITE,
        COMMENTAIRE,
        MAX_INFO
    };
 
    QString info[ MAX_INFO ];
 
    // pour clientResult in Facture
    int finded;
 
    hClient() : finded(0) {};
    ~hClient() {};
};
 
 
extern QPtrList   Cats;
extern QPtrList        Clients;


Would be very appreciate if someone could show us what's wrong and how to manage it or would mofify the sources.

Many thanks for any help to solve this problem.

Daniel

2

Sunday, May 23rd 2010, 4:54pm

No-one?

--
Daniel

3

Tuesday, June 15th 2010, 8:55am

Problem solved with a clean compilation