In the first few sections, a number of ways to share the process of communication: Windows message mechanism, Memory Shared (shared memory), this section on the process of communication on another way to -QProcess. sketch
Command line parameter start
Command line read
More reference to the command line parameters to start the process of A- with reference to start the process B
When writing a program, strictly speaking, start the external program, you need to determine the version is debug or release. Otherwise, there may be errors.
To determine whether the process will start to save...
In the last section, we share how to use the Windows message mechanism to communicate among different processes. But there are many limitations, such as: can not cross platform, but also the existence of two processes at the same time can be, or the process A who received the message? Here we share another cross platform Memory -Shared (shared memory). sketch
matters needing attention
Load into memory
Read from memory
Note that when the QSharedMemory is initialized, you must specify a unique identifier Key...
A brief look at the title to it, evil, and seriously it... Seriously lose! In fact, today said the content is not confined to Qt, in many other languages or frameworks are also applicable, that is, with a visual tool, or with a text editor? Drag, or not drag? If someone asks me which is better? I would not hesitate to say not to take off, because I reserved O (a _ U) O haha! In fact, from the beginning of the just contact Qt, I got used to the handwritten code, do not like to use Designer. Of course, do not like it does not mean (in fact, very skilled). And I have always liked to use Studio Visual...
Briefly on the lower right corner of the page will appear some tips of information, desktop software is also more common, similar to the 360 news, QQ news tips! This function is simple to achieve with the animation, this section we use the timer to achieve, the following chapters will be explained in detail on the animation framework. Here we come to the realization of a right angle under the function of the bubble. sketch
Connection signal and slot
Effect realization principle
Timer start, the lower right corner of the pop-up, gradually change the position
Let the interface to stay a certain time, the time after the automatic shutdown.
In this paper, we can see that the process of communication is very much, and we can see how to use the Windows message mechanism to carry out the communication between different processes. sketch
Custom type and receive form
Override the nativeEvent effect to send a message with a custom type to receive a form that contains the required library, define the custom type to send, receive the message form title. Custom types can handle messages in too many cases, the distinction between the message, if you do not need to also can be removed. Q_OS_WI #ifdef...
Describes the process of inter process communication is to spread or exchange of information between different processes, so there is a difference between the process of the two sides can access the media? Process user space is independent of each other, in general is not accessible to each other, the only exception is the shared memory area. However, the system space is "public places", so the kernel can clearly provide such conditions. In addition, that is, the two sides can access the peripheral. In this sense, the two processes can, of course, exchange information via the common file on disk, or by "Registry" or some of the table entries in the database and record the exchange of information. Guangzhou...
A brief description of the previous sections of the custom form of learning, we can easily write a set of their own style of the interface framework, generic in a variety of forms, such as: QDialog, QWidget, QMainWindow. Most of the form are realized by using control to complete the accumulation, as long as we have a clear idea, more complex interface implement with ease. Here I come to an extension of the QMessageBox by the prompt box - according to its source code to achieve! sketch
Custom prompt box
A brief description of the contents of the last section, we achieve a form of scaling, function is very good, but unfortunately - do not support cross platform! If this is a flawed for multi platform, so, it is urgent for us to to support cross platform implementation. On the Internet have seen many different ways to achieve, more or less, there are some problems - or fusion is too high, or not very good scaling, drag. Based on the previous share and summary, finally, I also took a long time to improve. Alone le le than the public Le Le, since pure open source - that all share out. sketch
Description of the first two sections, we achieve a custom form of the mobile, as well as the custom title bar - to display the form of the icon, title, and control the form to minimize, maximize, close. After that, we still lack the form of scaling - when the mouse movement to form the border left, top, right, bottom, left corner, the left corner and the top right corner, right angle, mouse to the corresponding style, and the form can be with the mouse to drag and zoom. sketch
Interface description of the effect of the form scaling to achieve the header files and the need to use the library Q_OS_WIN #ifdef...
We have achieved a custom form movement, but we are short of a title bar to display the icon and title of the form, as well as the control of the form to minimize, maximize, close the button. Customize the title bar, all the controls we can be customized, for example: in the title bar add skin, setting buttons and other controls. sketch
Custom title bar
Effect of the custom title bar to achieve TITLE_BAR title_bar.h#ifndef
UI design is to refer to the software of human-computer interaction, operation logic, the overall design of the interface aesthetics. Good UI design is not only to make the software to be personalized, have grade, but also to make the operation of the software become comfortable and simple, free, fully reflect the positioning and characteristics of software. Beauty of the heart of people all have. In fact, the software interface is like industrial modeling, is an important selling point of the product. A product has a beautiful interface will give people a comfortable visual enjoyment, closer to the distance between people and products, is built on the scientific nature of the art design. The standard for testing an interface - neither the opinion of a project development team leader nor the project member...
Before sharing all the basic knowledge, it is necessary to introduce the commonly used window -QWidget, QDialog, QMainWindow. Familiar with Qt students should know that in the new Widgets Qt project to choose the class information will encounter them, yes, very clever, every time they meet. So, in the future Qt development, we will often and they deal with. As the saying goes, the enemy, know yourself. Only understand them, know them, to better control them... QWidget inherits from QObject and QPaintD...
In general, we are in the process of developing software, will cache some information to the local, you can use a lightweight database SQLite, you can also operate the registry, read and write configuration files. On the use of QSettings has been introduced in the previous, more detailed, see "more reference", following the introduction of QSettings commonly used functions - read and write registry, configuration file. sketch
Read and write registry
Sub directory storage
Read and write configuration file
The QSettings class provides a persistent platform independent application settings.
Users usually expect the application to remember its settings (window size, location, etc.) for all sessions. This information is usually stored in the Windows system registry, X OS and iOS property list file. In the Unix system, in the absence of standard cases, many applications (including KDE applications) use INI text files.
QSettings surrounds these abstract technologies, so that we can save and restore application settings in a portable way. It also supports custom storage formats.
QProcess can be used to launch external programs, and interact with them. To start a process, by calling the start () to carry out, the parameter contains the name of the program and the command line parameters, the parameters as a single string QStringList. In addition, you can use the setProgram () and setArguments () to run, and then call start () or open ().
CMD band parameters
CMD gets the return value
Putty remote login
WinSCP remote transmission...