FramelessWindowHint freezes form with QAxWidget



  • An interesting problem when installing FramelessWindowHint flag all the content in the form as it is frozen, those buttons does not change when you hover style (: hover), and you can not edit the text field and more. All this happens when the form has QAxWidget. What could it be?
    Win10 x32-x64
    Qt 5.6 - 5.7


  • Qt Champions 2017

    Hi
    That sounds odd.
    Have you tried to create the QAxWidget later ?
    Like via button.
    After window is up and running etc.
    Im wondering if QAxWidget get truma if put in
    UI and then u set FramelessWindowHint in code.



  • I do everything on pure paper for the test...
    i create 2 example photo:
    no initialized qAxWidget
    initialized qAxWidget


  • Qt Champions 2017

    @Tikitko
    Ok, but in both cases, its included in the UI from start?
    It seems once active it dont like FramelessWindowHint

    I would look in
    https://bugreports.qt.io/secure/Dashboard.jspa

    and also test if you insert from code only
    not having it in UI .



  • @mrjj
    I tried so

    MainWindow::MainWindow(QWidget *parent) :
        QMainWindow(parent),
        ui(new Ui::MainWindow)
    {
        ui->setupUi(this);
        this->setWindowFlags(Qt::FramelessWindowHint);
    }
    

    like this

    void MainWindow::on_pushButton_clicked()
    {
        this->setWindowFlags(Qt::FramelessWindowHint);
        this->show();
    }
    

    and

    int main(int argc, char *argv[])
    {
        QApplication a(argc, argv);
        MainWindow w;
        w.setWindowFlags(Qt::FramelessWindowHint);
        w.show();
        qDebug() << w.windowFlags();
    
        return a.exec();
    }
    

  • Qt Champions 2017

    @Tikitko said:

    setWindowFlags(Qt::FramelessWindowHint);

    ok, but the flag is not the issue. that works.

    I was thinking about
    void MainWindow::on_pushButton_clicked()
    {
    QAxWidget *Test = new QAxWidget(this);
    Test->Show();
    .. other setup

    and not have it in UI.
    just to test.



  • @mrjj hmm
    i do this:

    void MainWindow::on_pushButton_clicked()
    {
        QAxWidget *Test = new QAxWidget(this);
        Test->setControl("{8856f961-340a-11d0-a96b-00c04fd705a2}");
        Test->dynamicCall("Navigate(const  QString&)","http://vk.com/");
        Test->show();
    }
    

    And work! this bug work when i create QAxWidget in Disigner...


    Hmm when i creat not in on_pushButton_clicked also this bug...


  • Qt Champions 2017

    well my "theory" is that
    if QAxWidget is assigned to a parent before FramelessWindowHint
    then bug comes.



  • @mrjj Then the solution is not to create QAxWidget in the constructor?


  • Qt Champions 2017

    Well I assume u tested that ?
    Create it after setupUI and FramelessWindowHint does not make it work ?

    If no, you can try with the showEvent
    void maiwinxx::showEvent( QShowEvent* event ) {
    QMainwindxx::showEvent( event );

    // create it here.

    }



  • @mrjj i create:

    void MainWindow::showEvent( QShowEvent* event ) {
    
        QAxWidget *Test = new QAxWidget(this);
        Test->setControl("{8856f961-340a-11d0-a96b-00c04fd705a2}");
        Test->dynamicCall("Navigate(const  QString&)","http://vk.com/");
        Test->show();
    
    }
    

    Not help...
    Excuse me, I find it hard to understand you, because I'm Russian ...


  • Qt Champions 2017

    @Tikitko
    Hi, np. That was what i wanted to test.

    So if we create it before windows is fully shown we get bug?

    But if you create in button_click , it works?



  • @mrjj Yes, once checked, it is so ...


  • Qt Champions 2017

    @Tikitko
    very strange!
    I though showEvent would been same as clicked.
    Try timer so that we first create after window fully shown.

    // in constructor
    QTimer *timer = new QTimer(this);
    connect(timer, SIGNAL(timeout()), this, SLOT(nowcreate()));
    timer->start(4000);
    }

    void MainWindow::nowcreate() << add this to .h also
    {
    qDebug() << "nowcreate";
    // create here
    QAxWidget *Test = new QAxWidget(this);
    ..
    }



  • @mrjj This work!


  • Qt Champions 2017

    @Tikitko
    ok
    so window must be fully shown to make it happy.
    Good testing :)



  • @mrjj Thank you very much for your help! So show window, and then create a widget ... So still the question, it is a bug Qt or something else? The problem can be considered solved only in the bug tracker you need to add ...


  • Qt Champions 2017

    @Tikitko
    You are most welcome.
    well I think its a bug but not sure.
    When bug comes, it seems to me it hangs. That seems like bug.

    Oh I forgot to ask.
    What is {8856f961-340a-11d0-a96b-00c04fd705a2} ?



  • @mrjj this is Internet Explorer but in any case, the error with any object in QAxWidget...



  • @mrjj Hello, another mament noticed everything was decided widget loading after displaying the window, but if you minimize the window and deploy the freeze button again ...


  • Qt Champions 2017

    @Tikitko
    Ehh. not sure I read that correctly.

    You say that if made with button, then bug dont show, but if you minimize and maxi window again, bug comes back?



  • @mrjj If i minimize a window, and deploy it, the problem returns


  • Qt Champions 2017

    Ok
    Have you tried with Qt 5.5 ?
    Maybe QAxWidget has bug in 5.6



  • Hello!

    I faced a similar problem, tried hacks with single QTimer and showEvent: timer was a solution, and showEvent -- wasn't. I also use Win10, but Qt5.5.1. Have you succeeded?


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.