Возможно глупый вопрос, НО почему так не отображается кнопка:
Test.cpp
#include <QMainWindow>
class Test : public QMainWindow {
Q_OBJECT
public:
Test(QWidget* parent = 0);
void cr();
};
#include <QtGui>
#include "Test.h"
Test::Test(QWidget* parent) : QMainWindow(parent) {
}
void Test::cr() {
QPushButton b("TEXT", this);
b.show();
}
int main(int argc, char *argv[]) {
QApplication app(argc, argv);
Test t;
t.cr();
t.show();
return app.exec();
}
void Test::cr() {
QPushButton* b = new QPushButton("TEXT", this);
b->show();
}
void Test::cr() {
QPushButton b("TEXT", this);
b.show();
}
void Test::cr() {
QPushButton* b = new QPushButton("TEXT", this);
b->show();
}
Форум Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)