{
Q_OBJECT
public:
~harpWin();
public slots:
void adminstart();
};
{
setWindowTitle("Harp Win0");
adminButton->setDefault(true);
vboxLayout->addWidget(adminButton);//, 1, Qt::AlignRight);
vboxLayout->addWidget(measureButton);
vboxLayout->addWidget(viewButton);
vboxLayout->addWidget(quitButton);
hboxLayout->addWidget(graphicsView, 1, Qt::AlignLeft);
hboxLayout->addLayout(vboxLayout);
setLayout(hboxLayout);
QObject::connect(quitButton,
SIGNAL(clicked
()),
qApp,
SLOT(quit
()));
connect(adminButton, SIGNAL(clicked()), this, SLOT( adminstart() ));
QObject::connect(viewButton,
SIGNAL(clicked
()),
qApp,
SLOT(quit
()));
QObject::connect(measureButton,
SIGNAL(clicked
()),
qApp,
SLOT(quit
()));
}
harpWin::~harpWin()
{
}
void harpWin::adminstart()
{
QString str
= "\n clicked button\n";
qDebug() << str;
}
int main(int argc, char *argv[])
{
harpWin introWindow;
//introWindow.setWindowTitle("Absolute");
introWindow.show();
return app.exec();
}
class harpWin : public QWidget
{
Q_OBJECT
public:
harpWin(QWidget *parent = 0);
~harpWin();
QGraphicsView *graphicsView;
QPushButton *adminButton;
QPushButton *measureButton;
QPushButton *viewButton;
QPushButton *quitButton;
QVBoxLayout *vboxLayout;
QHBoxLayout *hboxLayout;
public slots:
void adminstart();
};
harpWin::harpWin( QWidget *parent)
: QWidget(parent)
{
setWindowTitle("Harp Win0");
vboxLayout = new QVBoxLayout();
hboxLayout = new QHBoxLayout();
graphicsView = new QGraphicsView(this);
adminButton = new QPushButton("Admin", this);
adminButton->setDefault(true);
measureButton = new QPushButton("Measure", this);
viewButton = new QPushButton("View", this);
quitButton = new QPushButton("&Quit",this);
vboxLayout->addWidget(adminButton);//, 1, Qt::AlignRight);
vboxLayout->addWidget(measureButton);
vboxLayout->addWidget(viewButton);
vboxLayout->addWidget(quitButton);
hboxLayout->addWidget(graphicsView, 1, Qt::AlignLeft);
hboxLayout->addLayout(vboxLayout);
setLayout(hboxLayout);
QObject::connect(quitButton, SIGNAL(clicked()), qApp, SLOT(quit()));
connect(adminButton, SIGNAL(clicked()), this, SLOT( adminstart() ));
QObject::connect(viewButton, SIGNAL(clicked()), qApp, SLOT(quit()));
QObject::connect(measureButton, SIGNAL(clicked()), qApp, SLOT(quit()));
}
harpWin::~harpWin()
{
}
void harpWin::adminstart()
{
QString str = "\n clicked button\n";
qDebug() << str;
}
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
harpWin introWindow;
//introWindow.setWindowTitle("Absolute");
introWindow.show();
return app.exec();
}
To copy to clipboard, switch view to plain text mode
Bookmarks