int Elina_Labels::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: onTypeChar(); break; case 1: rowClicked((*reinterpret_cast< const QModelIndex(*)>(_a[1]))); break; case 2: next1Clicked(); break; case 3: insertClicked(); break; case 4: removeClicked(); break; case 5: rewrapClicked(); break; case 6: rowClickedSel((*reinterpret_cast< const QModelIndex(*)>(_a[1]))); break; case 7: Scanned(); break; case 8: setSpinBoxFormat(); break; case 9: clearLineEdit(); break; case 10: copy_machine(); break; case 11: copy_middledate(); break; case 12: upClicked(); break; case 13: downClicked(); break; case 14: checkClicked(); break; case 15: startread(); break; case 16: weight_check(); break; case 17: rowClickedSelProd((*reinterpret_cast< const QModelIndex(*)>(_a[1]))); break; case 18: timer1_v(); break; case 19: timer2_v(); break; case 20: dummycheckpressed(); break; default: ; } _id -= 21; } return _id; }
QMplayer::QMplayer(QWidget *parent, Qt::WFlags f) : QWidget(parent) { #ifdef QTOPIA this->setWindowState(Qt::WindowMaximized); #else Q_UNUSED(f); #endif lw = new QListWidget(this); int h = lw->fontMetrics().height(); lw->setIconSize(QSize(h, h)); scanItem = new QListWidgetItem(tr("Scan"), lw); scanItem->setSelected(true); settingsItem = new QListWidgetItem(tr("Sharing"), lw); bOk = new QPushButton(this); connect(bOk, SIGNAL(clicked()), this, SLOT(okClicked())); bBack = new QPushButton(this); connect(bBack, SIGNAL(clicked()), this, SLOT(backClicked())); bUp = new QPushButton(this); connect(bUp, SIGNAL(clicked()), this, SLOT(upClicked())); bDown = new QPushButton(this); connect(bDown, SIGNAL(clicked()), this, SLOT(downClicked())); label = new QLabel(this); lineEdit = new QLineEdit(this); progress = new QProgressBar(this); buttonLayout = new QHBoxLayout(); buttonLayout->setAlignment(Qt::AlignBottom); buttonLayout->addWidget(bOk); buttonLayout->addWidget(bBack); buttonLayout->addWidget(bUp); buttonLayout->addWidget(bDown); layout = new QVBoxLayout(this); layout->addWidget(lw); layout->addWidget(label); layout->addWidget(lineEdit); layout->addWidget(progress); layout->addLayout(buttonLayout); maxScanLevel = 0; fbset = false; delTmpFiles = -1; process = NULL; tcpServer = NULL; showScreen(QMplayer::ScreenInit); }
ListLayoutRow::ListLayoutRow(QWidget *widget, QWidget *parent, const bool &moveEnabled) : QFrame(parent) { m_widget = widget; m_upButton = m_downButton = 0; setMidLineWidth(0); setLineWidth(1); setFrameStyle(QFrame::Box); setFrameShadow(QFrame::Sunken); setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); QToolButton *removeButton = new QToolButton(this); removeButton->setIcon(KIcon("list-remove")); removeButton->setText(i18n("Remove")); removeButton->setToolTip(i18n("Remove")); connect(removeButton, SIGNAL(clicked()), this, SLOT(removeClicked())); KSeparator *separator = new KSeparator(Qt::Vertical); QHBoxLayout *layout = new QHBoxLayout; if (moveEnabled) { QToolButton *upButton = new QToolButton(this); upButton->setIcon(KIcon("go-up")); upButton->setText(i18n("Move up")); upButton->setToolTip(i18n("Move up")); QToolButton *downButton = new QToolButton(this); downButton->setIcon(KIcon("go-down")); downButton->setText(i18n("Move down")); downButton->setToolTip(i18n("Move down")); connect(upButton, SIGNAL(clicked()), this, SLOT(upClicked())); connect(downButton, SIGNAL(clicked()), this, SLOT(downClicked())); layout->addWidget(upButton); layout->addWidget(downButton); m_upButton = upButton; m_downButton = downButton; } layout->addWidget(removeButton); layout->addWidget(separator); layout->addWidget(m_widget); setLayout(layout); }
bool MainWidget::qt_invoke( int _id, QUObject* _o ) { switch ( _id - staticMetaObject()->slotOffset() ) { case 0: upClicked(); break; case 1: downClicked(); break; case 2: leftClicked(); break; case 3: rightClicked(); break; case 4: menuClicked(); break; case 5: radioClicked(); break; case 6: mp3Clicked(); break; case 7: gpsClicked(); break; case 8: obdiiClicked(); break; case 9: photoClicked(); break; case 10: linuxClicked(); break; default: return QWidget::qt_invoke( _id, _o ); } return TRUE; }
bool WizardEditor::qt_invoke( int _id, QUObject* _o ) { switch ( _id - staticMetaObject()->slotOffset() ) { case 0: okClicked(); break; case 1: applyClicked(); break; case 2: cancelClicked(); break; case 3: helpClicked(); break; case 4: addClicked(); break; case 5: removeClicked(); break; case 6: upClicked(); break; case 7: downClicked(); break; case 8: itemHighlighted((int)static_QUType_int.get(_o+1)); break; case 9: itemSelected((int)static_QUType_int.get(_o+1)); break; case 10: itemDragged((QListBoxItem*)static_QUType_ptr.get(_o+1)); break; case 11: itemDropped((QListBoxItem*)static_QUType_ptr.get(_o+1)); break; default: return WizardEditorBase::qt_invoke( _id, _o ); } return TRUE; }
bool WizardEditorBase::qt_invoke( int _id, QUObject* _o ) { switch ( _id - staticMetaObject()->slotOffset() ) { case 0: languageChange(); break; case 1: init(); break; case 2: destroy(); break; case 3: addClicked(); break; case 4: applyClicked(); break; case 5: cancelClicked(); break; case 6: downClicked(); break; case 7: helpClicked(); break; case 8: itemHighlighted((int)static_QUType_int.get(_o+1)); break; case 9: itemSelected((int)static_QUType_int.get(_o+1)); break; case 10: okClicked(); break; case 11: removeClicked(); break; case 12: upClicked(); break; default: return QDialog::qt_invoke( _id, _o ); } return TRUE; }
AlbumManager::AlbumManager(QWidget* parent) : AbstractDialog(parent) { setObjectName("AlbumManager"); setupUi(this); setWindowFlags(this->windowFlags() & ~Qt::WindowContextHelpButtonHint); up->setIcon(*icons[int(Icons::arrowUp_ICON)]); down->setIcon(*icons[int(Icons::arrowDown_ICON)]); album = 0; connect(add, SIGNAL(clicked()), SLOT(addClicked())); connect(addNew, SIGNAL(clicked()), SLOT(addNewClicked())); connect(up, SIGNAL(clicked()), SLOT(upClicked())); connect(down, SIGNAL(clicked()), SLOT(downClicked())); connect(remove, SIGNAL(clicked()), SLOT(removeClicked())); connect(scoreList, SIGNAL(currentRowChanged(int)), SLOT(currentScoreChanged(int))); connect(scoreList, SIGNAL(itemChanged(QListWidgetItem*)), SLOT(itemChanged(QListWidgetItem*))); connect(buttonBox, SIGNAL(clicked(QAbstractButton*)), SLOT(buttonBoxClicked(QAbstractButton*))); currentScoreChanged(-1); add->setEnabled(false); MuseScore::restoreGeometry(this); //createNewClicked(); }
VisualizationsEditor::VisualizationsEditor(const QString ¤tSelection, MythMainWindow *parent, const char *name) : MythDialog(parent, name) { Q3VBoxLayout *vbox = new Q3VBoxLayout(this, (int)(20 * wmult)); Q3HBoxLayout *hbox = new Q3HBoxLayout(vbox, (int)(10 * wmult)); // Window title QString message = tr("Visualizations"); QLabel *label = new QLabel(message, this); label->setBackgroundOrigin(WindowOrigin); QFont font = label->font(); font.setPointSize(int (font.pointSize() * 1.5)); font.setBold(true); label->setFont(font); label->setPaletteForegroundColor(QColor("yellow")); label->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed)); hbox->addWidget(label); hbox = new Q3HBoxLayout(vbox, (int)(10 * wmult)); label = new QLabel(tr("Selected Visualizations"), this); label->setBackgroundOrigin(WindowOrigin); label->setAlignment(Qt::AlignLeft | Qt::AlignBottom); hbox->addWidget(label); label = new QLabel(tr("Available Visualizations"), this); label->setBackgroundOrigin(WindowOrigin); label->setAlignment(Qt::AlignLeft | Qt::AlignBottom); hbox->addWidget(label); // selected listview hbox = new Q3HBoxLayout(vbox, (int)(10 * wmult)); selectedList = new Q3MythListView(this); selectedList->addColumn(tr("Name")); selectedList->addColumn(tr("Provider")); selectedList->setSorting(-1); // disable sorting selectedList->setSelectionMode(Q3ListView::Single); connect(selectedList, SIGNAL(currentChanged(Q3ListViewItem *)), this, SLOT(selectedChanged(Q3ListViewItem *))); connect(selectedList, SIGNAL(spacePressed(Q3ListViewItem *)), this, SLOT(selectedOnSelect(Q3ListViewItem *))); connect(selectedList, SIGNAL(returnPressed(Q3ListViewItem *)), this, SLOT(selectedOnSelect(Q3ListViewItem *))); selectedList->installEventFilter(this); hbox->addWidget(selectedList); // available listview availableList = new Q3MythListView(this); availableList->addColumn(tr("Name")); availableList->addColumn(tr("Provider")); availableList->setSorting(0); connect(availableList, SIGNAL(currentChanged(Q3ListViewItem *)), this, SLOT(availableChanged(Q3ListViewItem *))); connect(availableList, SIGNAL(spacePressed(Q3ListViewItem *)), this, SLOT(availableOnSelect(Q3ListViewItem *))); connect(availableList, SIGNAL(returnPressed(Q3ListViewItem *)), this, SLOT(availableOnSelect(Q3ListViewItem *))); availableList->installEventFilter(this); hbox->addWidget(availableList); hbox = new Q3HBoxLayout(vbox, (int)(10 * wmult)); MythPushButton *button = new MythPushButton( this, "Program" ); button->setBackgroundOrigin(WindowOrigin); button->setText( tr( "Move Up" ) ); button->setEnabled(true); connect(button, SIGNAL(clicked()), this, SLOT(upClicked())); hbox->addWidget(button); button = new MythPushButton( this, "Program" ); button->setBackgroundOrigin(WindowOrigin); button->setText( tr( "Move Down" ) ); button->setEnabled(true); connect(button, SIGNAL(clicked()), this, SLOT(downClicked())); hbox->addWidget(button); // fake labels used as spacers label = new QLabel(" ", this); label->setBackgroundOrigin(WindowOrigin); hbox->addWidget(label); label = new QLabel(" ", this); label->setBackgroundOrigin(WindowOrigin); hbox->addWidget(label); //OK Button hbox = new Q3HBoxLayout(vbox, (int)(10 * wmult)); button = new MythPushButton( this, "Program" ); button->setBackgroundOrigin(WindowOrigin); button->setText( tr( "OK" ) ); button->setEnabled(true); hbox->addWidget(button); connect(button, SIGNAL(clicked()), this, SLOT(okClicked())); //Cancel Button button = new MythPushButton( this, "Program" ); button->setBackgroundOrigin(WindowOrigin); button->setText( tr( "Cancel" ) ); button->setEnabled(true); hbox->addWidget(button); connect(button, SIGNAL(clicked()), this, SLOT(cancelClicked())); availableList->setFocus(); fillWidgets(currentSelection); }
QMplayer::QMplayer(QWidget *parent, Qt::WFlags f) : QWidget(parent) { #ifdef QTOPIA this->setWindowState(Qt::WindowMaximized); softm = QSoftMenuBar::menuFor(this); rmMpAction = softm->addAction(tr("Remove mplayer"), this, SLOT(removeMplayer())); rmDlAction = softm->addAction(tr("Remove youtube-dl"), this, SLOT(removeYoutubeDl())); rmFlvAction = softm->addAction(tr("Remove FLV videos"), this, SLOT(removeFlv())); #else Q_UNUSED(f); #endif lw = new QListWidget(this); int h = lw->fontMetrics().height(); lw->setIconSize(QSize(h, h)); scanItem = new QListWidgetItem(tr("Scan"), lw); scanItem->setSelected(true); sharingItem = new QListWidgetItem(tr("Sharing"), lw); encodingItem = new QListWidgetItem(lw); bOk = new QPushButton(this); connect(bOk, SIGNAL(clicked()), this, SLOT(okClicked())); bBack = new QPushButton(this); connect(bBack, SIGNAL(clicked()), this, SLOT(backClicked())); bUp = new QPushButton(this); connect(bUp, SIGNAL(clicked()), this, SLOT(upClicked())); bDown = new QPushButton(this); connect(bDown, SIGNAL(clicked()), this, SLOT(downClicked())); label = new QLabel(this); lineEdit = new QLineEdit(this); progress = new QProgressBar(this); buttonLayout = new QHBoxLayout(); buttonLayout->setAlignment(Qt::AlignBottom); buttonLayout->addWidget(bOk); buttonLayout->addWidget(bBack); buttonLayout->addWidget(bUp); buttonLayout->addWidget(bDown); layout = new QVBoxLayout(this); layout->addWidget(lw); layout->addWidget(label); layout->addWidget(lineEdit); layout->addWidget(progress); layout->addLayout(buttonLayout); maxScanLevel = 0; delTmpFiles = -1; useBluetooth = -1; process = NULL; tcpServer = NULL; ubasedir = QDir::homePath(); QString basedir1 = QDir::homePath()+"/Documents"; QString basedir2 = "/media/card/Documents"; QDir dirch; if (dirch.exists(basedir1)) ubasedir = basedir1; if (dirch.exists(basedir2)) ubasedir = basedir2; tube = false; QStringList cl_args = QCoreApplication::arguments(); int ac = cl_args.count(); if (ac>1) { int tki=1; while(true) { QString a = cl_args[tki]; if (a=="--mpargs") { if (ac>tki+1) { mpargs << QString(cl_args[tki+1]).split(" "); } else { console("Not enough parameters for '--mpargs' argument"); } tki+=2; } else if (a=="--basedir") { if (ac>tki+1) { ubasedir = cl_args[tki+1]; } else { console("Not enough parameters for '--basedir' argument"); } tki+=2; } else if (a=="--youtube-dl") { tube=true; tki+=1; } else { mplist << a; tki+=1; } if (tki>=ac) break; } } mpgui = (mplist.count()==0); if (mpgui) showScreen(QMplayer::ScreenInit); else { if (tube) { while (mplist.count() > 1) mplist.removeLast(); QTimer::singleShot(0, this, SLOT(sTimerEvent())); } else { this->screen = QMplayer::ScreenInit; okClicked(); } } }
void SpatialDomainWidget::refresh() { // -------- prepare classes list -------- QStringList OriginalClassesList = openfluid::tools::toQStringList(m_Domain.getClassNames()); QStringList ClassesList; // get display order for classes from project config file QVariant TmpList = openfluid::base::ProjectManager::instance()->getConfigValue("builder.spatial.unitsclasses","order"); if (!TmpList.isValid()) { openfluid::base::ProjectManager::instance()->setConfigValue("builder.spatial.unitsclasses","order", OriginalClassesList); ClassesList = OriginalClassesList; } else { ClassesList = TmpList.toStringList(); // find classes in project config file that are not in original dataset QStringList ClassesToRemove; for (int i=0; i< ClassesList.size();i++) { if (!OriginalClassesList.contains(ClassesList[i])) ClassesToRemove.append(ClassesList[i]); } // remove them from classes to display for (int i=0; i< ClassesToRemove.size();i++) ClassesList.removeAll(ClassesToRemove[i]); // remove classes from original list if they exists in classes to display for (int i=0; i< ClassesList.size();i++) { if (OriginalClassesList.contains(ClassesList[i])) OriginalClassesList.removeAll(ClassesList[i]); } // add original dataset classes that are not already in the classes to display for (int i=0; i< OriginalClassesList.size();i++) { if (!ClassesList.contains(OriginalClassesList[i])) ClassesList.append(OriginalClassesList[i]); } openfluid::base::ProjectManager::instance()->setConfigValue("builder.spatial.unitsclasses","order",ClassesList); } // -------- display classes widgets --------- // remove classes from display that does not exist anymore QVBoxLayout* Layout = dynamic_cast<QVBoxLayout*>(ui->UnitsClassAreaContents->layout()); // search for classes to remove from layout QList<int> ItemsToRemove; for (int j=0;j<Layout->count();j++) { if (Layout->itemAt(j)->widget() != NULL) { UnitsClassWidget* ClassW = dynamic_cast<UnitsClassWidget*>(Layout->itemAt(j)->widget()); if (!ClassesList.contains(ClassW->getClassName())) { if (ClassW->getClassName() == m_ActiveClass) m_ActiveClass = ""; ItemsToRemove.append(j); } } } // effectively remove classes from layout QListIterator<int> itTR(ItemsToRemove); itTR.toBack(); while (itTR.hasPrevious()) Layout->takeAt(itTR.previous())->widget()->deleteLater(); // Add of new classes to layout for (int i = 0; i<ClassesList.size(); i++) { bool AlreadyExist = false; // searching for already existing unit class in class list for (int j=0;j<Layout->count();j++) { if (j!=Layout->count()-1) { UnitsClassWidget* ClassW = dynamic_cast<UnitsClassWidget*>(Layout->itemAt(j)->widget()); if (ClassW->getClassName() == ClassesList[i]) AlreadyExist = true; } } // Add if it does not already exist if (!AlreadyExist) { UnitsClassWidget* ClassW = new UnitsClassWidget(ClassesList[i], m_Datastore.getItems(ClassesList[i].toStdString(), openfluid::core::UnstructuredValue::GeoVectorValue), ui->UnitsClassAreaContents); dynamic_cast<QVBoxLayout*>(ui->UnitsClassAreaContents->layout())->insertWidget(Layout->count()-1,ClassW); connect(ClassW,SIGNAL(selectionRequested(QString)),this,SLOT(setSelectedClass(QString))); connect(ClassW,SIGNAL(styleChanged(QString)),this,SLOT(refreshMap())); connect(ClassW,SIGNAL(upClicked(QString)),this,SLOT(moveUnitsClassUp(QString))); connect(ClassW,SIGNAL(downClicked(QString)),this,SLOT(moveUnitsClassDown(QString))); connect(ClassW,SIGNAL(removeClicked(QString)),this,SLOT(removeUnitsClass(QString))); } } if (m_ActiveClass.isEmpty()) { // active class is not defined, pick the first units class if any if (Layout->count()>1) setSelectedClass(dynamic_cast<UnitsClassWidget*>(Layout->itemAt(0)->widget())->getClassName()); else setActiveClass(""); } else { setSelectedClass(m_ActiveClass); } refreshMap(); }
void UnitsClassWidget::notifyDownClicked() { emit downClicked(m_ClassName); }
//#include "memory.h" CalWidget::CalWidget(QWidget *parent):QWidget(parent) { floatNumber=6; //isRound=false; formatState=FORMAT_MIXED; EqualState=true; display=new QLineEdit("0"); //display->setMaxLength(15); Button* BspaceButton=CreatButton(tr("退格"),SLOT(BspaceClicked())); Button* ClearButton=CreatButton(tr("清除"),SLOT(ClearClicked())); Button* CAllButton=CreatButton(tr("清除全部"),SLOT(CAllClicked())); Button* AddButton=CreatButton(tr("+"),SLOT(OrdinaryClicked())); Button* SubButton=CreatButton(tr("-"),SLOT(OrdinaryClicked())); Button* MulButton=CreatButton(tr("*"),SLOT(OrdinaryClicked())); Button* DivButton=CreatButton(tr("/"),SLOT(OrdinaryClicked())); Button* PowButton=CreatButton(tr("^"),SLOT(OrdinaryClicked())); Button* SqrtButton=CreatButton(tr("sqrt"),SLOT(FunctionClicked())); Button* LnButton=CreatButton(tr("ln"),SLOT(FunctionClicked())); Button* EqualButton=CreatButton(tr("="),SLOT(EqualClicked())); Button* PaiButton=CreatButton(tr("Pai"),SLOT(PaiClicked())); Button* PointButton=CreatButton(tr("."),SLOT(PointClicked())); //Button* LBBracketButton=CreatButton(tr("{"),SLOT(OrdinaryClicked())); //Button* RBBracketButton=CreatButton(tr("}"),SLOT(OrdinaryClicked())); Button* UpButton=CreatButton("↑",SLOT(upClicked())); Button* DownButton=CreatButton("↓",SLOT(downClicked())); Button* LBracketButton=CreatButton(tr("("),SLOT(OrdinaryClicked())); Button* RBracketButton=CreatButton(tr(")"),SLOT(OrdinaryClicked())); Button* ModButton=CreatButton(tr("%"),SLOT(OrdinaryClicked())); for(int i=0;i<10;++i) { DigitButton[i]=CreatButton(QString::number(i),SLOT(OrdinaryClicked())); } layout=new QGridLayout; layout->setSizeConstraint(QLayout::SetFixedSize); layout->addWidget(display,0,0,1,6); layout->addWidget(BspaceButton,1,0,1,2); layout->addWidget(ClearButton, 1, 2, 1, 2); layout->addWidget(CAllButton, 1, 5, 1, 1); for(int i=1;i<10;++i) { int r=4-(i-1)/3; int c=(i-1)%3; layout->addWidget(DigitButton[i],r,c); } layout->addWidget(AddButton,5,3); layout->addWidget(SubButton,4,3); layout->addWidget(MulButton,3,3); layout->addWidget(DivButton,2,3); layout->addWidget(SqrtButton,2,5); layout->addWidget(LnButton,3,5); layout->addWidget(PowButton,4,5); layout->addWidget(PaiButton,5,5); layout->addWidget(DigitButton[0],5,0); layout->addWidget(EqualButton,5,2); layout->addWidget(PointButton,5,1); //layout->addWidget(LBBracketButton,1,4); //layout->addWidget(RBBracketButton,2,4); layout->addWidget(UpButton,1,4); layout->addWidget(DownButton,2,4); layout->addWidget(LBracketButton,3,4); layout->addWidget(RBracketButton,4,4); layout->addWidget(ModButton,5,4); }
/** * Constructor. Connects the buttons the the right slots. * @param parent the parent widget * @param name the name of this widget */ PluginPriorityImp::PluginPriorityImp(QWidget *parent, const char *name) : PluginPriority( parent,name ){ connect(buttonMoveUp, SIGNAL(clicked()), this, SLOT(upClicked())); connect(buttonMoveDown, SIGNAL(clicked()), this, SLOT(downClicked())); connect(buttonOk, SIGNAL(clicked()), this, SLOT(okClicked())); }