Wrap up the front markdown convert HTML engine

Source: Internet
Author: User
Tags qt designer

Above is, a lot of features have not been implemented, currently just a demo, such as left and right synchronous scrolling (synchronization is more complex, because the left and right are unequal, there is no obvious proportional relationship), the left text editor function is very weak (just QT built-in plaintext control), not beautiful (beyond the scope of power, But it's nice to have a background and transparency. )......

There are a few important points that are worth documenting:

1. python file packaging, the use of Cxfreeze packaging, installation and packaging are very simple, pycharm inside can automatically generate packaging required setup.py, as long as the Cxfreeze in the corresponding directory command line run to generate EXE and DLL and so on.

2. The previous Python program is to accept the manual input, we want to integrate with QT, we need to convert to the form of command line parameters, of course, this is very simple,

3. Qt Qprocess can invoke an external program and can give it command-line arguments, using this to invoke the previously compiled conversion engine.

4. The logic in Qt is: 1. Gets the input text of the left text box; 2. Press the Make key to write the left text to the temp.md file in the same directory, and call the conversion engine to generate the temp.html file; 3. Press the preview key to read the temp.html file information, display to the right of the Qwebview space to go;

5. The use of QRC files, the picture ah what to put in, can be called in the program.

This program is very short,. cpp and. h are all 150 lines, and there's not a lot of Python code lines in the conversion engine.

Because the logic of the program is very simple, the main parsing work has been done with Python, so Qt is wrapped up, presumably is to use the Qtdesigner to the control, and then layout,clear Groove can be done between the way,

Then just write the constructor of the class in the program to initialize and write two slot functions make and preview, then the beautification and so on ....

In the use of QT designer, deeply discovered their feelings for beauty and control of the low ... Adjust a font color and background to long time, choose the background is ... Finally think of Ubuntu under the terminal transparent with its own space-style desktop is also a good look, was finally relieved ...

The effect is generally the same, but I feel like the general time, the general is ... It's ugly!

Wrap up the front markdown convert HTML engine

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.