Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Consider the following statements and answer the questions that follow them: QString userInput = QInputDialog::getText ( 0 , User Details, Enter your full name (

Consider the following statements and answer the questions that follow them:
QString userInput = QInputDialog::getText(0, "User Details", "Enter your full name (each word separated by :)");
QStringList userInfo = userInput.split(":");
if(userInfo.length()<2)
QMessageBox::warning(0, "Error", "Enter your full name!", 0,0);
else
QMessageBox::information(0,"Result",QString("Your name consists of %1 words.").arg(userInfo.length()),0,0);
1 Write a non-empty input string that the user can enter in the QInputDialog dialog that will be bring up the error message in the QMessageBox dialog in the code above. (2)
2 Write the output string displayed in the QMessageBox dialog when the user enters the string Mike:William:Owen in the QInputDialog dialog. (2)
3 What is the effect of entering a number, say 4444, in the above QInputDialog dialog? (2)
4 Explain one similarity and one difference between QInputDialog and QMessageBox dialogs for obtaining user input. (4)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Linked Data A Geographic Perspective

Authors: Glen Hart, Catherine Dolbear

1st Edition

1000218910, 9781000218916

More Books

Students also viewed these Databases questions