Develop a simple calculator with vs2013+qt5.7.0

Source: Internet
Author: User
Tags qt designer

Use QT for the first time, configure environment variables and add QT paths to vs to find out for yourself

Source Code connections: 77508615

  

To do a simple calculator implementation is probably the use of these several files

The first is the UI interface, open QT Designer can be edited, a bit like to do Android layout

The second one is the. h file that corresponds to the UI interface, which contains the code implementation for the various controls in the UI interface.

The third is the project. h file, which declares the action you want to implement

The fourth one is the CPP file, which defines the functions declared in the. h

Fifth main, nothing to say.

editing the UI interface

Drag and drop the desired control, adjust the scale position, and compile the UI file in VS, so that the Generated files are instantiated in the ui_xxx.h of each control, and so on.

  

I do not know what the meaning, it should be added a method to monitor OK this button?

Wait until I find it and come back to update.

---------------------------------------------------------------

Https://www.cnblogs.com/felix-wang/p/6212197.html

Should be said here, the use of slots defined is the function of the signal realization, that is, the reaction tank

Then define the function of the button binding

A simple If-else statement that determines the operator to choose between two numbers for a radio control

Consider the addition of digits 0 or no input condition

Compile and run, OK

------the UI interface after editing to compile, or not open the Ui_xxx.h file, otherwise you will be prompted "Unable to open the document, may be renamed, moved or deleted."

------Error Warning Msb8027:two or more files with the name of Moc_geometry.cpp would produce outputs to the same location.  This can leads to an incorrect build result. The files involved is generatedfiles\debug\moc_xxx.cpp, generatedfiles\release\moc_xxx.cpp.

  

Change the mocdirectory into. \generatedfiles

Did I change my own back after this change?

But no more errors.

------Double-click UI file vs will get stuck

This online has a solution, that is, right-click UI file, change the default of open mode, to QT file to find QT Designers.exe file, set as the default value

No matter what, go to the QT Directory folder bin to find the Qt5WebEngineWidgets.dll file to change the name of the individual

Develop a simple calculator with vs2013+qt5.7.0

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.