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. How to make the contents in central and make the window fullscreen?
Forum Updated to NodeBB v4.3 + New Features

How to make the contents in central and make the window fullscreen?

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 4 Posters 514 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.
  • Mahin AbidM Offline
    Mahin AbidM Offline
    Mahin Abid
    wrote on last edited by
    #1

    Hi, I want to make a application that have some windows.I have two questions.
    One:
    The windows are all default size when i run it . I want to make it fullscreen. I have found a method which is
    Mainwindow w;
    w.setWindowState(Qt::WindowFullScreen);
    w.show();
    That works but the problem is the Exit option(I mean the cross) gets vanished. How can i make the window fullscreen by keeping the exit option.
    Two:
    When it becomes fullscreen the contents like lable, pushbutton, messagebox all are displaced.How can i centralized the contents when i make the window fullscreen.
    It will be very kind if anyone can help me with this.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Then don't make it full screen but resize it to take the screen size. You can use showMaximized for that.

      As for your widgets, are you using layouts to place them ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • Mahin AbidM Offline
        Mahin AbidM Offline
        Mahin Abid
        wrote on last edited by
        #3

        In some cases there are layouts and in some there is no layout. I used layout for the pushbuttons . But i didn't use it for labels.
        Thanks for the maximized option it works perfectly.

        1 Reply Last reply
        0
        • Kiranachari ShilpiK Offline
          Kiranachari ShilpiK Offline
          Kiranachari Shilpi
          wrote on last edited by
          #4

          Hi,

          Why can't you use Qml Qt Quick application for your application development it was fully OpenGL , helps you to works application smoothly and Sharp finishing to the application.

          SGaistS 1 Reply Last reply
          0
          • Kiranachari ShilpiK Kiranachari Shilpi

            Hi,

            Why can't you use Qml Qt Quick application for your application development it was fully OpenGL , helps you to works application smoothly and Sharp finishing to the application.

            SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #5

            @Kiranachari-Shilpi how is that related to the question at hand ?

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            1
            • Ashok KumarA Offline
              Ashok KumarA Offline
              Ashok Kumar
              wrote on last edited by Ashok Kumar
              #6

              Give fixed size for your widgets like pushbutton , label and message box and since you are using Mainwindow place all these widgets in the centralwidget by using setcentralwidget() so that they will be placed correctly and if u want to maximize your window use showMaximized()

              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