dialogAnalog::dialogAnalog( int nbbits,QWidget * parent, Qt::WFlags f) : QDialog(parent, f) { setupUi(this); connect(chkBCapture, SIGNAL(stateChanged(int)), this, SLOT(updatecapture(int))); connect(pbZoomIn, SIGNAL(clicked()), this, SLOT(zoomin())); connect(pbZoomOut, SIGNAL(clicked()), this, SLOT(zoomout())); connect(pbFit, SIGNAL(clicked()), this, SLOT(fitmarkers())); connect(hlScrollBar, SIGNAL(valueChanged(int)), this, SLOT(scroll(int))); connect(pbSave, SIGNAL(clicked()), this, SLOT(slotSave())); connect(pbLoad, SIGNAL(clicked()), this, SLOT(slotLoad())); connect(pbMarker, SIGNAL(clicked()), this, SLOT(slotMarker())); connect(twWatchPoint, SIGNAL(currentItemChanged ( QTreeWidgetItem * , QTreeWidgetItem * )), this, SLOT(slotChangeWatchPoint( QTreeWidgetItem * , QTreeWidgetItem * ))); connect(mainwindow,SIGNAL(DestroySignal(CPObject*)),this,SLOT(DestroySlot(CPObject*))); Capture = false; NbBits = nbbits; m_zoom = 1.0; pPC = 0; currentWatchPoint = 0; currentWatchPointSize=8; fill_twWatchPoint(); twWatchPoint->expandAll(); }
KCookieServer::KCookieServer(const QCString &name) : KDEDModule(name) { mOldCookieServer = new DCOPClient(); // backwards compatibility. mOldCookieServer->registerAs("kcookiejar", false); mOldCookieServer->setDaemonMode(true); mCookieJar = new KCookieJar; mPendingCookies = new KHttpCookieList; mPendingCookies->setAutoDelete(true); mRequestList = new RequestList; mAdvicePending = false; mTimer = new QTimer(); connect(mTimer, SIGNAL(timeout()), SLOT(slotSave())); mConfig = new KConfig("kcookiejarrc"); mCookieJar->loadConfig(mConfig); QString filename = locateLocal("data", "kcookiejar/cookies"); // Stay backwards compatible! QString filenameOld = locate("data", "kfm/cookies"); if(!filenameOld.isEmpty()) { mCookieJar->loadCookies(filenameOld); if(mCookieJar->saveCookies(filename)) { unlink(QFile::encodeName(filenameOld)); // Remove old kfm cookie file } } else { mCookieJar->loadCookies(filename); } connect(this, SIGNAL(windowUnregistered(long)), this, SLOT(slotDeleteSessionCookies(long))); }
void ClassMainWindow::initGUI() { m_centralWidget = new QWidget( this ); setCentralWidget( m_centralWidget ); QHBoxLayout *layout = new QHBoxLayout( m_centralWidget ); m_classChooser = new ClassChooser( m_centralWidget ); m_classChooser->setMaximumWidth( 200 ); m_classChooser->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ); layout->addWidget( m_classChooser ); QVBoxLayout *vlayout = new QVBoxLayout( layout ); m_listView = new CollectionListView( 0, m_centralWidget ); m_listView->setClassInfo( m_classChooser->currentClass() ); m_classChooser->load(); m_listView->setClassInfo( m_classChooser->currentClass() ); connect( m_listView, SIGNAL(doubleClicked(QListViewItem*,const QPoint&, int)), SLOT(slotDoubleClicked(QListViewItem*,const QPoint&, int))); connect( m_listView, SIGNAL(rightButtonClicked(QListViewItem*,const QPoint&,int)), SLOT(slotRightClick(QListViewItem*,const QPoint &,int)) ); m_listViewSearchLine = new KListViewSearchLine( m_centralWidget ); m_listViewSearchLine->setListView( m_listView ); vlayout->addWidget( m_listViewSearchLine ); vlayout->addWidget( m_listView ); KStdAction::save( this, SLOT(slotSave()), actionCollection() ); setupGUI(); connect( m_classChooser, SIGNAL(classSelected(const ClassInfo*)), SLOT(slotCurrentClassChanged(const ClassInfo*)) ); }
/* * Constructs a SQDFrame as a child of 'parent', with the * name 'name' and widget flags set to 'f'. */ SQDFrame::SQDFrame( QWidget* parent, const char* name, WFlags fl ) : QWidget( parent, name, fl ), HFSolver(NULL) { if ( !name ) setName( "SQDFrame" ); potLabel = new QLabel( this, "poteLabel" ); potLabel->setGeometry( QRect( 240, 20, 260, 24 ) ); potFrame = new NxyCurvePlot(this,"potPlot"); potFrame->setGeometry( QRect( 20, 60, 540, 200 ) ); potFrame->setFrameShape( QFrame::StyledPanel ); potFrame->setFrameShadow( QFrame::Raised ); wfsLabel = new QLabel( this, "wfsLabel" ); wfsLabel->setGeometry( QRect( 160, 280, 400, 24 ) ); wfsFrame = new NxyCurvePlot(this,"wfsPlot"); wfsFrame->setGeometry( QRect( 20, 320, 540, 270 ) ); d_log = new QTextEdit(this); d_log->setGeometry( QRect( 40, 600, 510, 200 )); d_log->setTextFormat(Qt::LogText); QFrame *hb = new QFrame(this,"buttonbox"); hb->setGeometry(QRect(40,805,540,60)); QHBoxLayout *layout = new QHBoxLayout(hb); quitButton = new QPushButton(hb, "quitButton" ); layout->addItem(new QSpacerItem( 50, 20, QSizePolicy::Expanding, QSizePolicy::Minimum )); layout->addWidget(quitButton); layout->addItem(new QSpacerItem( 50, 20, QSizePolicy::Fixed, QSizePolicy::Minimum )); saveButton = new QPushButton( hb, "saveButton" ); layout->addWidget(saveButton); layout->addItem(new QSpacerItem( 50, 20, QSizePolicy::Expanding, QSizePolicy::Minimum )); connect( quitButton, SIGNAL(clicked()), qApp, SLOT(quit()) ); connect( saveButton, SIGNAL(clicked()), this, SLOT(slotSave()) ); resize( QSize(600, 860).expandedTo(minimumSizeHint()) ); languageChange(); clearWState( WState_Polished ); }
QDialogEmployeeDataInput::QDialogEmployeeDataInput(QWidget *parent) : QDialog(parent), ui(new Ui::QDialogEmployeeDataInput) { ui->setupUi(this); connect(this, SIGNAL(accepted()), SLOT(slotSave())); QSqlQuery *query = DBAdapter::getInstance().getQuery("select * from users.v_groups order by name"); query->exec(); while (query->next()) { ui->boxGroup->addItem(query->value("name").toString(), query->value("id").toString()); } delete query; query = DBAdapter::getInstance().getQuery("select * from users.v_employee_position where status = 0 order by position_name"); query->exec(); while (query->next()) { ui->boxPosition->addItem(query->value("position_name").toString(), query->value("id").toString()); } delete query; query = DBAdapter::getInstance().getQuery("select * from users.v_company where status = 0 order by company_name"); query->exec(); while (query->next()) { ui->boxCompany->addItem(query->value("company_name").toString(), query->value("id").toString()); } delete query; }
void ClsQSAList::slotSaveAs() { // cout << "ClsQSAList::slotSaveAs()" << endl; QString qstrFilename = QFileDialog::getSaveFileName( "", "*", this, "save file dialog" "Choose a filename to save under" ); if(qstrFilename.length()<=0){ return; } if ( QFile::exists(qstrFilename) ) { /* warning on overwrite */ int iReturn; iReturn = QMessageBox::warning( this, "IQR", "A file with the seleteced name exists\n", "Overwrite", "Cancel", 0, 0, 1 ); if(iReturn == 1){ return; } } strFilename = qstrFilename.latin1(); // cout << "strFilename: " << strFilename << endl; slotSave(); }
Scribble::Scribble( QWidget *parent, const char *name ) : QMainWindow( parent, name ) { canvas = new Canvas( this ); setCentralWidget( canvas ); QToolBar *tools = new QToolBar( this ); bSave = new QToolButton( QPixmap(), "Save", "Save as PNG image", this, SLOT( slotSave() ), tools ); bSave->setText( "Save as..." ); tools->addSeparator(); bPColor = new QToolButton( QPixmap(), "Choose Pen Color", "Choose Pen Color", this, SLOT( slotColor() ), tools ); bPColor->setText( "Choose Pen Color..." ); tools->addSeparator(); bPWidth = new QSpinBox( 1, 20, 1, tools ); QToolTip::add( bPWidth, "Choose Pen Width" ); connect( bPWidth, SIGNAL( valueChanged( int ) ), this, SLOT( slotWidth( int ) ) ); bPWidth->setValue( 3 ); tools->addSeparator(); bClear = new QToolButton( QPixmap(), "Clear Screen", "Clear Screen", this, SLOT( slotClear() ), tools ); bClear->setText( "Clear Screen" ); }
void ATSkeletonWindow::wireSignals() { // Connect buttons ATVERIFY( connect( ui.btnAddTunnel, SIGNAL( clicked() ), this, SLOT( slotAddTunnel() ) ) ); ATVERIFY( connect( ui.btnSave, SIGNAL( clicked() ), this, SLOT( slotSave() ) ) ); ATVERIFY( connect( ui.btnEditTunnel, SIGNAL( clicked() ), this, SLOT( slotEditTunnel() ) ) ); ATVERIFY( connect( ui.btnDuplicate, SIGNAL( clicked() ), this, SLOT( slotDuplicateTunnel() ) ) ); ATVERIFY( connect( ui.btnDeleteTunnel, SIGNAL( clicked() ), this, SLOT( slotDeleteTunnel() ) ) ); ATVERIFY( connect( ui.btnConnect, SIGNAL( clicked() ), this, SLOT( slotConnect() ) ) ); ATVERIFY( connect( ui.btnDisconnect, SIGNAL( clicked() ), this, SLOT( slotDisconnect() ) ) ); ATVERIFY( connect( ui.btnBrowseSSHKeyFile, SIGNAL( clicked() ), this, SLOT( slotBrowseKeyFile() ) ) ); // Connect option related controls ATVERIFY( connect( &m_timerReadOptions, SIGNAL( timeout() ), this, SLOT( slotReadOptions() ) ) ); ATVERIFY( connect( ui.editHotkey, SIGNAL( textChanged(const QString&) ), this, SLOT( slotDelayReadOptions() ) ) ); ATVERIFY( connect( ui.comboHotkey1, SIGNAL( currentIndexChanged(int) ), this, SLOT( slotDelayReadOptions() ) ) ); ATVERIFY( connect( ui.comboHotkey2, SIGNAL( currentIndexChanged(int) ), this, SLOT( slotDelayReadOptions() ) ) ); ATVERIFY( connect( ui.checkMinimizeToTray, SIGNAL( stateChanged(int) ), this, SLOT( slotDelayReadOptions() ) ) ); ATVERIFY( connect( ui.checkConfirmOnQuit, SIGNAL( stateChanged(int) ), this, SLOT( slotDelayReadOptions() ) ) ); ATVERIFY( connect( ui.groupHotkey, SIGNAL( toggled(bool) ), this, SLOT( slotDelayReadOptions() ) ) ); // Connect tab widget ATVERIFY( connect( ui.tabWidget, SIGNAL( currentChanged(int) ), this, SLOT( slotTabChanged() ) ) ); // Connect tree ATVERIFY( connect( ui.treeTunnels, SIGNAL( itemSelectionChanged() ), this, SLOT( slotSelectTunnel() ) ) ); ATVERIFY( connect( ui.treeTunnels, SIGNAL( activated(const QModelIndex &) ), this, SLOT( slotItemActivated() ) ) ); // Connect buttons ATVERIFY( connect( this, SIGNAL( signalAutoConnect(Tunnel_c*) ), this, SLOT( slotAutoConnect(Tunnel_c*) ), Qt::QueuedConnection ) ); }
Preferences::Preferences(QWidget *w) : Q3TabDialog(w, "Preferences", FALSE, Qt::WDestructiveClose) { helpFile = "preferences.html"; setCaption(tr("Edit Prefs")); loadSettings(); createGeneralPage(); createColorPage(); createFontPage(); createMTPage(); // main tool bar createCTPage(); // chart tool bar createETPage(); // extra tool bar setApplyButton(tr("&Apply")); connect(this, SIGNAL(applyButtonPressed()), this, SLOT(slotSave())); setCancelButton(tr("&Ok")); //connect(this, SIGNAL(cancelButtonPressed()), this, SLOT(exitDialog())); setOkButton(QString::null); setHelpButton(); QObject::connect(this, SIGNAL(helpButtonPressed()), this, SLOT(slotHelp())); resize(sz); }
CloseMessageBox::CloseMessageBox(const QString& Caption, const QString& Text, QWidget *parent, const char *name) : QDialog(parent, name) // must not be "WDestructiveClose" !!!!! { setCaption(Caption); all = new Q3VBoxLayout(this); all->setSpacing(5); QLabel *l = new QLabel(Text, this); l->setAlignment(Qt::AlignVCenter|Qt::AlignHCenter); l->setMargin(5); all->addWidget(l); Q3HBox *Butts = new Q3HBox(this); // Butts->setSpacing(5); all->addWidget(Butts); QPushButton *Save = new QPushButton(tr("Save"), Butts); connect(Save, SIGNAL(clicked()), SLOT(slotSave())); QPushButton *SaveAll = new QPushButton(tr("Save all"), Butts); connect(SaveAll, SIGNAL(clicked()), SLOT(slotSaveAll())); QPushButton *Discard = new QPushButton(tr("Discard"), Butts); connect(Discard, SIGNAL(clicked()), SLOT(slotDiscard())); QPushButton *DiscardAll = new QPushButton(tr("Discard all"), Butts); connect(DiscardAll, SIGNAL(clicked()), SLOT(slotDiscardAll())); QPushButton *Cancel = new QPushButton(tr("Cancel"), Butts); connect(Cancel, SIGNAL(clicked()), SLOT(slotCancel())); }
EquipmentWriter::EquipmentWriter() { QWidget *widget = new QWidget; ui.setupUi( widget ); ui.tabWidget->setCurrentIndex(0); setMainWidget( widget ); setCaption( i18n( "Define Equipment" ) ); setButtons( KDialog::Close ); ks = KStars::Instance(); nextScope = 0; nextEyepiece = 0; nextFilter = 0; nextLens = 0; loadEquipment(); newScope = true; newEyepiece = true; newLens = true; newFilter = true; #ifdef HAVE_INDI_H ui.driverComboBox->insertItems(1, DriverManager::Instance()->getDriversStringList()); #endif //make connections connect( this, SIGNAL( closeClicked() ), this, SLOT( slotClose() ) ); connect( ui.NewScope, SIGNAL( clicked() ), this, SLOT( slotNewScope() ) ); connect( ui.NewEyepiece, SIGNAL( clicked() ), this, SLOT( slotNewEyepiece() ) ); connect( ui.NewLens, SIGNAL( clicked() ), this, SLOT( slotNewLens() ) ); connect( ui.NewFilter, SIGNAL( clicked() ), this, SLOT( slotNewFilter() ) ); connect( ui.AddScope, SIGNAL( clicked() ), this, SLOT( slotSave() ) ); connect( ui.AddEyepiece, SIGNAL( clicked() ), this, SLOT( slotSave() ) ); connect( ui.AddLens, SIGNAL( clicked() ), this, SLOT( slotSave() ) ); connect( ui.AddFilter, SIGNAL( clicked() ), this, SLOT( slotSave() ) ); connect( ui.ScopeList, SIGNAL( currentTextChanged(const QString) ), this, SLOT( slotSetScope(QString) ) ); connect( ui.EyepieceList, SIGNAL( currentTextChanged(const QString) ), this, SLOT( slotSetEyepiece(QString) ) ); connect( ui.LensList, SIGNAL( currentTextChanged(const QString) ), this, SLOT( slotSetLens(QString) ) ); connect( ui.FilterList, SIGNAL( currentTextChanged(const QString) ), this, SLOT( slotSetFilter(QString) ) ); connect( ui.RemoveScope, SIGNAL( clicked() ), this, SLOT( slotRemoveScope() ) ); connect( ui.RemoveEyepiece, SIGNAL( clicked() ), this, SLOT( slotRemoveEyepiece() ) ); connect( ui.RemoveLens, SIGNAL( clicked() ), this, SLOT( slotRemoveLens() ) ); connect( ui.RemoveFilter, SIGNAL( clicked() ), this, SLOT( slotRemoveFilter() ) ); }
void desktopSelection::programInit(QList<QStringList> pkgList, QStringList sPkgs) { listDeskPkgs = pkgList; selectedPkgs = sPkgs; connect(pushClose, SIGNAL(clicked()), this, SLOT(slotClose())); connect(pushSave, SIGNAL(clicked()), this, SLOT(slotSave())); initDesktopPkgs(); }
void KMoneyThingMainWidget::slotSaveAs() { KURL kurl = KFileDialog::getSaveURL(0, i18n("*.kmt|KMoneyThing files (*.kmt)"), this); if (kurl.path() == "") return; mCurrentFile->setKurl(kurl); slotSave(); }
KCookieServer::~KCookieServer() { slotSave(); delete mCookieJar; delete mTimer; delete mPendingCookies; delete mConfig; }
ContextHelp::ContextHelp( KateMDI::ToolView * parent ) : QWidget(parent), Ui::ContextHelpWidget( /* parent */ ) { setupUi(this); QWhatsThis::add( this, i18n("Provides context-sensitive help relevant to the current editing being performed.") ); setAcceptDrops( true ); if (parent->layout()) { parent->layout()->addWidget(this); qDebug() << Q_FUNC_INFO << " added item selector to parent's layout " << parent; } else { qWarning() << Q_FUNC_INFO << " unexpected null layout on parent " << parent ; } QFont font; font.setBold( true ); if ( font.pointSize() != 0 ) font.setPointSize( int(font.pointSize() * 1.4) ); m_pNameLabel->setFont( font ); m_pNameLabel->setTextFormat( Qt::RichText ); m_pBrowser = new KHTMLPart( m_pWidgetStack->widget( 0 ) ); m_pBrowserView = m_pBrowser->view(); m_pBrowserView->setFocusPolicy( Qt::NoFocus ); m_pBrowserLayout->addWidget( m_pBrowserView ); connect( m_pBrowser->browserExtension(), SIGNAL(openUrlRequest( const KUrl &, const KParts::OpenUrlArguments & ) ), this, SLOT( openURL(const KUrl & /*, const KParts::OpenUrlArguments & */ ) ) ); // Adjust appearance of browser m_pBrowserView->setMarginWidth( 4 ); m_pEditor = new RichTextEditor( m_pWidgetStack->widget( 1 ), "ContextHelpEditor" ); m_pTopLayout->addWidget( m_pEditor ); m_pEditor->installEventFilter( this ); m_pEditor->editorViewport()->installEventFilter( this ); slotClear(); connect( m_pEditButton, SIGNAL(clicked()), this, SLOT(slotEdit()) ); connect( m_pSaveButton, SIGNAL(clicked()), this, SLOT(slotSave()) ); connect( m_pResetButton, SIGNAL(clicked()), this, SLOT(slotEditReset()) ); connect( m_pChangeDescriptionsDirectory, SIGNAL(clicked()), this, SLOT(requestItemDescriptionsDirectory()) ); connect( m_pLanguageSelect, SIGNAL(activated(const QString &)), this, SLOT(setCurrentLanguage( const QString& )) ); m_pResetButton->setPixmap( KIconLoader::global()->loadIcon( "button_cancel", KIconLoader::Small ) ); m_pChangeDescriptionsDirectory->setPixmap( KIconLoader::global()->loadIcon( "folder", KIconLoader::Small ) ); connect( ComponentSelector::self(), SIGNAL(itemSelected( const QString& )), this, SLOT(setBrowserItem( const QString& )) ); connect( FlowPartSelector::self(), SIGNAL(itemSelected( const QString& )), this, SLOT(setBrowserItem( const QString& )) ); #ifdef MECHANICS connect( MechanicsSelector::self(), SIGNAL(itemSelected( const QString& )), this, SLOT(setBrowserItem( const QString& )) ); #endif QTimer::singleShot( 10, this, SLOT(slotInitializeLanguageList()) ); }
bool RatingSettings::Create() { bool err = false; // Load the theme for this screen if (!LoadWindowFromXML("musicsettings-ui.xml", "ratingsettings", this)) return false; m_ratingWeight = dynamic_cast<MythUISpinBox *> (GetChild("ratingweight")); m_playCountWeight = dynamic_cast<MythUISpinBox *> (GetChild("playcountweight")); m_lastPlayWeight = dynamic_cast<MythUISpinBox *> (GetChild("lastplayweight")); m_randomWeight = dynamic_cast<MythUISpinBox *> (GetChild("randomweight")); m_saveButton = dynamic_cast<MythUIButton *> (GetChild("save")); m_cancelButton = dynamic_cast<MythUIButton *> (GetChild("cancel")); if (err) { LOG(VB_GENERAL, LOG_ERR, "Cannot load screen 'ratingsettings'"); return false; } m_ratingWeight->SetRange(0,100,1); m_ratingWeight->SetValue(gCoreContext->GetNumSetting("IntelliRatingWeight")); m_playCountWeight->SetRange(0,100,1); m_playCountWeight->SetValue(gCoreContext->GetNumSetting("IntelliPlayCountWeight")); m_lastPlayWeight->SetRange(0,100,1); m_lastPlayWeight->SetValue(gCoreContext->GetNumSetting("IntelliLastPlayWeight")); m_randomWeight->SetRange(0,100,1); m_randomWeight->SetValue(gCoreContext->GetNumSetting("IntelliRandomWeight")); m_ratingWeight->SetHelpText(tr("Used in \"Smart\" Shuffle mode. " "This weighting affects how much strength is " "given to your rating of a given track when " "ordering a group of songs.")); m_playCountWeight->SetHelpText(tr("Used in \"Smart\" Shuffle mode. " "This weighting affects how much strength is " "given to how many times a given track has been " "played when ordering a group of songs.")); m_lastPlayWeight->SetHelpText(tr("Used in \"Smart\" Shuffle mode. " "This weighting affects how much strength is " "given to how long it has been since a given " "track was played when ordering a group of songs.")); m_randomWeight->SetHelpText(tr("Used in \"Smart\" Shuffle mode. " "This weighting affects how much strength is " "given to good old (pseudo-)randomness " "when ordering a group of songs.")); m_cancelButton->SetHelpText(tr("Exit without saving settings")); m_saveButton->SetHelpText(tr("Save settings and Exit")); connect(m_saveButton, SIGNAL(Clicked()), this, SLOT(slotSave())); connect(m_cancelButton, SIGNAL(Clicked()), this, SLOT(Close())); BuildFocusList(); return true; }
void sndDialog::programInit() { // Connect our pushbuttons connect(pushTest, SIGNAL( clicked() ), this, SLOT( slotDiagnostic() ) ); connect(pushClose, SIGNAL( clicked() ), this, SLOT( slotClose() ) ); connect(pushApply, SIGNAL( clicked() ), this, SLOT( slotSave() ) ); connect(comboSound, SIGNAL( currentIndexChanged(int) ), this, SLOT( slotEnableApply() ) ); refreshDevices(); }
KCookieServer::~KCookieServer() { if(mCookieJar->changed()) slotSave(); delete mOldCookieServer; delete mCookieJar; delete mTimer; delete mPendingCookies; delete mConfig; }
Scribble::Scribble( QWidget *parent, const char *name ) : QMainWindow(parent) { setObjectName(QLatin1String(name)); canvas = new Canvas( this ); setCentralWidget( canvas ); tools = new QToolBar; addToolBar(tools); bSave = tools->addAction("Save As...", this, SLOT(slotSave())); bSave->setToolTip("Save as PNG image"); bSave->setIconText("Save"); tools->addSeparator(); bPColor = tools->addAction("Choose Pen Color...", this, SLOT(slotColor())); bPColor->setToolTip("Choose Pen Color"); bPColor->setIconText("Choose Pen Color"); tools->addSeparator(); bPWidth = new QSpinBox; bPWidth->setMinimum(1); bPWidth->setMaximum(20); bPWidth->setSingleStep(1); tools->addWidget(bPWidth); bPWidth->setToolTip("Choose Pen Width"); connect( bPWidth, SIGNAL( valueChanged( int ) ), this, SLOT( slotWidth( int ) ) ); bPWidth->setValue( 3 ); tools->addSeparator(); bClear = tools->addAction("Clear screen", this, SLOT(slotClear())); bClear->setToolTip("Clear Screen"); bClear->setIconText("Clear Screen"); project = new QSProject( this, "scribblescript_project" ); interpreter = project->interpreter(); #ifndef QSA_NO_GUI QSInputDialogFactory *factory = new QSInputDialogFactory(); interpreter->addObjectFactory( factory ); #endif project->addObject( new CanvasInterface( canvas, this, "Canvas" ) ); project->load( "scribblescript.qsa" ); connect( project, SIGNAL( projectEvaluated() ), project, SLOT( save() ) ); selector = new ScriptView( interpreter, false, this ); selector->setWindowTitle("ScribbleScripts"); addDockWidget(Qt::LeftDockWidgetArea, selector); selector->show(); }
KMapDialog::KMapDialog(QWidget *parent) : QDialog(parent) { ui.setupUi(this); m_btnOpen = ui.buttonBox->addButton(tr("Open..."), QDialogButtonBox::ActionRole); m_btnSave = ui.buttonBox->addButton(tr("Save As..."), QDialogButtonBox::ActionRole); m_btnOpen->setIcon(style()->standardIcon(QStyle::StandardPixmap(QStyle::SP_DialogOpenButton))); m_btnSave->setIcon(style()->standardIcon(QStyle::StandardPixmap(QStyle::SP_DialogSaveButton))); connect(m_btnOpen, SIGNAL(clicked()), SLOT(slotOpen())); connect(m_btnSave, SIGNAL(clicked()), SLOT(slotSave())); }
ViewDepartments::ViewDepartments(QWidget * parent): ui(new Ui::ViewDepartments) // ?? { ui->setupUi(this); setupModel(); QObject::connect(ui->action_New, SIGNAL(triggered()), this, SLOT(slotAdd())); QObject::connect(ui->action_Delete, SIGNAL(triggered()), this, SLOT(slotDelete())); QObject::connect(ui->action_Edit, SIGNAL(triggered()), this, SLOT(slotEdit())); QObject::connect(ui->action_Yes, SIGNAL(triggered()), this, SLOT(slotSave())); QObject::connect(ui->action_No, SIGNAL(triggered()), this, SLOT(slotCancel())); }
QucsEdit::QucsEdit(const QString& FileName_, bool readOnly) { // set application icon setIcon (QPixmap(QucsSettings.BitmapDir + "big.qucs.xpm")); setCaption("Qucs Editor " PACKAGE_VERSION " - " + tr("File: ")); QVBoxLayout *v = new QVBoxLayout(this); QHBox *h = new QHBox(this); v->addWidget(h); QToolButton *ButtLoad = new QToolButton(h); ButtLoad->setIconSet( QIconSet(QImage(QucsSettings.BitmapDir + "fileopen.png"))); connect(ButtLoad, SIGNAL(clicked()), SLOT(slotLoad())); QToolButton *ButtSave = new QToolButton(h); ButtSave->setIconSet( QIconSet(QImage(QucsSettings.BitmapDir + "filesave.png"))); connect(ButtSave, SIGNAL(clicked()), SLOT(slotSave())); ButtSave->setDisabled(readOnly); h->setStretchFactor(new QWidget(h),5); // stretchable placeholder PosText = new QLabel(tr("Line: %1 - Column: %2").arg(1).arg(1), h); h->setStretchFactor(new QWidget(h),5); // stretchable placeholder QPushButton *ButtAbout = new QPushButton(tr("About"),h); connect(ButtAbout, SIGNAL(clicked()), SLOT(slotAbout())); QPushButton *ButtOK = new QPushButton(tr("Quit"),h); connect(ButtOK, SIGNAL(clicked()), SLOT(slotQuit())); ButtOK->setFocus(); // try using same-sized mono-spaced font in the textarea QFont fedit = QFont("Courier New"); fedit.setPointSize(QucsSettings.font.pointSize()-1); fedit.setStyleHint(QFont::Courier); fedit.setFixedPitch(true); text = new QTextEdit(this); text->setTextFormat(Qt::PlainText); text->setReadOnly(readOnly); text->setWordWrap(QTextEdit::NoWrap); text->setMinimumSize(300,200); text->setFont(fedit); text->setCurrentFont(fedit); v->addWidget(text); connect(text, SIGNAL(cursorPositionChanged(int, int)), SLOT(slotPrintCursorPosition(int, int))); // ................................................. loadFile(FileName_); }
WidgetBoxCategoryListView *WidgetBoxTreeWidget::addCategoryView(QTreeWidgetItem *parent, bool iconMode) { QTreeWidgetItem *embed_item = new QTreeWidgetItem(parent); embed_item->setFlags(Qt::ItemIsEnabled); WidgetBoxCategoryListView *categoryView = new WidgetBoxCategoryListView(m_core, this); categoryView->setViewMode(iconMode ? QListView::IconMode : QListView::ListMode); connect(categoryView, SIGNAL(scratchPadChanged()), this, SLOT(slotSave())); connect(categoryView, SIGNAL(pressed(QString,QString,QPoint)), this, SIGNAL(pressed(QString,QString,QPoint))); connect(categoryView, SIGNAL(itemRemoved()), this, SLOT(slotScratchPadItemDeleted())); connect(categoryView, SIGNAL(lastItemRemoved()), this, SLOT(slotLastScratchPadItemDeleted())); setItemWidget(embed_item, 0, categoryView); return categoryView; }
void dialogFSSize::programInit(QString desc, int curSize, int availSize, int minSize) { connect(horizontalSizeSlider, SIGNAL(sliderMoved(int)), this, SLOT(slotSliderChangedValue(int))); connect(spinSize, SIGNAL(valueChanged(int)), this, SLOT(slotSpinBoxChanged(int))); connect(pushClose, SIGNAL(clicked()), this, SLOT(slotClose())); connect(pushSave, SIGNAL(clicked()), this, SLOT(slotSave())); horizontalSizeSlider->setMinimum(minSize); horizontalSizeSlider->setMaximum(availSize); horizontalSizeSlider->setValue(curSize); spinSize->setRange(minSize, availSize); spinSize->setValue(curSize); labelDesc->setText(desc); }
void CDiaryEdit::closeEvent(QCloseEvent * e) { if(diary.isModified()) { QMessageBox::Button res = QMessageBox::warning(this, tr("Diary modified..."), tr("The diary is modified. Do you want to save it?"), QMessageBox::Yes|QMessageBox::No,QMessageBox::Yes); if(res == QMessageBox::Yes) { slotSave(); } } QWidget::closeEvent(e); }
bool VisualizationSettings::Create() { bool err = false; // Load the theme for this screen if (!LoadWindowFromXML("musicsettings-ui.xml", "visualizationsettings", this)) return false; UIUtilE::Assign(this, m_changeOnSongChange, "cycleonsongchange", &err); UIUtilE::Assign(this, m_randomizeOrder, "randomizeorder", &err); UIUtilE::Assign(this, m_scaleWidth, "scalewidth", &err); UIUtilE::Assign(this, m_scaleHeight, "scaleheight", &err); UIUtilE::Assign(this, m_saveButton, "save", &err); UIUtilE::Assign(this, m_cancelButton, "cancel", &err); int changeOnSongChange = gCoreContext->GetNumSetting("VisualCycleOnSongChange", 0); if (changeOnSongChange == 1) m_changeOnSongChange->SetCheckState(MythUIStateType::Full); int randomizeorder = gCoreContext->GetNumSetting("VisualRandomize", 0); if (randomizeorder == 1) m_randomizeOrder->SetCheckState(MythUIStateType::Full); m_scaleWidth->SetRange(1,2,1); m_scaleWidth->SetValue(gCoreContext->GetNumSetting("VisualScaleWidth")); m_scaleHeight->SetRange(1,2,1); m_scaleHeight->SetValue(gCoreContext->GetNumSetting("VisualScaleHeight")); m_changeOnSongChange->SetHelpText(tr("Change the visualizer when the song changes.")); m_randomizeOrder->SetHelpText(tr("On changing the visualizer pick a new one at random.")); m_scaleWidth->SetHelpText(tr("If set to \"2\", visualizations will be " "scaled in half. Currently only used by " "the goom visualization. Reduces CPU load " "on slower machines.")); m_scaleHeight->SetHelpText(tr("If set to \"2\", visualizations will be " "scaled in half. Currently only used by " "the goom visualization. Reduces CPU load " "on slower machines.")); m_cancelButton->SetHelpText(tr("Exit without saving settings")); m_saveButton->SetHelpText(tr("Save settings and Exit")); connect(m_saveButton, SIGNAL(Clicked()), this, SLOT(slotSave())); connect(m_cancelButton, SIGNAL(Clicked()), this, SLOT(Close())); BuildFocusList(); SetFocusWidget(m_cancelButton); return true; }
// ************************************************************ bool QucsEdit::closeFile() { if(text->isModified()) { switch(QMessageBox::warning(this,tr("Closing document"), tr("The text contains unsaved changes!\n")+ tr("Do you want to save the changes?"), tr("&Save"), tr("&Discard"), tr("&Cancel"), 0, 2)) { case 0: slotSave(); if(FileName.isEmpty()) return false; return true; case 2: return false; } } return true; }
int ParaRW::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QDialog::qt_metacall(_c, _id, _a); if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { switch (_id) { case 0: slotSave(); break; case 1: slotGet(); break; default: ; } _id -= 2; } return _id; }
TreeRegions::TreeRegions(QWidget * parent): ui(new Ui::TreeRegions) // ?? { ui->setupUi(this); setupModel(); QObject::connect(ui->action_New, SIGNAL(triggered()), this, SLOT(slotAdd())); QObject::connect(ui->action_NewRoot, SIGNAL(triggered()), this, SLOT(slotAddRoot())); QObject::connect(ui->action_Delete, SIGNAL(triggered()), this, SLOT(slotDelete())); QObject::connect(ui->action_Edit, SIGNAL(triggered()), this, SLOT(slotEdit())); QObject::connect(ui->action_Yes, SIGNAL(triggered()), this, SLOT(slotSave())); QObject::connect(ui->action_No, SIGNAL(triggered()), this, SLOT(slotCancel())); QObject::connect(ui->treeView->selectionModel(), SIGNAL(selectionChanged(const QItemSelection &, const QItemSelection &)), this, SLOT(slotEnableButtons(const QItemSelection &, const QItemSelection &))); QObject::connect(this, SIGNAL(signalChangeEditMode()), this, SLOT(slotEnableButtons())); slotEnableButtons(QItemSelection(), QItemSelection()); }
void QG_ExitDialog::clicked(QAbstractButton * button){ QDialogButtonBox::StandardButton bt = buttonBox->standardButton ( button ); switch (bt){ case QDialogButtonBox::Close: emit accept(); break; case QDialogButtonBox::Save: slotSave(); break; case QDialogButtonBox::SaveAll: slotSaveAs(); break; default: emit reject(); }; }