Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Application that install browser plugin
QtWS25 Last Chance

Application that install browser plugin

Scheduled Pinned Locked Moved General and Desktop
15 Posts 6 Posters 5.8k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Q Offline
    Q Offline
    qwertyuiopearendil
    wrote on last edited by
    #1

    Hi All,
    Some of you was able to use trivial example to create a browser plugin?
    I'm trying to compile it but I'm not able to do.

    These are the steps done untill now:

    #1 Create a new project (Qt GUI Application);
    #2 Create a file trivial.cpp:

    @
    #include <QtGui>

    class Trivial : public QWidget
    {
    Q_OBJECT
    Q_PROPERTY(QString text READ text WRITE setText)

     Q_CLASSINFO("ClassID", "{5a22176d-118f-4185-9653-9f98958a6df8}")
     Q_CLASSINFO("InterfaceID", "{2df735ba-da4f-4fb7-8f35-b8dfbf8cfd9a}")
     Q_CLASSINFO("EventsID", "{449de213-f8bd-4d2e-a2cf-eab407c03245}")
    
     Q_CLASSINFO("MIME", "trivial/very:xxx:Trivial and useless")
     Q_CLASSINFO("ToSuperClass", "Trivial")
     Q_CLASSINFO("DefaultProperty", "text")
    

    public:
    Trivial(QWidget *parent = 0)
    : QWidget(parent)
    {
    m_text = QString::fromLatin1("Empty");
    }

     void mousePressEvent(QMouseEvent *)
     {
         mouseDown();
     }
     void mouseMoveEvent(QMouseEvent *e)
     {
         mouseMove(e->x(), e->y());
     }
     void mouseReleaseEvent(QMouseEvent*)
     {
         mouseUp();
     }
     QString text() const
     {
         return m_text;
     }
    

    public slots:
    void about()
    {
    QMessageBox::aboutQt(this);
    }
    void setText(const QString &text)
    {
    m_text = text;
    update();
    }

    signals:
    void mouseDown();
    void mouseMove(int x, int y);
    void mouseUp();

    protected:
    void paintEvent(QPaintEvent*)
    {
    QPainter p(this);
    QRect r(rect());
    r.adjust(0, 0, -1, -1);

         p.drawRect(r);
         p.drawText(r, Qt::AlignCenter, m_text);
     }
    

    private:
    QString m_text;
    };

    #include "trivial.moc"

    QTNPFACTORY_BEGIN("Trivial Qt-based Plugin", "A Qt-based LiveConnected plug-in that does nothing")
    QTNPCLASS(Trivial)
    QTNPFACTORY_END()

    #ifdef QAXSERVER
    #include <ActiveQt/QAxFactory>
    QAXFACTORY_BEGIN("{aa3216bf-7e20-482c-84c6-06167bacb616}", "{08538ca5-eb7a-4f24-a3c4-a120c6e04dc4}")
    QAXCLASS(Trivial)
    QAXFACTORY_END()
    #endif
    @

    #3 create a .pri file called trivial.pri:

    @
    SOURCES += trivial.cpp
    @

    #4 Add trivial.pri to my Main project:

    @
    include(trivial.pri)
    @

    When i compile main application it returns an error:
    trivial.cpp: error: 73: expected constructor, destructor, or type conversion before '(' token

    Can you help me?

    Thanks

    1 Reply Last reply
    0
    • T Offline
      T Offline
      tobias.hunger
      wrote on last edited by
      #2

      For which browser is this? Looks like IE to me, but I am not sure.

      1 Reply Last reply
      0
      • Q Offline
        Q Offline
        qwertyuiopearendil
        wrote on last edited by
        #3

        I'd like to create for all browser but for now I'll be very happy if it runs with firefox.
        But for now my project doesn't compile.

        1 Reply Last reply
        0
        • L Offline
          L Offline
          loladiro
          wrote on last edited by
          #4

          From "here":http://doc.qt.nokia.com/solutions/4/qtbrowserplugin/developingplugins.html
          Did you

          1. "Download":ftp://ftp.qt.nokia.com/pub/qt/solutions/ the necessary files?

          [quote]
          Include the qtbrowserplugin.pri in your .pro file, and regenerate the makefile with qmake. The resulting makefile will generate a shared library that the browsers will be able to load as a plugin.
          [/quote]

          1 Reply Last reply
          0
          • Q Offline
            Q Offline
            qwertyuiopearendil
            wrote on last edited by
            #5

            I compiled trivial example, it generates a .dll
            Now how can i install into firefox.
            Thanks.

            1 Reply Last reply
            0
            • L Offline
              L Offline
              loladiro
              wrote on last edited by
              #6

              "For Firefox":https://developer.mozilla.org/en/Gecko_Plugin_API_Reference/Plug-in_Basics#How_Gecko_Finds_Plug-ins

              "In General":http://doc.qt.nokia.com/solutions/4/qtbrowserplugin/developingplugins.html#installing-and-using-plugins

              1 Reply Last reply
              0
              • Q Offline
                Q Offline
                qwertyuiopearendil
                wrote on last edited by
                #7

                I've solved my Problem, we must simply put the dll created into a specific folder.
                Thanks to all

                1 Reply Last reply
                0
                • Q Offline
                  Q Offline
                  qwertyuiopearendil
                  wrote on last edited by
                  #8

                  Hi, About my last post: it's true that plugin is installed putting .dll file into specific folder but this doesn't run on windows.
                  What should i do to install my trivial plugin on internet explorer?
                  I've added line:
                  @CONFIG += qaxserver@
                  Necessary for Internet Explorer
                  Thanks.

                  1 Reply Last reply
                  0
                  • S Offline
                    S Offline
                    sonuesco
                    wrote on last edited by
                    #9

                    thanks all its helpful information for me

                    [url=http://bestcoloringpages.com/]Coloring Pages[/url]|[url=http://bestcoloringpages.com/animals-coloring-pages_1c15.html/]Animal Coloring Pages[/...

                    1 Reply Last reply
                    0
                    • L Offline
                      L Offline
                      loladiro
                      wrote on last edited by
                      #10

                      On Internet Exploerer it should be automatic:
                      [quote]
                      Windows, Internet Explorer: The Makefile generated by qmake by default runs the necessary commands to register the plugin as an ActiveX server (if CONFIG includes qaxserver).
                      [/quote]
                      Otherwise you can register it manually using 'regsvr32 "C:\PATH\TO\PLUGIN.dll" '.

                      1 Reply Last reply
                      0
                      • Q Offline
                        Q Offline
                        qwertyuiopearendil
                        wrote on last edited by
                        #11

                        I apologize for my experience lack, but what does it mean: " you can register it manually using ‘regsvr32 “C:\PATH\TO\PLUGIN.dll” ‘. "

                        Sorry

                        1 Reply Last reply
                        0
                        • D Offline
                          D Offline
                          DenisKormalev
                          wrote on last edited by
                          #12

                          you should run this command in console with path to your plugin.

                          1 Reply Last reply
                          0
                          • Q Offline
                            Q Offline
                            qwertyuiopearendil
                            wrote on last edited by
                            #13

                            Ok thanks for you quick feedback, but i should do it from Qt application or from Installer.

                            1 Reply Last reply
                            0
                            • A Offline
                              A Offline
                              aLukas
                              wrote on last edited by
                              #14

                              Hi all, I'm working with the Bouncer example from the "C++ GUI Programming with Qt 4, Second Edition
                              by Jasmin Blanchette; Mark Summerfield" book.
                              I can't receive the signal in javascript, which was sent from plugin (function AxBouncer::bouncing(), demo.html)
                              I used qtbrowserplugin, but did't work too.
                              Everything works Firefox.

                              1 Reply Last reply
                              0
                              • A Offline
                                A Offline
                                aLukas
                                wrote on last edited by
                                #15

                                Sorry, does not work in Internet explorer

                                1 Reply Last reply
                                0

                                • Login

                                • Login or register to search.
                                • First post
                                  Last post
                                0
                                • Categories
                                • Recent
                                • Tags
                                • Popular
                                • Users
                                • Groups
                                • Search
                                • Get Qt Extensions
                                • Unsolved