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. Create icons button in a grid that connect to applications in a folder
Forum Updated to NodeBB v4.3 + New Features

Create icons button in a grid that connect to applications in a folder

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 3 Posters 810 Views 3 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.
  • D Offline
    D Offline
    dashtag
    wrote on last edited by
    #1

    I am trying to create a simple application that contains a group of icons in a grid. These icons would link to applications(exes) i place in a folder

    I am working on the photoviewer example and trying to figure out how i can link the pictures to open the process(an exe) but unsure how to do link a qml object from the main and load a exe with Qprocess. Ultimatly I would like it to dynamic load the exes i am interested in but currently i am content with hardcoded paths.

    I am mainly a C++ developer and I am trying out qt to see if it is suitable for further use but it seems pretty overwhelming. I am trying to do my application over an example but it seems like there is a thousand ways to skin the cat which kinda impedes my learning as sometimes it gets confusing with the different file types in different examples like the qml,moc,qm files. Any tips on the best way to approach my particular problem?

    A 1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      So you would like to create some sort of launcher app with QtQuick, correct ?

      As for the "starting the application" part, you'll be interested by QProcess.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • D dashtag

        I am trying to create a simple application that contains a group of icons in a grid. These icons would link to applications(exes) i place in a folder

        I am working on the photoviewer example and trying to figure out how i can link the pictures to open the process(an exe) but unsure how to do link a qml object from the main and load a exe with Qprocess. Ultimatly I would like it to dynamic load the exes i am interested in but currently i am content with hardcoded paths.

        I am mainly a C++ developer and I am trying out qt to see if it is suitable for further use but it seems pretty overwhelming. I am trying to do my application over an example but it seems like there is a thousand ways to skin the cat which kinda impedes my learning as sometimes it gets confusing with the different file types in different examples like the qml,moc,qm files. Any tips on the best way to approach my particular problem?

        A Offline
        A Offline
        ambershark
        wrote on last edited by
        #3

        @dashtag This book may help you learn QML https://qmlbook.github.io.

        As for all the different file types and technologies. You don't need to use all of them. You could use QML for your UIs or you could do it with QtWidgets in C++. I use both for different things. For this project it sounds like QML would be good for you though. It would be very easy to make a nice looking interface with those requirements.

        As for linking C++ and QML, it is quite easy. Here is a quick example main.cpp that would load your qml:

        #include <QGuiApplication>
        #include <QQmlApplicationEngine>
        
        int main(int argc, char **argv)
        {
            bool shouldExit = false;
            QGuiApplication app(argc, argv);
            QQmlApplicationEngine engine;
            QObject::connect(&engine, &QQmlApplicationEngine::objectCreated, [&shouldExit](QObje
            // load our main window
            engine.load(QUrl("qrc:///qml/main.qml"));
        
            // if mainwindow failed to load, exit
            if (shouldExit)
                return 1;
        
            return app.exec();
        }
        

        The QML is in a QRC file which is just a resource file. If you're familiar with visual studio it is like a .rc file. You can use raw QML on the file system too, you don't need it in a QRC.

        If you need more info on connecting objects from QML to C++ let me know and I can show you an example of that as well.

        Finally, Qt is a large and very mature library. It has been around for 20 years or so. Actively developed the whole time. It is not something you will learn over night but it is an amazing library that will definitely benefit you and your company. Once I learned it I never looked back. That was 16 years ago. It's worth it! :) I now hate getting contracts or projects where I can't use it.

        My L-GPL'd C++ Logger github.com/ambershark-mike/sharklog

        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