Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Game Development
  4. Use code from Visual Studio 2015 in Qt / Input-Output box
Forum Updated to NodeBB v4.3 + New Features

Use code from Visual Studio 2015 in Qt / Input-Output box

Scheduled Pinned Locked Moved Unsolved Game Development
3 Posts 3 Posters 927 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.
  • G Offline
    G Offline
    Guest
    wrote on 27 Sept 2016, 16:23 last edited by A Former User 11 Jun 2016, 09:46
    #1

    Hi. I've made a really basic iSpy game in Visual Studio 2015, using the console for input/output. Now that I know more c++ I've moved onto working on QT to display an image of a landscape, and then making a console-like input/output box to actually play the game. The problem I'm having is making this input/output box in the main window.

    The questions I have are:
    how would I make this console inside of the main window,
    and how would I use the code from VS to make the game? Would I simply copy it over into my project and paste it where it should be?
    Also, if you have a different direction you think I should take this project, feel free to say so.

    I'm super sorry about how vague so much of this is, but if you ask I'll do my best to explain in more detail. Thanks.

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 27 Sept 2016, 22:28 last edited by
      #2

      Hi,

      Depending one what you want to do with that console maybe a QLineEdit + QPlainTextEdit combo would suite your needs.

      Hope it helps

      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
      • A Offline
        A Offline
        AxDSan
        wrote on 5 Nov 2016, 00:34 last edited by AxDSan 11 May 2016, 00:41
        #3

        You said you're making your game under Qt, however you never specified or mentioned any graphical rendering engine, I assume you're not using OpenGL or any third party graphical rendering engine, or further more a third party Game Engine.

        So, what I can think of when creating a console, is to maybe add a ListWidget (not ListView unless you know how to work with models, etc., etc.) and a textfield and a pushbutton.

        So the structure for the input/output console would be like so (pardon my poor drawing skills):



        So ultimately you will use the ListWidget to handle all the textual game information and even the information sent by the player, etc., etc. the QPushButton will serve as the actual event that will fire off the "trigger" that player has actually sent something, the TextEdit will simply act as the placeholder for player "commands" to send to the game.

        Good Luck!
        Cheers!


        Edit


        Didn't noticed this was questioned a month ago! My apologies if I caused necro-posting! just wanted to help!

        1 Reply Last reply
        1

        • Login

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