pymain.cpp

来自「qconsole2 qt寫的一個console元件」· C++ 代码 · 共 60 行

CPP
60
字号
/***************************************************************************                          main.cpp  -  description                             -------------------    begin                : mar mar 8 2005    copyright            : (C) 2005 by houssem    email                : houssem@localhost ***************************************************************************//*************************************************************************** *                                                                         * *   This program is free software; you can redistribute it and/or modify  * *   it under the terms of the GNU General Public License as published by  * *   the Free Software Foundation; either version 2 of the License, or     * *   (at your option) any later version.                                   * *                                                                         * ***************************************************************************/#include <qapplication.h>#include <qmainwindow.h>#include "qpyconsole.h"/* Define the following to fix __ctype_* from GLIBC2.3 and upper   if not compiled using the same GLIBC *///#define FIX__CTYPE_#ifdef FIX__CTYPE_#include <ctype.h>__const unsigned short int *__ctype_b;__const __int32_t *__ctype_tolower;__const __int32_t *__ctype_toupper;void ctSetup(){  __ctype_b = *(__ctype_b_loc());  __ctype_toupper = *(__ctype_toupper_loc());  __ctype_tolower = *(__ctype_tolower_loc());}#endif//The main entryint main( int argc, char ** argv ){#ifdef FIX__CTYPE_    ctSetup();#endif    QApplication a( argc, argv );    //Create and show the main window    QMainWindow mw(0, "Application window");    mw.setMinimumSize(640, 480);    //Instantiate and set the focus to the QPyConsole    QPyConsole *console = QPyConsole::getInstance(&mw);    mw.setFocusProxy((QWidget*)console);    mw.setCentralWidget((QWidget*)console);    a.setMainWidget(&mw);    mw.show();                        return a.exec();}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?