zoukankan      html  css  js  c++  java
  • Qt

    按钮角色枚举值

    图标枚举值

    标准按钮枚举

    构造函数:

    1 QMessageBox ( QWidget * parent = 0 )
    2 QMessageBox ( Icon icon, const QString & title, const QString & text, StandardButtons buttons = NoButton, QWidget * parent = 0, Qt::WindowFlags f = Qt::Dialog | Qt::MSWindowsFixedSizeDialogHint )

    4个静态函数:

    1 void    about ( QWidget * parent, const QString & title, const QString & text )
    2 void    aboutQt ( QWidget * parent, const QString & title = QString() )
    3 StandardButton    critical ( QWidget * parent, const QString & title, const QString & text, StandardButtons buttons = Ok, StandardButton defaultButton = NoButton )
    4 StandardButton    information ( QWidget * parent, const QString & title, const QString & text, StandardButtons buttons = Ok, StandardButton defaultButton = NoButton )
    5 StandardButton    question ( QWidget * parent, const QString & title, const QString & text, StandardButtons buttons = Ok, StandardButton defaultButton = NoButton )
    6 StandardButton    warning ( QWidget * parent, const QString & title, const QString & text, StandardButtons buttons = Ok, StandardButton defaultButton = NoButton )

    示例

    1 QMessageBox::information(NULL, "Title", "Content", QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes);

    1 QMessageBox::about(NULL, "About", "About this <font color='red'>application</font>");

    QMessageBox msgBox;
    msgBox.setWindowTitle("MsgBox"); msgBox.setText(
    "The document has been modified."); msgBox.setInformativeText("Do you want to save your changes?"); msgBox.setStandardButtons(QMessageBox::Save | QMessageBox::Discard | QMessageBox::Cancel); msgBox.setDefaultButton(QMessageBox::Save); int ret = msgBox.exec(); switch (ret) { case QMessageBox::Save: // Save was clicked break; case QMessageBox::Discard: // Don't Save was clicked break; case QMessageBox::Cancel: // Cancel was clicked break; default: // should never be reached break; }

  • 相关阅读:
    【POJ2777】Count Color(线段树)
    【HDU】I love sneakers!(分组背包)
    【HDU1712】ACboy needs your help(分组背包)
    【POJ1338】Ugly Numbers(暴力打表)
    【POJ2242】The Circumference of the Circle(初等几何)
    【POJ2136】Vertical Histogram(简单模拟)
    uvalive 6300 Signed Binary Representation of Integers
    第四届福建省大学生程序设计竞赛
    Codeforces Round #282 (Div. 1) B. Obsessive String
    Codeforces Round #282 (Div. 1) A. Treasure
  • 原文地址:https://www.cnblogs.com/paullam/p/3692993.html
Copyright © 2011-2022 走看看