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

Professional Microsoft SQL Server 2012 Administration

Authors: Adam Jorgensen, Steven Wort

1st Edition

1118106881, 9781118106884

Students also viewed these Databases questions

Question

Were the decisions based on appropriate facts?

Answered: 1 week ago

Question

Were the right people involved in the decision-making process?

Answered: 1 week ago