You are not calling setGeometry(), resize(), or move() after the window is shown. Try this:
#include <QApplication>
#include <QWidget>
#include <QTimer>
{
Q_OBJECT
public:
QTimer::singleShot(0,
this,
SLOT(afterShow
()));
}
private slots:
void afterShow() {
setGeometry
( QRect( 0,
0,
3840,
1200 ) );
// or
// move(0, 0);
// resize(3840, 1200);
}
};
int main( int argc, char** argv )
{
Widget w;
w.show();
return app.exec();
}
#include "main.moc"
#include <QApplication>
#include <QWidget>
#include <QTimer>
class Widget: public QWidget
{
Q_OBJECT
public:
explicit Widget(QWidget *p = 0): QWidget(p) {
QTimer::singleShot(0, this, SLOT(afterShow()));
}
private slots:
void afterShow() {
setGeometry( QRect( 0, 0, 3840, 1200 ) );
// or
// move(0, 0);
// resize(3840, 1200);
}
};
int main( int argc, char** argv )
{
QApplication app( argc, argv );
Widget w;
w.show();
return app.exec();
}
#include "main.moc"
To copy to clipboard, switch view to plain text mode
I don't have a dual screen setup to test.
Bookmarks