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. Why can't ie11 load the DLL generated by the qt-5.6/activeqt-hierarchy-example?
Forum Updated to NodeBB v4.3 + New Features

Why can't ie11 load the DLL generated by the qt-5.6/activeqt-hierarchy-example?

Scheduled Pinned Locked Moved Solved General and Desktop
27 Posts 3 Posters 1.8k Views 1 Watching
  • 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.
  • hskoglundH hskoglund

    Don't think it's possible to do in Javascript, but what I do know, is that it's pretty easy to change width and height of a QWidget (e.g. setGeometry(), same as in osgActiveGLQT's constructor)

    So, easiest would be to implement 2 new slots in your C++ code for the osgActiveGLQT object, for example setHeight() and setWidth().
    Then you could call those 2 functions from Javascript, in the same way you call setTimeout() now.

    M Offline
    M Offline
    mirro
    wrote on last edited by mirro
    #16

    Why is the activeQT window size wrong when i set window size injavascript?

    The following screenshots and code
    link text

    <object ID ="osgActiveGLQT" WIDTH = "900" HEIGHT = "600" CLASSID="CLSID:B0545661-8607-43BA-A1C2-B43C0A93D976">
    [Object not available! Did you forget to build and register the server?]
    </object>
    
    #ifndef ActiveQTOSGWidget_H
    #define ActiveQTOSGWidget_H
    
    #include <iostream>
    
    #include <QtWidgets/QWidget>
    #include <QtWidgets/QLayout>
    #include <QtWidgets/QApplication>
    #include <QtWidgets/QLCDNumber>
    #include <QTimer>
    #include <QMessageBox>
    
    #include <osgViewer/CompositeViewer>
    #include <osgViewer/ViewerEventHandlers>
    #include <osgGA/MultiTouchTrackballManipulator>
    #include <osgDB/ReadFile>
    #include <osgQt/GraphicsWindowQt>
    #include <osg/PolygonOffset>
    
    class ActiveQTOSGWidget : public QWidget
    {
    public:
    	ActiveQTOSGWidget(QWidget *parent = 0);
    public:
    	virtual void paintEvent(QPaintEvent* event)
    	{
    		// Update the camera
    		QPainter paint(this);
    		QPen pen;
    		pen.setColor(QColor(255, 0, 0));
    		QBrush brush(QColor(255, 0, 0));
    		paint.setPen(pen);
    		paint.setBrush(brush);
    		int ss = width();
    		paint.drawRect(0, 0, width(), height());
    	}
    };
    #endif // OSGVIEW_H
    
    #ifndef OSGACTIVEGLQT_H
    #define OSGACTIVEGLQT_H
    #include <iostream>
    
    #include <QtWidgets/QWidget>
    #include <ActiveQt/QAxBindable>
    #include <QtWidgets/QLayout>
    #include <QtWidgets/QApplication>
    #include <QtWidgets/QLCDNumber>
    #include <QTimer>
    #include <QApplication>
    #include <QDesktopWidget>
    #include <QMessageBox>
    #include <QPushButton>
    
    #include "ui_osgactiveglqt.h"
    
    #include "ActiveQTOSGWidget.h"
    
    class osgActiveGLQT : public QWidget,public QAxBindable
    {
    	Q_OBJECT
    public:
    	osgActiveGLQT(QWidget *parent = 0);
    private:
    	Ui::osgActiveGLQTClass ui;
    };
    
    #endif // OSGACTIVEGLQT_H
    1 Reply Last reply
    0
    • hskoglundH Offline
      hskoglundH Offline
      hskoglund
      wrote on last edited by
      #17

      Nice! Resizing is most likely is part of the ActiveX specification, and ActiveQt being of good quality supports it.

      M 1 Reply Last reply
      0
      • hskoglundH hskoglund

        Nice! Resizing is most likely is part of the ActiveX specification, and ActiveQt being of good quality supports it.

        M Offline
        M Offline
        mirro
        wrote on last edited by mirro
        #18

        @hskoglund

        Is... there? Why is the activeQT window's size less than QT Createor window's size when I set the size of 'WIDTH' and 'HEIGHT' Properties of ActiveQT Object in javascript?

        The following screenshots and code
        link text

        <object ID ="osgActiveGLQT" WIDTH = "900" HEIGHT = "600" CLASSID="CLSID:B0545661-8607-43BA-A1C2-B43C0A93D976">
        [Object not available! Did you forget to build and register the server?]
        </object>
        
        #ifndef ActiveQTOSGWidget_H
        #define ActiveQTOSGWidget_H
        
        #include <iostream>
        
        #include <QtWidgets/QWidget>
        #include <QtWidgets/QLayout>
        #include <QtWidgets/QApplication>
        #include <QtWidgets/QLCDNumber>
        #include <QTimer>
        #include <QMessageBox>
        
        #include <osgViewer/CompositeViewer>
        #include <osgViewer/ViewerEventHandlers>
        #include <osgGA/MultiTouchTrackballManipulator>
        #include <osgDB/ReadFile>
        #include <osgQt/GraphicsWindowQt>
        #include <osg/PolygonOffset>
        
        class ActiveQTOSGWidget : public QWidget
        {
        public:
        	ActiveQTOSGWidget(QWidget *parent = 0);
        public:
        	virtual void paintEvent(QPaintEvent* event)
        	{
        		// Update the camera
        		QPainter paint(this);
        		QPen pen;
        		pen.setColor(QColor(255, 0, 0));
        		QBrush brush(QColor(255, 0, 0));
        		paint.setPen(pen);
        		paint.setBrush(brush);
        		int ss = width();
        		paint.drawRect(0, 0, width(), height());
        	}
        };
        #endif // OSGVIEW_H
        
        #ifndef OSGACTIVEGLQT_H
        #define OSGACTIVEGLQT_H
        #include <iostream>
        
        #include <QtWidgets/QWidget>
        #include <ActiveQt/QAxBindable>
        #include <QtWidgets/QLayout>
        #include <QtWidgets/QApplication>
        #include <QtWidgets/QLCDNumber>
        #include <QTimer>
        #include <QApplication>
        #include <QDesktopWidget>
        #include <QMessageBox>
        #include <QPushButton>
        
        #include "ui_osgactiveglqt.h"
        
        #include "ActiveQTOSGWidget.h"
        
        class osgActiveGLQT : public QWidget,public QAxBindable
        {
        	Q_OBJECT
        public:
        	osgActiveGLQT(QWidget *parent = 0);
        private:
        	Ui::osgActiveGLQTClass ui;
        };
        
        #endif // OSGACTIVEGLQT_H
        1 Reply Last reply
        0
        • hskoglundH Offline
          hskoglundH Offline
          hskoglund
          wrote on last edited by
          #19

          Hmm it works for me, I tried with the hierarchyax sample and when I set WIDTH and HEIGHT in test.html:

          ..
          <p>
          This widget can have many children!
          </p>
          <object ID="ParentWidget" WIDTH = "900" HEIGHT = "600" CLASSID="CLSID:d574a747-8016-46db-a07c-b2b4854ee75c"
          [Object not available! Did you forget to build and register the server?]
          </object><br />
          ...
          

          the ActiveQt window is set to 900x600:
          Screenshot 2020-06-04 at 11.43.31.png

          M 1 Reply Last reply
          0
          • hskoglundH hskoglund

            Hmm it works for me, I tried with the hierarchyax sample and when I set WIDTH and HEIGHT in test.html:

            ..
            <p>
            This widget can have many children!
            </p>
            <object ID="ParentWidget" WIDTH = "900" HEIGHT = "600" CLASSID="CLSID:d574a747-8016-46db-a07c-b2b4854ee75c"
            [Object not available! Did you forget to build and register the server?]
            </object><br />
            ...
            

            the ActiveQt window is set to 900x600:
            Screenshot 2020-06-04 at 11.43.31.png

            M Offline
            M Offline
            mirro
            wrote on last edited by mirro
            #20

            @hskoglund
            oh~~ How to get the widget window from HWND in Qt5?

            The following QT4 code

            QWidget *myWidget;
            HWND hwnd;
            myWidget=QWidget::find(hwnd);
            
            1 Reply Last reply
            0
            • hskoglundH Offline
              hskoglundH Offline
              hskoglund
              wrote on last edited by hskoglund
              #21

              In Qt5 I think you have to step through all the QWidgets and look for a HWND match, like this:

              QWidget *myWidget = nullptr;
              HWND hwnd;
              
              for (auto w : findChildren<QWidget*>())
                  if (hwnd == (HWND) w->winId())
                      myWidget = w;
              
              M 2 Replies Last reply
              0
              • hskoglundH hskoglund

                In Qt5 I think you have to step through all the QWidgets and look for a HWND match, like this:

                QWidget *myWidget = nullptr;
                HWND hwnd;
                
                for (auto w : findChildren<QWidget*>())
                    if (hwnd == (HWND) w->winId())
                        myWidget = w;
                
                M Offline
                M Offline
                mirro
                wrote on last edited by mirro
                #22

                Thank you very much.

                How does the following lambda qt5 code translate into a normal slot for the singleshot in QT4?

                 QTimer::singleShot(value * 1000,[this] { signalFromQt("Hello no.:" + QString::number(++i)); });
                
                mrjjM 1 Reply Last reply
                0
                • M mirro

                  Thank you very much.

                  How does the following lambda qt5 code translate into a normal slot for the singleshot in QT4?

                   QTimer::singleShot(value * 1000,[this] { signalFromQt("Hello no.:" + QString::number(++i)); });
                  
                  mrjjM Offline
                  mrjjM Offline
                  mrjj
                  Lifetime Qt Champion
                  wrote on last edited by
                  #23

                  @mirro
                  Qt4 does not support lambdas as far as i know as it must use the new connect syntax that came in Qt5.
                  So in Qt4 you have to use a normal slot for the singleshot.

                  M 1 Reply Last reply
                  1
                  • mrjjM mrjj

                    @mirro
                    Qt4 does not support lambdas as far as i know as it must use the new connect syntax that came in Qt5.
                    So in Qt4 you have to use a normal slot for the singleshot.

                    M Offline
                    M Offline
                    mirro
                    wrote on last edited by mirro
                    #24

                    @mrjj

                    How does the following lambda qt5 code translate into a normal slot for the singleshot in QT4?
                    [this] { signalFromQt("Hello no.:" + QString::number(++i)); }

                    mrjjM 1 Reply Last reply
                    0
                    • M mirro

                      @mrjj

                      How does the following lambda qt5 code translate into a normal slot for the singleshot in QT4?
                      [this] { signalFromQt("Hello no.:" + QString::number(++i)); }

                      mrjjM Offline
                      mrjjM Offline
                      mrjj
                      Lifetime Qt Champion
                      wrote on last edited by
                      #25

                      @mirro
                      QTimer::singleShot(0, this, SLOT(theslot()));

                      like any other slot

                      theslot must be in the class that is /this/
                      the i variable must be also be a class member of same class

                      1 Reply Last reply
                      1
                      • hskoglundH hskoglund

                        In Qt5 I think you have to step through all the QWidgets and look for a HWND match, like this:

                        QWidget *myWidget = nullptr;
                        HWND hwnd;
                        
                        for (auto w : findChildren<QWidget*>())
                            if (hwnd == (HWND) w->winId())
                                myWidget = w;
                        
                        M Offline
                        M Offline
                        mirro
                        wrote on last edited by
                        #26

                        @hskoglund
                        Start with C++ in Qt, emit a signal from there into IE11,Can it be implemented in QT4?

                        QTimer::singleShot(value * 1000,[this] { signalFromQt("Hello no.:" + QString::number(++i)); });
                        
                        mrjjM 1 Reply Last reply
                        0
                        • M mirro

                          @hskoglund
                          Start with C++ in Qt, emit a signal from there into IE11,Can it be implemented in QT4?

                          QTimer::singleShot(value * 1000,[this] { signalFromQt("Hello no.:" + QString::number(++i)); });
                          
                          mrjjM Offline
                          mrjjM Offline
                          mrjj
                          Lifetime Qt Champion
                          wrote on last edited by mrjj
                          #27

                          @mirro
                          Hi
                          As told, Qt4 has no lamdas./ the new connect syntax.
                          so no you cannot use that syntax in Qt4.

                          1 Reply Last reply
                          1

                          • Login

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