Linker Temat założony przez niniejszego użytkownika |
[Qt] Kompilacja linux-windows » 2014-05-01 17:45:49 Witam. Mam problem napisałem proste okno w bibliotece qt na ubuntu 12.04 LTS i w windows xp mam błąd:'QLabel' does not name a type. Słyszałem, że da się skompilować program na linuxie tak, żeby działał na windows. Pomóżcie jak tak skompilować, oraz proszę o wyrozumiałaść linuxa mam od 5 dni. Liczę na szybką pomoc. |
|
anonim |
» 2014-05-01 17:51:28 Może trzeba dodać nagłówek QLabel #include <QLabel> |
|
Linker Temat założony przez niniejszego użytkownika |
» 2014-05-01 17:54:14 Próbowałem lecz wywala wtedy dużo błędów na liuxie dodałem qtgui i było git. Ale jak skompilować na linuxie program na windowsa? |
|
anonim |
» 2014-05-01 18:04:34 Daj pełny kod ( w znacznikach [] cpp) |
|
Linker Temat założony przez niniejszego użytkownika |
» 2014-05-01 18:07:27 mainwindow.cpp: #include"mainwindow.h"
MainWindow::MainWindow() { QTextCodec::setCodecForTr( QTextCodec::codecForName( "UTF-8" ) ); createMenus(); createStatutsBar(); label = new QLabel( tr( "Label ety" ), this ); label->setGeometry( 5, 5, 100, 30 ); button = new QPushButton( tr( "&Enter..;)" ), this ); button->setGeometry( 75, 15, 150, 75 ); butlab = new QPushButton( tr( "&Zmiana" ), this ); butlab->setGeometry( 5, 64, 100, 30 ); connect( button, SIGNAL( clicked() ), qApp, SLOT( quit() ) ); connect( butlab, SIGNAL( clicked() ), this, SLOT( foo() ) ); setMinimumSize( 200, 200 ); resize( 480, 320 ); }
void MainWindow::foo() { label->setText( tr( "Heppy :)" ) ); }
void MainWindow::createMenus() { menu = menuBar()->addMenu( tr( "&Plik" ) ); Action = new QAction( tr( "&Exit" ), this ); Action->setStatusTip( tr( "Wyjdz" ) ); connect( Action, SIGNAL( triggered() ), qApp, SLOT( quit() ) ); menu->addAction( Action ); }
void MainWindow::createStatutsBar() { statusBar()->showMessage( tr( "Ready" ) ); }
mainwindow.h: #ifndef MAINWINDOW_H #define MAINWINDOW_H
#include<QMainWindow> #include<QPushButton> #include<QTextCodec> #include<QtGui>
class MainWindow : public QMainWindow { Q_OBJECT private: QPushButton * button; QPushButton * butlab; QLabel * label; QMenu * menu; QAction * Action; void createMenus(); void createStatutsBar(); public: MainWindow(); private slots: void foo(); };
#endif
main.cpp: #include<QApplication>
#include"mainwindow.h"
int main( int argc, char * argv[] ) { QApplication app( argc, argv ); MainWindow okno; okno.show(); return app.exec(); }
|
|
Parapet |
» 2014-05-01 20:16:11 Skompiluj to na wirtualnej maszynie. |
|
MrPoxipol |
» 2014-05-01 20:48:07 |
|
Linker Temat założony przez niniejszego użytkownika |
» 2014-05-02 11:39:06 @up Takl posiadam windowsa. Spróbuję zainstalować jeszcze raz i dlaczego lepiej normalnie? |
|
« 1 » 2 |