void ICQSecure::fill() { chkAuth->setChecked(m_client->data.owner.WaitAuth.bValue); chkWeb->setChecked(m_client->data.owner.WebAware.bValue); chkHideIP->setChecked(m_client->getHideIP()); chkIgnoreAuth->setChecked(m_client->getIgnoreAuth()); grpDirect->setButton(m_client->getDirectMode()); fillListView(lstVisible, offsetof(ICQUserData, VisibleId)); fillListView(lstInvisible, offsetof(ICQUserData, InvisibleId)); hideIpToggled(m_client->getHideIP()); }
void ICQSecure::fill() { chkAuth->setChecked(m_client->data.owner.WaitAuth); chkWeb->setChecked(m_client->data.owner.WebAware); chkHideIP->setChecked(m_client->getHideIP()); chkIgnoreAuth->setChecked(m_client->getIgnoreAuth()); grpDirect->setButton(m_client->getDirectMode()); tabPassword->setEnabled(m_client->getState() == Client::Connected); fillListView(lstVisible, offsetof(ICQUserData, VisibleId)); fillListView(lstInvisible, offsetof(ICQUserData, InvisibleId)); hideIpToggled(m_client->getHideIP()); }
void *ICQSecure::processEvent(Event *e) { if (e->type() == EventClientChanged){ if ((Client*)(e->param()) == m_client) fill(); } if (e->type() == EventContactChanged){ fillListView(lstVisible, offsetof(ICQUserData, VisibleId)); fillListView(lstInvisible, offsetof(ICQUserData, InvisibleId)); } return NULL; }
void ChannelsJoinDialog::regClicked() { QString szTmp = m_pChannelEdit->text(); if(szTmp.isEmpty()) return; KviQString::escapeKvs(&szTmp); QString szCmd = "regchan.add "; szCmd += szTmp; KviConsoleWindow * c = g_pApp->topmostConnectedConsole(); if(!c) return; // no connection KviWindow * w = g_pActiveWindow; if(w->console() != c) w = c; KviKvsScript::run(szCmd,w); fillListView(); //focus the new item (in reality, the first matching one) QList<QTreeWidgetItem*> items = m_pTreeWidget->findItems(szTmp, Qt::MatchRecursive | Qt::MatchExactly); if(!items.empty()) { m_pTreeWidget->setCurrentItem(items.first()); m_pTreeWidget->scrollToItem(items.first()); } }
void Deleteitem::deleteItem() { Win::HourGlassCursor hgc(true); const int selectedIndex= lvItems.GetSelectedIndex(); if(selectedIndex<0) return; //_____________________________Nothing is selected //_________________________________________________________Ask the user if(this->MessageBox(L"Are you sure you want to delete the selected item?", L"Delete item", MB_YESNO|MB_ICONQUESTION)!=IDYES) return; //________________________________________________________Delete; Sql::SqlConnection conn; wstring cmd; const int item_id= lvItems.Items[selectedIndex].Data; //Get the Primary Key; int rows = 0; try { //conn.OpenSession(DSN, USERNAME, PASSWORD); //Control Panel>Administrative Tools>Data Sources (ODBC)>Create dsn_myDatabase conn.OpenSession(hWnd, CONNECTION_STRING); Sys::Format(cmd, L"DELETE FROM item WHERE item_id= %d", item_id); rows = conn.ExecuteNonQuery(cmd); if (rows!=1) { this->MessageBox(Sys::Convert::ToString(rows), L"Error: number of deleted rows", MB_OK | MB_ICONERROR); } } catch (Sql::SqlException e) { this->MessageBox(e.GetDescription(), L"Error", MB_OK | MB_ICONERROR); } fillListView(); }
void TeethX::insertItem() { toolbMain.EnableButton(IDM_INSERT,false); if(tabSelection.SelectedData==0)//Patient { PatientDlg dlg; dlg.BeginDialog(hWnd); } else if(tabSelection.SelectedData==1)//Payment { PaymentDlg dlg; dlg.userz_id= userz_id; dlg.patient_id= patient_id; dlg.BeginDialog(hWnd); } //else if(tabSelection.SelectedData==2)//Patient Chart //{ // DepartmentDlg dlg; // dlg.BeginDialog(hWnd); //} else if(tabSelection.SelectedData==3)//Proc Setup { ProcedureSetupDlg dlg; dlg.BeginDialog(hWnd); } else if(tabSelection.SelectedData==4)//Users { UserDlg dlg; dlg.BeginDialog(hWnd); } fillListView(); toolbMain.EnableButton(IDM_INSERT,true); }
void Deleteitem::Window_Open(Win::Event& e) { //________________________________________________________ toolbMain TBBUTTON tbButton[1];//<< EDIT HERE THE NUMBER OF BUTTONS toolbMain.imageList.Create(20, 20, 1);//<< EDIT HERE THE NUMBER OF IMAGES toolbMain.imageList.AddIcon(this->hInstance, IDI_DELETE); toolbMain.SendMessage(TB_BUTTONSTRUCTSIZE, (WPARAM)(int)sizeof(TBBUTTON), 0); toolbMain.SetImageList(toolbMain.imageList); //_____________________________________ tbButton[0].iBitmap=MAKELONG(0, 0); //<< IMAGE INDEX tbButton[0].idCommand=IDM_DELETE; tbButton[0].fsState=TBSTATE_ENABLED; // | TBSTATE_WRAP tbButton[0].fsStyle=BTNS_BUTTON; tbButton[0].dwData=0L; tbButton[0].iString= (LONG_PTR)L"Delete"; toolbMain.SetBitmapSize(20, 20); toolbMain.SetButtonSize(24, 24); toolbMain.AddButtons(tbButton, 1);// << EDIT HERE THE NUMBER OF BUTTONS toolbMain.SendMessage(TB_AUTOSIZE, 0, 0); toolbMain.SetMaxTextRows(0);// EDIT HERE TO DISPLAY THE BUTTON TEXT toolbMain.Show(SW_SHOWNORMAL); //________________________________________________________ lvItems: Column Setup lvItems.Cols.Add(0, LVCFMT_LEFT, 200, L"Item name"); lvItems.Cols.Add(1, LVCFMT_LEFT, 120, L"Model"); lvItems.Cols.Add(2, LVCFMT_LEFT, 120, L"Brand"); lvItems.Cols.Add(3, LVCFMT_LEFT, 120, L"Category"); //________________________________________________________Disable the Delete Button toolbMain.EnableButton(IDM_DELETE, false); fillListView(); //Fill the list view control wit the items }
void KonqSidebarBookmarkModule::addTopLevelItem( KonqSidebarTreeTopLevelItem * item ) { m_ignoreOpenChange = true; m_topLevelItem = item; fillListView(); m_ignoreOpenChange = false; }
void TeethX::Cmd_Five(Win::Event& e) { toolbMain.EnableButton(IDM_FIVE, false); //Clear Patient patient_id= -1; patient_name= L""; // fillListView(); this->Text= L"TeethX"; }
void TeethX::fillTabSelection() { //____________________________________________________Get Access info from the userz table bool is_active= false; bool has_acceess_patient_info= false; bool has_access_users= false; bool has_access_payments= false; bool has_access_patient_chart= false; bool has_access_dental_procedure_setup= false; Sql::SqlConnection conn; wstring cmd; int employee_id=0; try { //conn.OpenSession(DSN, USERNAME, PASSWORD); //Control Panel>Administrative Tools>Data Sources (ODBC)>Create dsn_myDatabase conn.OpenSession(hWnd, CONNECTION_STRING); Sys::Format(cmd, L"SELECT is_active, has_access_patient_info, has_access_users, has_access_payments, has_access_patient_chart, has_access_dental_procedure_setup FROM userz WHERE userz_id= %d", userz_id); conn.ExecuteSelect(cmd); conn.BindColumn(1, is_active); conn.BindColumn(2, has_acceess_patient_info); conn.BindColumn(3, has_access_users); conn.BindColumn(4, has_access_payments); conn.BindColumn(5, has_access_patient_chart); conn.BindColumn(6, has_access_dental_procedure_setup); if(conn.Fetch()!=true) { this->MessageBox(L"Unable to get user access.", L"TeethX", MB_OK|MB_ICONERROR); this->Destroy(); return; } } catch(Sql::SqlException e) { this->MessageBox(e.GetDescription(),L"TeethX", MB_OK|MB_ICONERROR); } if(is_active==false) { this->MessageBox(L"This account is not active.", L"TeethX", MB_OK|MB_ICONERROR); this->Destroy(); return; } //____________________________________________________Tab Selection int index= 0; if(has_acceess_patient_info==true) tabSelection.Items.Add(index++, L"Patient", TAB_PATIENT); if(has_access_payments==true) tabSelection.Items.Add(index++, L"Payment", TAB_PAYMENT); if(has_access_patient_chart==true) tabSelection.Items.Add(index++, L"Patient Chart", TAB_PATIENT_CHART); if(has_access_dental_procedure_setup==true) tabSelection.Items.Add(index++, L"Procedure Setup", TAB_PROCEDURE_SETUP); if(has_access_users==true) tabSelection.Items.Add(index++, L"Users", TAB_USERS); tabSelection.SelectedIndex= 0; fillListView(); }
void TeethX::Cmd_Userz(Win::Event& e) { toolbMain.EnableButton(IDM_USERZ, false); SelectPatientDlg dlg; dlg.BeginDialog(hWnd); patient_id= dlg.patient_id; patient_name= dlg.patient_name; toolbMain.EnableButton(IDM_USERZ, true); fillListView(); this->Text= L"TeethX Patient: "; this->Text+= patient_name; toolbMain.EnableButton(IDM_FIVE, true); }
void ChannelsJoinDialog::clearClicked() { QString szCmd = "option stringlistRecentChannels"; KviConsoleWindow * c = g_pApp->topmostConnectedConsole(); if(!c) return; // no connection KviWindow * w = g_pActiveWindow; if(w->console() != c) w = c; KviKvsScript::run(szCmd,w); fillListView(); }
void TeethX::editItem() { toolbMain.EnableButton(IDM_EDIT,false); const int selectedIndex= lvMain.GetSelectedIndex(); if(selectedIndex<0) return; //____________________________________________________Ask the user if(this->MessageBox(L"Are you sure you want to modify the selected item?", L"Edit item", MB_YESNO|MB_ICONQUESTION)!=IDYES) return; //___________________________________________________Edit const int item_id= lvMain.Items[selectedIndex].Data; if(tabSelection.SelectedData==0) { PatientDlg dlg; dlg.patient_id= item_id; dlg.BeginDialog(hWnd); } else if(tabSelection.SelectedData==1) { PaymentDlg dlg; dlg.transactionz_id= item_id; dlg.userz_id= userz_id; dlg.patient_id= patient_id; dlg.BeginDialog(hWnd); } else if(tabSelection.SelectedData==2) { TransactionDentalProcedureDlg dlg; dlg.transactionz_id= item_id; dlg.userz_id= userz_id; dlg.patient_id= patient_id; dlg.BeginDialog(hWnd); } else if(tabSelection.SelectedData==3) { ProcedureSetupDlg dlg; dlg.dental_procedure_id= item_id; dlg.BeginDialog(hWnd); } else if(tabSelection.SelectedData==4) { UserDlg dlg; dlg.userz_id= item_id; dlg.BeginDialog(hWnd); } fillListView(); toolbMain.EnableButton(IDM_EDIT,true); }
void AddonManagementDialog::installScript() { QString szFileName, szError; if(!KviFileDialog::askForOpenFileName( szFileName, __tr2qs_ctx("Select a Installation File - KVIrc","addon"), QString(),KVI_FILTER_ADDON,false,true,this )) return; szFileName.replace("\\","\\\\"); // Sanity check if(szFileName.endsWith(".kva")) { if(!AddonFunctions::installAddonPackage(szFileName,szError,this)) { QMessageBox::critical( this, __tr2qs_ctx("Install Addon - KVIrc","addon"), szError, QMessageBox::Ok, QMessageBox::NoButton, QMessageBox::NoButton ); return; } } else { // Just for sanity check. We should NEVER enter here qDebug("Entered sanity check"); AddonFunctions::notAValidAddonPackage(szError); QMessageBox::critical( this, __tr2qs_ctx("Install Addon - KVIrc","addon"), szError, QMessageBox::Ok, QMessageBox::NoButton, QMessageBox::NoButton ); } fillListView(); currentChanged(0,0); //m_pListWidget->publicUpdateContents(); //m_pListWidget->triggerUpdate(); }
void AddonManagementDialog::uninstallScript() { AddonListViewItem * it = (AddonListViewItem *)m_pListWidget->currentItem(); if(!it)return; QString txt = "<p>"; txt += __tr2qs_ctx("Do you really want to uninstall the addon \"%1\"?","addon").arg(it->addon()->visibleName()); txt += "</p>"; if(QMessageBox::question( this, __tr2qs_ctx("Confirm Addon Uninstallation - KVIrc","addon"), txt, __tr2qs_ctx("Yes","addon"), __tr2qs_ctx("No","addon"),0,1 ) != 0) return; KviKvsScriptAddonManager::instance()->unregisterAddon(it->addon()->name(),g_pActiveWindow); fillListView(); currentChanged(0,0); }
/** * * @param type * @param parent * @param name * @return */ UserGroupDialog::UserGroupDialog ( DialogType type, QWidget *parent, const char *name ) : UserGroupDialogUI(parent, name), _type ( type ) { if ( type == User ) { setCaption ( "User Selection Dialog"); chooseLabel->setText ( " <h2> Select a User </h2>" ); listView->setColumnText ( 0, "uid" ); listView->setColumnText ( 1, "User" ); } else { setCaption ( "Group Selection Dialog"); chooseLabel->setText ( " <h2> Select a Group </h2>"); listView->setColumnText ( 0, "gid" ); listView->setColumnText ( 1, "Group" ); } connect ( listView, SIGNAL (selectionChanged ( QListViewItem * ) ), SLOT ( itemSelected ( QListViewItem * ) ) ) ; connect ( cancelButton, SIGNAL ( clicked ( ) ), SLOT ( reject ( ) ) ); fillListView ( ); }
void TeethX::deleteItem() { toolbMain.EnableButton(IDM_DELETE,false); Win::HourGlassCursor hgc(true); const int selectedIndex= lvMain.GetSelectedIndex(); if(selectedIndex<0) return; //_____________________________Nothing is selected //_________________________________________________________Ask the user if(this->MessageBox(L"Are you sure you want to delete the selected item?", L"Delete item", MB_YESNO|MB_ICONQUESTION)!=IDYES) return; //________________________________________________________Delete; Sql::SqlConnection conn; wstring cmd; const int item_id= lvMain.Items[selectedIndex].Data; //Get the Primary Key; int rows = 0; try { //conn.OpenSession(DSN, USERNAME, PASSWORD); //Control Panel>Administrative Tools>Data Sources (ODBC)>Create dsn_myDatabase conn.OpenSession(hWnd, CONNECTION_STRING); if(tabSelection.SelectedData==0) {Sys::Format(cmd, L"DELETE FROM patient WHERE patient_id= %d", item_id);} else if(tabSelection.SelectedData==1) {Sys::Format(cmd, L"DELETE FROM transactionz WHERE transactionz_id= %d", item_id);} else if(tabSelection.SelectedData==2) Sys::Format(cmd, L"DELETE FROM transactionz WHERE transactionz_id= %d", item_id); else if(tabSelection.SelectedData==3) {Sys::Format(cmd, L"DELETE FROM dental_procedure WHERE dental_procedure_id= %d", item_id);} else if(tabSelection.SelectedData==4) {Sys::Format(cmd, L"DELETE FROM userz WHERE userz_id= %d", item_id);} rows = conn.ExecuteNonQuery(cmd); if (rows!=1) { this->MessageBox(Sys::Convert::ToString(rows), L"ERROR: number of deleted rows", MB_OK | MB_ICONERROR); } } catch (Sql::SqlException ex) { this->MessageBox(ex.GetDescription(), L"ERROR", MB_OK | MB_ICONERROR); } fillListView(); }
ChannelsJoinDialog::ChannelsJoinDialog(const char * name) : QDialog(g_pMainWindow) { setObjectName(name); setWindowTitle(__tr2qs("Join Channels")); setWindowIcon(*(g_pIconManager->getSmallIcon(KviIconManager::Channel))); m_pConsole = 0; QGridLayout * g = new QGridLayout(this); m_pTreeWidget = new ChannelsJoinDialogTreeWidget(this); m_pTreeWidget->setHeaderLabel(__tr2qs("Channel")); m_pTreeWidget->setRootIsDecorated(true); m_pTreeWidget->setSelectionMode(QAbstractItemView::SingleSelection); g->addWidget(m_pTreeWidget,0,0,1,2); //connect(m_pTreeWidget,SIGNAL(itemDoubleClicked(QTreeWidgetItem *,int)),this,SLOT(itemDoubleClicked(QTreeWidgetItem *,int))); m_pGroupBox = new KviTalGroupBox(Qt::Horizontal,__tr2qs("Channel" ),this); QString szMsg = __tr2qs("Name"); szMsg.append(":"); new QLabel(szMsg,m_pGroupBox); m_pChannelEdit = new QLineEdit(m_pGroupBox); connect(m_pChannelEdit,SIGNAL(returnPressed()), this, SLOT(editReturnPressed())); connect(m_pChannelEdit,SIGNAL(textChanged(const QString &)),this,SLOT(editTextChanged(const QString &))); szMsg = __tr2qs("Password"); szMsg.append(":"); QLabel(szMsg,m_pGroupBox); m_pPass = new QLineEdit(m_pGroupBox); m_pPass->setEchoMode(QLineEdit::Password); g->addWidget(m_pGroupBox,1,0,1,2); KviTalHBox * hb = new KviTalHBox(this); hb->setSpacing(4); g->addWidget(hb,2,0,1,2,Qt::AlignHCenter); m_pJoinButton = new QPushButton(__tr2qs("&Join"),hb); // Join on return pressed m_pJoinButton->setDefault(true); connect(m_pJoinButton,SIGNAL(clicked()),this,SLOT(joinClicked())); m_pRegButton = new QPushButton(__tr2qs("&Register"),hb); // Join on return pressed connect(m_pRegButton,SIGNAL(clicked()),this,SLOT(regClicked())); m_pClearButton = new QPushButton(__tr2qs("Clear Recent"),hb); connect(m_pClearButton,SIGNAL(clicked()),this,SLOT(clearClicked())); m_pShowAtStartupCheck = new QCheckBox(__tr2qs("Show this window after connecting"),this); m_pShowAtStartupCheck->setChecked(KVI_OPTION_BOOL(KviOption_boolShowChannelsJoinOnIrc)); g->addWidget(m_pShowAtStartupCheck,3,0); QPushButton * cancelButton = new QPushButton(__tr2qs("Close"),this); connect(cancelButton,SIGNAL(clicked()),this,SLOT(cancelClicked())); g->addWidget(cancelButton,3,1); /* KviTalHBox * hb = new KviTalHBox(this); hb->setSpacing(4); QPushButton * namesButton = new QPushButton("/names", hb); connect(namesButton,SIGNAL(clicked()),this,SLOT(namesClicked())); QPushButton * whoButton = new QPushButton("/who", hb); connect(whoButton,SIGNAL(clicked()),this,SLOT(whoClicked())); g->addWidget(hb,2,0); */ g->setRowStretch(0,1); g->setColumnStretch(0,1); fillListView(); if(g_rectChannelsJoinGeometry.y() < 5) g_rectChannelsJoinGeometry.setY(5); resize(g_rectChannelsJoinGeometry.width(),g_rectChannelsJoinGeometry.height()); //move(g_rectChannelsJoinGeometry.x(),g_rectChannelsJoinGeometry.y()); QRect rect = g_pApp->desktop()->screenGeometry(g_pMainWindow); move(rect.x() + ((rect.width() - g_rectChannelsJoinGeometry.width())/2),rect.y() + ((rect.height() - g_rectChannelsJoinGeometry.height())/2)); enableJoin(); }
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ void TeethX::tabSelection_SelChange(Win::Event& e) { fillListView(); }
void ChannelsJoinDialog::setConsole(KviConsoleWindow * pConsole) { m_pConsole = pConsole; fillListView(); }
AddonManagementDialog::AddonManagementDialog(QWidget * p) : QWidget(p) { setWindowTitle(__tr2qs_ctx("Manage Addons - KVIrc","addon")); setObjectName("Addon manager"); setWindowIcon(*(g_pIconManager->getSmallIcon(KviIconManager::Addons))); #ifdef COMPILE_WEBKIT_SUPPORT m_pWebInterfaceDialog = NULL; #endif //COMPILE_WEBKIT_SUPPORT m_pInstance = this; QGridLayout * g = new QGridLayout(this); KviTalHBox *hb = new KviTalHBox(this); hb->setMargin(1); hb->setSpacing(1); g->addWidget(hb,0,0); QToolButton * tb; QFrame * sep; m_pConfigureButton = new QToolButton(hb); m_pConfigureButton->setIcon(*(g_pIconManager->getBigIcon(KVI_BIGICON_ADDONS))); m_pConfigureButton->setIconSize(QSize(32,32)); KviTalToolTip::add(m_pConfigureButton,__tr2qs_ctx("Configure addon...","addon")); connect(m_pConfigureButton,SIGNAL(clicked()),this,SLOT(configureScript())); m_pHelpButton = new QToolButton(hb); m_pHelpButton->setIcon(*(g_pIconManager->getBigIcon(KVI_BIGICON_HELP))); m_pHelpButton->setIconSize(QSize(32,32)); KviTalToolTip::add(m_pHelpButton,__tr2qs_ctx("Show help","addon")); connect(m_pHelpButton,SIGNAL(clicked()),this,SLOT(showScriptHelp())); m_pUninstallButton = new QToolButton(hb); m_pUninstallButton->setIcon(*(g_pIconManager->getBigIcon(KVI_BIGICON_REMOVE))); m_pUninstallButton->setIconSize(QSize(32,32)); KviTalToolTip::add(m_pUninstallButton,__tr2qs_ctx("Delete selected addon","addon")); connect(m_pUninstallButton,SIGNAL(clicked()),this,SLOT(uninstallScript())); sep = new QFrame(hb); sep->setFrameStyle(QFrame::VLine | QFrame::Sunken); sep->setMinimumWidth(12); m_pPackButton = new QToolButton(hb); m_pPackButton->setIcon(*(g_pIconManager->getBigIcon(KVI_BIGICON_PACK))); m_pPackButton->setIconSize(QSize(32,32)); KviTalToolTip::add(m_pPackButton,__tr2qs_ctx("Create an addon as a distributable package","addon")); connect(m_pPackButton,SIGNAL(clicked()),this,SLOT(packScript())); sep = new QFrame(hb); sep->setFrameStyle(QFrame::VLine | QFrame::Sunken); sep->setMinimumWidth(12); tb = new QToolButton(hb); tb->setIcon(*(g_pIconManager->getBigIcon(KVI_BIGICON_OPEN))); tb->setIconSize(QSize(32,32)); KviTalToolTip::add(tb,__tr2qs_ctx("Install addon package from disk","addon")); connect(tb,SIGNAL(clicked()),this,SLOT(installScript())); tb = new QToolButton(hb); tb->setIcon(*(g_pIconManager->getBigIcon(KVI_BIGICON_WWW))); tb->setIconSize(QSize(32,32)); KviTalToolTip::add(tb,__tr2qs_ctx("Get more addons...","addon")); connect(tb,SIGNAL(clicked()),this,SLOT(getMoreScripts())); QWidget *w= new QWidget(hb); w->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Minimum); m_pListWidget = new KviTalListWidget(this); KviTalIconAndRichTextItemDelegate *itemDelegate=new KviTalIconAndRichTextItemDelegate(m_pListWidget); m_pListWidget->setItemDelegate(itemDelegate); m_pListWidget->setSelectionMode(QAbstractItemView::SingleSelection); m_pListWidget->setSortingEnabled(true); m_pListWidget->setMinimumHeight(400); m_pListWidget->setMinimumWidth(380); g->addWidget(m_pListWidget,1,0); fillListView(); currentChanged(0,0); connect(m_pListWidget,SIGNAL(currentItemChanged(QListWidgetItem *,QListWidgetItem *)),this,SLOT(currentChanged(QListWidgetItem *,QListWidgetItem *))); m_pListWidget->setCurrentItem(m_pListWidget->item(0)); QPushButton * pCloseBtn = new QPushButton(__tr2qs_ctx("Close","addon"),this); pCloseBtn->setMaximumSize(pCloseBtn->sizeHint().width(),pCloseBtn->sizeHint().height()); connect(pCloseBtn,SIGNAL(clicked()),this,SLOT(closeClicked())); g->addWidget(pCloseBtn,2,0); g->setMargin(5); g->setSpacing(5); g->setAlignment(pCloseBtn,Qt::AlignRight); if(g_rectManagementDialogGeometry.y() < 5) { g_rectManagementDialogGeometry.setY(5); } resize(g_rectManagementDialogGeometry.width(), g_rectManagementDialogGeometry.height()); QRect rect = g_pApp->desktop()->screenGeometry(g_pMainWindow); move(rect.x() + ((rect.width() - g_rectManagementDialogGeometry.width())/2),rect.y() + ((rect.height() - g_rectManagementDialogGeometry.height())/2)); new QShortcut(Qt::Key_Escape, this, SLOT(closeClicked())); }