im started with qt creator,i what write source code for a label is on form .ui placing
im started with qt creator,i what write source code for a label is on form .ui placing
code for on form .ui is placing in writing of qt creator code thingy or designer whatsitcalled.
In other words:
What?
I just wanted to see I started qt creator, how can write source code for the label set on form mainwindow.h
maybe he uses a translator program.
Szilvi
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:
ui->myLabel->setText("Hello world!");To copy to clipboard, switch view to plain text mode
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.
[IMG]file://C:\Users\hamed\Desktop\shidfar ht\1.jpg[/IMG]
Last edited by hamedazimi; 4th March 2011 at 05:59.
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:
#include "mainwindow.h" #include <QTextEdit> #include <QPushButton> #include <QVBoxLayout> #include <QString> #include <QFileDialog> #include <QDir> #include <QComboBox> { ui.setupUi(this); ui.pushButton->connect(ui.pushButton,SIGNAL(clicked()),ui.comboBox_3,SLOT(browse())); } void MainWindow:: browse() { if(!dire.isEmpty()); ui.comboBox_3->addItem(dire); ui.comboBox_3->setCurrentIndex(ui.comboBox_3->currentIndex()+1); } MainWindow::~MainWindow() { }To copy to clipboard, switch view to plain text mode
Last edited by wysota; 10th March 2011 at 21:34. Reason: missing [code] tags
Slot does not run because you use connect incorrectly.
Qt Code:
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?
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.
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...I do not understand.
does QT support IC programming?ta.
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.
wanna know how i can do hardware programing in qt?
In the same way as you would do hardware programming without Qt.
Bookmarks