2008年11月19日星期三

Reading Qt 4.4 Tutorial 1

  • The QApplication object must be created before any GUI-related features of Qt are used.
  •     QPushButton hello("Hello world!");
    A push button is created. Because we don't specify a parent window (as second argument to the QPushButton constructor), the button will be a window of its own, with its own window frame and title bar.
  • The button's size is determined by its default size hint. We could call QWidget::move() to assign a specific screen position to the widget, but instead we let the windowing system choose a position.
  •     hello.show();
    A widget is never visible when you create it. You must call QWidget::show() to make it visible.
  •    return app.exec();
    This is where main() passes control to Qt
    int QApplication::exec ()

    Enters the main event loop and waits until exit() is called, then returns the value that was set to exit() (which is 0 if exit() is called via quit()).

  • 基本把教程上的COPY下来了,细节注意到了却影响到整体阅读速度,在博客上修改这破格式花了不少时间。


没有评论: