Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7593 in orxonox.OLD


Ignore:
Timestamp:
May 11, 2006, 10:18:13 AM (18 years ago)
Author:
bensch
Message:

qt_gui: File-Selector-Dialog

Location:
branches/qt_gui/src/lib/gui/qt_gui
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/qt_gui/src/lib/gui/qt_gui/Makefile.am

    r7585 r7593  
    2222                gui_video.cc \
    2323                gui_audio.cc \
    24                 gui_general.cc
     24                gui_general.cc \
     25                gui_general_moc.cc
     26
    2527
    2628noinst_HEADERS= \
  • branches/qt_gui/src/lib/gui/qt_gui/gui_general.cc

    r7586 r7593  
    2828
    2929#include <QtGui/QLayout>
     30#include <QtGui/QFileDialog>
     31
    3032#include "debug.h"
    3133
     
    4749      QtGuiInputLine* dataDir = new QtGuiInputLine("Data-Directory", this);
    4850      layout->addWidget(dataDir, 0, 1, 1, 2);
     51      QPushButton* dataFileDialogButton = new QPushButton("browse");
     52      layout->addWidget(dataFileDialogButton, 0, 3, 1, 1);
     53      connect(dataFileDialogButton, SIGNAL(released()), this, SLOT(openDataFileDialog()));
     54
     55
    4956
    5057      QLabel* debugLabel = new QLabel("debug-mode");
     
    7279  }
    7380
     81  void GuiGeneral::openDataFileDialog()
     82  {
     83    QString s = QFileDialog::getOpenFileName(
     84        this,
     85    "Choose a file",
     86    "/home",
     87    "Images (*.png *.xpm *.jpg)");
     88  }
     89
    7490
    7591}
  • branches/qt_gui/src/lib/gui/qt_gui/gui_general.h

    r7585 r7593  
    1414{
    1515  //! Class that creates the Audio-Options.
    16   class GuiGeneral : public OrxGui::Element, public QGroupBox
     16  class GuiGeneral : public QGroupBox, public OrxGui::Element
    1717  {
     18    Q_OBJECT
     19
    1820  public:
    1921    GuiGeneral(OrxGui::Gui* gui);
    2022    virtual ~GuiGeneral();
     23
     24    public slots:
     25      void openDataFileDialog();
    2126
    2227  };
Note: See TracChangeset for help on using the changeset viewer.