Results 1 to 16 of 16

Thread: programin in the qt creator

  1. #1
    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

    Question programin in the qt creator

    im started with qt creator,i what write source code for a label is on form .ui placing

  2. #2
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: programin in the qt creator

    code for on form .ui is placing in writing of qt creator code thingy or designer whatsitcalled.

    In other words:
    What?

  3. #3
    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

    Question Re: programin in the qt creator

    I just wanted to see I started qt creator, how can write source code for the label set on form mainwindow.h

  4. #4
    Join Date
    Nov 2010
    Location
    Budapest, Hungary
    Posts
    125
    Thanks
    17
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: programin in the qt creator

    maybe he uses a translator program.
    Szilvi

  5. #5
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: programin in the qt creator

    Quote Originally Posted by szisziszilvi View Post
    maybe he uses a translator program.
    That's possible, but being a simple human being, I can't know that.
    Furthermore, I can't even know what he/she was asking in the first place, translator program or not.

    As for writing code for a label being placed with designer:
    Normally, if you use Qt Creator with a standard template, a couple of files are generated. Suppose your main window is in the files mainwindow.h and mainwindow.cpp
    In these files a class called something like MainWindow is defined and it will use the ui object which represents the user interface made by designer.
    You use this ui object to access and control the widgets set in designer.

    Example:
    Qt Code:
    1. ui->myLabel->setText("Hello world!");
    To copy to clipboard, switch view to plain text mode 

  6. #6
    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

    Default Re: programin in the qt creator

    Were the basis of the code that I wrote. not run.
    I want to see how one label or a button in qt creator on form .ui write code.

  7. #7
    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

    Default Re: programin in the qt creator

    [IMG]file://C:\Users\hamed\Desktop\shidfar ht\1.jpg[/IMG]
    Last edited by hamedazimi; 4th March 2011 at 05:59.

  8. #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

  9. #9
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: programin in the qt creator

    Slot does not run because you use connect incorrectly.

    Qt Code:
    1. ui.pushButton->connect(ui.pushButton,SIGNAL(clicked()),ui.comboB ox_3,SLOT(browse()));
    To copy to clipboard, switch view to plain text mode 

    is not good.

    Please see the examples.

    I also do not understand slot browse() of comboBox_3. According to your code, this should be MainWindow, as thats where browse lives?

  10. #10
    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

    Default Re: programin in the qt creator

    Whether qt programming is on ic and how the programin in Industry


    Added after 5 minutes:


    Whether qt programming is on ic and how the programin in Industry
    Last edited by hamedazimi; 8th March 2011 at 20:04.

  11. #11
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: programin in the qt creator

    I do not understand.

  12. #12
    Join Date
    Sep 2009
    Location
    Wroclaw, Poland
    Posts
    1,394
    Thanked 342 Times in 324 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: programin in the qt creator

    I do not understand.
    And I doubt that anyone does - dear hamedazimi, as long as you are not going to improve your english language skills, you'll get no constructive feedback - simply because people can't understand what you mean. There are plenty of people around here, willing to help others, but without understanding each other it's just not going to work...

  13. #13
    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

    Default Re: programin in the qt creator

    does QT support IC programming?ta.

  14. #14
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: programin in the qt creator

    What is IC programming?

    Do you mean does Qt (note: Not QT) support embedded hardware? Yes it does.
    Last edited by wysota; 10th March 2011 at 21:44.

  15. #15
    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

    Default Re: programin in the qt creator

    wanna know how i can do hardware programing in qt?

  16. #16
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: programin in the qt creator

    In the same way as you would do hardware programming without Qt.

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.