Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QWindow::showFullScreen() crashes the application
Forum Updated to NodeBB v4.3 + New Features

QWindow::showFullScreen() crashes the application

Scheduled Pinned Locked Moved Solved General and Desktop
8 Posts 3 Posters 2.4k Views 1 Watching
  • 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.
  • rockinJR Offline
    rockinJR Offline
    rockinJ
    wrote on last edited by
    #1

    the code is simple.

        if(!window) {
            window = new QWindow;
            connect(window, SIGNAL(visibleChanged(bool)), this, SLOT(update(bool)));
            store = new QBackingStore(window);
        }
        window->showFullScreen();
    

    this is inside a slot that is connected to a button click. When run to the line window->showFullScreen(), I got a segment fault and crashed.
    Debugger shows:

    1    QWindow::setWindowState  qwindow.cpp      1153
    2    QWindow::showFullScreen  qwindow.cpp      1910
    3    Widget::process          widget.cpp       73
    ...
    

    on Windows 7, kit: Desktop QT 5.7.0 MinGW 32 bit
    Any ideas? Please help. Thanks in advance!

    raven-worxR 1 Reply Last reply
    0
    • rockinJR rockinJ

      the code is simple.

          if(!window) {
              window = new QWindow;
              connect(window, SIGNAL(visibleChanged(bool)), this, SLOT(update(bool)));
              store = new QBackingStore(window);
          }
          window->showFullScreen();
      

      this is inside a slot that is connected to a button click. When run to the line window->showFullScreen(), I got a segment fault and crashed.
      Debugger shows:

      1    QWindow::setWindowState  qwindow.cpp      1153
      2    QWindow::showFullScreen  qwindow.cpp      1910
      3    Widget::process          widget.cpp       73
      ...
      

      on Windows 7, kit: Desktop QT 5.7.0 MinGW 32 bit
      Any ideas? Please help. Thanks in advance!

      raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by raven-worx
      #2

      @rockinJ
      why do you need to create a QWindow by yourself?!
      Are you sure about what you are doing?

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      rockinJR 1 Reply Last reply
      2
      • raven-worxR raven-worx

        @rockinJ
        why do you need to create a QWindow by yourself?!
        Are you sure about what you are doing?

        rockinJR Offline
        rockinJR Offline
        rockinJ
        wrote on last edited by
        #3

        @raven-worx
        I want to create another window to show pictures in full screen besides my main window.

        mrjjM raven-worxR 2 Replies Last reply
        0
        • rockinJR rockinJ

          @raven-worx
          I want to create another window to show pictures in full screen besides my main window.

          mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @rockinJ said:

          if(!window) {
              window = new QWindow;
              connect(window, SIGNAL(visibleChanged(bool)), this, SLOT(update(bool)));
              store = new QBackingStore(window);
          }
          window->showFullScreen();
          

          do you set window pointer to NULL to start with?
          else first time you click, u will crash at
          window->showFullScreen();

          rockinJR 1 Reply Last reply
          2
          • mrjjM mrjj

            @rockinJ said:

            if(!window) {
                window = new QWindow;
                connect(window, SIGNAL(visibleChanged(bool)), this, SLOT(update(bool)));
                store = new QBackingStore(window);
            }
            window->showFullScreen();
            

            do you set window pointer to NULL to start with?
            else first time you click, u will crash at
            window->showFullScreen();

            rockinJR Offline
            rockinJR Offline
            rockinJ
            wrote on last edited by
            #5

            @mrjj
            Thank you! You solved the problem. Forgot to set window to null in constructor. Sorry, new to C++.

            mrjjM 1 Reply Last reply
            1
            • rockinJR rockinJ

              @mrjj
              Thank you! You solved the problem. Forgot to set window to null in constructor. Sorry, new to C++.

              mrjjM Offline
              mrjjM Offline
              mrjj
              Lifetime Qt Champion
              wrote on last edited by
              #6

              @rockinJ
              Hurra :)
              well its a classic.

              if you are using C++11 you are allowed to set directly in class

              class XX {
              QWindow *win=NULL;
              };

              1 Reply Last reply
              2
              • rockinJR rockinJ

                @raven-worx
                I want to create another window to show pictures in full screen besides my main window.

                raven-worxR Offline
                raven-worxR Offline
                raven-worx
                Moderators
                wrote on last edited by
                #7

                @rockinJ
                i was asking, because it's possible show any QWidget as window.
                This is in most cases easier to handle, because most of the stuff then happens internally.

                --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
                If you have a question please use the forum so others can benefit from the solution in the future

                rockinJR 1 Reply Last reply
                0
                • raven-worxR raven-worx

                  @rockinJ
                  i was asking, because it's possible show any QWidget as window.
                  This is in most cases easier to handle, because most of the stuff then happens internally.

                  rockinJR Offline
                  rockinJR Offline
                  rockinJ
                  wrote on last edited by
                  #8

                  @raven-worx
                  I see, thanks anyway!

                  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