Nokia N8 showFullScreen() don't work
-
At this example too?
@ int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QDialog dlg;
dlg.showFullScreen();
return a.exec();
}@ -
error:
aggregate 'QDialog dlg' has incomplete type and cannot be defined
?edit: i forgot to include
-
okay, it works, but how can i get my buttons into the dialog now?
edit: now there is just a gray screen
-
Just add your button to the dialog.
-
how can i show the mainwindow.ui??
-
Write your own class from QDialog.
@#include <QDialog>
namespace Ui {
class TestDialog;
}class TestDialog : public QDialog
{
Q_OBJECTpublic:
explicit TestDialog(QWidget *parent = 0);
~TestDialog();private:
Ui::TestDialog *ui;
};@@TestDialog::TestDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::TestDialog)
{
ui->setupUi(this);
}TestDialog::~TestDialog()
{
delete ui;
}
@ -
okay, i canged 'QMainWindow' to 'QDialog'. everything semms to be allright,
but i still just get the gray screen. the setupui looks great so i have no idea whats wrong. -
show your code
-
main.cpp:
@int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QDialog dlg;
/MainWindow w;/
dlg.showFullScreen();
return a.exec();
}
@mainwindow.cpp:
@#include "QDialog"
MainWindow::MainWindow(QWidget *parent) :
QDialog(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);}
MainWindow::~MainWindow()
{
delete ui;}@
mainwindow.h:
@#include <QDialog>namespace Ui {
class MainWindow;
}class MainWindow : public QDialog
{
Q_OBJECTpublic:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();private:
Ui::MainWindow *ui;private slots:
.
.
.
};@ -
and mainwindow.ui:
@<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>MainWindow</class>
<widget class="QDialog" name="MainWindow">
<property name="windowModality">
<enum>Qt::NonModal</enum>
</property>
...@ -
Well, based in the code you posted, you don't instantiate-and-show your MainWindow in main.cpp, just a standard QDialog :-)
-
why QDialog, must be MainWindow:
main.cpp:
@int main(int argc, char *argv[])
{
QApplication a(argc, argv);
MainWindow dlg;
dlg.showFullScreen();
return a.exec();
}@ -
okay, thanks!
but now i have the same problem again:
i can only start the app when i rotate the device!
its not possible to run it while the device is in the normal position!
the app is exiting always! -
comment this line
@ui->setupUi(this);@
does program work? -
no, even not when i rotate it!
-
But with QDialog all works correctly?
-
no, it crashes when i start it. its just working with the gray screen when i dont add buttons etc..
there has to be a problem with showFullscreen() because when i use showMaximized everythings ok, but than theres to low space for my app.
any idea? -
ok, i tried around an found out that its not a problem with showFullscreen();.
Its seems to be a problem with the images i have used.
i removed all my .bmp files and the app works.
now i dont use images, but it looks bad, so what can i use therefor now?
or is it maybe a problem in the .pro file?
the line RESOURCES: images.qrc ?? but it worked fine with symbian 5th.
any other idea? or other image types to use?
thanks! -
Can you write test with images? And upload it?
-
i tried it with .jpg files now, and it worked.
but it is very buggy now. so very often the wrong files are shown, or the files are not correctly positioned or both! maybe its a problem of icons?? i use these .jpg files as icons on buttons.
i will try to upload a small sample.