Lazarus

Programming => Widgetset => QT => Topic started by: bpranoto on June 16, 2019, 12:48:55 pm

Title: [SOLVED] Form shown with ShowModal cannot be moved
Post by: bpranoto on June 16, 2019, 12:48:55 pm
With Qt widgetet, a form showed with ShowModal cannot be moved. If I changed the widgetset to  Gtk2, the child form can be moved freely.

Is it a feature or a bug?

Code: Pascal  [Select][+][-]
  1.  
  2. procedure TForm1.Button1Click(Sender: TObject);
  3. var
  4.   F : TForm2;
  5. begin
  6.   F := TForm2.Create(Self);
  7.   try
  8.     F.ShowModal;
  9.   finally
  10.     F.Free;
  11.   end;
  12. end;
  13.  
Title: Re: Form shown with ShowModal cannot be moved
Post by: bpranoto on June 16, 2019, 04:38:05 pm
I  meant move the form with mouse
Title: Re: Form shown with ShowModal cannot be moved
Post by: zeljko on June 21, 2019, 12:40:52 pm
I've spotted that when using wayland instead of xorg. So, what's your  OS, window manager etc ?
Title: Re: Form shown with ShowModal cannot be moved
Post by: bpranoto on June 28, 2019, 07:25:35 pm
Ubuntu 18.04 64bits with defaut Desktop Manager (GNome3)
Title: Re: Form shown with ShowModal cannot be moved
Post by: VTwin on June 28, 2019, 09:17:24 pm
I noticed that with gkt2 a modal dialog can not be moved with respect to the calling form, the calling form moves with it. It sounds like you are seeing something different.

It seems to be new behavior, and is annoying, but I figured it was a Ubuntu change.
Title: Re: Form shown with ShowModal cannot be moved
Post by: lucamar on June 28, 2019, 09:33:36 pm
I noticed that with gkt2 a modal dialog can not be moved with respect to the calling form, the calling form moves with it. It sounds like you are seeing something different.

It seems to be new behavior, and is annoying, but I figured it was a Ubuntu change.

In which version of Ubuntu (or, rather, GTK) are you seeing that? I've never had that problem and I have used [K|L|X]Ubuntus from version 8 up to 17.04 (or 18.04, I don't remember ATM).

What I have noticed is that Qt applications don't always work quite right in Gnome (GTK) based systems, although they do under KDE.
Title: Re: Form shown with ShowModal cannot be moved
Post by: bpranoto on June 29, 2019, 06:05:26 am
I try make a simple example with Qt5.11.

The modal form in Qt application can move freely independently of the main form.

I'll make a bug report.

Code: C  [Select][+][-]
  1. void MainWindow::on_pushButton_clicked()
  2. {
  3.     QMessageBox MsgBox;
  4.     MsgBox.setWindowTitle("Error");
  5.     MsgBox.setIcon(QMessageBox::Warning);
  6.     MsgBox.setText("Konfirmasi");
  7.     MsgBox.setInformativeText("Yakin?");
  8.     MsgBox.setStandardButtons(QMessageBox::Ok|QMessageBox::Cancel);
  9.     MsgBox.setDefaultButton(QMessageBox::Ok);
  10.     MsgBox.exec();
  11.  
  12. }
  13.  
  14.  
Title: Re: Form shown with ShowModal cannot be moved
Post by: bpranoto on June 29, 2019, 06:34:45 am
Reported.

https://bugs.freepascal.org/view.php?id=35782 (https://bugs.freepascal.org/view.php?id=35782)
Title: Re: Form shown with ShowModal cannot be moved
Post by: zeljko on June 29, 2019, 10:22:52 am
I try make a simple example with Qt5.11.

The modal form in Qt application can move freely independently of the main form.

I'll make a bug report.

Code: C  [Select][+][-]
  1. void MainWindow::on_pushButton_clicked()
  2. {
  3.     QMessageBox MsgBox;
  4.     MsgBox.setWindowTitle("Error");
  5.     MsgBox.setIcon(QMessageBox::Warning);
  6.     MsgBox.setText("Konfirmasi");
  7.     MsgBox.setInformativeText("Yakin?");
  8.     MsgBox.setStandardButtons(QMessageBox::Ok|QMessageBox::Cancel);
  9.     MsgBox.setDefaultButton(QMessageBox::Ok);
  10.     MsgBox.exec();
  11.  
  12. }
  13.  
  14.  

Note that you don't use QWidget as form but QMessageDlg which have it's own event loop.
Title: Re: [SOLVED] Form shown with ShowModal cannot be moved
Post by: bpranoto on June 30, 2019, 02:55:34 pm
Fixed  in revision 61490.

Thank you very much Zeljko.
TinyPortal © 2005-2018