void frmMain::InitStyle() { QPropertyAnimation *animation = new QPropertyAnimation(this, "windowOpacity"); animation->setDuration(1000); animation->setStartValue(0); animation->setEndValue(1); animation->start(); this->max = false; this->location = this->geometry(); this->setProperty("Form", true); this->setProperty("CanMove", true); this->setWindowTitle(ui->lab_Title->text()); this->setWindowFlags(Qt::FramelessWindowHint | Qt::WindowSystemMenuHint | Qt::WindowMinimizeButtonHint); IconHelper::Instance()->SetIcoMain(ui->lab_Ico, 40); IconHelper::Instance()->SetIcoMin(ui->btnMenu_Min); IconHelper::Instance()->SetIcoNormal(ui->btnMenu_Max); IconHelper::Instance()->SetIcoClose(ui->btnMenu_Close); connect(ui->btnMenu_Min, SIGNAL(clicked()), this, SLOT(showMinimized())); connect(ui->btnMenu_Close, SIGNAL(clicked()), this, SLOT(closeWidget())); connect(ui->btnExit, SIGNAL(clicked()),this, SLOT(closeWidget())); ui->widget_title->installEventFilter(this); ui->btnMenu_Max->click(); }
void WenliBackWidget::initConnect() { connect(m_groupButton, SIGNAL(playVideo()), this, SIGNAL(playVideo())); connect(m_groupButton, SIGNAL(showSkin()), this, SIGNAL(showSkin())); connect(m_groupButton, SIGNAL(showMenu()), this, SIGNAL(showMenu())); connect(m_groupButton, SIGNAL(showMin()), this, SIGNAL(showMin())); connect(m_groupButton, SIGNAL(closeWidget()), this, SIGNAL(closeWidget())); connect(m_button, SIGNAL(buttonClicked()), this, SIGNAL(buttonClicked())); }
SysButtonGroup::SysButtonGroup(QWidget *parent) : QWidget(parent) { QHBoxLayout *hLayout = new QHBoxLayout; StaticButton *playButton = new StaticButton(":/main/playvideo"); connect(playButton, SIGNAL(buttonClicked()), this, SIGNAL(playVideo())); StaticButton *skinButton = new StaticButton(":/main/skin"); connect(skinButton, SIGNAL(buttonClicked()), this, SIGNAL(showSkin())); StaticButton *menuButton = new StaticButton(":/main/menu"); connect(menuButton, SIGNAL(buttonClicked()), this, SIGNAL(showMenu())); StaticButton *minButton = new StaticButton(":/main/sys_min"); connect(minButton, SIGNAL(buttonClicked()), this, SIGNAL(showMin())); StaticButton *closeButton = new StaticButton(":/main/sys_close"); connect(closeButton, SIGNAL(buttonClicked()), this, SIGNAL(closeWidget())); hLayout->addWidget(playButton); hLayout->addWidget(skinButton); hLayout->addWidget(menuButton); hLayout->addWidget(minButton); hLayout->addWidget(closeButton); hLayout->setContentsMargins(5, 0, 5, 0); hLayout->setSpacing(0); this->setLayout(hLayout); }
void se_kbmwidget::initUI() { this->setWindowIcon(QIcon(":/img/Logo")); //this->setWindowFlags(Qt::Tool | Qt::X11BypassWindowManagerHint); this->setGeometry(QRect(380,140,650,400)); this->setWindowFlags(Qt::FramelessWindowHint); this->setModal(true); m_backgroundWidget = new Kbmbasewidget(this); m_backgroundWidget->setGeometry(rect()); m_backgroundWidget->lower(); QLabel *logoLabel = new QLabel; logoLabel->setPixmap(QPixmap(":/img/logo"));//logo QLabel *textLabel = new QLabel; textLabel->setText("OS 测评之家 1.0");//界面tital textLabel->setStyleSheet("color:white;"); textLabel->adjustSize(); QHBoxLayout *hLayout = new QHBoxLayout;//左上角布局 hLayout->addWidget(logoLabel); hLayout->addWidget(textLabel); stack = new QStackedWidget; buttonGroup = new SysButtonGroup;//右上角按钮组 connect(buttonGroup, SIGNAL(closeWidget()), this, SIGNAL(closeWidget())); QWidget *title = new QWidget;//顶部第一页面 title->setAttribute(Qt::WA_TranslucentBackground); title->setLayout(hLayout); kbm = new MainKBMview;//显示页面 wait = new LoadingDialog;//等待页面 stack->addWidget(wait); stack->addWidget(kbm); QHBoxLayout *titleLayout = new QHBoxLayout; titleLayout->addWidget(title, 0, Qt::AlignLeft | Qt::AlignTop); titleLayout->addStretch(); titleLayout->addWidget(buttonGroup, 0, Qt::AlignRight | Qt::AlignTop); titleLayout->setContentsMargins(10, 0, 0, 0); QVBoxLayout *vLayout = new QVBoxLayout; vLayout->addLayout(titleLayout); vLayout->addWidget(stack); vLayout->setSpacing(0); vLayout->setContentsMargins(0,0,0,0); this->setLayout(vLayout); }
void MainWindow::initConnect() { connect(m_topWidget, SIGNAL(goExamine()), m_bottomWidget, SLOT(goExamine()));//绑定top一键测评信号 connect(m_topWidget, SIGNAL(goExamine()), this, SLOT(goSetinformation())); connect(m_topWidget, SIGNAL(reexamine()), m_bottomWidget, SLOT(clearInfo())); connect(m_topWidget, SIGNAL(reexamine()), this, SLOT(goSetinformation())); connect(m_topWidget, SIGNAL(goView()), m_bottomWidget, SLOT(goToview())); connect(m_topWidget, SIGNAL(goMain()), m_bottomWidget, SLOT(goMain()));//绑定top第二界面返回信号 connect(m_topWidget, SIGNAL(closeWidget()), this, SLOT(closeWidget())); connect(m_topWidget, SIGNAL(showSkin()), this, SLOT(showSkin())); connect(m_safeWidget, SIGNAL(goToMain()), this, SLOT(goToMain())); connect(m_thionetWidget, SIGNAL(goToMain()), this, SLOT(goToMain())); connect(m_kbmWidget, SIGNAL(goToMain()), this, SLOT(goToMain())); connect(m_bottomWidget, SIGNAL(safeClicked()), this, SLOT(goToSafe())); connect(m_bottomWidget, SIGNAL(KBMClicked()), this, SLOT(goToKBM())); connect(m_bottomWidget, SIGNAL(TIONClicked()), this, SLOT(goToTion())); connect(m_upGroup, SIGNAL(finished()), this, SLOT(upAnimFinished())); connect(m_bottomWidget, SIGNAL(doClick(int)), this , SLOT(goToinfo(int))); }
void LeftHandMenu::shouldShowButtons(const QString& key, bool) { for (const auto& widget : mRoomWidgets) { if (widget->key() != key) { auto groupWidget = qobject_cast<ListRoomWidget*>(widget); Q_ASSERT(groupWidget); groupWidget->closeWidget(); } } resize(); }
AboutBox::AboutBox(IPluginManager *APluginManager, QWidget *AParent) : QDialog(AParent) { ui.setupUi(this); setAttribute(Qt::WA_DeleteOnClose,true); #ifdef Q_WS_MAC ui.buttonsLayout->setSpacing(16); //ui.buttonsLayout->addWidget(ui.pbtSendComment); setWindowGrowButtonEnabled(this->window(), false); #endif QString styleBegin = "<html><style>a { color: #acacac; }</style><body><font color=#acacac>"; QString styleEnd = "</font></body></html>"; //ui.lblName->setText(tr("Contacts")); IconStorage::staticStorage(RSR_STORAGE_MENUICONS)->insertAutoIcon(ui.lblName, MNI_OPTIONS_LOGIN_LOGO, 0, 0, "pixmap"); ui.lblVersion->setText(styleBegin + tr("Version: %1.%2 %3").arg(APluginManager->version()).arg(APluginManager->revision()).arg(CLIENT_VERSION_SUFIX).trimmed() + styleEnd); ui.lblHomePage->setText(styleBegin + tr("Site: %1").arg("<a href='http://contacts.rambler.ru'>contacts.rambler.ru</a>") + "</font>"); ui.lblCopyright->setText(styleBegin + tr("© 2011, \"Rambler Internet Holding LLC\".<br>%1").arg(QString("<a href='http://help.rambler.ru/legal/?s=44761'>%1</a>").arg(tr("Terms of Use"))) + styleEnd); ui.lblFontInfo->setText(styleBegin + tr("The program uses the Segoe UI font on the license granted Monotype Imaging Inc. %1").arg("<a href=\'http://www.fonts.com\'>www.fonts.com</a>") + styleEnd); ui.lblAboutQt->setText(styleBegin + tr("The program is developed with %1.").arg("<a href=\'about:qt\'>Qt</a>") + styleEnd); connect(ui.lblAboutQt, SIGNAL(linkActivated(const QString &)), SLOT(onLabelLinkActivated(const QString &))); connect(ui.lblHomePage,SIGNAL(linkActivated(const QString &)),SLOT(onLabelLinkActivated(const QString &))); connect(ui.lblCopyright,SIGNAL(linkActivated(const QString &)),SLOT(onLabelLinkActivated(const QString &))); connect(ui.pbtSendComment, SIGNAL(clicked()), APluginManager->instance(), SLOT(onShowCommentsDialog())); border = CustomBorderStorage::staticStorage(RSR_STORAGE_CUSTOMBORDER)->addBorder(this, CBS_DIALOG); if (border) { border->setResizable(false); border->setMinimizeButtonVisible(false); border->setMaximizeButtonVisible(false); border->setAttribute(Qt::WA_DeleteOnClose, true); connect(border, SIGNAL(closeClicked()), SLOT(reject())); connect(this, SIGNAL(accepted()), border, SLOT(closeWidget())); connect(this, SIGNAL(rejected()), border, SLOT(closeWidget())); } StyleStorage::staticStorage(RSR_STORAGE_STYLESHEETS)->insertAutoStyle(this, STS_PLUGINMANAGER_ABOUTBOX); GraphicsEffectsStorage::staticStorage(RSR_STORAGE_GRAPHICSEFFECTS)->installGraphicsEffect(this, GFX_LABELS); }
TTKMoveResizeWidgetWindow::TTKMoveResizeWidgetWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::TTKMoveResizeWidgetWindow) { setAttribute(Qt::WA_DeleteOnClose); ui->setupUi(this); m_widget = nullptr; connect(ui->pushButton, SIGNAL(clicked()), SLOT(changed())); connect(ui->pushButton_2, SIGNAL(clicked()), SLOT(closeWidget())); }
MTitleWidget::MTitleWidget(QWidget *parent) : QWidget(parent) { ui.setupUi(this); ui.minBtn->setPicName(":/sysButton/Resources/Images/SysButton/min"); ui.maxBtn->setPicName(":/sysButton/Resources/Images/SysButton/max"); ui.closeBtn->setPicName(":/sysButton/Resources/Images/SysButton/close"); connect(ui.minBtn, SIGNAL(clicked()), this, SIGNAL(minWidget())); connect(ui.maxBtn, SIGNAL(clicked()), this, SIGNAL(maxWidget())); connect(ui.closeBtn, SIGNAL(clicked()), this, SIGNAL(closeWidget())); }
SetupPluginsDialog::SetupPluginsDialog(IPluginManager *APluginManager, QDomDocument APluginsSetup, QWidget *AParent) : QDialog(AParent) { ui.setupUi(this); IconStorage::staticStorage(RSR_STORAGE_MENUICONS)->insertAutoIcon(this,MNI_PLUGINMANAGER_SETUP,0,0,"windowIcon"); StyleStorage::staticStorage(RSR_STORAGE_STYLESHEETS)->insertAutoStyle(this, STS_PLUGINMANAGER_SETUPPLUGINSDIALOG); CustomBorderContainer *border = NULL; //CustomBorderStorage::staticStorage(RSR_STORAGE_CUSTOMBORDER)->addBorder(this, CBS_DIALOG); if (border) { border->setAttribute(Qt::WA_DeleteOnClose, true); connect(border, SIGNAL(closeClicked()), SLOT(reject())); connect(this, SIGNAL(accepted()), border, SLOT(closeWidget())); connect(this, SIGNAL(rejected()), border, SLOT(closeWidget())); } else { setAttribute(Qt::WA_DeleteOnClose,true); } FPluginManager = APluginManager; FPluginsSetup = APluginsSetup; updateLanguage(); connect(ui.cmbLanguage,SIGNAL(currentIndexChanged(int)),SLOT(onCurrentLanguageChanged(int))); updatePlugins(); ui.twtPlugins->horizontalHeader()->setResizeMode(COL_NAME,QHeaderView::Stretch); ui.twtPlugins->horizontalHeader()->setResizeMode(COL_FILE,QHeaderView::ResizeToContents); connect(ui.twtPlugins,SIGNAL(currentItemChanged(QTableWidgetItem *, QTableWidgetItem *)),SLOT(onCurrentPluginChanged(QTableWidgetItem *, QTableWidgetItem *))); connect(ui.dbbButtons,SIGNAL(clicked(QAbstractButton *)),SLOT(onDialogButtonClicked(QAbstractButton *))); connect(ui.lblHomePage, SIGNAL(linkActivated(const QString &)),SLOT(onHomePageLinkActivated(const QString &))); ui.cmbCountry->setView(new QListView); ui.cmbLanguage->setView(new QListView); QString ns = CustomBorderStorage::isBordered(this) ? QString::null : QString("system-border"); window()->restoreGeometry(Options::fileValue("misc.setup-plugins-dialog.geometry",ns).toByteArray()); }
void VirtualJoystickPlugin::menuAction(int action, bool checked) { (void) checked; switch (action) { case 1: if (!joystick) { joystick = new JoystickWidget(); gui->addDockWidget((void*)joystick); joystick->setMaxSpeed(12.0); connect(joystick, SIGNAL(newSpeed(double, double)), this, SLOT(newSpeed(double, double))); connect(joystick, SIGNAL(hideSignal()), this, SLOT(hideWidget())); connect(joystick, SIGNAL(closeSignal()), this, SLOT(closeWidget())); } else {
void QSoftKeyDesignToolWidget::closeEvent(QCloseEvent *) { QRect rc( x(), y(), width(), height() ); QString str = QString("%1,%2,%3,%4").arg(rc.left()).arg(rc.top()).arg(rc.right()).arg(rc.bottom()); QSettings settings( "Habilience", "T3kSoftlogic" ); settings.beginGroup( "Windows" ); settings.setValue( "SoftkeyDesignTool_Pos", str ); settings.endGroup(); QString strShow( ui->BtnShowToolbar->text() ); bool bShow = false; if( strShow.contains( "Hide" ) ) bShow = true; settings.beginGroup( "Settings" ); settings.setValue( "ShowLayoutToolBar", bShow ); settings.endGroup(); emit closeWidget(); }
void CameraConfigurator::menuAction(int action, bool checked) { (void)checked; switch(action) { case 1: if (myWidget != NULL && myWidget->pDialog) { myWidget->pDialog->close(); delete myWidget; myWidget = NULL; } myWidget = new CameraConfiguratorGUI(control); mainGui->addDockWidget((void*)myWidget->pDialog); myWidget->show(); std::vector<CameraConfig*>::iterator iter; myMutex.lock(); for(iter=cameras.begin(); iter!=cameras.end(); ++iter) myWidget->addCamera((*iter)); myMutex.unlock(); connect(myWidget->pDialog, SIGNAL(closeSignal()), this, SLOT(closeWidget())); break; } }
MainWidget::MainWidget(QWidget *parent) : DropShadowWidget(parent) { initLocalConnection(); setMinimumSize(900, 600); setWindowIcon(QIcon(":/img/safe")); statked_widget = new QStackedWidget(); title_widget = new TitleWidget(); content_widget = new ContentWidget(); kill_mummy_widget = new KillMummyWidget(); main_menu = new MainMenu(); character_widget = new CharacterWidget(); about_us_dialog = new AboutUsDialog(this); setting_dialog = new SettingDialog(this); login_dialog = new LoginDialog(this); register_widget = new RegisterWidget(this); skin_widget = new SkinWidget(this); system_tray = new SystemTray(this); QPalette palette; palette.setBrush(QPalette::Window, QBrush(Qt::white)); statked_widget->setPalette(palette); statked_widget->setAutoFillBackground(true); statked_widget->addWidget(content_widget); statked_widget->addWidget(kill_mummy_widget); QVBoxLayout *center_layout = new QVBoxLayout(); center_layout->addWidget(statked_widget); center_layout->setSpacing(0); center_layout->setContentsMargins(0, 0, 0, 0); QVBoxLayout *main_layout = new QVBoxLayout(); main_layout->addWidget(title_widget); main_layout->addLayout(center_layout); main_layout->setSpacing(0); main_layout->setContentsMargins(SHADOW_WIDTH, SHADOW_WIDTH, SHADOW_WIDTH, SHADOW_WIDTH); setLayout(main_layout); connect(title_widget, SIGNAL(showSkin()), this, SLOT(showSkinWidget())); connect(title_widget, SIGNAL(showMainMenu()), this, SLOT(showMainMenu())); connect(title_widget, SIGNAL(showMin()), this, SLOT(showMinimized())); connect(title_widget, SIGNAL(closeWidget()), this, SLOT(hide())); connect(title_widget, SIGNAL(turnPage(int)), this, SLOT(turnPage(int))); connect(main_menu, SIGNAL(showSettingDialog()), this, SLOT(showSettingDialog())); connect(main_menu, SIGNAL(showNewCharacter()), this, SLOT(showNewCharacter())); connect(main_menu, SIGNAL(showAboutUs()), this, SLOT(showAboutUs())); connect(content_widget, SIGNAL(showLoginDialog()), this, SLOT(showLoginDialog())); connect(content_widget, SIGNAL(showRegisterDialog()), this, SLOT(showRegisterDialog())); connect(setting_dialog, SIGNAL(changeLanguage(LANGUAGE)), this, SLOT(changeLanguage(LANGUAGE))); connect(skin_widget, SIGNAL(changeSkin(QString)), this, SLOT(changeSkin(QString))); connect(system_tray, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), this, SLOT(iconIsActived(QSystemTrayIcon::ActivationReason))); connect(system_tray, SIGNAL(showWidget()), this, SLOT(showWidget())); system_tray->show(); title_widget->turnPage("0"); skin_name = Util::getSkinName(); if( QString::compare(skin_name, QString("")) == 0) { this->changeSkin(DEFAULT_SKIN); } }
void QAdvancedCalibrationWidget::closeEvent(QCloseEvent *) { emit closeWidget(); }
TTKMoveResizeWidgetWindow::~TTKMoveResizeWidgetWindow() { delete ui; closeWidget(); }
void QSoftKeyDesignToolWidget::on_BtnClose_clicked() { emit closeWidget(); close(); }
MergeContactsDialog::MergeContactsDialog(IMetaContacts *AMetaContacts, IMetaRoster *AMetaRoster, const QList<QString> AMetaIds, QWidget *AParent) : QDialog(AParent) { ui.setupUi(this); StyleStorage::staticStorage(RSR_STORAGE_STYLESHEETS)->insertAutoStyle(this,STS_METACONTACTS_MERGECONTACTSDIALOG); GraphicsEffectsStorage::staticStorage(RSR_STORAGE_GRAPHICSEFFECTS)->installGraphicsEffect(this, GFX_LABELS); FBorder = CustomBorderStorage::staticStorage(RSR_STORAGE_CUSTOMBORDER)->addBorder(this, CBS_DIALOG); if (FBorder) { FBorder->setResizable(false); FBorder->setMinimizeButtonVisible(false); FBorder->setMaximizeButtonVisible(false); FBorder->setAttribute(Qt::WA_DeleteOnClose,true); FBorder->setWindowTitle(ui.lblCaption->text()); connect(this, SIGNAL(accepted()), FBorder, SLOT(closeWidget())); connect(this, SIGNAL(rejected()), FBorder, SLOT(closeWidget())); connect(FBorder, SIGNAL(closeClicked()), SLOT(reject())); setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); } else { ui.lblCaption->setVisible(false); setAttribute(Qt::WA_DeleteOnClose,true); } #ifdef Q_WS_MAC ui.buttonsLayout->setSpacing(16); ui.buttonsLayout->addWidget(ui.pbtMerge); setWindowGrowButtonEnabled(this->window(), false); #endif ui.lneName->setAttribute(Qt::WA_MacShowFocusRect, false); FMetaRoster = AMetaRoster; FMetaContacts = AMetaContacts; FMetaIds = AMetaIds; ui.lblNotice->setText(tr("These %n contacts will be merged into one:","",AMetaIds.count())); QString name; int nameCapCount = 0; QRegExp nameRegExp(tr("([a-z])","From first letter to last of alphabet"),Qt::CaseInsensitive); QSet<Jid> items; ui.ltContacts->addStretch(); foreach(QString metaId, FMetaIds) { IMetaContact contact = FMetaRoster->metaContact(metaId); items += contact.items; QImage avatar = FMetaRoster->metaAvatarImage(metaId,false,false).scaled(24, 24, Qt::KeepAspectRatio,Qt::SmoothTransformation); QString itemName = FMetaContacts->metaContactName(contact); int pos = 0; int itemNameCapCount = 0; while ((pos = nameRegExp.indexIn(itemName, pos)) != -1) { itemNameCapCount++; pos += nameRegExp.matchedLength(); } if (nameCapCount < itemNameCapCount) { name = itemName; nameCapCount = itemNameCapCount; } else if (name.isEmpty()) { name = itemName.trimmed(); } QHBoxLayout *itemLayout = new QHBoxLayout(); itemLayout->setContentsMargins(0, 0, 0, 0); itemLayout->setSpacing(8); QLabel *avatarLabel = new QLabel(this); avatarLabel->setFixedSize(24, 24); avatarLabel->setPixmap(QPixmap::fromImage(avatar)); avatarLabel->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); itemLayout->addWidget(avatarLabel); QLabel *nameLabel = new QLabel(this); nameLabel->setText(itemName); itemLayout->addWidget(nameLabel); ui.ltContacts->addItem(itemLayout); }
this->toolBox = toolbox; this->textEdit->setText(QString::fromUtf8(f->getName().c_str())); this->te_synopsis->setText(QString::fromUtf8(f->getSynopsis().c_str())); loadHoraire(); initSignal(); } DetailEditWidget::~DetailEditWidget() {} void DetailEditWidget::initSignal() { QObject::connect(this->checkAll,SIGNAL(stateChanged(int/*Qt::Unchecked*/)), this,SLOT(selectAll())); QObject::connect(this->btn_back,SIGNAL(clicked()), this,SLOT(closeWidget())); if(this->mode==MODE_EDIT) { QObject::connect(this->btnEditer,SIGNAL(clicked()), this,SLOT(editFilm())); } else { QObject::connect(this->btnEditer,SIGNAL(clicked()), this,SLOT(saveFilm())); } } int DetailEditWidget::getMode() { return this->mode;