本文整理汇总了C++中QDialog::font方法的典型用法代码示例。如果您正苦于以下问题:C++ QDialog::font方法的具体用法?C++ QDialog::font怎么用?C++ QDialog::font使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QDialog
的用法示例。
在下文中一共展示了QDialog::font方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: about
void MainWindow::about()
{
QDialog *aboutdialog = new QDialog();
int pSize = aboutdialog->font().pointSize();
aboutdialog->setWindowTitle("About");
aboutdialog->setFixedSize(pSize*27,pSize*17);
QVBoxLayout *templayout = new QVBoxLayout();
templayout->setMargin(5);
QLabel *projectname = new QLabel(QString(APP_NAME) +"\t"+ QString(APP_VERSION));
projectname->setFrameStyle(QFrame::Box | QFrame::Raised);
projectname->setAlignment(Qt::AlignCenter);
QLabel *projectauthors = new QLabel(QString(APP_DESIGNER) + "\n\nBMSTU\n\nNovember of 2015");
projectauthors->setWordWrap(true);
projectauthors->setAlignment(Qt::AlignCenter);
QLabel *hyperlink = new QLabel("<a href='mailto:[email protected]?subject=Pointmetry'>Contact us at [email protected]");
hyperlink->setOpenExternalLinks(true);
hyperlink->setAlignment(Qt::AlignCenter);
templayout->addWidget(projectname);
templayout->addWidget(projectauthors);
templayout->addWidget(hyperlink);
aboutdialog->setLayout(templayout);
aboutdialog->exec();
delete hyperlink;
delete projectauthors;
delete projectname;
delete templayout;
delete aboutdialog;
}
示例2: show_about
void MainWindow::show_about()
{
QDialog *aboutdialog = new QDialog();
int pSize = aboutdialog->font().pointSize();
aboutdialog->setWindowTitle("About");
aboutdialog->setFixedSize(pSize*30,pSize*17);
QVBoxLayout *templayout = new QVBoxLayout();
templayout->setMargin(APP_MARGIN);
QLabel *projectname = new QLabel(QString(APP_NAME) +"\t"+ QString(APP_VERS));
projectname->setFrameStyle(QFrame::Box | QFrame::Raised);
projectname->setAlignment(Qt::AlignCenter);
QLabel *projectauthors = new QLabel("Designed by: Taranov Alex\n\nFirst release was in 2014");
projectauthors->setWordWrap(true);
projectauthors->setAlignment(Qt::AlignCenter);
QLabel *hyperlink = new QLabel("<a href='mailto:[email protected]?subject=QVideoProcessing'>Contact us at [email protected]");
hyperlink->setToolTip("Will try to open your default mail client");
hyperlink->setOpenExternalLinks(true);
hyperlink->setAlignment(Qt::AlignCenter);
templayout->addWidget(projectname);
templayout->addWidget(projectauthors);
templayout->addWidget(hyperlink);
aboutdialog->setLayout(templayout);
aboutdialog->exec();
delete hyperlink;
delete projectauthors;
delete projectname;
delete templayout;
delete aboutdialog;
}