⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 readdir.cpp

📁 适合初学者学习的QT源程序
💻 CPP
字号:
/****************************************************************************** Form implementation generated from reading ui file 'readdir.ui'**** Created: 四  4月 17 15:02:34 2008**      by: The User Interface Compiler ($Id: qt/main.cpp   3.3.5   edited Aug 31 12:13 $)**** WARNING! All changes made in this file will be lost!****************************************************************************/#include "readdir.h"#include <qvariant.h>#include <qlabel.h>#include <qbuttongroup.h>#include <qlistbox.h>#include <qcombobox.h>#include <qlayout.h>#include <qtooltip.h>#include <qwhatsthis.h>#include <qimage.h>#include <qpixmap.h>#include "../readdir.ui.h"/* *  Constructs a ReadDir as a child of 'parent', with the *  name 'name' and widget flags set to 'f'. * *  The dialog will by default be modeless, unless you set 'modal' to *  TRUE to construct a modal dialog. */ReadDir::ReadDir( QWidget* parent, const char* name, bool modal, WFlags fl )    : QDialog( parent, name, modal, fl ){    if ( !name )	setName( "ReadDir" );    ParentDirText = new QLabel( this, "ParentDirText" );    ParentDirText->setGeometry( QRect( 20, 20, 70, 41 ) );    buttonGroup1 = new QButtonGroup( this, "buttonGroup1" );    buttonGroup1->setGeometry( QRect( 0, 80, 460, 240 ) );    DirList = new QListBox( buttonGroup1, "DirList" );    DirList->setGeometry( QRect( 20, 20, 430, 210 ) );    ParentDir = new QComboBox( FALSE, this, "ParentDir" );    ParentDir->setGeometry( QRect( 100, 20, 181, 41 ) );    languageChange();    resize( QSize(465, 336).expandedTo(minimumSizeHint()) );    clearWState( WState_Polished );    // signals and slots connections    connect( ParentDir, SIGNAL( activated(const QString&) ), DirList, SLOT( clear() ) );    connect( ParentDir, SIGNAL( activated(const QString&) ), this, SLOT( ShowDirList() ) );    init();}/* *  Destroys the object and frees any allocated resources */ReadDir::~ReadDir(){    // no need to delete child widgets, Qt does it all for us}/* *  Sets the strings of the subwidgets using the current *  language. */void ReadDir::languageChange(){    setCaption( tr( "Read Dir" ) );    ParentDirText->setText( trUtf8( "\xe7\x88\xb6\xe7\x9b\xae\xe5\xbd\x95\xef\xbc\x9a" ) );    buttonGroup1->setTitle( trUtf8( "\xe7\x9b\xae\xe5\xbd\x95\xe5\x88\x97\xe8\xa1\xa8" ) );    DirList->clear();    DirList->insertItem( tr( "New Item" ) );    ParentDir->clear();    ParentDir->insertItem( tr( "/etc" ) );    ParentDir->insertItem( tr( "/home" ) );    ParentDir->insertItem( tr( "/bin" ) );    ParentDir->insertItem( tr( "/proc" ) );    ParentDir->insertItem( tr( "/dev" ) );    ParentDir->insertItem( tr( "/lib" ) );    ParentDir->insertItem( tr( "/usr" ) );    ParentDir->insertItem( tr( "/tmp" ) );}

⌨️ 快捷键说明

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