PDA

View Full Version : مبتدی: آیا می توان از توابع ++c در qt استفاده کرد؟



hassanmohagheghiyan
چهارشنبه 19 آبان 1389, 12:30 عصر
برنامه ی زیر رادر محیط qt creator نوشتم

#include <QApplication> #include <QPushButton> #include <QLabel> #include <iostream> #include <conio.h> int main(int argc, char *argv[]) { QApplication app(argc, argv); QPushButton hello("Hello world!"); QLabel ma("sdsdsdsdsd"); cout<<"dfdf"; hello.show(); ma.show(); getch(); return app.exec(); }
اما برنامه جواب نداد
مگر نمی شود از توابع ++c در qt استفاده کرد ؟
در ضمن چگونه می شود برنامه ی زیر در یک صفحه باز شود.

#include <QApplication> #include <QPushButton> #include <QLabel> #include <iostream> #include <conio.h> int main(int argc, char *argv[]) { QApplication app(argc, argv); QPushButton hello("Hello world!"); QLabel ma("sdsdsdsdsd"); hello.show(); ma.show(); return app.exec(); }

r00tkit
چهارشنبه 19 آبان 1389, 13:37 عصر
درست بنویس تا کمک کنیم

کد بالا کار می کنه فقط درست بنویس


#include<QApplication>
#include<QPushButton>
#include<QLabel>
#include<iostream>
#include<conio.h>
int main(int argc,char*argv[])
{
QApplication app(argc,argv);

QPushButton hello("Helloworld!");
QLabel ma("sdsdsdsdsd");

std::cout<<"dfdf";
hello.show();
ma.show();

getch();

return app.exec();


}