Sunday, July 20th 2008, 2:38am UTC+1

You are not logged in.

  • Login
  • Register

Dear visitor, welcome to QtForum.org. If this is your first visit here, please read the Help. It explains how this page works. You must be registered before you can use all the page's features. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

jkelly

Beginner

Posts: 6

Location: singapore

Occupation: student

1

Monday, May 12th 2008, 2:33am

HOw to execute this file?

HI, what is the commands to type in order to execute this file?

1
2 1: #include <kapp.h>
3 2: #include <qwidget.h>
4 3: #include <qpainter.h>
5 4:
6 5: class MyWindow : public Qwidget
7 6: {
8 7: public:
9 8: MyWindow() : QWidget() { }
10 9: protected:
11 10: void paintEvent(QPaintEvent *);
12 11: };
13 12:
14 13: void MyWindow::paintEvent(QPaintEvent *)
15 14: {
16 15: // Draw graphics on this object
17 16: QPainter paint(this);
18 17: // Draw a line (the destructor will make the line visible)
19 18: paint.drawLine(10,10,190,140);
20 19: }
21 20:
22 21:
23 22: int main(int argc, char **argv)
24 23: {
25 24: KApplication app(argc, argv);
26 25: MyWindow window;
27 26: window.setGeometry(50,50,200,150);
28 27: app.setMainWidget(&window);
29 28: window.setCaption("Qpainter");
30 29: window.show();
31 30: return app.exec();
32 31: }
33

thanks.
please help me, i'm only a student.. ..
  • Go to the top of the page

2

Monday, May 12th 2008, 7:48am

RE: HOw to execute this file?

in your app directory
qmake -project //make .pro file
qmake //get makefile
nmake or make
  • Go to the top of the page

Rate this thread