void InfoScreens::editModeBtnClicked(MultiFunctionButtonAction event) { switch (event) { case BTN_CLICK: debugf("edit - click"); moveToNextEditParam(); // moveRight(); // handleClick(); break; case BTN_DOUBLE_CLICK: // debugf("return to View mode"); setViewMode(ViewMode::INFO); show(); // moveLeft(); // handleDoubleClick(); break; case BTN_LONG_CLICK: // debugf("edit - BTN_LONG_CLICK"); setViewMode(ViewMode::EDIT_FIELD); // handleHoldClick(); break; case BTN_HOLD_CLICK: debugf("BTN_HOLD_CLICK"); break; } }
void CMDIArea::setMDIArrangementMode( const MDIArrangementMode newArrangementMode ) { m_mdiArrangementMode = newArrangementMode; switch (m_mdiArrangementMode) { case ArrangementModeManual: setViewMode(QMdiArea::SubWindowView); break; case ArrangementModeTile: setViewMode(QMdiArea::SubWindowView); tileSubWindows(); break; case ArrangementModeTabbed: setViewMode(QMdiArea::TabbedView); break; default: setViewMode(QMdiArea::SubWindowView); triggerWindowUpdate(); break; } Q_FOREACH(QTabBar * const tab, findChildren<QTabBar *>()) { QObject* parent = tab->parent(); if (parent == this) { tab->setTabsClosable(true); // As of version 4.8, Qt does the close for us. #if QT_VERSION < 0x040800 disconnect(tab, SIGNAL(tabCloseRequested(int)), this, SLOT(closeTab(int))); connect(tab, SIGNAL(tabCloseRequested(int)), this, SLOT(closeTab(int))); #endif }
ImportDialog::ImportDialog(QWidget* parent) : QFileDialog(parent, WINDOW_NAME, DESKTOP_LOCATION, NULL), _importButton(IMPORT_BUTTON_NAME, this), _cancelButton(CANCEL_BUTTON_NAME, this), fileAccepted(false) { setOption(QFileDialog::DontUseNativeDialog, true); setFileMode(QFileDialog::ExistingFile); setViewMode(QFileDialog::Detail); #ifdef Q_OS_MAC QString cmdString = ("Command"); #else QString cmdString = ("Control"); #endif QLabel* infoLabel = new QLabel(QString(INFO_LABEL_TEXT).arg(cmdString)); infoLabel->setObjectName("infoLabel"); QGridLayout* gridLayout = (QGridLayout*) layout(); gridLayout->addWidget(infoLabel, 2, 0, 2, 1); gridLayout->addWidget(&_cancelButton, 2, 1, 2, 1); gridLayout->addWidget(&_importButton, 2, 2, 2, 1); setImportTypes(); setLayout(); connect(&_importButton, SIGNAL(pressed()), SLOT(import())); connect(this, SIGNAL(currentChanged(QString)), SLOT(saveCurrentFile(QString))); connect(&_cancelButton, SIGNAL(pressed()), SLOT(close())); connect(this, SIGNAL(currentChanged(QString)), SLOT(saveCurrentFile(QString))); }
ImportDialog::ImportDialog(QWidget *parent) : QFileDialog(parent, WINDOW_NAME, DESKTOP_LOCATION, IMPORT_FILE_TYPES), _importButton (IMPORT_BUTTON_NAME, this), _clipboardImportBox(IMPORT_TO_CLIPBOARD_CHECKBOX_STRING, this), _previewBox (PREVIEW_CHECKBOX_STRING, this), _previewBar (this), _glPreview (new GLWidget(this)) { setOption(QFileDialog::DontUseNativeDialog, true); setFileMode(QFileDialog::ExistingFile); setViewMode(QFileDialog::Detail); QGridLayout* gridLayout = (QGridLayout*) layout(); gridLayout->addWidget(&_importButton , 2, 2); gridLayout->addWidget(&_clipboardImportBox, 2, 3); gridLayout->addWidget(&_previewBox , 3, 3); gridLayout->addWidget(&_previewBar , 0, 3); gridLayout->addWidget(_glPreview , 1, 3); gridLayout->setColumnStretch(3, 1); _previewBar.setVisible(false); _previewBar.setRange(0, 100); _previewBar.setValue(0); connect(&_importButton, SIGNAL(pressed()), SLOT(import())); connect(&_previewBox, SIGNAL(toggled(bool)), SIGNAL(previewToggled(bool))); connect(&_previewBox, SIGNAL(toggled(bool)), SLOT(preview(bool))); connect(this, SIGNAL(currentChanged(QString)), SLOT(saveCurrentFile(QString))); connect(&_glTimer, SIGNAL(timeout()), SLOT(timer())); }
void KPrView::startPresentation() { m_actionDrawOnPresentation->setEnabled(true); m_actionHighlightPresentation->setEnabled(true); m_actionBlackPresentation->setEnabled(true); setViewMode( m_presentationMode ); }
void QPreviewFileDialog::initDlg() { ImageIOSupporter iisup; QStringList filters; QString qs; if(mPreviewMode) { QWidget* widget = new QWidget(this); QVBoxLayout* qvbl = new QVBoxLayout(widget); mpPreviewCheckBox = new QCheckBox(tr("Show preview"),widget); connect(mpPreviewCheckBox,SIGNAL(toggled(bool)), this,SLOT(slotShowPreview(bool))); mpPixWidget = new QLabel(widget); mpPixWidget->setMinimumWidth(200); qvbl->setMargin(5); qvbl->addWidget(mpPreviewCheckBox); qvbl->addWidget(mpPixWidget); qvbl->setStretchFactor (mpPixWidget,1); mpPixWidget->setPalette(QColor(lightGray)); addLeftWidget(widget); resize(550,300); } mImageFormat =xmlConfig->stringValue("VIEWER_IMAGE_TYPE","ALL_FILES"); filters = iisup.getOrderedOutFilterList(mImageFormat); setDir(xmlConfig->stringValue("SINGLEFILE_SAVE_PATH")); setFilters(filters); setMode(QFileDialog::AnyFile); setSizeGripEnabled(false); setViewMode((QFileDialog::ViewMode)xmlConfig->intValue("SINGLEFILE_VIEW_MODE")); }
MusicToolSetsWidget::MusicToolSetsWidget(QWidget *parent) : QListWidget(parent) { setAttribute(Qt::WA_TranslucentBackground, true); setFrameShape(QFrame::NoFrame);//Set No Border setStyleSheet(MusicUIObject::MScrollBarStyle01); setIconSize(QSize(60, 60)); setViewMode(QListView::IconMode); setMovement(QListView::Static); #ifdef Q_OS_WIN setSpacing(17); addListWidgetItem(); #else setSpacing(16); QTimer::singleShot(1, this, SLOT(addListWidgetItem())); #endif MusicUtils::UWidget::setTransparent(this, 50); connect(this, SIGNAL(itemClicked(QListWidgetItem*)), SLOT(itemHasClicked(QListWidgetItem*))); M_CONNECTION_PTR->setValue(getClassName(), this); M_CONNECTION_PTR->poolConnect(getClassName(), MusicApplication::getClassName()); M_CONNECTION_PTR->poolConnect(getClassName(), MusicLeftAreaWidget::getClassName()); }
void GameScene::clickedDashboardButton() { #if defined Q_WS_MAEMO_5 QDBusConnection connection = QDBusConnection::sessionBus(); QDBusMessage message = QDBusMessage::createSignal("/","com.nokia.hildon_desktop","exit_app_view"); connection.send(message); #elif (defined Q_OS_LINUX || defined Q_OS_MAC || defined Q_OS_WIN32) && !defined OS_IS_HARMATTAN && !defined OS_IS_ANDROID if(viewMode() == ViewNormal) { setViewMode(ViewFullScreen); } else { setViewMode(ViewNormal); } #else qDebug() << "Dashboard button should not have been shown..."; #endif }
ScFileWidget::ScFileWidget(QWidget * parent) : QFileDialog(parent, Qt::Widget) { setSizeGripEnabled(false); setModal(false); setViewMode(QFileDialog::List); setWindowFlags(Qt::Widget); #ifdef Q_OS_MAC QList<QUrl> urls; QUrl computer(QUrl::fromLocalFile(QLatin1String(""))); if (!urls.contains(computer)) urls << computer; QUrl volumes(QUrl::fromLocalFile("/Volumes")); if (!urls.contains(volumes)) urls << volumes; //desktop too? QUrl computer(QUrl::fromLocalFile(QDesktopServices::storageLocation(QDesktopServices::DesktopLocation))); setSidebarUrls(urls); #endif QList<QPushButton *> b = findChildren<QPushButton *>(); QListIterator<QPushButton *> i(b); while (i.hasNext()) i.next()->setVisible(false); setMinimumSize(QSize(480, 310)); setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred); }
int QPrintPreviewWidget::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QWidget::qt_metacall(_c, _id, _a); if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { switch (_id) { case 0: paintRequested((*reinterpret_cast< QPrinter*(*)>(_a[1]))); break; case 1: previewChanged(); break; case 2: print(); break; case 3: zoomIn((*reinterpret_cast< qreal(*)>(_a[1]))); break; case 4: zoomIn(); break; case 5: zoomOut((*reinterpret_cast< qreal(*)>(_a[1]))); break; case 6: zoomOut(); break; case 7: setZoomFactor((*reinterpret_cast< qreal(*)>(_a[1]))); break; case 8: setOrientation((*reinterpret_cast< QPrinter::Orientation(*)>(_a[1]))); break; case 9: setViewMode((*reinterpret_cast< ViewMode(*)>(_a[1]))); break; case 10: setZoomMode((*reinterpret_cast< ZoomMode(*)>(_a[1]))); break; case 11: setCurrentPage((*reinterpret_cast< int(*)>(_a[1]))); break; case 12: fitToWidth(); break; case 13: fitInView(); break; case 14: setLandscapeOrientation(); break; case 15: setPortraitOrientation(); break; case 16: setSinglePageViewMode(); break; case 17: setFacingPagesViewMode(); break; case 18: setAllPagesViewMode(); break; case 19: updatePreview(); break; case 20: d_func()->_q_fit(); break; case 21: d_func()->_q_updateCurrentPage(); break; } _id -= 22; } return _id; }
QListView* makeView(QAbstractItemModel* model, int column) { auto view = new QListView; view->setViewMode(QListView::ListMode); view->setModel(model); view->setModelColumn(column); return view; }
PhotosImportView::PhotosImportView(QWidget * parent): QListView(parent) { setViewMode(QListView::IconMode); setSpacing(5); setContextMenuPolicy(Qt::CustomContextMenu); connect(this, SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(contextMenu(const QPoint&))); }
MusicBackgroundListWidget::MusicBackgroundListWidget(QWidget *parent) : QListWidget(parent) { setFrameShape(QFrame::NoFrame); //Set No Border setStyleSheet(MusicUIObject::MScrollBarStyle01); setIconSize(QSize(100, 80)); setViewMode(QListView::IconMode); setMovement(QListView::Static); }
PathWindow::PathWindow(QWidget *parent) : QListWidget(parent) { char sz[16]; setViewMode(QListWidget::IconMode); setResizeMode(QListWidget::Adjust); setMovement(QListWidget::Static); connect(this, SIGNAL(itemDoubleClicked(QListWidgetItem*)), this, SLOT(moveClicked(QListWidgetItem*))); }
FolderView::FolderView(int mode, QWidget *parent) : QStackedWidget(parent) { listView = new ListView(); addWidget(listView); //colView = new ColumnView(); //addWidget(colView); setViewMode(mode); }
MyCentralWidget::MyCentralWidget(QWidget *parent) : QMdiArea(parent) { setViewMode(QMdiArea::TabbedView); setTabsMovable(true); setTabsClosable(true); setDocumentMode(true); }
QGroupList::QGroupList(QWidget *parent) : QAutoExpandList(parent) { setIconSize(QSize(ICON_DIM, ICON_DIM)); setViewMode(QListView::IconMode); setWordWrap(true); setFrameStyle(QFrame::NoFrame); //setSizePolicy(QSizePolicy(QSizePolicy::Preferred, QSizePolicy::Minimum)); }
IconPickerDialog::IconPickerDialog(QWidget *parent) : QDialog(parent), ui(new Ui::IconPickerDialog) { MultiMCPlatform::fixWM_CLASS(this); ui->setupUi(this); setWindowModality(Qt::WindowModal); auto contentsWidget = ui->iconView; contentsWidget->setViewMode(QListView::IconMode); contentsWidget->setFlow(QListView::LeftToRight); contentsWidget->setIconSize(QSize(48, 48)); contentsWidget->setMovement(QListView::Static); contentsWidget->setResizeMode(QListView::Adjust); contentsWidget->setSelectionMode(QAbstractItemView::SingleSelection); contentsWidget->setSpacing(5); contentsWidget->setWordWrap(false); contentsWidget->setWrapping(true); contentsWidget->setUniformItemSizes(true); contentsWidget->setTextElideMode(Qt::ElideRight); contentsWidget->setVerticalScrollMode(QAbstractItemView::ScrollPerPixel); contentsWidget->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn); contentsWidget->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); contentsWidget->setItemDelegate(new ListViewDelegate()); //contentsWidget->setAcceptDrops(true); contentsWidget->setDropIndicatorShown(true); contentsWidget->viewport()->setAcceptDrops(true); contentsWidget->setDragDropMode(QAbstractItemView::DropOnly); contentsWidget->setDefaultDropAction(Qt::CopyAction); contentsWidget->installEventFilter(this); contentsWidget->setModel(MMC->icons().get()); auto buttonAdd = ui->buttonBox->addButton(tr("Add Icon"),QDialogButtonBox::ResetRole); auto buttonRemove = ui->buttonBox->addButton(tr("Remove Icon"),QDialogButtonBox::ResetRole); connect(buttonAdd,SIGNAL(clicked(bool)),SLOT(addNewIcon())); connect(buttonRemove,SIGNAL(clicked(bool)),SLOT(removeSelectedIcon())); connect ( contentsWidget, SIGNAL(doubleClicked(QModelIndex)), SLOT(activated(QModelIndex)) ); connect ( contentsWidget->selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)), SLOT(selectionChanged(QItemSelection,QItemSelection)) ); }
void InfoScreens::editModeBtnClicked(MultiFunctionButtonAction event) { switch (event) { case BTN_CLICK: debugf("edit - click"); moveToNextEditParam(); break; case BTN_DOUBLE_CLICK: setViewMode(ViewMode::INFO); show(); break; case BTN_LONG_CLICK: setViewMode(ViewMode::EDIT_FIELD); break; case BTN_HOLD_CLICK: debugf("BTN_HOLD_CLICK"); break; } }
PiecesList::PiecesList(QWidget *parent) : QListWidget(parent) { setDragEnabled(true); setViewMode(QListView::IconMode); setIconSize(QSize(60, 60)); setSpacing(10); setAcceptDrops(true); setDropIndicatorShown(true); }
PiecesList::PiecesList(int pieceSize, QWidget *parent) : QListWidget(parent), m_PieceSize(pieceSize) { setDragEnabled(true); setViewMode(QListView::IconMode); setIconSize(QSize(m_PieceSize, m_PieceSize)); setSpacing(10); setAcceptDrops(true); setDropIndicatorShown(true); }
TemplateIconView::TemplateIconView(QWidget *parent) : QListWidget(parent), m_templateManager(Q_NULLPTR), m_proc(Q_NULLPTR) { setViewMode(QListView::IconMode); setMovement(QListView::Static); setResizeMode(QListView::Adjust); setSelectionMode(QAbstractItemView::SingleSelection); setFlow(QListView::TopToBottom); setMinimumHeight(100); setIconSize(QSize(48, 48)); }
PlayerTable::PlayerTable( QWidget* parent ) : QListWidget( parent ) { setViewMode( QListView::ListMode ); setSelectionMode( QAbstractItemView::NoSelection ); setSelectionRectVisible( false ); setFrameStyle( QFrame::Panel | QFrame::Sunken ); }
ViewProperties::ViewProperties(const KUrl& url) : m_changedProps(false), m_autoSave(true), m_node(0) { GeneralSettings* settings = DolphinSettings::instance().generalSettings(); const bool useGlobalViewProps = settings->globalViewProps(); bool useDetailsViewWithPath = false; // We try and save it to the file .directory in the directory being viewed. // If the directory is not writable by the user or the directory is not local, // we store the properties information in a local file. if (useGlobalViewProps) { m_filePath = destinationDir("global"); } else if (url.protocol().contains("search")) { m_filePath = destinationDir("search"); useDetailsViewWithPath = true; } else if (url.protocol() == QLatin1String("trash")) { m_filePath = destinationDir("trash"); useDetailsViewWithPath = true; } else if (url.isLocalFile()) { m_filePath = url.toLocalFile(); const QFileInfo info(m_filePath); if (!info.isWritable() || !isPartOfHome(m_filePath)) { m_filePath = destinationDir("local") + m_filePath; } } else { m_filePath = destinationDir("remote") + m_filePath; } const QString file = m_filePath + QDir::separator() + QLatin1String(".directory"); m_node = new ViewPropertySettings(KSharedConfig::openConfig(file)); // If the .directory file does not exist or the timestamp is too old, // use default values instead. const bool useDefaultProps = (!useGlobalViewProps || useDetailsViewWithPath) && (!QFileInfo(file).exists() || (m_node->timestamp() < settings->viewPropsTimestamp())); if (useDefaultProps) { if (useDetailsViewWithPath) { setViewMode(DolphinView::DetailsView); setAdditionalInfo(KFileItemDelegate::InformationList() << KFileItemDelegate::LocalPathOrUrl); } else { // The global view-properties act as default for directories without // any view-property configuration settings->setGlobalViewProps(true); ViewProperties defaultProps(url); setDirProperties(defaultProps); settings->setGlobalViewProps(false); m_changedProps = false; } } }
/*========================================================================= setPath =========================================================================*/ void KFileBrowser::setPath (const QString &_path) { QString path; if (_path != "") path = _path; else path = homeDir; QDir dir(path, "*", QDir::DirsFirst); if (dir.isReadable()) { emit statusUpdate (tr("Scanning folder...")); list->clear(); QStringList entries = dir.entryList(); QStringList::ConstIterator it = entries.constBegin(); int count = 0; while (it != entries.constEnd()) { if (*it != "." && *it != "..") { QListWidgetItem *item = new QListWidgetItem(*it, list); item->setIcon (getIconForFile (path + "/" + *it)); //QSize size (200, 50); //item->setSizeHint (size); count++; } ++it; } this->path = dir.canonicalPath(); pathDisplay->setText (this->path); QString title; if (this->path == "/") title = tr("Files: ") + "/"; else title = tr("Files: ") + QFileInfo(this->path).fileName(); emit tabTitleChanged ((QWidget *)this, &title); setViewMode (viewMode); if (count == 0) emit statusUpdate (tr("Folder empty")); else if (count == 1) emit statusUpdate (QString::number (count) + " " + tr("item") + " " + tr("in folder")); else emit statusUpdate (QString::number (count) + " " + tr("items") + " " + tr("in folder")); } else { QMessageBox msgBox; msgBox.setIcon(QMessageBox::Critical); msgBox.setText("Can't read directory"); msgBox.exec(); } }
KexiCategorizedView::KexiCategorizedView(QWidget *parent) : KCategorizedView(parent) { //setWordWrap(true); setSelectionMode(QAbstractItemView::SingleSelection); setMouseTracking(true); setViewMode(QListView::IconMode); setResizeMode(QListView::Adjust); KexiCategoryDrawer* categoryDrawer = new KexiCategoryDrawer; setCategoryDrawer(categoryDrawer); }
int QMdiArea::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QAbstractScrollArea::qt_metacall(_c, _id, _a); if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { if (_id < 14) qt_static_metacall(this, _c, _id, _a); _id -= 14; } #ifndef QT_NO_PROPERTIES else if (_c == QMetaObject::ReadProperty) { void *_v = _a[0]; switch (_id) { case 0: *reinterpret_cast< QBrush*>(_v) = background(); break; case 1: *reinterpret_cast< WindowOrder*>(_v) = activationOrder(); break; case 2: *reinterpret_cast< ViewMode*>(_v) = viewMode(); break; case 3: *reinterpret_cast< bool*>(_v) = documentMode(); break; case 4: *reinterpret_cast< bool*>(_v) = tabsClosable(); break; case 5: *reinterpret_cast< bool*>(_v) = tabsMovable(); break; case 6: *reinterpret_cast< QTabWidget::TabShape*>(_v) = tabShape(); break; case 7: *reinterpret_cast< QTabWidget::TabPosition*>(_v) = tabPosition(); break; } _id -= 8; } else if (_c == QMetaObject::WriteProperty) { void *_v = _a[0]; switch (_id) { case 0: setBackground(*reinterpret_cast< QBrush*>(_v)); break; case 1: setActivationOrder(*reinterpret_cast< WindowOrder*>(_v)); break; case 2: setViewMode(*reinterpret_cast< ViewMode*>(_v)); break; case 3: setDocumentMode(*reinterpret_cast< bool*>(_v)); break; case 4: setTabsClosable(*reinterpret_cast< bool*>(_v)); break; case 5: setTabsMovable(*reinterpret_cast< bool*>(_v)); break; case 6: setTabShape(*reinterpret_cast< QTabWidget::TabShape*>(_v)); break; case 7: setTabPosition(*reinterpret_cast< QTabWidget::TabPosition*>(_v)); break; } _id -= 8; } else if (_c == QMetaObject::ResetProperty) { _id -= 8; } else if (_c == QMetaObject::QueryPropertyDesignable) { _id -= 8; } else if (_c == QMetaObject::QueryPropertyScriptable) { _id -= 8; } else if (_c == QMetaObject::QueryPropertyStored) { _id -= 8; } else if (_c == QMetaObject::QueryPropertyEditable) { _id -= 8; } else if (_c == QMetaObject::QueryPropertyUser) { _id -= 8; } #endif // QT_NO_PROPERTIES return _id; }
void KstTopLevelView::commonConstructor() { _type = "TopLevelView"; _focusOn = false; _pressDirection = -1; _moveOffset = QPoint(-1, -1); _moveOffsetSticky = QPoint(0, 0); _backgroundColor = _w->backgroundColor(); _mouseGrabbed = false; _activeHandler = 0L; _mode = Unknown; setViewMode(KstApp::inst()->currentViewMode(), KstApp::inst()->currentCreateType()); }
/* 构造函数 */ FileListWidget::FileListWidget(QListWidget* parent):QListWidget(parent) { setIconSize(QSize(W_ICONSIZE,H_ICONSIZE)); setViewMode(QListView::IconMode); setMovement(QListView::Static); setSpacing(SPACING); // setContextMenuPolicy(Qt::DefaultContextMenu); connect(this,SIGNAL(ShowFilesSig(QStringList)),this,SLOT(ShowFiles(QStringList))); }
CategorizedView::CategorizedView(QWidget *parent) : QListView(parent), m_leftMargin(5), m_rightMargin(5), m_bottomMargin(5), m_categoryMargin(5)//, m_updatesDisabled(false), m_categoryEditor(0), m_editedCategory(0) { setViewMode(IconMode); setMovement(Snap); setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded); setWordWrap(true); setDragDropMode(QListView::InternalMove); setAcceptDrops(true); setSpacing(10); }