2009-09-21

Fullscreen Qt widget

If your Qt executable is the single application running at your embedded system. It makes sense that your Qt widget is border-less and full-screen.
Max modifies the example in Qt tutorial 4:

class MyWidget : public QWidget
{
public:
MyWidget(QWidget *parent = 0);
};

MyWidget::MyWidget(QWidget *parent)
: QWidget(parent, Qt::FramelessWindowHint)
{
//setFixedSize(200, 120);

QPushButton *quit = new QPushButton("Quit", this);
quit->setGeometry(62, 40, 75, 30);
quit->setFont(QFont("Times", 18, QFont::Bold));

connect(quit, SIGNAL(clicked()), qApp, SLOT(quit()));
}

int main(int argc, char *argv[])
{
QApplication app(argc, argv);
MyWidget widget;
//widget.show();
widget.showFullScreen ();
return app.exec();
}

Compile the code using Embedded Qt and run the binary among qvfb (See "Program and Test Qt Embedded Code on PC - virtual framebuffer"). The following snapshot is at 240x320 PDA configuration.

No comments:

Post a Comment