korm->setGeometry(730, 84, 40, 40);korm->setStyleSheet("background-image: url(\'C:/Qt/2010.05/qt/Dogbattle/images/korm.jpg\'); background-repeat: no-repeat;"); window->setStyleSheet("background-image: url(\'C:/Qt/2010.05/qt/Dogbattle/images/back.jpg\'); background-repeat: no-repeat;"); layout->addWidget(korm); layout->addWidget(log);
QLineF line(10.0, 80.0, 90.0, 20.0);QPainter painter(this);painter.drawLine(line);
#include "mainwindow.h"MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent){ QLineF line(10.0, 80.0, 90.0, 20.0); QPainter painter(this); painter.drawLine(line);}
#ifndef MAINWINDOW_H#define MAINWINDOW_H#include <QtGui/QMainWindow>class MainWindow : public QMainWindow{ Q_OBJECTpublic: MainWindow(QWidget *parent = 0); ~MainWindow();};#endif // MAINWINDOW_H