void Settings::setLayout(const QWidget* w) { if(!w || w->objectName().isEmpty()) { return; } beginGroup("Geometry"); QList<int> values; int x = w->x(); if (w->isFullScreen()) x |= 0x40000000; else if (w->isMaximized()) x |= 0x80000000; values << x << w->y() << w->width() << w->height() << w->isVisible(); setList(w->objectName(), values); const QMainWindow* m = qobject_cast<const QMainWindow*>(w); if (m) { setValue("Docks", m->saveState(0)); } const QSplitter* s = qobject_cast<const QSplitter*>(w); if (s) { setValue("Splitter", s->saveState()); } endGroup(); }
bool TextEncoding::isJapanese() const { if (noExtendedTextEncodingNameUsed()) return false; return m_name && setList()->contains(m_name); }
int main(int argc, char *argv[]) { QApplication a(argc, argv); MyWindow window; window.showMaximized(); QThread thread; Detector *detector = new Detector(); detector->moveToThread(&thread); detector->connect(&thread,SIGNAL(started()),SLOT(work())); QThread thread2; MyBluetooth *bt = new MyBluetooth(); bt->moveToThread(&thread2); bt->connect(&thread2,SIGNAL(started()),SLOT(scanList())); bt->connect(&window,SIGNAL(updateScan()),SLOT(scanList())); bt->connect(detector,SIGNAL(detected()),SLOT(checkAlert())); //typedef std::list<Phone> listPhone; qRegisterMetaType<std::list<Phone*> >("List<Phone>"); window.connect(bt,SIGNAL(finishedScan(std::list<Phone*>)),SLOT(setList(std::list<Phone*>))); window.connect(bt,SIGNAL(finishedCheck(std::list<Phone*>)),SLOT(checkAlert(std::list<Phone*>))); thread.start(); thread2.start(); return a.exec(); }
void TextEncoding::staticFinalize() { if (!TextEncoding::m_st_iIsEmpty) { setList()->clear(); TextEncoding::m_st_iIsEmpty = 1; } releaseBaseTextCodecMaps(); delete pGlobalASCIIEncoding; pGlobalASCIIEncoding = NULL; delete pGlobalLatin1Encoding; pGlobalLatin1Encoding = NULL; delete pGlobalUTF16BigEndianEncoding; pGlobalUTF16BigEndianEncoding = NULL; delete pGlobalUTF16LittleEndianEncoding; pGlobalUTF16LittleEndianEncoding = NULL; delete pGlobalUTF32LittleEndianEncoding; pGlobalUTF32LittleEndianEncoding = NULL; delete pGlobalUTF32BigEndianEncoding; pGlobalUTF32BigEndianEncoding = NULL; delete pGlobalUTF8Encoding; pGlobalUTF8Encoding = NULL; delete pGlobalWindowsLatin1Encoding; pGlobalWindowsLatin1Encoding = NULL; }
int main(int argc, char** argv) { g_cell.next = NULL;//先頭のセルの初期化 setList(&g_cell, 0); setList(g_cell.next, 1); setList(g_cell.next, 2); setList(g_cell.next, 3); cell_t *cp = NULL; int i = 0; for (cp = g_cell.next;cp != NULL;cp = cp->next,i++){ printf("%dth cell data = %d\n",i,cp->data); } /* deleteList(&g_cell); */ allDeleteList(&g_cell); return(0); }
void eEventDisplay::init_eEventDisplay(const ePtrList<EITEvent>* e) { eventlist=0; events=0; scrollbar = new eProgress(this); scrollbar->setName("scrollbar"); scrollbar->setStart(0); scrollbar->setPerc(100); descr = new eWidget(this); descr->setName("epg_description"); eventTime = new eLabel(this); eventTime->setName("time"); eventDate = new eLabel(this); eventDate->setName("date"); channel = new eLabel(this); channel->setName("channel"); timer_icon = new eLabel(this); timer_icon->setName("timer_icon"); eSkin *skin=eSkin::getActive(); if (skin->build(this, "eventview")) eFatal("skin load of \"eventview\" failed"); long_description=new eLabel(descr); long_description->setFlags(RS_WRAP); // try to recalc long description label... ( no broken text lines.. ) float lineheight=fontRenderClass::getInstance()->getLineHeight( long_description->getFont() ); int lines = (int)(descr->getSize().height() / lineheight); pageHeight = (int)(lines * lineheight); descr->resize( eSize( descr->getSize().width(), pageHeight+(int)(lineheight/6))); long_description->resize(eSize(descr->getSize().width(), pageHeight*16)); #ifndef DISABLE_FILE addActionToHelpList( &i_epgSelectorActions->addDVRTimerEvent ); #endif #ifndef DISABLE_NETWORK addActionToHelpList( &i_epgSelectorActions->addNGRABTimerEvent ); #endif addActionToHelpList( &i_epgSelectorActions->addSwitchTimerEvent ); addActionToHelpList( &i_epgSelectorActions->removeTimerEvent ); addActionToHelpList( &i_enigmaEventViewActions->close ); if (e) setList(*e); else if (evt) setEvent(evt); addActionMap( &i_enigmaEventViewActions->map ); addActionMap( &i_epgSelectorActions->map ); setHelpID(11); }
//private void MenuHighScoreState::buildMenu(const sf::Font& font) { const float centreX = xy::DefaultSceneSize.x / 2.f; const auto& scores = getContext().appInstance.getScores(); auto list = xy::UI::create<xy::UI::ScoreList>(font); list->setAlignment(xy::UI::Alignment::Centre); list->setPosition(centreX, 590.f); list->setList(scores); list->setIndex(getContext().appInstance.getLastScoreIndex()); m_uiContainer.addControl(list); auto upScroll = xy::UI::create<xy::UI::Button>(font, m_textureResource.get("assets/images/ui/scroll_arrow_vertical.png")); upScroll->setAlignment(xy::UI::Alignment::Centre); upScroll->setPosition(1310, 470.f); upScroll->addCallback([list]() { list->scroll(list->getVerticalSpacing()); }); m_uiContainer.addControl(upScroll); auto downScroll = xy::UI::create<xy::UI::Button>(font, m_textureResource.get("assets/images/ui/scroll_arrow_vertical.png")); downScroll->setAlignment(xy::UI::Alignment::Centre); downScroll->setRotation(180.f); downScroll->setPosition(1310.f, 720.f); downScroll->addCallback([list]() { list->scroll(-list->getVerticalSpacing()); }); m_uiContainer.addControl(downScroll); auto button = xy::UI::create<xy::UI::Button>(font, m_textureResource.get("assets/images/ui/start_button.png")); button->setString("OK"); button->setAlignment(xy::UI::Alignment::Centre); button->setPosition(centreX, 875.f); button->addCallback([this]() { auto msg = m_messageBus.post<xy::Message::UIEvent>(xy::Message::UIMessage); msg->type = xy::Message::UIEvent::MenuClosed; msg->value = 0.f; msg->stateID = (m_endGame) ? States::ID::HighScoresEnd : States::ID::HighScoresMenu; if (m_endGame) { requestStackClear(); requestStackPush(States::ID::MenuBackground); } else { requestStackPop(); requestStackPush(States::ID::MenuMain); } }); m_uiContainer.addControl(button); }
DriverViewSettings::DriverViewSettings(QWidget* parent ) : QFrame( parent ) { //QCursor cursor(Qt::PointingHandCursor); QLabel *selectingDriverLabel = new QLabel(tr("Select the CAN device:"),this); listBox = new QListWidget(this); connect(listBox, SIGNAL(itemDoubleClicked(QListWidgetItem *)), this , SLOT(selectClicked())); // Select Button selectButton = new QPushButton(tr("&Select"), this); buttonBox = new QDialogButtonBox(Qt::Vertical); buttonBox->addButton(selectButton, QDialogButtonBox::ActionRole); connect(selectButton, SIGNAL(clicked()), this, SLOT(selectClicked())); setList(canFactory()->driverList()); extension = new QWidget; QHBoxLayout *extensionLayout = new QHBoxLayout; extensionLayout->setMargin(0); extensionLayout->addWidget(listBox, 1); extensionLayout->addWidget(buttonBox); extensionLayout->addStretch(); QVBoxLayout *extensionVLayout = new QVBoxLayout; extensionVLayout->addWidget(selectingDriverLabel); extensionVLayout->addLayout(extensionLayout); extension->setLayout(extensionVLayout); extension->setVisible(false); QLabel *settingsLabel = new QLabel(tr("Select CAN device:"),this); openSettingsButton = new QPushButton("", this); openSettingsButton->setFlat(true); openSettingsButton->setCheckable(true); openSettingsButton->setIcon(QIcon( ":/nav_up_blue.png" )); openSettingsButton->setCursor(QCursor(Qt::PointingHandCursor)); QHBoxLayout *openSettingsLayout = new QHBoxLayout; openSettingsLayout->addStretch(); openSettingsLayout->addWidget(settingsLabel); openSettingsLayout->addWidget(openSettingsButton); verticalLayout = new QVBoxLayout; verticalLayout->addLayout(openSettingsLayout); verticalLayout->addWidget(extension); setLayout(verticalLayout); connect(openSettingsButton, SIGNAL(toggled(bool)), extension, SLOT(setVisible(bool))); connect(openSettingsButton, SIGNAL(toggled(bool)), this, SLOT(setButtonIcon(bool))); connect(canFactory(), SIGNAL(driverIsCommunicating(bool)),this, SLOT(enableChangeInSettings(bool))); setFixedHeight(50); }
void NavigationWindow::getCoordinates(Location worldMap[][5]) { for (int i = 0; i < 5; i++) { for (int j = 0; j < 5; j++) { if (worldMap[i][j].isIsActive() == true) { currentX = i; currentY = j; choiceType[0] = TextBox("Explore " + worldMap[i][j].getName()); if (currentX == 0) { bounded[WEST] = true; } else { bounded[WEST] = false; } if (currentX == 4) { bounded[EAST] = true; } else { bounded[EAST] = false; } if (currentY == 0) { bounded[NORTH] = true; } else { bounded[NORTH] = false; } if (currentY == 4) { bounded[SOUTH] = true; } else { bounded[SOUTH] = false; } } } } setList(); }
TITANIUM_FUNCTION(Properties, setList) { ENSURE_STRING_AT_INDEX(property, 0); ENSURE_ARRAY_AT_INDEX(array, 1); const auto js_context = this_object.get_context(); const auto object_ptr = GetStaticObject(js_context).GetPrivate<Properties>(); object_ptr->setList(property, array); return js_context.CreateUndefined(); }
bool ListRenders::caseMessage( af::Msg* msg) { //AFINFO("ListRenders::caseMessage:\n"); switch( msg->type()) { case af::Msg::TRendersList: af::MCAfNodes nodes( msg); setList( nodes); subscribe(); return true; } return false; }
ImgGeo::ImgGeo(PixelType<imageNode> listImg) { ctrX = 0; ctrY = 0; prinMax = 0; prinMin = 0; axisMax = 0; axisMin = 0; orienTheta = 0; dEccentric = 0; setList(listImg); }
//private void ScoreState::buildMenu(const sf::Font& menuFont, const sf::Font& scoreFont) { const auto& scores = getContext().appInstance.getScores(); auto list = std::make_shared<ui::ScoreList>(scoreFont); list->setAlignment(ui::Alignment::Centre); list->setPosition(960.f, 590.f); list->setList(scores); list->setIndex(getContext().appInstance.getLastScoreIndex()); m_uiContainer.addControl(list); auto upScroll = std::make_shared<ui::Button>(menuFont, getContext().appInstance.getTexture("assets/images/ui/scroll_arrow_vertical.png")); upScroll->setAlignment(ui::Alignment::Centre); upScroll->setPosition(1310, 470.f); upScroll->setCallback([list]() { list->scroll(list->getVerticalSpacing()); }); m_uiContainer.addControl(upScroll); auto downScroll = std::make_shared<ui::Button>(menuFont, getContext().appInstance.getTexture("assets/images/ui/scroll_arrow_vertical.png")); downScroll->setAlignment(ui::Alignment::Centre); downScroll->setRotation(180.f); downScroll->setPosition(1310.f, 720.f); downScroll->setCallback([list]() { list->scroll(-list->getVerticalSpacing()); }); m_uiContainer.addControl(downScroll); auto applyButton = std::make_shared<ui::Button>(menuFont, getContext().appInstance.getTexture("assets/images/ui/button.png")); applyButton->setText("OK"); applyButton->setAlignment(ui::Alignment::Centre); applyButton->setPosition(960.f, 875.f); applyButton->setCallback([this]() { requestStackPop(); requestStackPush(States::ID::Menu); Message msg; msg.type = Message::Type::UI; msg.ui.type = Message::UIEvent::MenuClosed; msg.ui.value = 0.f; msg.ui.stateId = States::ID::Score; m_messageBus.send(msg); }); m_uiContainer.addControl(applyButton); }
StringListEdit::StringListEdit(const QStringList &list, UntitledList* unamedList, QWidget *parent) : QDialog(parent), ask(false), duplicatesOk(false), _suggestedStringsList(unamedList) { addCaption = "Add String"; addLabel = "String:"; editCaption = "Edit String"; editLabel = addLabel; Q3HBoxLayout *hbox = new Q3HBoxLayout(this, 5, 5); Q3VBoxLayout *vbox = new Q3VBoxLayout; listBox = new Q3ListBox(this); connect(listBox, SIGNAL(currentChanged(Q3ListBoxItem*)), this, SLOT(updateButtons())); hbox->addWidget(listBox, 1); QPushButton *button = new QPushButton(tr("&Add..."), this); connect(button, SIGNAL(clicked()), this, SLOT(addString())); vbox->addWidget(button); editButton = new QPushButton(tr("&Edit..."), this); connect(editButton, SIGNAL(clicked()), this, SLOT(editString())); vbox->addWidget(editButton); removeButton = new QPushButton(tr("&Remove..."), this); connect(removeButton, SIGNAL(clicked()), this, SLOT(removeString())); vbox->addWidget(removeButton); upButton = new QPushButton(tr("&Up"), this); connect(upButton, SIGNAL(clicked()), this, SLOT(moveUp())); vbox->addWidget(upButton); downButton = new QPushButton(tr("&Down"), this); connect(downButton, SIGNAL(clicked()), this, SLOT(moveDown())); vbox->addWidget(downButton); vbox->addStretch(1); button = new QPushButton(tr("OK"), this); connect(button, SIGNAL(clicked()), this, SLOT(accept())); vbox->addWidget(button); button = new QPushButton(tr("Cancel"), this); connect(button, SIGNAL(clicked()), this, SLOT(reject())); vbox->addWidget(button); hbox->addLayout(vbox); setList(list); }
void AppNodeStar::ShowMainMenu( Wt::WContainerWidget* pcw ) { // still need to show the widget, and there needs to be a click event so when // logged in we can refresh // so devote a page to the login, clean out main menu, // but still need an event on when logged in is successful // because nothing else happens on the page if ( m_pAuth->LoggedIn() ) { AddLink( pcw, "member", "/show/addresses", "Address List" ); AddLink( pcw, "member", "/admin/tables/upload", "Upload" ); // <a id="ov7qcp1" // href="admin/tables/populate/mysql?wtd=jLpA57e4vgIIoYxI" // class="Wt-rr"><span id="ov7qcp0">Populate Tables: MySQL sourced</span> // </a> auto pMenu = new Wt::WContainerWidget( pcw ); // test against database, and figure out which can be shown, particularily the tables/init one pMenu->setList(true); // ==> sub WContainerWidget added as <li> elements AddLink( pMenu, "admin", "/admin/tables/init", "Init Tables" ); AddLink( pMenu, "admin", "/admin/tables/populate/basics", "Populate Tables: Basics" ); // use the Upload class to do this one: AddLink( pMenu, "admin", "/ad min/tables/populate/mysql", "Populate Tables: MySQL sourced" ); // use the Upload class to do this one: AddLink( pMenu, "admin", "/admin/tables/populate/smcxml", "Populate Tables: SMC XML sourced" ); } else { } // sample button code, but now implemented as a link //Wt::WPushButton* pBtn = new Wt::WPushButton( "Show Addresses" ); //pBtn->clicked().connect(this, &AppNodeStar::HandleShowAddresses ); //pcw->addWidget( pBtn ); }
void ParameterProperties::setValue(QVariant p) { setType(p.type()); switch (p.type()) { case QVariant::Bool: _bool->setCurrentIndex(p.toBool() ? 1 : 0); break; case QVariant::Int: _int->setText(QString::number(p.toInt())); break; case QVariant::Double: _double->setText(QString::number(p.toDouble())); break; case QVariant::String: _string->setText(p.toString()); break; case QVariant::List: setList(p.toList()); break; default: _string->setText(p.toString()); } }
int MessageListScript::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = MessageList::qt_metacall(_c, _id, _a); if (_id < 0) return _id; #ifndef QT_NO_PROPERTIES if (_c == QMetaObject::ReadProperty) { void *_v = _a[0]; switch (_id) { case 0: *reinterpret_cast< QColor*>(_v) = criColor(); break; case 1: *reinterpret_cast< QColor*>(_v) = attColor(); break; case 2: *reinterpret_cast< QColor*>(_v) = normColor(); break; case 3: *reinterpret_cast< QColor*>(_v) = backColor(); break; case 4: *reinterpret_cast< vtlmeta::types::NamedList*>(_v) = getList(); break; case 5: *reinterpret_cast< QString*>(_v) = sourcerName(); break; case 6: *reinterpret_cast< QString*>(_v) = toolTip(); break; case 7: *reinterpret_cast< VISIBLE*>(_v) = getVisible(); break; case 8: *reinterpret_cast< bool*>(_v) = useMask(); break; case 9: *reinterpret_cast< QString*>(_v) = globalListName(); break; case 10: *reinterpret_cast< QFont*>(_v) = font(); break; case 11: *reinterpret_cast< QRect*>(_v) = geometry(); break; case 12: *reinterpret_cast< Shape*>(_v) = frameShape(); break; case 13: *reinterpret_cast< Shadow*>(_v) = frameShadow(); break; case 14: *reinterpret_cast< int*>(_v) = lineWidth(); break; case 15: *reinterpret_cast< int*>(_v) = midLineWidth(); break; case 16: *reinterpret_cast< int*>(_v) = margin(); break; case 17: *reinterpret_cast< vtlmeta::types::NamedList*>(_v) = getFuncList(); break; } _id -= 18; } else if (_c == QMetaObject::WriteProperty) { void *_v = _a[0]; switch (_id) { case 0: setCriColor(*reinterpret_cast< QColor*>(_v)); break; case 1: setAttColor(*reinterpret_cast< QColor*>(_v)); break; case 2: setNormColor(*reinterpret_cast< QColor*>(_v)); break; case 3: setBackColor(*reinterpret_cast< QColor*>(_v)); break; case 4: setList(*reinterpret_cast< vtlmeta::types::NamedList*>(_v)); break; case 5: setSourcerName(*reinterpret_cast< QString*>(_v)); break; case 6: setToolTip(*reinterpret_cast< QString*>(_v)); break; case 7: setVisible(*reinterpret_cast< VISIBLE*>(_v)); break; case 8: setUseMask(*reinterpret_cast< bool*>(_v)); break; case 9: setGlobalListName(*reinterpret_cast< QString*>(_v)); break; case 10: setFont(*reinterpret_cast< QFont*>(_v)); break; case 11: setGeometry(*reinterpret_cast< QRect*>(_v)); break; case 12: setFrameShape(*reinterpret_cast< Shape*>(_v)); break; case 13: setFrameShadow(*reinterpret_cast< Shadow*>(_v)); break; case 14: setLineWidth(*reinterpret_cast< int*>(_v)); break; case 15: setMidLineWidth(*reinterpret_cast< int*>(_v)); break; case 16: setMargin(*reinterpret_cast< int*>(_v)); break; case 17: setFuncList(*reinterpret_cast< vtlmeta::types::NamedList*>(_v)); break; } _id -= 18; } else if (_c == QMetaObject::ResetProperty) { _id -= 18; } else if (_c == QMetaObject::QueryPropertyDesignable) { _id -= 18; } else if (_c == QMetaObject::QueryPropertyScriptable) { _id -= 18; } else if (_c == QMetaObject::QueryPropertyStored) { _id -= 18; } else if (_c == QMetaObject::QueryPropertyEditable) { _id -= 18; } else if (_c == QMetaObject::QueryPropertyUser) { _id -= 18; } #endif // QT_NO_PROPERTIES return _id; }
KisColorSelectorComboBoxPrivate(QWidget* parent) : QWidget(parent, Qt::Popup), spacing(20), selectorSize(100), highlightArea(-1,-1,0,0) { setMouseTracking(true); QGridLayout* layout = new QGridLayout(this); layout->setSpacing(spacing); //dbgKrita<<"Created list"; layout->addWidget(new KisColorSelector(KisColorSelectorConfiguration(KisColorSelectorConfiguration::Triangle, KisColorSelectorConfiguration::Ring, KisColorSelectorConfiguration::SL , KisColorSelectorConfiguration::H), this), 0,0); layout->addWidget(new KisColorSelector(KisColorSelectorConfiguration(KisColorSelectorConfiguration::Square, KisColorSelectorConfiguration::Ring, KisColorSelectorConfiguration::SV , KisColorSelectorConfiguration::H), this), 0,1); layout->addWidget(new KisColorSelector(KisColorSelectorConfiguration(KisColorSelectorConfiguration::Square, KisColorSelectorConfiguration::Ring, KisColorSelectorConfiguration::SV2, KisColorSelectorConfiguration::H), this), 0,2); layout->addWidget(new KisColorSelector(KisColorSelectorConfiguration(KisColorSelectorConfiguration::Wheel, KisColorSelectorConfiguration::Slider, KisColorSelectorConfiguration::VH, KisColorSelectorConfiguration::hsvS), this), 0,3); layout->addWidget(new KisColorSelector(KisColorSelectorConfiguration(KisColorSelectorConfiguration::Wheel, KisColorSelectorConfiguration::Slider, KisColorSelectorConfiguration::hsvSH, KisColorSelectorConfiguration::V), this), 0,4); layout->addWidget(new KisColorSelector(KisColorSelectorConfiguration(KisColorSelectorConfiguration::Square, KisColorSelectorConfiguration::Slider, KisColorSelectorConfiguration::SV2, KisColorSelectorConfiguration::H), this), 1,0); layout->addWidget(new KisColorSelector(KisColorSelectorConfiguration(KisColorSelectorConfiguration::Square, KisColorSelectorConfiguration::Slider, KisColorSelectorConfiguration::SV, KisColorSelectorConfiguration::H), this), 1,1); layout->addWidget(new KisColorSelector(KisColorSelectorConfiguration(KisColorSelectorConfiguration::Square, KisColorSelectorConfiguration::Slider, KisColorSelectorConfiguration::VH, KisColorSelectorConfiguration::hsvS), this), 1,2); layout->addWidget(new KisColorSelector(KisColorSelectorConfiguration(KisColorSelectorConfiguration::Square, KisColorSelectorConfiguration::Slider, KisColorSelectorConfiguration::hsvSH, KisColorSelectorConfiguration::V), this), 1,3); layout->addWidget(new KisColorSelector(KisColorSelectorConfiguration(KisColorSelectorConfiguration::Square, KisColorSelectorConfiguration::Ring, KisColorSelectorConfiguration::SL , KisColorSelectorConfiguration::H), this), 0,1); layout->addWidget(new KisColorSelector(KisColorSelectorConfiguration(KisColorSelectorConfiguration::Wheel, KisColorSelectorConfiguration::Slider, KisColorSelectorConfiguration::LH, KisColorSelectorConfiguration::hslS), this), 0,2); layout->addWidget(new KisColorSelector(KisColorSelectorConfiguration(KisColorSelectorConfiguration::Wheel, KisColorSelectorConfiguration::Slider, KisColorSelectorConfiguration::hslSH, KisColorSelectorConfiguration::L), this), 0,3); layout->addWidget(new KisColorSelector(KisColorSelectorConfiguration(KisColorSelectorConfiguration::Square, KisColorSelectorConfiguration::Slider, KisColorSelectorConfiguration::SL, KisColorSelectorConfiguration::H), this), 1,0); layout->addWidget(new KisColorSelector(KisColorSelectorConfiguration(KisColorSelectorConfiguration::Square, KisColorSelectorConfiguration::Slider, KisColorSelectorConfiguration::LH, KisColorSelectorConfiguration::hslS), this), 1,1); layout->addWidget(new KisColorSelector(KisColorSelectorConfiguration(KisColorSelectorConfiguration::Square, KisColorSelectorConfiguration::Slider, KisColorSelectorConfiguration::hslSH, KisColorSelectorConfiguration::L), this), 1,2); layout->addWidget(new KisColorSelector(KisColorSelectorConfiguration(KisColorSelectorConfiguration::Square, KisColorSelectorConfiguration::Ring, KisColorSelectorConfiguration::SI , KisColorSelectorConfiguration::H), this), 0,1); layout->addWidget(new KisColorSelector(KisColorSelectorConfiguration(KisColorSelectorConfiguration::Wheel, KisColorSelectorConfiguration::Slider, KisColorSelectorConfiguration::IH, KisColorSelectorConfiguration::hsiS), this), 0,2); layout->addWidget(new KisColorSelector(KisColorSelectorConfiguration(KisColorSelectorConfiguration::Wheel, KisColorSelectorConfiguration::Slider, KisColorSelectorConfiguration::hsiSH, KisColorSelectorConfiguration::I), this), 0,3); layout->addWidget(new KisColorSelector(KisColorSelectorConfiguration(KisColorSelectorConfiguration::Square, KisColorSelectorConfiguration::Slider, KisColorSelectorConfiguration::SI, KisColorSelectorConfiguration::H), this), 1,0); layout->addWidget(new KisColorSelector(KisColorSelectorConfiguration(KisColorSelectorConfiguration::Square, KisColorSelectorConfiguration::Slider, KisColorSelectorConfiguration::IH, KisColorSelectorConfiguration::hsiS), this), 1,1); layout->addWidget(new KisColorSelector(KisColorSelectorConfiguration(KisColorSelectorConfiguration::Square, KisColorSelectorConfiguration::Slider, KisColorSelectorConfiguration::hsiSH, KisColorSelectorConfiguration::I), this), 1,2); layout->addWidget(new KisColorSelector(KisColorSelectorConfiguration(KisColorSelectorConfiguration::Square, KisColorSelectorConfiguration::Ring, KisColorSelectorConfiguration::SY , KisColorSelectorConfiguration::H), this), 0,1); layout->addWidget(new KisColorSelector(KisColorSelectorConfiguration(KisColorSelectorConfiguration::Wheel, KisColorSelectorConfiguration::Slider, KisColorSelectorConfiguration::YH, KisColorSelectorConfiguration::hsyS), this), 0,2); layout->addWidget(new KisColorSelector(KisColorSelectorConfiguration(KisColorSelectorConfiguration::Wheel, KisColorSelectorConfiguration::Slider, KisColorSelectorConfiguration::hsySH, KisColorSelectorConfiguration::Y), this), 0,3); layout->addWidget(new KisColorSelector(KisColorSelectorConfiguration(KisColorSelectorConfiguration::Square, KisColorSelectorConfiguration::Slider, KisColorSelectorConfiguration::SY, KisColorSelectorConfiguration::H), this), 1,0); layout->addWidget(new KisColorSelector(KisColorSelectorConfiguration(KisColorSelectorConfiguration::Square, KisColorSelectorConfiguration::Slider, KisColorSelectorConfiguration::YH, KisColorSelectorConfiguration::hsyS), this), 1,1); layout->addWidget(new KisColorSelector(KisColorSelectorConfiguration(KisColorSelectorConfiguration::Square, KisColorSelectorConfiguration::Slider, KisColorSelectorConfiguration::hsySH, KisColorSelectorConfiguration::Y), this), 1,2); setList(0); for(int i=0; i<this->layout()->count(); i++) { KisColorSelector* item = dynamic_cast<KisColorSelector*>(this->layout()->itemAt(i)->widget()); Q_ASSERT(item); if(item!=0) { item->setMaximumSize(selectorSize, selectorSize); item->setMinimumSize(selectorSize, selectorSize); item->setMouseTracking(true); item->setEnabled(false); item->setColor(KoColor(QColor(255,0,0), item->colorSpace())); item->setDisplayBlip(false); } } }
IndexDialog::IndexDialog (QString &nam, QString &l) : QTabDialog (0, "IndexDialog", TRUE) { helpFile = "indexes.html"; QWidget *w = new QWidget(this); QVBoxLayout *vbox = new QVBoxLayout(w); vbox->setMargin(5); vbox->setSpacing(5); QGridLayout *grid = new QGridLayout(vbox); grid->setColStretch(1, 1); grid->setSpacing(5); QLabel *label = new QLabel(tr("Name"), w); grid->addWidget(label, 0, 0); name = new QLineEdit(nam, w); grid->addWidget(name, 0, 1); QHBoxLayout *hbox = new QHBoxLayout(vbox); hbox->setSpacing(2); list = new QListView(w); list->addColumn(tr("Symbol"), 200); list->addColumn(tr("Weight"), -1); QObject::connect(list, SIGNAL(selectionChanged()), this, SLOT(buttonStatus())); hbox->addWidget(list); toolbar = new Toolbar(w, Toolbar::Vertical); hbox->addWidget(toolbar); QString s = "add"; QString s2 = tr("Add Item"); toolbar->addButton(s, insert, s2); QObject::connect(toolbar->getButton(s), SIGNAL(clicked()), this, SLOT(addItem())); s = "edit"; s2 = tr("Edit"); toolbar->addButton(s, edit, s2); QObject::connect(toolbar->getButton(s), SIGNAL(clicked()), this, SLOT(editItem())); s = "delete"; s2 = tr("Delete"); toolbar->addButton(s, deleteitem, s2); QObject::connect(toolbar->getButton(s), SIGNAL(clicked()), this, SLOT(deleteItem())); vbox->insertStretch(-1, 1); addTab(w, tr("Details")); setOkButton(tr("&OK")); setCancelButton(tr("&Cancel")); connect(this, SIGNAL(applyButtonPressed()), this, SLOT(accept())); setHelpButton(); QObject::connect(this, SIGNAL(helpButtonPressed()), this, SLOT(help())); setList(l); resize(325, 250); }
easysmb::easysmb(QWidget *parent):QMainWindow(parent){ //menu fileMenu = new QMenu("&File"); downloadAct = new QAction("download",this); downloadAct->setIcon(QIcon(":/images/download.png")); downloadAct->setShortcut(Qt::CTRL + Qt::Key_D); downloadAct->setStatusTip("Download directorys or files"); QObject::connect(downloadAct, SIGNAL(triggered()), this, SLOT(downloadIt())); uploadAct = new QAction("upload",this); uploadAct->setIcon(QIcon(":/images/upload.png")); uploadAct->setShortcut(Qt::CTRL + Qt::Key_U); uploadAct->setStatusTip("Upload directorys or files"); QObject::connect(uploadAct, SIGNAL(triggered()), this, SLOT(uploadIt())); closeAct = new QAction("close",this); closeAct->setShortcut(Qt::CTRL + Qt::Key_X); QObject::connect(closeAct, SIGNAL(triggered()), this, SLOT(close())); fileMenu->addAction(uploadAct); fileMenu->addAction(downloadAct); fileMenu->addSeparator(); fileMenu->addAction(closeAct); viewMenu = new QMenu("&View"); iconAct = new QAction("Icon",this); iconAct->setShortcut(Qt::CTRL + Qt::Key_I); QObject::connect(iconAct, SIGNAL(triggered()), this, SLOT(setIcon())); listAct = new QAction("List",this); listAct->setShortcut(Qt::CTRL + Qt::Key_L); QObject::connect(listAct, SIGNAL(triggered()), this, SLOT(setList())); viewMenu->addAction(iconAct); viewMenu->addAction(listAct); aboutMenu = new QMenu("&About"); aboutAct = new QAction("About",this); aboutMenu->addAction(aboutAct); aboutMenu->addAction(aboutAct); aboutAct->setShortcut(Qt::CTRL + Qt::Key_A); aboutAct->setStatusTip("About"); QObject::connect(aboutAct, SIGNAL(triggered()), this, SLOT(showAbout())); this->menuBar()->addMenu(fileMenu); this->menuBar()->addMenu(viewMenu); this->menuBar()->addMenu(aboutMenu); //toolbar toolBar = new QToolBar("QToolBar"); toolBar->addAction(downloadAct); toolBar->addAction(uploadAct); toolBar->addSeparator(); rh=new host; rh->setFocus(); toolBar->addWidget(rh); this->addToolBar(toolBar); // statusbar statusBar()->showMessage("Ready", 6000); //Qtreeview lb = new lbrowse; rb = new rbrowse; QObject::connect(rb, SIGNAL(rdownloadIt()), this, SLOT(downloadIt())); QObject::connect(lb, SIGNAL(luploadIt()), this, SLOT(uploadIt())); QSplitter *splitter = new QSplitter(Qt::Horizontal); splitter->addWidget(rb); splitter->addWidget(lb); this->setCentralWidget(splitter); }
void Database_Config_General::setResourcesToCache (vector <string> values) { setList ("resources-to-cache", values); }
/** * @brief MainWindow::work starts parsing * and displaying data process */ void MainWindow::work() { parser = new WebParse(m_location); setList(parser->download()); }
void MainWindow::redrawTable() { parser->setLocation(m_location); ui->tableWidget->clearContents(); setList(parser->download()); }
void Player::playIndex(int index, int listIndex) { qDebug() << "PlayIndex,index: " << index << "listIndex: " << listIndex; if(listIndex > -1) { if(currentListIndex != listIndex || !listSync) { setList(parser->sources[listIndex]); currentListIndex = listIndex; } } if(index > playList.size() - 1) index = 0; prevIndex = curIndex; curIndex = index; mediaObject->stop(); setState(Player::STOPED); buffer->close(); buffer->setData(""); buffer = new QBuffer(mediaObject); QFile file; QDir::setCurrent(savePath); QString fileName = playList[curIndex]["artist"]+" - "+playList[curIndex]["title"]+"__"+playList[curIndex]["opt4"]+".mp3"; fileName.replace(QRegExp("[?*/\"<>]"), "_"); file.setFileName(fileName); if(file.open(QIODevice::ReadOnly)) { emit bufferProgress(1, 1); //buffer->setData(file.readAll()); //buffer->open(QBuffer::ReadWrite); if(obCreated) { nReply->reset(); if(nReply->isRunning()) nReply->abort(); } mediaObject->stop(); mediaObject->setCurrentSource(Phonon::MediaSource(fileName)); mediaObject->play(); setState(Player::PLAY); ob2Created = true; } else { if(bufferOff) { emit bufferProgress(-1, -1); mediaObject->stop(); mediaObject->setCurrentSource(Phonon::MediaSource(playList[curIndex]["link"])); mediaObject->play(); setState(Player::PLAY); } else { blockNum = 0; QNetworkRequest req; req.setUrl(QUrl(playList[curIndex]["link"])); if(obCreated) { if(nReply->isRunning()) nReply->abort(); } canPlay = false; nReply = nManager.get(req); connect(nReply, SIGNAL(readyRead()), this, SLOT(readData())); connect(nReply, SIGNAL(downloadProgress(qint64,qint64)), this, SLOT(dProgress(qint64,qint64))); connect(nReply, SIGNAL(finished()), this, SLOT(rFinished())); connect(nReply, SIGNAL(error(QNetworkReply::NetworkError)), this, SLOT(nError(QNetworkReply::NetworkError))); obCreated = true; } } file.close(); emit curSong(playList[curIndex], curIndex, autoNext); autoNext = false; QRegExp rx("(.*):(.*)"); // Сиськиии!) rx.indexIn(playList[curIndex]["duration"]); QString c1 = rx.capturedTexts()[1]; QString c2 = rx.capturedTexts()[2]; int dur1 = c1.toInt(); int dur2 = c2.toInt(); duration = dur1 * 60; duration += dur2; }