Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
qtws26_logo

The Qt Event of the Year: Qt World Summit 2026

Save Your Spot >
Brand Logo
  1. Home
  2. International
  3. German
  4. ComboBox Dateipfad zuweisen
Qt 6.12 LTS is out! See what's new in the release blog

ComboBox Dateipfad zuweisen

Scheduled Pinned Locked Moved German
2 Posts 2 Posters 1.5k 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.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #1

    Hallo,

    ich bin relativ neu im Bereich Qt und versuche mir gerade ein Tool zu schreiben, welches mir Dateien aus einem bestimmten Pfad anzeigt. Per ComboBox. Aktuell weiß ich, dass man im Designer Elemente hinzufügen kann. Jedoch weiß ich nicht, wie man der ComboBox einen Pfad einmalig zuweist und dann in der Combobox immer alle .docx Dateien angezeigt bekommt. Bzw. wie ich es auf ein bestimmten Dateityp beschränke weiß ich vom Synthax her aber das war es dann auch schon. Später soll sich das ganze dann über den Kalender noch auf den Monat einschränken lassen und in einem TextEdit Widget angezeigt werden können. Aktuell sitze ich aber noch an der ComboBox..

    PS: Falls ihr diesbezüglich eine gute Doku kennt oder ein Tutorial, könnt ihr das gerne posten. Ich wills wissen :)

    viele Grüße
    Kopfii

    1 Reply Last reply
    0
    • E Offline
      E Offline
      euchkatzl
      wrote on last edited by
      #2

      @QWidget * mainWidget = new QWidget(this);
      QHBoxLayout * layout =new QHBoxLayout(mainWidget);

      QComboBox* comboBox = new QComboBox(this);
      layout->addWidget(comboBox);
      QDir dir("Dein Pfad");
      foreach(QFileInfo info, dir.entryInfoList(QStringList() << "*.docx",QDir::Files)){
      comboBox->addItem(info.baseName(),info.absoluteFilePath());
      }

      mainWidget->show();@

      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
      • Unsolved