void textAreaDemo() { showArea( textAreaFULL, "Full"); showArea( textAreaTOP, "Top"); showArea( textAreaBOTTOM, "Bottom"); showArea( textAreaRIGHT, "Right"); showArea( textAreaLEFT, "Left"); showArea( textAreaTOPLEFT, "Top Left"); showArea( textAreaTOPRIGHT, "Top Right"); showArea( textAreaBOTTOMLEFT, "Bot Left"); showArea( textAreaBOTTOMRIGHT,"Bot Right"); }
Dialog::Dialog(QWidget *parent) : QDialog(parent), ui(new Ui::Dialog) { ui->setupUi(this); Radius_label=new QLabel(this); Radius_label->setText("Radius"); Radius_lineEdit=new QLineEdit(this); Radius_lineEdit->setText("1"); Area_label=new QLabel(this); Calc_pushButton=new QPushButton(this); Calc_pushButton->setText(tr("Cacl!")); QGridLayout *mainLayout; mainLayout=new QGridLayout(this); mainLayout->addWidget(Radius_label,0,0); mainLayout->addWidget(Radius_lineEdit,0,1); mainLayout->addWidget(Area_label,1,0); mainLayout->addWidget(Calc_pushButton,1,1); connect(Calc_pushButton,SIGNAL(clicked()),this,SLOT(showArea())); }
Dialog::Dialog(QWidget *parent) : QDialog(parent) { label1=new QLabel(this); label1->setText(tr("请输入圆的半径:")); lineEdit=new QLineEdit(this); label2=new QLabel(this); button=new QPushButton(this); button->setText(tr("显示对应圆的面积")); QGridLayout *mainLayout=new QGridLayout(this); mainLayout->addWidget(label1,0,0); mainLayout->addWidget(lineEdit,0,1); mainLayout->addWidget(label2,1,0); mainLayout->addWidget(button,1,1); //connect(button,SIGNAL(clicked()),this,SLOT(showArea())); connect(lineEdit,SIGNAL(textChanged(QString)),this,SLOT(showArea())); }
dlgMapper::dlgMapper( QWidget * parent, Host * pH, TMap * pM ) : QWidget( parent ) , mpMap( pM ) , mpHost( pH ) { setupUi(this); glWidget->mpMap = pM; mp2dMap->mpMap = pM; mp2dMap->mpHost = pH; repopulateAreas(); bubbles->setChecked( mpHost->mBubbleMode ); mp2dMap->mBubbleMode = mpHost->mBubbleMode; d3buttons->setVisible(false); roomSize->setValue(mpHost->mRoomSize*10); lineSize->setValue(mpHost->mLineSize); showInfo->setChecked( mpHost->mShowInfo ); mp2dMap->mShowInfo = mpHost->mShowInfo; showRoomIDs->setChecked( mpHost->mShowRoomID ); mp2dMap->mShowRoomID = mpHost->mShowRoomID; panel->setVisible(mpHost->mShowPanel); //searchList->setSelectionMode( QAbstractItemView::SingleSelection ); //connect(roomID, SIGNAL(returnPressed()), this, SLOT(goRoom())); connect(bubbles, SIGNAL(clicked()), this, SLOT(slot_bubbles())); connect(showInfo, SIGNAL(clicked()), this, SLOT(slot_info())); connect(ortho, SIGNAL(pressed()), glWidget, SLOT(fullView())); connect(singleLevel, SIGNAL(pressed()), glWidget, SLOT(singleView())); connect(increaseTop, SIGNAL(pressed()), glWidget, SLOT(increaseTop())); connect(increaseBottom, SIGNAL(pressed()), glWidget, SLOT(increaseBottom())); connect(reduceTop, SIGNAL(pressed()), glWidget, SLOT(reduceTop())); connect(reduceBottom, SIGNAL(pressed()), glWidget, SLOT(reduceBottom())); //connect(searchList, SIGNAL(itemClicked(QListWidgetItem*)), this, SLOT(choseRoom(QListWidgetItem*))); connect(shiftZup, SIGNAL(pressed()), mp2dMap, SLOT(shiftZup())); connect(shiftZdown, SIGNAL(pressed()), mp2dMap, SLOT(shiftZdown())); connect(shiftLeft, SIGNAL(pressed()), mp2dMap, SLOT(shiftLeft())); connect(shiftRight, SIGNAL(pressed()), mp2dMap, SLOT(shiftRight())); connect(shiftUp, SIGNAL(pressed()), mp2dMap, SLOT(shiftUp())); connect(shiftDown, SIGNAL(pressed()), mp2dMap, SLOT(shiftDown())); connect(shiftZup, SIGNAL(pressed()), glWidget, SLOT(shiftZup())); connect(shiftZdown, SIGNAL(pressed()), glWidget, SLOT(shiftZdown())); connect(shiftLeft, SIGNAL(pressed()), glWidget, SLOT(shiftLeft())); connect(shiftRight, SIGNAL(pressed()), glWidget, SLOT(shiftRight())); connect(shiftUp, SIGNAL(pressed()), glWidget, SLOT(shiftUp())); connect(shiftDown, SIGNAL(pressed()), glWidget, SLOT(shiftDown())); connect(showInfo, SIGNAL(clicked()), glWidget, SLOT(showInfo())); connect(showArea, SIGNAL(activated(QString)), mp2dMap, SLOT(switchArea(QString))); connect(showArea, SIGNAL(activated(QString)), glWidget, SLOT(showArea(QString))); connect(defaultView, SIGNAL(pressed()), glWidget, SLOT(defaultView())); connect(dim2,SIGNAL(pressed()), this, SLOT(show2dView())); connect(sideView, SIGNAL(pressed()), glWidget, SLOT(sideView())); connect(topView, SIGNAL(pressed()), glWidget, SLOT(topView())); connect(togglePanel, SIGNAL(pressed()), this, SLOT(slot_togglePanel())); connect(lineSize, SIGNAL(valueChanged(int)), this, SLOT(slot_lineSize(int))); connect(roomSize, SIGNAL(valueChanged(int)), this, SLOT(slot_roomSize(int))); connect(scale, SIGNAL(valueChanged(int)), glWidget, SLOT(setScale(int))); connect(xRot, SIGNAL(valueChanged(int)), glWidget, SLOT(setXRotation(int))); connect(yRot, SIGNAL(valueChanged(int)), glWidget, SLOT(setYRotation(int))); connect(zRot, SIGNAL(valueChanged(int)), glWidget, SLOT(setZRotation(int))); mpDownloader = new QNetworkAccessManager( this ); connect(mpDownloader, SIGNAL(finished(QNetworkReply*)),this, SLOT(replyFinished(QNetworkReply*))); connect(showRoomIDs, SIGNAL(stateChanged(int)), this, SLOT(slot_toggleShowRoomIDs(int))); mp2dMap->mFontHeight = QFontMetrics( mpHost->mDisplayFont ).height(); glWidget->hide(); mpMap->customEnvColors[257] = mpHost->mRed_2; mpMap->customEnvColors[258] = mpHost->mGreen_2; mpMap->customEnvColors[259] = mpHost->mYellow_2; mpMap->customEnvColors[260] = mpHost->mBlue_2; mpMap->customEnvColors[261] = mpHost->mMagenta_2; mpMap->customEnvColors[262] = mpHost->mCyan_2; mpMap->customEnvColors[263] = mpHost->mWhite_2; mpMap->customEnvColors[264] = mpHost->mBlack_2; mpMap->customEnvColors[265] = mpHost->mLightRed_2; mpMap->customEnvColors[266] = mpHost->mLightGreen_2; mpMap->customEnvColors[267] = mpHost->mLightYellow_2; mpMap->customEnvColors[268] = mpHost->mLightBlue_2; mpMap->customEnvColors[269] = mpHost->mLightMagenta_2; mpMap->customEnvColors[270] = mpHost->mLightCyan_2; mpMap->customEnvColors[271] = mpHost->mLightWhite_2; mpMap->customEnvColors[272] = mpHost->mLightBlack_2; mp2dMap->init(); }