本文整理汇总了C++中GLWidget::resize方法的典型用法代码示例。如果您正苦于以下问题:C++ GLWidget::resize方法的具体用法?C++ GLWidget::resize怎么用?C++ GLWidget::resize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GLWidget
的用法示例。
在下文中一共展示了GLWidget::resize方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: QMainWindow
/* \x41\x41\x41\x41\x41\x41\x41 */
TempleWin::TempleWin(QWidget *parent)
: QMainWindow(parent) {
lang = new TempleLang();
std::cout << "==========" << std::endl;
//menu
QAction *quit = new QAction("&Quit", this);
QMenu *file;
file = menuBar()->addMenu("&File");
file->addAction(quit);
connect(quit, SIGNAL(triggered()), qApp, SLOT(quit()));
//toolbar
QToolBar *tb = new QToolBar("TOOLBAR");
TBar *tbw = new TBar(this, lang);
tb->addWidget(tbw);
tb->setMovable(false);
addToolBar(Qt::RightToolBarArea, tb);
GLWidget *widGl = new GLWidget(this, lang);
widGl->show();
widGl->resize(200,200);
setCentralWidget(widGl);
}
示例2: main
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
GLWidget w;
w.resize(400,400);
w.show();
return a.exec();
}
示例3: main
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
GLWidget mainwin;
mainwin.resize(500,500);
mainwin.show();
return app.exec();
}
示例4: main
int main(int argc, char *argv[]) {
QApplication app(argc, argv);
GLWidget window;
window.resize(800,600);
window.show();
return app.exec();
}
示例5: main
int main( int argc, char ** argv )
{
QApplication a( argc, argv );
QSurfaceFormat format;
format.setDepthBufferSize(16);
QSurfaceFormat::setDefaultFormat(format);
// Two top-level windows with two QOpenGLWidget children in each.
// The rendering for the four QOpenGLWidgets happens on four separate threads.
GLWidget topLevelGlWidget;
QPoint pos = QApplication::desktop()->availableGeometry(&topLevelGlWidget).topLeft() + QPoint(200, 200);
topLevelGlWidget.setWindowTitle(QStringLiteral("Threaded QOpenGLWidget example top level"));
topLevelGlWidget.resize(200, 200);
topLevelGlWidget.move(pos);
topLevelGlWidget.show();
const QString glInfo = getGlString(topLevelGlWidget.context()->functions(), GL_VENDOR)
+ QLatin1Char('/') + getGlString(topLevelGlWidget.context()->functions(), GL_RENDERER);
const bool supportsThreading = !glInfo.contains(QLatin1String("nouveau"), Qt::CaseInsensitive)
&& !glInfo.contains(QLatin1String("ANGLE"), Qt::CaseInsensitive)
&& !glInfo.contains(QLatin1String("llvmpipe"), Qt::CaseInsensitive);
const QString toolTip = supportsThreading ? glInfo : glInfo + QStringLiteral("\ndoes not support threaded OpenGL.");
topLevelGlWidget.setToolTip(toolTip);
QScopedPointer<MainWindow> mw1;
QScopedPointer<MainWindow> mw2;
if (!QApplication::arguments().contains(QStringLiteral("--single"))) {
if (supportsThreading) {
pos += QPoint(100, 100);
mw1.reset(new MainWindow);
mw1->setToolTip(toolTip);
mw1->move(pos);
mw1->setWindowTitle(QStringLiteral("Threaded QOpenGLWidget example #1"));
mw1->show();
pos += QPoint(100, 100);
mw2.reset(new MainWindow);
mw2->setToolTip(toolTip);
mw2->move(pos);
mw2->setWindowTitle(QStringLiteral("Threaded QOpenGLWidget example #2"));
mw2->show();
} else {
qWarning() << toolTip;
}
}
return a.exec();
}
示例6: GLWidget_resize
/** void QWidget::resize(int w, int h)
* bind/QWidget.h:11
*/
static int GLWidget_resize(lua_State *L) {
try {
GLWidget *self = *((GLWidget **)dub_checksdata(L, 1, "mimas.GLWidget"));
int w = dub_checkint(L, 2);
int h = dub_checkint(L, 3);
self->resize(w, h);
return 0;
} catch (std::exception &e) {
lua_pushfstring(L, "resize: %s", e.what());
} catch (...) {
lua_pushfstring(L, "resize: Unknown exception");
}
return dub_error(L);
}
示例7: main
int main(int argc, char** argv) {
QApplication a(argc, argv);
QSurfaceFormat format;
format.setVersion(3,3);
format.setProfile(QSurfaceFormat::CoreProfile);
QSurfaceFormat::setDefaultFormat(format);
GLWidget glWidget;
qreal pixelRatio = glWidget.devicePixelRatio();
cout << "pixel ratio: " << pixelRatio << std::endl;
glWidget.resize(640/pixelRatio,480/pixelRatio);
glWidget.show();
return a.exec();
}
示例8: main
int main(int argc, char** argv) {
// Do projective reconstruction
bool is_projective = true;
// Assume noise free
bool has_outliers = false;
// Read 2D points from text file
Mat_<double> x1, x2;
int npts;
if (argc < 2) {
help();
exit(0);
} else {
ifstream myfile(argv[1]);
if (!myfile.is_open()) {
cout << "Unable to read file: " << argv[1] << endl;
exit(0);
} else {
string line;
// Read number of points
getline(myfile, line);
npts = (int) atof(line.c_str());
x1 = Mat_<double>(2, npts);
x2 = Mat_<double>(2, npts);
// Read the point coordinates
for (int i = 0; i < npts; ++i) {
getline(myfile, line);
stringstream s(line);
string cord;
s >> cord;
x1(0, i) = atof(cord.c_str());
s >> cord;
x1(1, i) = atof(cord.c_str());
s >> cord;
x2(0, i) = atof(cord.c_str());
s >> cord;
x2(1, i) = atof(cord.c_str());
}
myfile.close();
}
}
// Call the reconstruction function
vector < Mat_<double> > points2d;
points2d.push_back(x1);
points2d.push_back(x2);
Mat_<double> points3d_estimated;
vector < Mat > Ps_estimated;
reconstruct(points2d, Ps_estimated, points3d_estimated, is_projective,
has_outliers);
// Print output
cout << endl;
cout << "Projection Matrix of View 1: " << endl;
cout << "============================ " << endl;
cout << Ps_estimated[0] << endl << endl;
cout << "Projection Matrix of View 1: " << endl;
cout << "============================ " << endl;
cout << Ps_estimated[1] << endl << endl;
cout << "Reconstructed 3D points: " << endl;
cout << "======================== " << endl;
cout << points3d_estimated << endl;
// Display 3D points using Qt widget
// Create the structure
vector<Vec3f> struct_coords;
for (int i = 0; i < npts; ++i) {
Vec3f point3d((float) points3d_estimated(0, i),
(float) points3d_estimated(1, i),
(float) points3d_estimated(2, i));
struct_coords.push_back(point3d);
}
// Qt stuff
QApplication app(argc, argv);
GLWidget window;
window.AddNewStructure(struct_coords);
window.resize(800, 600);
window.show();
return app.exec();
}