Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Select and execute the MIDI files displayed on QListWidget in Qt
Forum Updated to NodeBB v4.3 + New Features

Select and execute the MIDI files displayed on QListWidget in Qt

Scheduled Pinned Locked Moved Mobile and Embedded
2 Posts 2 Posters 938 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.
  • P Offline
    P Offline
    prom3792
    wrote on last edited by
    #1

    How to select and execute the MIDI files shown QListWidget in Qt so it can be played by a MIDI player?

    I've made ​​a MIDI file player, but can only play songs that are determined directly from the source code. My Source Code still can not select from the table shown by QListWidget.Here is the source code for QListWidget and the integration of midi player with a menu created with Qt.

    @gbe::gbe(QWidget *parent) : QMainWindow(parent), ui(new Ui::gbe)

    {
    ui->setupUi(this);
    QDir myPath("/home/prom/playlist/");

    myPath.setFilter((QDir::Dirs | QDir::Files | QDir::NoDotAndDotDot));
    myPlaylist = myPath.entryList();
    ui->listWidget->addItems(myPlaylist);}
    

    void gbe::on_btnPlay_clicked()
    {
    process.kill();
    process.start("/home/prom/QTGBE/gbe/midiplayer", QStringList() << "/home/prom/playlist/coldplay-magic.mid");

    }
    @

    Please be specific in your answer i will appreciate that,thank you

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

      Hi and welcome to devnet,

      You can use QListWidget's currentItem method to retrieve the data you need to feed your QProcess.

      Hope it helps

      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

      • Login

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