Results 1 to 5 of 5

Thread: Use code from Visual Studio 2015 in QT / Input-Output box

  1. #1
    Join Date
    Sep 2016
    Posts
    2
    Thanks
    1
    Qt products
    Qt5
    Platforms
    Windows

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

    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.

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Use code from Visual Studio 2015 in QT / Input-Output box

    how would I use the code from VS to make the game?
    Yep, it's vague all right... What is this "code from VS" - is it native Windows or MFC code? Plain old C++? If it is Windows-specific code, you should (or will have to) port it to the Qt equivalent to make it work. If it is C++, it depends on what it is. Plain old C++ classes or functions (i.e. without dependencies on Windows-specific data structures or types) are perfectly usable in Qt apps. If you use Standard Library containers and algorithms (std::vector<>, etc.), these work just fine and don't need to be ported to the Qt equivalent (QVector<>).

    So if you have implemented your game logic in OS-independent C++ code, then you should have a minimal amount of porting.

    I am not sure what you mean by a "console" - are you referring to something like an MS DOS terminal window where you would type a command and get printed feedback in response? I would replace that with a QLineEdit (for entering the commands) and a read-only QTextEdit or QListWidget for displaying the responses.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

  3. The following user says thank you to d_stranz for this useful post:

    Guest3 (22nd September 2016)

  4. #3
    Join Date
    Sep 2016
    Posts
    2
    Thanks
    1
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Use code from Visual Studio 2015 in QT / Input-Output box

    I'm pretty sure it's plain old C++, so that should make things easier.
    I'm referring to the cmd-looking window that you input into when running the program.
    Thanks for your response so far, it's appreciated.

  5. #4
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Use code from Visual Studio 2015 in QT / Input-Output box

    I'm referring to the cmd-looking window that you input into when running the program.
    Since I've never seen the program, I can only guess at what you mean. A screen shot of what you are trying to port would help.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

  6. #5
    Join Date
    Mar 2008
    Location
    Kraków, Poland
    Posts
    1,536
    Thanked 284 Times in 279 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Use code from Visual Studio 2015 in QT / Input-Output box

    Quote Originally Posted by Guest3 View Post
    I'm referring to the cmd-looking window that you input into when running the program.
    Maybe this is what You need.

Similar Threads

  1. Visual Studio 2015 not updating UI files
    By pcrewik in forum Qt Tools
    Replies: 4
    Last Post: 11th August 2016, 03:33
  2. Qt Debug Error on MS Visual Studio 2015
    By wiatrak11 in forum Installation and Deployment
    Replies: 0
    Last Post: 6th April 2016, 17:03
  3. Qt 5.6beta + Visual Studio 2015
    By thru in forum Newbie
    Replies: 5
    Last Post: 1st January 2016, 21:34
  4. Qt 4.4.1 and Visual Studio 2015
    By Arthur in forum Installation and Deployment
    Replies: 1
    Last Post: 7th April 2015, 10:06
  5. qt visual studio add-in source code
    By GreenScape in forum General Programming
    Replies: 2
    Last Post: 3rd August 2010, 12:50

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.