Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Some Advice Ubuntu
Qt 6.11 is out! See what's new in the release blog

Some Advice Ubuntu

Scheduled Pinned Locked Moved General and Desktop
9 Posts 3 Posters 2.1k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    Jackiechann
    wrote on last edited by
    #1

    I'm looking to make a few simple programs for Ubuntu, they will just be used by myself and given free to anyone who wants them.

    They won't be require a great deal of speed/power.

    The main functionality is simply opening, writing text files and sending emails.

    Qt seems to have a lot of options...

    I know JavaScript well, I've done c#.

    I did C++ for a few months but found it too difficult and gave up, so would sooner avoid C++ although I did look at C++ with QT examples and it does look far easier.

    I'm really looking for where should I be looking to start based on what I know? can a QT program be written in just javascript that gives then functionality I need? and where can I start learning how to do that?

    I also noticed the HTML5 option, if I use this where can I find the functions I need for sending email and opening/writing text files?

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      File operations and sending emails is best handled by the C++ part. HTML5 and QML (the new UI framework) is focused on the GUI. I'm not saying it can't be done in JS, though.

      As usual, I recommend 2 books: the old-but-great "link":https://qt-project.org/books/view/c_gui_programming_with_qt_4_2nd_edition_the_official_c_qt_book and a new one "link":http://qmlbook.org/. Also, Qt documentation is superb, so I advise to take a look into it. Don't be afraid of the C++ in Qt, it is made much easier by various enhancements that Qt brings with itself.

      (Z(:^

      1 Reply Last reply
      0
      • J Offline
        J Offline
        Jackiechann
        wrote on last edited by
        #3

        Hi,

        While I understand C++ would be far faster and better, I'm really just trying to make a few simple applications for my own use because they don't exist on Ubuntu so I have to switch to windows.

        I would really sooner have a worse version made with JavaScript, than a good version made in C++ that times me time to learn.

        It really doesn't matter if the application is less efficient.

        Does anyone know of examples using JavaScript as the logic etc rarther than C++

        1 Reply Last reply
        0
        • sierdzioS Offline
          sierdzioS Offline
          sierdzio
          Moderators
          wrote on last edited by
          #4

          Check out the SameGame example: it does everything in JS, or at least it used to.

          (Z(:^

          1 Reply Last reply
          0
          • J Offline
            J Offline
            Jackiechann
            wrote on last edited by
            #5

            Thanks, that helps a lot, but what would I write in javascript to for example write to a file?

            1 Reply Last reply
            0
            • sierdzioS Offline
              sierdzioS Offline
              sierdzio
              Moderators
              wrote on last edited by
              #6

              I do not know, my knowledge about JS is very limited. You sounded like JavaScript was what you wanted, so I thought you have the know-how there ;-)

              Qt and QML definitely add PersistentStorage that can be used from JavaScript. But I am certain that JS itself also has some file-saving capabilities.

              (Z(:^

              1 Reply Last reply
              0
              • J Offline
                J Offline
                Jackiechann
                wrote on last edited by
                #7

                JavaScript doesn't have file saving, has to send to server for server to write files.

                1 Reply Last reply
                0
                • JKSHJ Offline
                  JKSHJ Offline
                  JKSH
                  Moderators
                  wrote on last edited by
                  #8

                  Hi,

                  JavaScript was designed for web scripting, so it doesn't have built-in file storage support.

                  You might be able to import "Node.js":http://nodejs.org/docs/latest/api/fs.html to do this, but I've never tried it with QML. Give it a shot, and let us know how you go :)

                  Anyway, to write to a text file in C++:

                  @
                  QFile myFile("/home/Jackiechann/Desktop/a_little_file.txt");
                  myFile.open(QFile::WriteOnly | QFile::Text);
                  myFile.write("Hello world!");
                  myFile.close();
                  @

                  Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

                  1 Reply Last reply
                  0
                  • J Offline
                    J Offline
                    Jackiechann
                    wrote on last edited by
                    #9

                    You are right that is very easy, maybe I could use C++ with Qt when I tried to learn C++ all the memory stuff was just too hard.

                    1 Reply Last reply
                    0

                    • Login

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • Users
                    • Groups
                    • Search
                    • Get Qt Extensions
                    • Unsolved