Results 1 to 16 of 16

Thread: programin in the qt creator

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #8
    Join Date
    Feb 2011
    Location
    Iran
    Posts
    8
    Qt products
    Qt3 Qt4 Qt/Embedded Qt Jambi PyQt3 PyQt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Exclamation Re: programin in the qt creator

    I wrote this code but the button signal and slot does not run
    If you can help thank you that you are my answers.

    Qt Code:
    1. #include "mainwindow.h"
    2. #include <QTextEdit>
    3. #include <QPushButton>
    4. #include <QVBoxLayout>
    5. #include <QString>
    6. #include <QFileDialog>
    7. #include <QDir>
    8. #include <QComboBox>
    9.  
    10.  
    11. MainWindow::MainWindow(QWidget *parent, Qt::WFlags flags)
    12. : QMainWindow(parent, flags)
    13.  
    14. {
    15.  
    16. ui.setupUi(this);
    17. ui.pushButton->connect(ui.pushButton,SIGNAL(clicked()),ui.comboBox_3,SLOT(browse()));
    18. }
    19. void MainWindow:: browse()
    20. {
    21.  
    22.  
    23. ui.comboBox_3->addItem((QDir::currentPath()));
    24. QString dire=QFileDialog::getExistingDirectory(this,tr("find file"),QDir::currentPath());
    25. if(!dire.isEmpty());
    26. ui.comboBox_3->addItem(dire);
    27. ui.comboBox_3->setCurrentIndex(ui.comboBox_3->currentIndex()+1);
    28. }
    29.  
    30.  
    31.  
    32. MainWindow::~MainWindow()
    33. {
    34.  
    35.  
    36. }
    To copy to clipboard, switch view to plain text mode 
    Last edited by wysota; 10th March 2011 at 21:34. Reason: missing [code] tags

Similar Threads

  1. QT creator +SDL
    By ShapeShiftme in forum Qt Tools
    Replies: 2
    Last Post: 19th December 2010, 11:44
  2. Qt Creator
    By Baracardi in forum Qt Tools
    Replies: 5
    Last Post: 28th May 2010, 14:43
  3. QT creator - best IDE.
    By megabyte-ceercop in forum Qt Tools
    Replies: 1
    Last Post: 12th April 2009, 09:01
  4. Qt Creator
    By fnmblot in forum General Discussion
    Replies: 3
    Last Post: 12th April 2009, 08:06
  5. Qt Creator on Mac OS X
    By stephenju in forum Qt Tools
    Replies: 2
    Last Post: 12th March 2009, 21:51

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.