What is the use of QT MOC Uic RCC (360ui porting to eclipse)

Source: Internet
Author: User
Tags qt designer

Moc is mainly used to process signals and slots inside classes containing q_object into moc_xxx files.

Because the QT signal and slot part of this is not pure C + +, it is MOC to compile the information contained in Q_object.

When you do not use the signal to remove the q_object can also be compiled through. Just can't handle the signal these.




RCC is mainly to convert the RC resource file into a byte stream in the form of CPP files, all the resources can be obtained through this file.



Uic Uic primarily converts interface design UI files into Ui_xxx, which translates the UI of the design into C code

Like what

<width>600</width>

into Xxx.setwidth (400) setheight;

When we don't want to use QT Designer. You can implement these by your own direct code. This is more helpful to understand.

1 realize all within the constructor itself. You need to delete its constructed include "Ui_xxx.h"

Delete his private:: Ui::xxxclass Ui;




2 generated by QT He's going to automatically add a ui_xxx.h to your current class.

This ui_xxx contains a Xxxclass class. There is a setui function inside. This function is implemented for you Xxx.setwidth (setheight) (400);

There is a xxxclass private object in the current class






The combination also contains a compilation that does not use the QT IDE on Eclipse. Transplantation.


The porting code comes from the

http://blog.csdn.net/liang19890820

╰☆ Struggle ing❤ Children '

Can search his 360ui downloads.


Add all of your code to the Eclipse settings environment after you compile (all. h and. cpp) excluding resources.h and resource.rc these are the two windows

Problem

qtdemo/debug/.. /about_us.cpp:5: Undefined reference to ' vtable for Aboutusdialog '


The main reason is that these classes use Q_object to require MOC extensions.

Try to solve the aboutusdialog problem first.

Call the Qtdir directory bin MOC to process these CPP


Export Prein=/xxx/qtdemo
Export Preout=/xxx/qtdemo/out


./moc $PREIN/about_us.h-o $PREOUT/moc_about_us.cpp
./moc $PREIN/account_item.h-o $PREOUT/moc_account_item.cpp
./moc $PREIN/change_skin_widget.h-o $PREOUT/moc_change_skin_widget.cpp
./moc $PREIN/character_widget.h-o $PREOUT/moc_character_widget.cpp
./moc $PREIN/clabel.h-o $PREOUT/moc_clabel.cpp
./moc $PREIN/content_widget.h-o $PREOUT/moc_content_widget.cpp
./moc $PREIN/drop_shadow_widget.h-o $PREOUT/moc_drop_shadow_widget.cpp
./moc $PREIN/kill_mummy_widget.h-o $PREOUT/moc_kill_mummy_widget.cpp
./moc $PREIN/loading_widget.h-o $PREOUT/moc_loading_widget.cpp
./moc $PREIN/login_dialog.h-o $PREOUT/moc_login_dialog.cpp
./moc $PREIN/main_menu.h-o $PREOUT/moc_main_menu.cpp
./moc $PREIN/main_widget.h-o $PREOUT/moc_main_widget.cpp




./moc $PREIN/msg_box.h-o $PREOUT/moc_msg_box.cpp
./moc $PREIN/push_button.h-o $PREOUT/moc_push_button.cpp
./moc $PREIN/register_widget.h-o $PREOUT/moc_register_widget.cpp
./moc $PREIN/setting_dialog.h-o $PREOUT/moc_setting_dialog.cpp
./moc $PREIN/shadow_widget.h-o $PREOUT/moc_shadow_widget.cpp
./moc $PREIN/skin_widget.h-o $PREOUT/moc_skin_widget.cpp
./moc $PREIN/system_tray.h-o $PREOUT/moc_system_tray.cpp
./moc $PREIN/title_widget.h-o $PREOUT/moc_title_widget.cpp




The resulting moc_xxx.cpp are then put into the directory to compile.

The compilation is now ready to pass. This is the result of the operation. Without the resources to look




Because we did not design the UI but write it directly. So there's no need to use UIC here.


Next, convert the resource resource file

Convert the 360SAFE.QRC into a binary CPP stream


./rcc/xxx/qtdemo/resources/360safe.qrc-o/xxx/qtdemo/360resorce.cpp


Include this CPP.


Compile execution



Related Article

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.