QWidget* ODocumentFileView::widget( QWidget* parent ) { if (!m_selector ) { m_selector = new FileSelector(currentMimeType().join(";"), parent, "fileselector", showNew(), showClose() ); QObject::connect(m_selector, SIGNAL(fileSelected(const DocLnk&) ), selector(), SLOT(slotDocLnkBridge(const DocLnk&) ) ); QObject::connect(m_selector, SIGNAL(closeMe() ), selector(), SIGNAL(closeMe() ) ); QObject::connect(m_selector, SIGNAL(newSelected(const DocLnk&) ), selector(), SIGNAL(newSelected(const DocLnk&) ) ); } return m_selector; }
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) { setWindowTitle(tr("Epdf")); setWindowIcon(QIcon(tr(":/qpdf_icon"))); m_busy = false; m_pages = 0; m_zoom = 72; m_currentpage = 0; m_fullscreen = false; m_renderok = false; m_doc = NULL; createToolBars(); m_filesel = new FileSelector(); connect(m_filesel, SIGNAL(closeMe()), this, SLOT(closeFileSelector())); connect(m_filesel, SIGNAL(fileSelected(const QString &)), this, SLOT(openFile(const QString &))); m_outdev = new MyOutputDev(); connect(m_outdev, SIGNAL(selectionChanged(const QRect&)), this, SLOT(copyToClipboard(const QRect&))); m_stack = new QStackedWidget(); m_stack->addWidget(m_outdev); m_stack->addWidget(m_filesel); setCentralWidget(m_stack); openFile(); }
void DatePickerYearSelector::yearEnteredSlot() { bool ok; int newYear; // check if entered value is a number newYear = text().toInt(&ok); if (!ok) { QApplication::beep(); return; } // check if new year will lead to a valid date if (QDate(newYear, oldDate.month(), oldDate.day()).isValid()) { result = newYear; emit(closeMe(1)); } else { QApplication::beep(); } }
Pojisteniclanek::Pojisteniclanek(const QString &str, QWidget *parent) : QMainWindow(parent), ui(new Ui::Pojisteniclanek) { ui->setupUi(this); QPalette* palette = new QPalette(); palette->setBrush(QPalette::Background,*(new QBrush(*(new QPixmap(":/images/per_tex.png"))))); setPalette(*palette); QNetworkProxyFactory::setUseSystemConfiguration (true); //QWebSettings::globalSettings()->setAttribute(QWebSettings::PluginsEnabled, true); QWebSettings::globalSettings()->setAttribute(QWebSettings::AutoLoadImages, true); ui->webView->load(QUrl(str)); QPixmap pixmap(":/images/arrow_green.png"); QIcon ButtonIcon(pixmap); ui->pushButton->setIcon(ButtonIcon); QRect *r = new QRect(); r->setWidth(200); r->setHeight(30); ui->pushButton->setFocusPolicy(Qt::NoFocus); ui->pushButton->setMaximumHeight(30); ui->pushButton->setMaximumWidth(200); ui->pushButton->setFlat(true); ui->pushButton->setIconSize(r->size()); ui->pushButton->setText(""); connect(ui->pushButton, SIGNAL(clicked()), this, SLOT(closeMe())); }
void KDateInternalMonthPicker::contentsMouseReleaseEvent(QMouseEvent *e) { if(!isEnabled()) { return; } // ----- int row, col, pos; QPoint mouseCoord; // ----- mouseCoord = e->pos(); row=rowAt(mouseCoord.y()); col=columnAt(mouseCoord.x()); if(row<0 || col<0) { // the user clicked on the frame of the table emit(closeMe(0)); } pos=3*row+col+1; result=pos; emit(closeMe(1)); }
void KDatePickerPrivateWeekSelector::weekEnteredSlot() { bool ok; int newWeek; // check if entered value is a number newWeek = text().toInt(&ok); if (!ok) { KNotification::beep(); return; } result = newWeek; emit(closeMe(1)); }
void KDatePickerPrivateYearSelector::yearEnteredSlot() { bool ok; int newYear; QDate newDate; // check if entered value is a number newYear = text().toInt(&ok); if (!ok) { KNotification::beep(); return; } // check if new year will lead to a valid date if (calendar->setDate(newDate, newYear, calendar->month(oldDate), calendar->day(oldDate))) { result = newYear; emit(closeMe(1)); } else { KNotification::beep(); } }
NotifierWindowTab::NotifierWindowTab(KviWindow * pWnd, QTabWidget * pParent) : QScrollArea(pParent) { m_pWnd = pWnd; if(m_pWnd) { m_szLabel = m_pWnd->windowName(); connect(pWnd, SIGNAL(windowNameChanged()), this, SLOT(labelChanged())); connect(pWnd, SIGNAL(destroyed()), this, SLOT(closeMe())); } else { m_szLabel = "----"; } if(pParent) { m_pParent = pParent; m_pParent->addTab(this, m_szLabel); } setFocusPolicy(Qt::NoFocus); setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded); if(verticalScrollBar()) connect(verticalScrollBar(), SIGNAL(rangeChanged(int, int)), this, SLOT(scrollRangeChanged(int, int))); QPalette pal = palette(); pal.setColor(backgroundRole(), Qt::transparent); setPalette(pal); m_pVWidget = new QWidget(viewport()); m_pVBox = new QVBoxLayout(m_pVWidget); m_pVBox->setSizeConstraint(QLayout::SetFixedSize); m_pVBox->setSpacing(SPACING); m_pVBox->setMargin(SPACING); setWidget(m_pVWidget); }
void KDateInternalYearSelector::yearEnteredSlot() { bool ok; int year; QDate date; // ----- check if this is a valid year: year=text().toInt(&ok); if(!ok) { KNotifyClient::beep(); return; } date.setYMD(year, 1, 1); if(!date.isValid()) { KNotifyClient::beep(); return; } result=year; emit(closeMe(1)); }
HelpAppliance::HelpAppliance(QObject *parent) : QObject(parent) , m_helpScene(new HelpScene) , m_dummyWidget(new QWidget) { // create the gui components over a dummy widget ui.setupUi(m_dummyWidget); ui.tutorialButton->setVisible(App::onlineServices->checkForTutorial()); connect(App::onlineServices, SIGNAL(tutorialFound(bool)), ui.tutorialButton, SLOT(setVisible(bool))); connect(ui.webButton, SIGNAL(clicked()), App::onlineServices, SLOT(openWebpage())); connect(ui.blogButton, SIGNAL(clicked()), App::onlineServices, SLOT(openBlog())); connect(ui.tutorialButton, SIGNAL(clicked()), App::onlineServices, SLOT(openTutorial())); connect(ui.updateButton, SIGNAL(clicked()), App::onlineServices, SLOT(checkForUpdates())); // listen to scene events connect(m_helpScene->helpItem, SIGNAL(closeMe()), this, SLOT(slotClose())); // customize appliance sceneSet(m_helpScene); topbarAddWidget(ui.helpBox); setFocusToScene(); }
void GlyphSliderGroup::addSlicesMap(int x, int y, int z, int alpha, int value) { QVBoxLayout* tempOutLayout = new QVBoxLayout(); QHBoxLayout* tempLayout = new QHBoxLayout(); QPushButton* button = new QPushButton("Remove"); QPushButton* buttonx = new QPushButton("X"); QPushButton* buttony = new QPushButton("Y"); QPushButton* buttonz = new QPushButton("Z"); QPushButton* buttonv = new QPushButton("V"); QPushButton* buttont = new QPushButton("Toggle"); button -> setCheckable(1); buttonx -> setCheckable(1); buttony -> setCheckable(1); buttonz -> setCheckable(1); buttonv -> setCheckable(1); buttont -> setCheckable(1); buttonz -> setChecked(1); MapNode* current; QSlider* slider = new QSlider(); current = cmaplist -> addMap(x, y, z, alpha, value); current -> setButtons(buttonx, buttony, buttonz, buttonv); slider -> setMaximum(256); slider -> setMinimum(1); slider -> setOrientation(Qt::Horizontal); connect(slider, SIGNAL(valueChanged(int)), current, SLOT(uValue(int))); connect(slider, SIGNAL(sliderPressed()), current, SLOT(setActive())); connect(button, SIGNAL(clicked()), button, SLOT(close())); connect(button, SIGNAL(clicked()), buttonx, SLOT(close())); connect(button, SIGNAL(clicked()), buttony, SLOT(close())); connect(button, SIGNAL(clicked()), buttonz, SLOT(close())); connect(button, SIGNAL(clicked()), buttonv, SLOT(close())); connect(button, SIGNAL(clicked()), buttont, SLOT(close())); connect(button, SIGNAL(clicked()), slider, SLOT(close())); connect(button, SIGNAL(clicked()), current, SLOT(selfDestruct())); connect(buttonx, SIGNAL(clicked()), current, SLOT(setX())); connect(buttony, SIGNAL(clicked()), current, SLOT(setY())); connect(buttonz, SIGNAL(clicked()), current, SLOT(setZ())); connect(buttonv, SIGNAL(clicked()), current, SLOT(setV())); connect(buttont, SIGNAL(clicked()), current, SLOT(setToggle())); connect(current, SIGNAL(closeMe()), button, SLOT(close())); connect(current, SIGNAL(closeMe()), buttonx, SLOT(close())); connect(current, SIGNAL(closeMe()), buttony, SLOT(close())); connect(current, SIGNAL(closeMe()), buttonz, SLOT(close())); connect(current, SIGNAL(closeMe()), buttonv, SLOT(close())); connect(current, SIGNAL(closeMe()), buttont, SLOT(close())); connect(current, SIGNAL(closeMe()), slider, SLOT(close())); //tempLayout->addWidget(slider); tempOutLayout->addWidget(slider); tempLayout->addWidget(buttonx); tempLayout->addWidget(buttony); tempLayout->addWidget(buttonz); tempLayout->addWidget(buttonv); tempLayout->addWidget(buttont); tempLayout->addWidget(button); tempOutLayout->addLayout(tempLayout); layout->addLayout(tempOutLayout); return; }
void HelpItem::mousePressEvent(QGraphicsSceneMouseEvent * /*event*/) { emit closeMe(); }
void PlotWidget::on_closeButton_clicked() { emit closeMe(this->plotName); }
OFileViewFileListView::OFileViewFileListView( QWidget* parent, const QString& startDir, OFileSelector* sel) : QWidget( parent ), m_sel( sel ) { m_all = false; QVBoxLayout* lay = new QVBoxLayout( this ); m_currentDir = startDir; /* * now we add a special bar * One Button For Up * Home * Doc * And a dropdown menu with FileSystems * FUTURE: one to change dir with lineedit * Bookmarks * Create Dir */ QHBox* box = new QHBox(this ); box->setBackgroundMode( PaletteButton ); box->setSpacing( 0 ); QToolButton *btn = new QToolButton( box ); btn->setIconSet( Resource::loadIconSet("up") ); connect(btn, SIGNAL(clicked() ), this, SLOT( cdUP() ) ); btn = new QToolButton( box ); btn->setIconSet( Resource::loadIconSet("home") ); connect(btn, SIGNAL(clicked() ), this, SLOT( cdHome() ) ); btn = new QToolButton( box ); btn->setIconSet( Resource::loadIconSet("DocsIcon") ); connect(btn, SIGNAL(clicked() ), this, SLOT(cdDoc() ) ); m_btnNew = new QToolButton( box ); m_btnNew->setIconSet( Resource::loadIconSet("new") ); connect(m_btnNew, SIGNAL(clicked() ), this, SLOT(slotNew() ) ); m_btnClose = new QToolButton( box ); m_btnClose->setIconSet( Resource::loadIconSet("close") ); connect(m_btnClose, SIGNAL(clicked() ), selector(), SIGNAL(closeMe() ) ); btn = new QToolButton( box ); btn->setIconSet( Resource::loadIconSet("pcmcia") ); /* let's fill device parts */ QPopupMenu* pop = new QPopupMenu(this); connect(pop, SIGNAL( activated(int) ), this, SLOT(slotFSActivated(int) ) ); StorageInfo storage; const QList<FileSystem> &fs = storage.fileSystems(); QListIterator<FileSystem> it(fs); for ( ; it.current(); ++it ) { const QString disk = (*it)->name(); const QString path = (*it)->path(); m_dev.insert( disk, path ); pop->insertItem( disk ); } m_fsPop = pop; btn->setPopup( pop ); lay->addWidget( box ); m_view = new QListView( this ); m_view->installEventFilter(this); QPEApplication::setStylusOperation( m_view->viewport(), QPEApplication::RightOnHold); m_view->addColumn(" " ); m_view->addColumn(tr("Name"), 135 ); m_view->addColumn(tr("Size"), -1 ); m_view->addColumn(tr("Date"), 60 ); m_view->addColumn(tr("Mime Type"), -1 ); m_view->setSorting( 1 ); m_view->setAllColumnsShowFocus( TRUE ); lay->addWidget( m_view, 1000 ); connectSlots(); }