PDA

View Full Version : 2 Questions



kingfinn
9th January 2010, 12:19
Hi all,

I've got to Questions:

1. How can I make my QMainWindow use the full screen (not full screen mode, but use as many space as possible, just like Firefox) ? // Solved

2. Is it possible to draw half-transparent text?

Thank you,

kingfinn

wysota
9th January 2010, 13:06
Would you care to explain what does "just like Firefox" mean? Do you mean QWidget::showMaximized()?

kingfinn
9th January 2010, 13:39
Thats it, thank you!

numbat
10th January 2010, 09:39
For 2, just use a transparent pen. This example draws in 50% transparent red:


void paintEvent ( QPaintEvent * event )
{
QPainter painter(this);
painter.setPen(QPen(QColor(255, 0, 0, 128)));
painter.setFont(QFont("Arial", 30));
painter.drawText(rect(), Qt::AlignCenter, "Qt");
}

kingfinn
12th March 2010, 18:00
Thank you Guys!