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. Qt Console Application Window Resizeable
Forum Updated to NodeBB v4.3 + New Features

Qt Console Application Window Resizeable

Scheduled Pinned Locked Moved Solved General and Desktop
9 Posts 4 Posters 3.4k Views 3 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.
  • D Offline
    D Offline
    DannyL408
    wrote on 8 May 2016, 02:25 last edited by
    #1

    Hello,
    I am trying to make the console application window be resizeable or at least be able to adjust the width as it currently only allows adjustable height

    ? 1 Reply Last reply 8 May 2016, 02:38
    0
    • D DannyL408
      8 May 2016, 02:25

      Hello,
      I am trying to make the console application window be resizeable or at least be able to adjust the width as it currently only allows adjustable height

      ? Offline
      ? Offline
      A Former User
      wrote on 8 May 2016, 02:38 last edited by
      #2

      Hi! Your console application runs within your operating system's terminal emulator. The window is owned by the terminal emulator. Your program can do nothing about it.

      1 Reply Last reply
      0
      • D Offline
        D Offline
        DannyL408
        wrote on 8 May 2016, 03:53 last edited by DannyL408 5 Aug 2016, 03:53
        #3

        What would be the simplest way to be able to resize a Console application in windows then?

        1 Reply Last reply
        0
        • ? Offline
          ? Offline
          A Former User
          wrote on 8 May 2016, 03:59 last edited by
          #4

          Just to be sure what we are talking about: You want to resize a window of cmd.exe?

          D 1 Reply Last reply 8 May 2016, 05:57
          0
          • P Offline
            P Offline
            Paul Colby
            wrote on 8 May 2016, 04:18 last edited by
            #5

            @DannyL408 said:

            What would be the simplest way to be able to resize a Console application in windows then?

            You can wrap it in a Windows cmd script, that does something like:

            mode con:cols=140 lines=70
            my-console-app.exe
            

            If you need to do it within the console application itself, you'll need to use Microsoft's Console Functions (obviously not portable), such as SetConsoleScreenBufferSize.

            Some further reading:

            • How to change Screen buffer size in Windows Command Prompt from batch script (Stack Overflow)
            • CMD: Set buffer height independently of window height (Stack Overflow)
            • tenox7/cmdmax/cmdmax.c (github)

            Good luck.

            Cheers.

            M 1 Reply Last reply 8 May 2016, 07:48
            1
            • ? A Former User
              8 May 2016, 03:59

              Just to be sure what we are talking about: You want to resize a window of cmd.exe?

              D Offline
              D Offline
              DannyL408
              wrote on 8 May 2016, 05:57 last edited by
              #6

              @Wieland
              I have Qt basic console application in release mode with the .exe that i would like to have a wider window with

              1 Reply Last reply
              0
              • P Paul Colby
                8 May 2016, 04:18

                @DannyL408 said:

                What would be the simplest way to be able to resize a Console application in windows then?

                You can wrap it in a Windows cmd script, that does something like:

                mode con:cols=140 lines=70
                my-console-app.exe
                

                If you need to do it within the console application itself, you'll need to use Microsoft's Console Functions (obviously not portable), such as SetConsoleScreenBufferSize.

                Some further reading:

                • How to change Screen buffer size in Windows Command Prompt from batch script (Stack Overflow)
                • CMD: Set buffer height independently of window height (Stack Overflow)
                • tenox7/cmdmax/cmdmax.c (github)

                Good luck.

                Cheers.

                M Offline
                M Offline
                mrjj
                Lifetime Qt Champion
                wrote on 8 May 2016, 07:48 last edited by mrjj 5 Aug 2016, 07:50
                #7

                Hi starting your .exe with a bat file as @Paul-Colby mentions is the fastest
                way to a bigger window.
                Tested on win 10.
                Not sure on win 7 as console window
                had strict ideas about available sizes :)

                1 Reply Last reply
                0
                • D Offline
                  D Offline
                  DannyL408
                  wrote on 8 May 2016, 18:15 last edited by
                  #8

                  It seems i can just go to the properties of the .exe and edit the "layout"

                  M 1 Reply Last reply 8 May 2016, 18:19
                  1
                  • D DannyL408
                    8 May 2016, 18:15

                    It seems i can just go to the properties of the .exe and edit the "layout"

                    M Offline
                    M Offline
                    mrjj
                    Lifetime Qt Champion
                    wrote on 8 May 2016, 18:19 last edited by
                    #9

                    @DannyL408
                    Cool, where do u see such option ?

                    1 Reply Last reply
                    0

                    1/9

                    8 May 2016, 02:25

                    • Login

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