Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Nokia N8 showFullScreen() don't work
QtWS25 Last Chance

Nokia N8 showFullScreen() don't work

Scheduled Pinned Locked Moved Mobile and Embedded
32 Posts 3 Posters 14.5k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Matze5590
    wrote on last edited by
    #1

    Hi,
    i can't use showFullScreen(); with my Nokia N8.
    The App exits at the beginning.
    But when i rotate my phone and try it once more, the App is shown.
    How can i solve that?

    Thanks!

    1 Reply Last reply
    0
    • A Offline
      A Offline
      alexander
      wrote on last edited by
      #2

      At this example too?

      @ int main(int argc, char *argv[])
      {
      QApplication a(argc, argv);
      QDialog dlg;
      dlg.showFullScreen();
      return a.exec();
      }@

      1 Reply Last reply
      0
      • M Offline
        M Offline
        Matze5590
        wrote on last edited by
        #3

        error:
        aggregate 'QDialog dlg' has incomplete type and cannot be defined
        ?

        edit: i forgot to include

        1 Reply Last reply
        0
        • M Offline
          M Offline
          Matze5590
          wrote on last edited by
          #4

          okay, it works, but how can i get my buttons into the dialog now?

          edit: now there is just a gray screen

          1 Reply Last reply
          0
          • A Offline
            A Offline
            alexander
            wrote on last edited by
            #5

            Just add your button to the dialog.

            1 Reply Last reply
            0
            • M Offline
              M Offline
              Matze5590
              wrote on last edited by
              #6

              how can i show the mainwindow.ui??

              1 Reply Last reply
              0
              • A Offline
                A Offline
                alexander
                wrote on last edited by
                #7

                Write your own class from QDialog.

                @#include <QDialog>

                namespace Ui {
                class TestDialog;
                }

                class TestDialog : public QDialog
                {
                Q_OBJECT

                public:
                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;
                }
                @

                1 Reply Last reply
                0
                • M Offline
                  M Offline
                  Matze5590
                  wrote on last edited by
                  #8

                  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.

                  1 Reply Last reply
                  0
                  • A Offline
                    A Offline
                    alexander
                    wrote on last edited by
                    #9

                    show your code

                    1 Reply Last reply
                    0
                    • M Offline
                      M Offline
                      Matze5590
                      wrote on last edited by
                      #10

                      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_OBJECT

                      public:
                      explicit MainWindow(QWidget *parent = 0);
                      ~MainWindow();

                      private:
                      Ui::MainWindow *ui;

                      private slots:
                      .
                      .
                      .
                      };@

                      1 Reply Last reply
                      0
                      • M Offline
                        M Offline
                        Matze5590
                        wrote on last edited by
                        #11

                        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>
                        ...@

                        1 Reply Last reply
                        0
                        • A Offline
                          A Offline
                          anselmolsm
                          wrote on last edited by
                          #12

                          Well, based in the code you posted, you don't instantiate-and-show your MainWindow in main.cpp, just a standard QDialog :-)

                          Anselmo L. S. Melo (anselmolsm)

                          1 Reply Last reply
                          0
                          • A Offline
                            A Offline
                            alexander
                            wrote on last edited by
                            #13

                            why QDialog, must be MainWindow:

                            main.cpp:

                            @int main(int argc, char *argv[])
                            {
                            QApplication a(argc, argv);
                            MainWindow dlg;
                            dlg.showFullScreen();
                            return a.exec();
                            }@

                            1 Reply Last reply
                            0
                            • M Offline
                              M Offline
                              Matze5590
                              wrote on last edited by
                              #14

                              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!

                              1 Reply Last reply
                              0
                              • A Offline
                                A Offline
                                alexander
                                wrote on last edited by
                                #15

                                comment this line
                                @ui->setupUi(this);@
                                does program work?

                                1 Reply Last reply
                                0
                                • M Offline
                                  M Offline
                                  Matze5590
                                  wrote on last edited by
                                  #16

                                  no, even not when i rotate it!

                                  1 Reply Last reply
                                  0
                                  • A Offline
                                    A Offline
                                    alexander
                                    wrote on last edited by
                                    #17

                                    But with QDialog all works correctly?

                                    1 Reply Last reply
                                    0
                                    • M Offline
                                      M Offline
                                      Matze5590
                                      wrote on last edited by
                                      #18

                                      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?

                                      1 Reply Last reply
                                      0
                                      • M Offline
                                        M Offline
                                        Matze5590
                                        wrote on last edited by
                                        #19

                                        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!

                                        1 Reply Last reply
                                        0
                                        • A Offline
                                          A Offline
                                          alexander
                                          wrote on last edited by
                                          #20

                                          Can you write test with images? And upload it?

                                          1 Reply Last reply
                                          0

                                          • Login

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • Users
                                          • Groups
                                          • Search
                                          • Get Qt Extensions
                                          • Unsolved