VideoWidget::VideoWidget(QWidget *parent) : QGLWidget(parent) , m_thread(0) , m_frameCount(0) , m_opacity(1) , m_frame(0) , m_oldFrame(0) , m_aspectRatioMode(Qt::KeepAspectRatio) , m_adjustDx1(0) , m_adjustDy1(0) , m_adjustDx2(0) , m_adjustDy2(0) , m_showOverlayText(false) , m_overlayText("") , m_forceFps(-1) , m_renderFps(false) , m_fadeLength(0) , m_fadeToBlack(false) , m_latencyAccum(0) , m_queuedSource(0) , m_oldThread(0) , m_overlayFrame(0) , m_overlaySource(0) { //setAttribute(Qt::WA_PaintOnScreen, true); //setAttribute(Qt::WA_OpaquePaintEvent, true); //setAttribute(Qt::WA_PaintOutsidePaintEvent); srand ( time(NULL) ); connect(&m_paintTimer, SIGNAL(timeout()), this, SLOT(callUpdate())); m_paintTimer.setInterval(1000/30); connect(&m_fadeTimer, SIGNAL(timeout()), this, SLOT(fadeAdvance())); setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding); }
ExportAudioDialog::ExportAudioDialog( Sawe::Project* project, SelectionModel* selection_model, RenderView* render_view ) : QDialog(project->mainWindow()), ui(new Ui::ExportAudioDialog), project(project), selection_model(selection_model), render_view(render_view), total(0), drawnFinished_(false) { EXCEPTION_ASSERTX(false, "not implemented: exportTarget"); TaskInfo ti("ExportAudioDialog"); ui->setupUi(this); update_timer.setSingleShot( true ); update_timer.setInterval( 100 ); connect( &update_timer, SIGNAL( timeout() ), SLOT( callUpdate() ) ); setupGui(); }
AbstractCardItem::AbstractCardItem(const QString &_name, Player *_owner, int _id, QGraphicsItem *parent) : ArrowTarget(_owner, parent), infoWidget(0), id(_id), name(_name), tapped(false), facedown(false), tapAngle(0), isHovered(false), realZValue(0) { setCursor(Qt::OpenHandCursor); setFlag(ItemIsSelectable); setCacheMode(DeviceCoordinateCache); connect(db, SIGNAL(cardListChanged()), this, SLOT(cardInfoUpdated())); connect(settingsCache, SIGNAL(displayCardNamesChanged()), this, SLOT(callUpdate())); cardInfoUpdated(); }
void PileZone::addCardImpl(CardItem *card, int x, int /*y*/) { connect(card, SIGNAL(sigPixmapUpdated()), this, SLOT(callUpdate())); cards.insert(x, card); card->setPos(0, 0); if (!contentsKnown()) { card->setName(QString()); card->setId(-1); // If we obscure a previously revealed card, its name has to be forgotten if (cards.size() > x + 1) cards.at(x + 1)->setName(QString()); } card->setVisible(false); card->resetState(); card->setParentItem(this); }
void SN_PixmapWidget::start() { /** // QRunnable // If true, runnable will be deleted after thread finishes. setAutoDelete(false); // Note that the thread pool takes ownership of the runnable if runnable->autoDelete() returns true, and the runnable will be deleted automatically by the thread pool after the runnable->run() returns. If runnable->autoDelete() returns false, ownership of runnable remains with the caller. Note that changing the auto-deletion on runnable after calling this functions results in undefined behavior. QThreadPool::globalInstance()->start(static_cast<QRunnable *>(this)); **/ setCacheMode(QGraphicsItem::NoCache); //setAttribute(Qt::WA_PaintOnScreen); futureWatcher = new QFutureWatcher<bool>(this); connect(futureWatcher, SIGNAL(finished()), this, SLOT(callUpdate())); /* start receiving thread */ QFuture<bool> future = QtConcurrent::run(this, &SN_PixmapWidget::readImage); futureWatcher->setFuture(future); }
/*virtual*/ void av::shade::StateGroup::UpdateCallback::operator() (::osg::Node *node, ::osg::NodeVisitor *nv) { callUpdate(node); traverse(node, nv); }
GitBrowser::GitBrowser(QString localRepoFolder, QWidget *parent) : QWidget(parent), newDocumentDialog(0) { Q_INIT_RESOURCE(gitbrowser); ui = new Ui::GitBrowser; ui->setupUi(this); repoParams = new RepoParams(); model = new QFileSystemModel; model->setNameFilters(QStringList()<<"*.lyx"); model->setNameFilterDisables(false); repoFolder = localRepoFolder; model->setRootPath(repoFolder); model->setReadOnly(false); ui->listView->setModel(model); ui->listView->setEditTriggers(QAbstractItemView::SelectedClicked|QAbstractItemView::EditKeyPressed); connect(model, SIGNAL(fileRenamed(QString,QString,QString)), this, SLOT(onFileRenamed(QString,QString,QString))); syncWidget = new SyncDialog(this); repoSettingsDialog = new RepoSettings(this); connect(repoSettingsDialog, SIGNAL(changed()), this, SLOT(updateRepoParams())); git = new GitManager(repoFolder); actUpdate = new QAction(QIcon(":/images/refresh.png"), "Обновить", this); connect(actUpdate, SIGNAL(triggered()), this, SLOT(callUpdate())); actUp = new QAction(QIcon(":/images/arrow-up.png"), "Перейти на каталог выше", this); connect(actUp, SIGNAL(triggered()), this, SLOT(up())); actGo = new QAction(QIcon(":/images/go.png"), "Перейти", this); connect(actGo, SIGNAL(triggered()), this, SLOT(onGoBtn_clicked())); actOpen = new QAction("Открыть", this); connect(actOpen, SIGNAL(triggered()), this, SLOT(callOpen())); actVersions = new QAction("Версии...", this); connect(actVersions, SIGNAL(triggered()), this, SLOT(callVersions())); actRename = new QAction("Переименовать", this); connect(actRename, SIGNAL(triggered()), this, SLOT(callRename())); actRemove = new QAction("Удалить", this); connect(actRemove, SIGNAL(triggered()), this, SLOT(callRemove())); actNewDir = new QAction("Новая папка", this); connect(actNewDir, SIGNAL(triggered()), this, SLOT(callNewDir())); actNewDocument = new QAction(QIcon(":/images/new-document.png"), "Новый документ", this); connect(actNewDocument, SIGNAL(triggered()), this, SLOT(callNewDocument())); actCopy = new QAction("Копировать", this); connect(actCopy, SIGNAL(triggered()), this, SLOT(callCopy())); actCut = new QAction("Вырезать", this); connect(actCut, SIGNAL(triggered()), this, SLOT(callCut())); actPaste = new QAction("Вставить", this); connect(actPaste, SIGNAL(triggered()), this, SLOT(callPaste())); actRepoSettings = new QAction(QIcon(":/images/settings.png"), "Настройки репозитория", this); connect(actRepoSettings, SIGNAL(triggered(bool)), SLOT(callRepoSettings())); ui->listView->setContextMenuPolicy(Qt::CustomContextMenu); registerAction("settings", actRepoSettings); registerAction("new-document", actNewDocument); ui->navigationPanel->addActions(QList<QAction* >()<<actUpdate<<actUp); pathLE = new QLineEdit(); connect(pathLE, SIGNAL(returnPressed()), this, SLOT(onLineEdit_returnPressed())); ui->navigationPanel->addWidget(pathLE); ui->navigationPanel->addActions(QList<QAction* >()<<actGo); QList<int> list= ui->splitter->sizes(); list.replace(0,200); list.replace(1,this->width()-200); ui->splitter->setSizes(list); QJS rootItem; rootItem["name"] = "Хранилища"; QJS n1; n1["name"] = "Отчеты"; n1["type"] = "folder"; QJS n2; n2["name"] = "Карточки"; n2["type"] = "folder"; QJS n3; n3["name"] = "Инструкции"; n3["type"] = "folder"; QJS n4; n4["name"] = "Генетические отчеты"; n4["type"] = "folder"; QJS n5; n5["name"] = "Прочие отчеты"; n5["type"] = "folder"; n1["children"][0] = n4; n1["children"][1] = n5; rootItem["children"][0] = n1; rootItem["children"][1] = n2; rootItem["children"][2] = n3; QJSModel *rm = new QJSModel(rootItem); rm->setIcon("folder", "://images/folder.png"); ui->treeView->setModel(rm); go("/"); connect(syncWidget, SIGNAL(retry()), this, SLOT(retry())); }