Announcement

Collapse
No announcement yet.

Java 4-ever

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #16
    Thanks for that GreyGeek. Am I right in saying that to make use of Qt you have to be using C++? I always wanted to try some simple desktop apps for Kubuntu but wasn't sure if C++ would be too. challenging for a first app... Java has a reputation for being "easy".

    I've written scripts in BASH and Perl, but I've never written anything with a GUI... I'm pretty stubborn though, so I don't think I'd give up easily if I could see myself making some progress! What do you think?
    samhobbs.co.uk

    Comment


      #17
      Originally posted by Feathers McGraw View Post
      Am I right in saying that to make use of Qt you have to be using C++?
      No, there are a lot of language bindings for Qt that allow you to use the Qt libraries in other languages (https://en.wikipedia.org/wiki/List_o...dings_for_Qt_4)

      Here's a small python "hello world" app using Qt (through PyQt)
      Code:
      #!/usr/bin/python
       
      import sys
      from PyQt4.QtCore import *
      from PyQt4.QtGui import *
      app = QApplication(sys.argv)
      label = QLabel("Hello World")
      label.show()
      app.exec_()
      sys.exit()

      Comment


        #18
        Here's a little python script that uses PyQT.

        Code:
        #!/usr/bin/env python
        
        import sys
        from PyQt4.QtGui import QDialog, QLabel, QHBoxLayout, QApplication
        
        
        class MessageDlg(QDialog):
            def __init__(self, message=None, parent=None):
                super(MessageDlg, self).__init__(parent)
        
                self.message = message
        
                self.label = QLabel(self.message)
                layout = QHBoxLayout()
                layout.addWidget(self.label)
                self.setLayout(layout)
                self.setWindowTitle("Message")
        
        if __name__ == "__main__":
            app = QApplication(sys.argv)
            form = MessageDlg("Hello, world!")
            form.show()
            app.exec_()

        Comment


          #19
          Groovy. Is there any reason to choose Qt4 over Qt5?
          samhobbs.co.uk

          Comment


            #20
            Originally posted by Feathers McGraw View Post
            Groovy. Is there any reason to choose Qt4 over Qt5?
            Basically just a few:
            Last I checked there weren't bindings for as many languages yet available for Qt5 (moot if there are bindings for the language you wish to use)
            You have to have Qt5 (and the bindings) installed (moot if you are willing to install them)

            Comment


              #21
              Thank you! I'll have a play around and see what I can come up with
              samhobbs.co.uk

              Comment


                #22
                Originally posted by Feathers McGraw View Post
                Thanks for that GreyGeek. Am I right in saying that to make use of Qt you have to be using C++? I always wanted to try some simple desktop apps for Kubuntu but wasn't sure if C++ would be too. challenging for a first app... Java has a reputation for being "easy".
                As Kubical pointed out, Qt bindings to lots of languages exist. However, Qt was built using C++ and using a C++ with Qt has the least integration problems, the least version problems, and the least update problems. Nothing is more discouraging while developing to find out your API update isn't compatible with the binding you are using because the binding is behind the API, or there is a version mismatch which introduces control errors ... grids that displayed integers as integers now display them with scientific notation, your choice of character format (ISO 5589-1, UTF-8, etc...) isn't compatible with the new combo box, etc., etc., etc... This is especially true with proprietary tools.

                Originally posted by Feathers McGraw View Post
                I've written scripts in BASH and Perl, but I've never written anything with a GUI... I'm pretty stubborn though, so I don't think I'd give up easily if I could see myself making some progress! What do you think?
                All languages have at least five properties: input, output, choice, sequence and repetition. They only differ in notation and syntax on those common elements. Your bash scripts can get as complicated as language with pointers, addresses, buffers, indexes, arrays, etc... Perl is often described as a "write only" language. Having written a Perl program and failing to properly document it can lead to forgetting what the program did because studying the Perl source won't necessarily reveal the intent of the programmer.

                Kubuntu users are fortunate because all the necessary tools are in the repository. The C++ complier, the Qt API, qtcreator (the Qt GUI dev tool with interfaces with ALL the Qt API components), git, valgrind, gbg, cmake. The Qt API includes the Qt-Designer (creates GUI interfaces graphically), Qt-Linquist (adding other languages to the GUIs you make), Qt-Assistant, etc...

                The package qt-sdk will install the complete Qt4 software development kit. If you want the Qt5 SDK version you can download it from here: http://qt-project.org/downloads
                It will install under the /opt directory. It is what I use because it includes the latest qml and qt quick development. Here is a group of demo videos of Qt5 capabilities and use.

                C++ is not hard to learn. In fact, it is rather transparent, in the background. All you really need to know is in the docs, here.

                I began my 40 year programing career using Apple ][ BASIC, UCSD Pascal on Apple, Turbo Pascal 3.02A on Apple, SAVVY on Apple, SAVVY on IBM, AREV, dbBuilder, Visual Basic 3.0, FoxPro, Visual FoxPro and Qt4 with C++. I learned C++ and Qt4 at the same time, in 2004, while writing the Homestead Application, which is still being used at Revenue today. I was 63 at the time. Feathers, you are a lot younger than I am and I belive you will find, like I did, that learning and using C++ and Qt was liberating ... and a joy. Of all the GUI rad tools I've used over the years, Qt/C++ was the most powerful, most flexible and the fastest I've ever used. I coded in Linux because using Kate and issuing the gcc compile comand within Kate's text box, and running Kdbg from it, with the speed and power of gcc, allowed me to code & compile 2X to 3X faster than I could using MS Visual Studio 6.0 C++ with the Qt addon. And, to be able to use the tools for free.
                "A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
                – John F. Kennedy, February 26, 1962.

                Comment


                  #23
                  You can always try livecode

                  Comment


                    #24
                    Writing applets for iPhone and Android is a good, and sometimes profitable, experience.
                    "A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
                    – John F. Kennedy, February 26, 1962.

                    Comment


                      #25
                      Originally posted by SteveRiley View Post
                      There's just one minor problem with these videos -- they're packed with lies! Java never fulfilled its write once, run anywhere promise; and the JVMs are so badly written that they present one of the most lucrative attack targets on PCs these days.
                      Could you please provide evidence of your statement as I've tried to search for issues with JVM and cannot find any such issues that you've highlighted.

                      Edit: I've just found a paper written by Hashemi Shouaib title "Security Issues of the sandbox inside Java Virtual Machine"
                      Last edited by Guest; Sep 08, 2014, 11:27 AM.

                      Comment


                        #26
                        GreyGeek, I just wanted to say thanks again for pushing me to look into C++, I probably wouldn't have if you hadn't mentioned it in this thread and a couple of other times, and I'm really enjoying it so far!
                        samhobbs.co.uk

                        Comment


                          #27
                          You're welcome!
                          I hope you have as much enjoyment learning and using C++ (and Qt) as I did.
                          "A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
                          – John F. Kennedy, February 26, 1962.

                          Comment

                          Working...
                          X