Hello !

Alors, ma classe marche parfaitement, voici quand meme les sources:
Header:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
#ifndef DIALOGS_H
#define DIALOGS_H
 
#include <QObject>
 
#include "div.h"
 
class dialogs : public QObject
{
public:
    dialogs(const QString &title, hdiv &parent);
    hdiv *getDialog();
 
 
private:
    hdiv *_tmpdiv;
 
    void addTitlePicture();
    void addCloseButton();
    void addContent();
public slots:
    void closeDialog();
};
 
#endif // DIALOGS_H
Source:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
#include "dialogs.h"
#include "const.h"
 
 
#include <QMessageBox>
#include <QPushButton>
dialogs::dialogs(const QString &title, hdiv &parent)
{
    hdiv *t = new hdiv(title, false, parent);
    _tmpdiv = t;
    _tmpdiv->setStyle(QString::fromUtf8("background-color: rgb(0, 0, 0);background-image: url(:/bg-images/background-menu.png)"));
    _tmpdiv->resize(QRect(0,0,249,282));
 
    addTitlePicture();
    addCloseButton();
}
hdiv *dialogs::getDialog()
{
    return _tmpdiv;
}
void dialogs::addTitlePicture()
{
    QString divtitle = _tmpdiv->getID();
    divtitle.append("-title");
    hdiv *t = new hdiv(divtitle,false,*_tmpdiv);
    t->resize(QRect(10,10,192,9));
    QString stylesheet = "background-color: ";
    stylesheet.append(QString(HS_COLOR_DIALOGS_BACKGROUND));
    stylesheet.append(";background-image: url(:/bg-images/images/");
    stylesheet.append(_tmpdiv->getID());
    stylesheet.append("-title-bgpicture.png)");
    t->setStyle(stylesheet);
    _tmpdiv->appendChild(t);
}
void dialogs::addCloseButton()
{
    QString divtitle = _tmpdiv->getID();
    divtitle.append("-closebutton");
    hdiv *t = new hdiv(divtitle,false,*_tmpdiv);
    t->resize(QRect(219,5,24,23));
    QPushButton *qpb = new QPushButton(t->getWidget());
    qpb->setGeometry(QRect(0,0,24,23));
    QString stylesheet = "QPushButton { border:none; background-color: ";
    stylesheet.append(QString(HS_COLOR_DIALOGS_BACKGROUND));
    stylesheet.append(";background-image: url(:/bg-images/images/");
    stylesheet.append("closebutton-bgpicture.png)}");
    qpb->setStyleSheet(stylesheet);
    t->appendChild(qpb);
    stylesheet = "background-color: ";
    stylesheet.append(QString(HS_COLOR_DIALOGS_BACKGROUND));
    stylesheet.append(";background-image: none;");
    t->setStyle(stylesheet);
    t->connect(qpb,SIGNAL(clicked()), this, SLOT(closeDialog()));
    _tmpdiv->appendChild(t);
}
void dialogs::closeDialog()
{
    QMessageBox mb;
    mb.setText("Closing dialog");
    mb.exec();
}
Mon signal devrait etre emis lorsque je clicke sur le bouton, et appeler dialogs::closeDialog()
Or, quand je compile:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
Starting C:/dev/HighStory/HighStory_Client/debug/HighStory_Client.exe
Object::connect: No such slot QObject::closeDialog()
Pourquoi ? O.o


-----------------------------------------------

Ensuite, j'aurais besoin de quelques conseils sur des effets. Je m'explique.

Vous connaissez probablement Le Prototype JavaScript & Script.aculo.us
Ils permettent notamment de faire de MAGNIFIQUES effets (fade, move, shake, etc)

On fait ca comment en Qt ? o.o



m'ci