Bonjour à tous,
j'ai une erreur lors de la compilation que je n'arrive pas à résoudre...
J'ai un QSystemTrayIcon est je voudrais faire en sorte de faire un mini popup pour afficher des messages.
donc je l'inclus comme ça dans le fichier qui créer mon QSystemTrayIcon :
et mon fichier popup.h
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5 #include "popup.h" QPopup t(200,140); t.Show("Un popup","C'est juste un petit message Show pour le montrer");
J'ai cette erreur :
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
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 #include <QtGui> #include <QtCore/QtCore> #include <QtCore/QObject> #include <windows.h> const int SCREENX = GetSystemMetrics(SM_CXSCREEN); const int SCREENY = GetSystemMetrics(SM_CYSCREEN); class QPopup : public QWidget { Q_OBJECT; private: int mqx; int mqy; int mpx; int mpy; bool etat; QLabel *label; QGridLayout *layout; public: QPopup(const int x, const int y) { etat = false; init(x,y); } void addWid(QWidget* widget,const int a = 0,const int b = 0,const int c = 0,const int d = 0) { layout->addWidget(widget,a,b,c,d); } void Show(const QString titre,const QString texte,const int _ti = 3000) { checkEtat(); label->setText(texte); setWindowTitle(titre); QTimer* timer = new QTimer(this); QObject::connect(timer,SIGNAL(timeout()), this ,SLOT(animateClose())); animateShow(); timer->start(_ti); } public slots: void animateShow() { checkEtat(); for(int i = SCREENX; i >= mpy; i--) { show(); setGeometry(mpx,i,mqx,mqy); } } void animateClose() { checkEtat(); for(int i = mpy; i < SCREENX; i++) { setGeometry(mpx,i,mqx,mqy); } close(); } private: void init(const int x,const int y) { mqx = x; mqy = y; mpx = SCREENX-(mqx+40); mpy = SCREENY-(mqy+40); label = new QLabel(this); layout = new QGridLayout(this); label->resize(mqx,mqy); label->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter); label->setWordWrap(true); layout->addWidget(label); setLayout(layout); setGeometry(mpx,mpy,mqx,mqy); setLayout(layout); setWindowFlags(Qt::WindowTitleHint); etat = true; } void checkEtat() { if(!etat) init(mqx,mqy); } };
ça fais pas mal de temps que je suis sur ce problème que je n'arrive pas à résoudre seul...
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 mingw32-make -f Makefile.Debug mingw32-make[1]: Entering directory `C:/Sources' g++ -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT - DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"c:\Qt \4.4.3\include\QtCore" -I"c:\Qt\4.4.3\include\QtCore" -I"c:\Qt\4.4.3\include\QtG ui" -I"c:\Qt\4.4.3\include\QtGui" -I"c:\Qt\4.4.3\include" -I"." -I"c:\Qt\4.4.3\i nclude\ActiveQt" -I"debug" -I"." -I"c:\Qt\4.4.3\mkspecs\win32-g++" -o debug\tool .o tool.cpp C:\Qt\4.4.3\bin\moc.exe -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_GUI_LIB - DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"c:\Qt\4.4.3\include\QtCore" -I"c:\Qt\4.4.3\include\QtCore" -I"c:\Qt\4.4.3\include\QtGui" -I"c:\Qt\4.4.3\inc lude\QtGui" -I"c:\Qt\4.4.3\include" -I"." -I"c:\Qt\4.4.3\include\ActiveQt" -I"de bug" -I"." -I"c:\Qt\4.4.3\mkspecs\win32-g++" -D__GNUC__ -DWIN32 tool.h -o debug\ moc_tool.cpp g++ -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT - DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"c:\Qt \4.4.3\include\QtCore" -I"c:\Qt\4.4.3\include\QtCore" -I"c:\Qt\4.4.3\include\QtG ui" -I"c:\Qt\4.4.3\include\QtGui" -I"c:\Qt\4.4.3\include" -I"." -I"c:\Qt\4.4.3\i nclude\ActiveQt" -I"debug" -I"." -I"c:\Qt\4.4.3\mkspecs\win32-g++" -o debug\moc_ tool.o debug\moc_tool.cpp g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-rel oc -mthreads -Wl -Wl,-subsystem,windows -o "debug\programme.exe" object_scrip t.programme.Debug -L"c:\Qt\4.4.3\lib" -lmingw32 -lqtmaind debug\ressources_r es.o -lws2_32 -lQtGuid4 -lQtCored4 g++: object_script.programme: No such file or directory g++: Live.Debug: No such file or directory mingw32-make[1]: *** ["debug\programme] Error 1 mingw32-make[1]: Leaving directory `C:/Sources' mingw32-make: *** [debug] Error 2
Merci beaucoup !
Partager