rishid
5th February 2008, 21:50
Just trying to use a QPainter to draw a line across my widget. I thought it would be easy, just not working. Here is the entire widget code.
Thanks.
#ifndef TOPBAR_H_
#define TOPBAR_H_
#include <QtGui/QWidget>
#include <QPainter>
#include "ui_TopBar.h"
class TopBar : public QWidget, private Ui::TopBarClass {
Q_OBJECT
public:
TopBar(QWidget *parent = 0) :
QWidget(parent) {
setupUi(this);
QPainter painter(this);
painter.drawLine(0,21,240,21);
}
};
#endif /*TOPBAR_H_*/
Thanks.
#ifndef TOPBAR_H_
#define TOPBAR_H_
#include <QtGui/QWidget>
#include <QPainter>
#include "ui_TopBar.h"
class TopBar : public QWidget, private Ui::TopBarClass {
Q_OBJECT
public:
TopBar(QWidget *parent = 0) :
QWidget(parent) {
setupUi(this);
QPainter painter(this);
painter.drawLine(0,21,240,21);
}
};
#endif /*TOPBAR_H_*/