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:
setupUi(this);
painter.drawLine(0,21,240,21);
}
};
#endif /*TOPBAR_H_*/
#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_*/
To copy to clipboard, switch view to plain text mode
Bookmarks