A cross-platform dictionary software goldendict for open source projects

Source: Internet
Author: User

Goldendict is a good, and StarDict (star translation) similar to the dictionary software. It uses WebKit as the rendering core, formatting, colors, images, links and other support available, supporting a variety of dictionary file formats, including Babylon. BGL file, stardict. ifo/.dict/.idx/.syn file, dictd. index/.dict (. dz) file, abbyy lingvo. dsl/.lsa/.dat file, query Wikipedia, wikt MediaWiki Wiki sites such as Ionary, and the ability to use other online dictionary sites via template Url patterns, morphology systems based on Hunspell, complete Unicode support, scan windows, and global hotkey functions. Effect as shown:



The Qtsingleapplication component provides support applications, which are very useful and even critical for some applications. The application should activate and start an instance that is already running, and can perform the requested action, such as loading a file.
The Qtsingleapplication class provides an interface to detect a running instance that sends a command string. For Console (non-GUI) applications, qtsinglecoreapplication variants, thereby avoiding reliance on Qtgui.

The following is a show of how to use an existing application qtsingleapplication:

Original
 int main (int argc, char **argv)
 {
     qapplication app (argc, argv);

     Mymainwidget MMW;
     Mmw.show ();
     return app.exec ();
 }

 Single Instance
 int main (int argc, char **argv)
 {
     qtsingleapplication app (argc, argv);

     if (app.isrunning ()) return
         !app.sendmessage (somedatastring);

     Mymainwidget MMW;
     App.setactivationwindow (&MMW);
     Mmw.show ();
     return app.exec ();
 }
The following instance log view shows messages sent by other instances of the same application.
This example demonstrates how to use the Qtsingleapplication class to detect and communicate a running instance of an application using the SendMessage (API). A qtextedit log displays the received message (messagereceived).

#include <qtsingleapplication.h>
 #include <QtGui/QTextEdit>

 class Textedit:public Qtextedit
 {
     q_object public
 :
     textedit (Qwidget *parent = 0)
         : qtextedit (parent)
     {} Public
 slots:
     void Append (const QString &STR)
     {
         qtextedit::append (str);
     }
 ;

 #include "MAIN.MOC"

 int main (int argc, char **argv)
 {
     qtsingleapplication instance (argc, argv);
	Create an Qtsingleapplication object immediately

     if (Instance.sendmessage ("Wake up!")
         return 0;
	Only one instance is allowed to

     TextEdit LogView;
     Logview.setreadonly (true);
     Logview.show ();
	Create a form. ~

     Instance.setactivationwindow (&logview);

     Qobject::connect (&instance, SIGNAL (messagereceived (const qstring&)),
                      &logview, SLOT (Append (const qstring&)));

     return instance.exec ();
The Log Viewer object is also set to the application's activation window. Each time a message is received, the window is raised and automatically activated.
//each received message will be displayed in the log.
//The event loop is entered.


The goal of learning is to be mature. ~~~

SOURCE Package Download


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.