[SOMEHOW SOLVED] QStatusBar - draw frameless widgets
-
Hello everybody,
I'm painting my own widget on status bar and have some trouble with it.On windows, status bar draws two small lines on the right of my widget, one horizontal and one vertical:
!http://vip2006.net/statusbar.png(StatusBar Windows)!And on Linux system, same code draws a border around the widget:
!http://vip2006.net/statusbarlin.png(StatusBar Linux)!How do I get them off?
My widget is subclass of QWidget:
@
class ExStatusText : public QWidget
{
Q_OBJECTpublic:
ExStatusText(QWidget *parent = NULL);
void SetText(const QString & text);protected:
void paintEvent(QPaintEvent *);private:
QStaticText m_staticText;
QPixmap clock;
};ExStatusText::ExStatusText(QWidget *parent):QWidget(parent),clock(":/TecArtStarter/Resources/clock.png")
{}
void ExStatusText::SetText(const QString & text)
{
this->m_staticText.setText(text);
QTimer::singleShot(1,this,SLOT(update()));
}void ExStatusText::paintEvent(QPaintEvent *)
{
QPainter painter(this);
painter.drawPixmap(0,0,this->clock);
painter.drawStaticText(this->clock.width()+5,0,this->m_staticText);
}//here is how I'm adding it to the QStatusBar
this->crmtime = new ExStatusText();
this->ui.statusBar->addWidget(this->crmtime,1);
@ -
have tried this allready... doesn't help... looks like I must subclass QStatusBar and reimplement its paintEvent...