FramelessWindowHint freezes form with QAxWidget
-
@mrjj
I tried soMainWindow::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(); }
-
@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 setupand 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...
-
well my "theory" is that
if QAxWidget is assigned to a parent before FramelessWindowHint
then bug comes. -
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 ... -
@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);
..
}