PDA

View Full Version : Need help with a project



Wanheda
11th March 2019, 03:49
Hello everyone,i just installed Qt for the first time,so i am a total newbie. I have to make an application which will do the following : I need to insert a powerpoint presentation(the presentation is about C/C++),create 3 buttons (next,back and exit) and make one more thing. When the user comes to a slide with a C/C++ example that a random line of the code is missing and that the user needs to insert the missing line,if the line is correct he then may proceed to the next slide. As i mentioned before,im using Qt for the first time,and i have almost no knowledge about C/C++. I hope you can give me some tips or something that can help me do this. Thanks in advance.

anda_skoa
11th March 2019, 07:50
Since this is centered around Powerpoint my suggestion would be to investigate some form of Powerpoint scripting instead.

Like Visual Basic for Applications or any .NET/C# variation thereof.

Cheers,
_

Wanheda
13th March 2019, 02:49
Thank you for your reply, but as i mentioned above i have almost no knowledge/experience when it comes to programming. The project must be done in Qt,and i dont know from where to start...

d_stranz
13th March 2019, 17:31
I think what anda_skoa is trying to say is that this project is not suitable for doing in Qt. If you have to interact with an actual Powerpoint presentation where you must keep track not only of which slide is being displayed, but know the content of the slide -and- be able to tell if a user has correctly entered missing information onto the slide, this is not something you can easily do with Qt.

Qt does have support for embedding ActiveX controls and objects into a Qt program, but this is really no different from what you can do much more easily with Visual Basic or .NET / C#.

If you do not need to interact with an actual Powerpoint presentation, but can use JPG / PNG images of the pages in the presentation instead, then the problem is easier. You can use the image / pixmap support in Qt to display the "pages" of the presentation on a QLabel. QPushButton is for the three buttons, and QLineEdit so the user can type the missing text if there is any.

You would need to build a list of filenames for each page in the presentation, and for each of those pages, a lookup table that gives the missing text for each page. If a page does not have missing text, the entry for that page is an empty string. As you advance to each page, you load the file with the image of that page, check the lookup table to see if there is any missing text, and enable or disable the Next button accordingly. If there is missing text, you wait for the user to enter it (using a slot connected to the QLineEdit::editingFinished() signal), compare the user's answer to the "correct" answer, and if the user is right, enable the Next button.

Look at the Qt Image Viewer (https://doc.qt.io/qt-5/qtwidgets-widgets-imageviewer-example.html) example for ideas if this kind of solution is within the scope of your project.