Forum > QT

Error: Qt is not installed.

(1/3) > >>

Fred vS:
Hello everybody. :)
I have a free DJ application compiled with Qt.
If Qt is not installed I want that the application shows a error message like : "Error, Qt libraries are not installed, please do a sudo apt-get install Qt".
But, of course, if Qt is not installed, message dialogs do not works... :(
Anybody have a idea how to show such a message and how to know that Qt is installed ?
Thanks.

Blaazen:
If you try run your Qt-application or Lazarus itself without libQt4pas.so installed, then you have this output in console:

--- Code: ---$ ./lazarus
./lazarus: error while loading shared libraries: libQt4Pas.so.5: cannot open shared object file: No such file or directory
--- End code ---
This is common behaviour on Linux. Linux users usually know that they have to run it from console to see what's bad.

Fred vS:
Hello Mr Blaazen and thanks for your answer...

--- Code: ---Linux users usually know that they have to run it from console to see what's bad.
--- End code ---

Of course, but for helping Linux Dummies, is there a way to show a message dialog without Qt installed ?

Leledumbo:

--- Quote ---Of course, but for helping Linux Dummies, is there a way to show a message dialog without Qt installed ?
--- End quote ---
You can try LoadLibrary-ing a Qt lib (QtCore is enough maybe?), and check the return value.

felipemdc:

--- Quote from: Fred vS on August 15, 2011, 09:24:58 pm ---Of course, but for helping Linux Dummies, is there a way to show a message dialog without Qt installed ?

--- End quote ---

Yes, but not using the LCL. You can use for example X11 in Linux. It is almost always installed, it could be safe. Your code could be something like this:

<delphi>
program blabla;
....
begin
  lLib := LoadLibrary(...);
  if lLib = nil then
  begin
    ShowX11MessageBox;
  end;
end.
</delphi>

And you can implement the message box using X11. A initial code to get started: http://wiki.lazarus.freepascal.org/X11#A_window_with_a_message

In Windows you can use the Windows API. There is a API for showing message boxes, so it should be much easier.

Navigation

[0] Message Index

[#] Next page

Go to full version