CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6

Thread: Should I go for QT?

  1. #1
    Join Date
    Dec 2019

    Should I go for QT?

    Hi Guys!

    I am facing a specific task and, lacking of experience, don't know if QT is a good point to start with. I am aiming to create a program that should do the following things:

    - Let the user write texts/dates/etc in text fields

    - Store the data in either a local database (for example SQLite) or on a server (any suggestions)

    - Write the stored data in a well formated Word/Office/Outlook file

    My first attempt to create it was with MFC c++ which proved to be a little clumsy in some parts. So I was thinking that QT might come in more handy. Could you please answer me the following questions:

    1. Is there an easy way to automate MS office and open office with QT?
    2. I want to create an application where the user can decide between different templates for their surface. Not only things like color but also complete rearrangements of input fields etc.
    2. Is there an easy way to connect databases with QT? 3a. For local databases: Do you think SQLite is a good solution or are there better free solutions out there? 3b. For web based databases: What solutions do you suggest? Things like Amazon AWS or something different? Please note that data security plays an important role there

    Any help is appreciated, be it an advice to go for QT (or something else) or be it a specific answer to the questions listed above.

    Thanks a lot in advance!


  2. #2
    2kaud's Avatar
    2kaud is offline Super Moderator Power Poster
    Join Date
    Dec 2012

    Re: Should I go for QT?

    Is C++ a requirement for this project - or could other languages such as C#, vb.net be used?
    All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!

    C++17 Compiler: Microsoft VS2019 (16.4.2)

  3. #3
    Join Date
    Dec 2019

    Re: Should I go for QT?

    Well, I would prefer c++ as it is currently the only programming language I know. Besides that I have little experience with Java - do you think it's more suitable for the task?

  4. #4
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004

    Re: Should I go for QT?

    You've got several programming 'challenges' to solve: UI, COM interaction (e.g. word automation), and database interaction. QT helps with UI but doesn't offer classes AFAIK with the other two. MFC does UI and offers classes for the other two, but they are dated, imo. As an alternative, I find WTL and ATL better for all three. WTL lacks the out of the box project templates that MFC has, but gives you a UI that is leaner with a smaller footprint. I prefer ATL for COM and database interaction (because the code is template based and not clunky like the MFC code).

    All that being said, the world has passed c++ by in terms of general (non-graphics) UI, and ease of COM and database interaction. Of course, this is my opinion, but it is based on years of experience coding in C++ and C#.

    I can't speak for Java, but coding these 3 areas in C# is way simpler. For standalone UI applications, C# provides the older Forms approach which doesn't offer the doc/view architecture of MFC but makes up for it with ease of coding everywhere else. Even better is C# WPF, a declarative syntax approach to UI. With WPF, the doc/view architecture returns, only it's now called view/model (VM or MVVM), and even more exciting is binding, which bi-directionally binds the UI elements to model properties. No more manually populating UI controls with data or reading data from controls.

    C# also offers automation classes for Office app integration. It hides the COM aspect, so you get the functionality without the pain.

    For database interaction there is Entity Framework or the much improved Entity Framework Core. Too much to talk about here, but EF is an ORM (object relational model) that maps the database schema to classes. You can choose to code the classes (called Entities in EF) and relationships by hand and EF will create the db tables and constraints for you or you can reverse engineer and auto-generate the entities from an existing database. EF offers support for multiple SQL and noSQL databases as well as other types of data stores. It is orders of magnitudes easier than working with a database in C++ with MFC, ATL or raw ODBC.

    I was focusing on standalone apps, but if that isn't enough C# can produce web apps, web services and cloud apps (Azure and AWS) as well. There is a whole other world of development there.
    Last edited by Arjay; December 21st, 2019 at 02:01 PM.

  5. #5
    Join Date
    Feb 2017

    Re: Should I go for QT?

    If you want C++ then I suggest you go for Qt. It's not just a GUI but also an application framework. You'll have to check out the contents of the framework to find out whether it has what you need. There is a free version of Qt but the information you get at the Qt site is designed to coerce you into buying the commercial version. If you browse the framework and find interesting stuff make sure it's included in the free version (if free is important).

    Java and C# are pretty much the same. Both come with huge frameworks (standard libraries). It's not that picking one over the other is going to make your project hassle free. Regardless of which you go for you will regret many times that you didn't go for the other. The main difference I'd say is that Java supports many OS platforms.

    Then there's the offer of the day, Python 3. I don't know anything about it other than hearsay. It's considered a very high-level and easy to learn language with lots of libraries covering any need imaginable. I would have serious look at it and then go for C++ .

    Good luck!
    Last edited by wolle; December 22nd, 2019 at 03:31 AM.

  6. #6
    Join Date
    Dec 2019

    Re: Should I go for QT?

    Thank you all for the very useful input! I think I will give c# a look

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

On-Demand Webinars (sponsored)