QVariant Grid_proxy_model::data(const QModelIndex &index, int role) const
{
    if (!index.isValid())
        return QVariant();

    if (role == Qt::DecorationRole) {
    	QIcon icon;
      QString type = grid_types_.at(index.row());
    	if(type == "Cgrid") {
    		icon.addFile(QString::fromUtf8(":/icons/appli/Pixmaps/cgrid.svg"), QSize(), QIcon::Normal, QIcon::Off);
    	}
    	else if(type == "Point_set") {
    		icon.addFile(QString::fromUtf8(":/icons/appli/Pixmaps/pset.svg"), QSize(), QIcon::Normal, QIcon::Off);
    	}
    	else if(type == "Masked_grid") {
    		icon.addFile(QString::fromUtf8(":/icons/appli/Pixmaps/mgrid.svg"), QSize(), QIcon::Normal, QIcon::Off);
    	}
    	else if(type == "Log_data_grid") {
    		icon.addFile(QString::fromUtf8(":/icons/appli/Pixmaps/log_grid.svg"), QSize(), QIcon::Normal, QIcon::Off);
    	}
    	return icon;
    }

    if( role == Qt::DisplayRole ) {
      if(index.column() == 0) return  grid_names_.at(index.row());
      else if(index.column() == 1) return  grid_types_.at(index.row());
    }

    return QVariant();
}
MapSignalsDlg::MapSignalsDlg(UID_ELEMENT uidEcu, int nFrameLen, std::map<UID_ELEMENT, SignalInstanse> mapSignals, QWidget* parent)
{
    IElement* pElement = nullptr;
    m_pouEcu = nullptr;
    m_nFrameLen = nFrameLen;
    if(EC_SUCCESS == LDFDatabaseManager::GetDatabaseManager()->GetLDFCluster()->GetElement(eEcuElement, uidEcu, &pElement))
    {
        m_pouEcu = (IEcu*)pElement;
    }

    m_mapSignalUIDSigInst = mapSignals;
    ui.setupUi(this);



    connect(ui.buttonBox, SIGNAL(accepted()), this, SLOT(onSelectionOk()));
    connect(ui.buttonBox, SIGNAL(rejected()), this, SLOT(onSelectionCancel()));

    QIcon ouWindowIcon;
    ouWindowIcon.addFile(":/LDFEditorIcons/Resources/icons/16x16/Signals.png", QSize(16, 16));
    ouWindowIcon.addFile(":/LDFEditorIcons/Resources/icons/22x22/Signals.png", QSize(16, 16));
    ouWindowIcon.addFile(":/LDFEditorIcons/Resources/icons/32x32/Signals.png", QSize(16, 16));

    setWindowIcon(ouWindowIcon);
    std::string strEcuName;
    m_pouEcu->GetName(strEcuName);
    setWindowTitle(tr("Signals Published by ECU - %1").arg(strEcuName.c_str()));

    SetUpUi();
}
Exemple #3
0
void Window::CreateTrayIcon() {
  mTrayIconMenu = new QMenu( this);
  mTrayIconMenu->addAction( mOpenProfileAction );
  mTrayIconMenu->addSeparator();
  mTrayIconMenu->addAction( mShowAction );
  mTrayIconMenu->addSeparator();
  mTrayIconMenu->addAction( mQuitAction );

  mTrayIcon = new QSystemTrayIcon( this );
  mTrayIcon->setContextMenu (mTrayIconMenu );

#if defined Q_WS_MAC
  QIcon::Mode blackMode = QIcon::Normal;
  QIcon::Mode whiteMode = QIcon::Selected;
  if( OSX_YosemiteDarkModeEnabled() ) {
    blackMode = QIcon::Disabled;
    whiteMode = QIcon::Normal;
  }

  QIcon icon;
  icon.addFile( ":/icons/[email protected]", QSize(), blackMode );
  icon.addFile( ":/icons/mac_black.png", QSize(), blackMode );
  icon.addFile( ":/icons/mac_white.png", QSize(), whiteMode );
  icon.addFile( ":/icons/[email protected]", QSize(), whiteMode );
#elif defined Q_WS_WIN
  QIcon icon = QIcon( ":/icons/win.ico" );
#endif

  mTrayIcon->setIcon( icon );
  mTrayIcon->show();
}
UnconditionalFrameEditDlg::UnconditionalFrameEditDlg(IFrame** pouFrame, eMode eUIType, QWidget* parent)
    : QDialog(parent)
{
    m_pouFrame = pouFrame;
    m_eUIMode = eUIType;




    m_pouLDFCluster = LDFDatabaseManager::GetDatabaseManager()->GetLDFCluster();
    ui.setupUi(this);
    layout()->setSizeConstraint( QLayout::SetFixedSize );
    SetUpUi();



    connect(ui.btnMapSignal, SIGNAL(clicked(bool)), this, SLOT(onMapSignal(bool)));
    connect(ui.buttonBox, SIGNAL(accepted()), this, SLOT(onSelectionOk()));
    connect(ui.buttonBox, SIGNAL(rejected()), this, SLOT(onSelectionCancel()));
    connect(ui.comboPublisher, SIGNAL(currentIndexChanged(QString)), this, SLOT(onChangePublisher(QString)));
    connect(ui.comboFrameLength, SIGNAL(currentIndexChanged(QString)), this, SLOT(onChangeFrameLength(QString)));

    QIcon ouWindowIcon;
    ouWindowIcon.addFile(":/LDFEditorIcons/Resources/icons/16x16/Frame.png", QSize(16, 16));
    ouWindowIcon.addFile(":/LDFEditorIcons/Resources/icons/22x22/Frame.png", QSize(16, 16));
    ouWindowIcon.addFile(":/LDFEditorIcons/Resources/icons/32x32/Frame.png", QSize(16, 16));

    setWindowIcon(ouWindowIcon);

}
Exemple #5
0
 void MainWindow::updateinfo()
 {
    m_thread = new Thread();
    m_thread->start();
    m_thread->wait();
    m_thread->terminate();
    int i;
     QString info;
     for(i=0;i<view->items.size();i++)
     {
         QIcon icon;
         switch(m_thread->status[i])
         {
             case 0:
             info=tr("开启");
             icon.addFile("/opt/kde4/share/icons/oxygen/48x48/actions/dialog-ok-apply.png");
             break;
             case 256:
             info=tr("关闭");
             icon.addFile("/opt/kde4/share/icons/oxygen/48x48/actions/dialog-close.png");
             break;
             default:
             info=tr("未知");
             icon.addFile("/opt/kde4/share/icons/oxygen/48x48/actions/dialog-cancel.png");
             break;
          }
        //view->model->setData(view->model->index(i,1),info);
        view->model->item(i,1)->setIcon(icon);
        view->model->item(i,1)->setText(info);
        view->model->item(i,0)->setText(m_thread->items.at(i));
        view->model->item(i,2)->setText(m_thread->explains.at(i));
        }
     view->sortByColumn(1,Qt::AscendingOrder);
}
SporadicFrameEditDlg::SporadicFrameEditDlg(IFrame** pouFrame,eMode ouMode, QWidget* parent)
{
    m_pouFrame = pouFrame;
    ui.setupUi(this);
    m_pLdfCluster = LDFDatabaseManager::GetDatabaseManager()->GetLDFCluster();
    m_ouMode = ouMode;

    connect(ui.buttonOk, SIGNAL(accepted()), this, SLOT(OnButtonClickOk()));
    connect(ui.buttonOk, SIGNAL(rejected()), this, SLOT(reject()));

    vPrepareValidations();

    setWindowTitle("Create SporadicFrame");

    if(m_ouMode == eEdit)
    {
        vPrepareUIForEditMode();
    }

    QIcon ouWindowIcon;
    ouWindowIcon.addFile(":/LDFEditorIcons/Resources/icons/16x16/Frame.png", QSize(16, 16));
    ouWindowIcon.addFile(":/LDFEditorIcons/Resources/icons/22x22/Frame.png", QSize(16, 16));
    ouWindowIcon.addFile(":/LDFEditorIcons/Resources/icons/32x32/Frame.png", QSize(16, 16));

    setWindowIcon(ouWindowIcon);

}
UBWebPluginPDFWidget::UBWebPluginPDFWidget(const QUrl &url, QWidget *parent)
    : UBWebPluginWidget(url, parent)
    , mPreviousPageButton(this)
    , mNextPageButton(this)
    , mPreviousPageAction(0)
    , mNextPageAction(0)
    , mRenderer(0)
    , mScale(1.5)
    , mPageNumber(1)
{
    QIcon previousPageIcon;
    QIcon nextPageIcon;
    previousPageIcon.addFile(":/images/toolbar/previousPage.png", QSize(32, 32), QIcon::Normal);
    nextPageIcon.addFile(":/images/toolbar/nextPage.png", QSize(32, 32), QIcon::Normal);
    mPreviousPageAction = new QAction(previousPageIcon, QString(), this);
    mNextPageAction = new QAction(nextPageIcon, QString(), this);

    connect(mPreviousPageAction, SIGNAL(triggered()), this, SLOT(previousPage()));
    connect(mNextPageAction, SIGNAL(triggered()), this, SLOT(nextPage()));

    mPreviousPageButton.setFixedSize(32, 32);
    mNextPageButton.setFixedSize(32, 32);

    mPreviousPageButton.setDefaultAction(mPreviousPageAction);
    mNextPageButton.setDefaultAction(mNextPageAction);
    mNextPageButton.move(mPreviousPageButton.x() + mPreviousPageButton.width() + 10, mNextPageButton.y());
}
Exemple #8
0
void ListOfTasks::setContextMenu() {
    this->tasksTree->setContextMenuPolicy(Qt::ActionsContextMenu);


    QIcon iconAdd;
    iconAdd.addFile(QString::fromUtf8(":add.png"), QSize(), QIcon::Normal, QIcon::Off);
    QIcon iconEdit;
    iconEdit.addFile(QString::fromUtf8(":edit.png"), QSize(), QIcon::Normal, QIcon::Off);
    QIcon iconDelete;
    iconDelete.addFile(QString::fromUtf8(":user-trash.png"), QSize(), QIcon::Normal, QIcon::Off);

    contextMenu = new QMenu(tasksTree);
    addTaskAction = new QAction(iconAdd, QString::fromUtf8("Nouvelle tâche"), contextMenu);
    addTaskAction->setIcon(iconAdd);
    this->tasksTree->addAction(addTaskAction);

    editTaskAction = new QAction(iconEdit, QString::fromUtf8("Éditer"), contextMenu);
    editTaskAction->setIcon(iconEdit);
    editTaskAction->setEnabled(false);
    this->tasksTree->addAction(editTaskAction);

    deleteTaskAction = new QAction(iconDelete, QString::fromUtf8("Supprimer"), contextMenu);
    deleteTaskAction->setIcon(iconDelete);
    deleteTaskAction->setEnabled(false);
    this->tasksTree->addAction(deleteTaskAction);

}
void DTAbstractEditWidget::createActions()
{
    QIcon mApplyIcon;
    mApplyIcon.addFile(QString::fromUtf8(":/Image64x64/Images/64x64/apply.png"), QSize(), QIcon::Normal, QIcon::Off);
    mAcApply = new QAction(this);
    mAcApply->setIcon(mApplyIcon);
    mAcApply->setText(tr("Принять"));
    mAcApply->setToolTip(tr("Принять изменения\nCtrl+S"));
    mAcApply->setShortcut(QKeySequence("Ctrl+S"));

    QIcon mCancelIcon;
    mCancelIcon.addFile(QString::fromUtf8(":/Image64x64/Images/64x64/cancel.png"), QSize(), QIcon::Normal, QIcon::Off);
    mAcCancel = new QAction(this);
    mAcCancel->setIcon(mCancelIcon);
    mAcCancel->setText(tr("Отменить"));
    mAcCancel->setToolTip(tr("Отменить изменения\nCtrl+Z"));
    mAcCancel->setShortcut(QKeySequence("Ctrl+Z"));

    QIcon mCommitIcon;
    mCommitIcon.addFile(QString::fromUtf8(":/Image64x64/Images/64x64/db_commit.png"), QSize(), QIcon::Normal, QIcon::Off);
    mAcCommit = new QAction(this);
    mAcCommit->setIcon(mCommitIcon);
    mAcCommit->setText(tr("Сохранить"));
    mAcCommit->setToolTip(tr("Сохранить изменения"));

    QIcon mRollBackIcon;
    mRollBackIcon.addFile(QString::fromUtf8(":/Image64x64/Images/64x64/db_rollback.png"), QSize(), QIcon::Normal, QIcon::Off);
    mAcRollBack = new QAction(this);
    mAcRollBack->setIcon(mRollBackIcon);
    mAcRollBack->setText(tr("Откатить"));
    mAcRollBack->setToolTip(tr("Откатить изменения"));
}
Exemple #10
0
/******************************************************************************
* Initializes the graphical user interface of the application.
******************************************************************************/
void Application::initializeGUI()
{
	// Set the application icon.
	QIcon mainWindowIcon;
	mainWindowIcon.addFile(":/core/mainwin/window_icon_256.png");
	mainWindowIcon.addFile(":/core/mainwin/window_icon_128.png");
	mainWindowIcon.addFile(":/core/mainwin/window_icon_48.png");
	mainWindowIcon.addFile(":/core/mainwin/window_icon_32.png");
	mainWindowIcon.addFile(":/core/mainwin/window_icon_16.png");
	QApplication::setWindowIcon(mainWindowIcon);

	// Create the main window.
	MainWindow* mainWin = new MainWindow();
	_datasetContainer = &mainWin->datasetContainer();

	// Make the application shutdown as soon as the last main window has been closed.
	QGuiApplication::setQuitOnLastWindowClosed(true);

	// Show the main window.
#ifndef OVITO_DEBUG
	mainWin->showMaximized();
#else
	mainWin->show();
#endif
	mainWin->restoreLayout();
}
Exemple #11
0
Application::Application(int& argc, char* argv[]) : QApplication(argc, argv)
{
    setApplicationName("Communi");
    setOrganizationName("Communi");
    setApplicationVersion(Irc::version());

    QIcon icon;
    icon.addFile(":/resources/icons/16x16/communi.png");
    icon.addFile(":/resources/icons/24x24/communi.png");
    icon.addFile(":/resources/icons/32x32/communi.png");
    icon.addFile(":/resources/icons/48x48/communi.png");
    icon.addFile(":/resources/icons/64x64/communi.png");
    icon.addFile(":/resources/icons/128x128/communi.png");
    setWindowIcon(icon);

    qRegisterMetaTypeStreamOperators<Settings>("Settings");
    qRegisterMetaTypeStreamOperators<ConnectionInfo>("ConnectionInfo");
    qRegisterMetaTypeStreamOperators<ConnectionInfos>("ConnectionInfos");

    QSettings settings;
    if (arguments().contains("-reset"))
        settings.clear();
    ApplicationData::settings = settings.value("settings").value<Settings>();

    QFile file(":resources/stylesheet.css");
    if (file.open(QFile::ReadOnly | QIODevice::Text))
        setStyleSheet(QString::fromUtf8(file.readAll()));
}
Exemple #12
0
CodingDlg::CodingDlg(ICluster* pouCluster, ICoding** pouCoding, bool bNew, QWidget* parent)
    : QDialog(parent)
{
    ui.setupUi(this);
    m_pLdfCluster = pouCluster;
    m_pCoding = pouCoding;
    m_bEditMode = !bNew;
    vPrepareValidations();
    ui.buttonDeletePhysical->setDisabled(true);
    ui.buttonDeleteLogical->setDisabled(true);


    setWindowTitle("Create Coding");

    if ( true == m_bEditMode )
    {
        vPrepareUiForEdit();
    }
    connect(ui.buttonAddLogical, SIGNAL(clicked()), this, SLOT(AddLogicalRow()));
    connect(ui.buttonAddPhysical, SIGNAL(clicked()), this, SLOT(AddPhysicalRow()));
    connect(ui.buttonDeleteLogical, SIGNAL(clicked()), this, SLOT(DeleteLogicalRow()));
    connect(ui.buttonDeletePhysical, SIGNAL(clicked()), this, SLOT(DeletePhysicalRow()));
    connect(ui.tableLogicalValues, SIGNAL(ui.tableLogicalValues->itemSelectionChanged()), this, SLOT(ItemSelectionChangeLogical()));

    connect(ui.buttonOption, SIGNAL(accepted()), this, SLOT(onSelectionOk()));
    connect(ui.buttonOption, SIGNAL(rejected()), this, SLOT(onSelecetionCancel()));

    QIcon ouWindowIcon;
    ouWindowIcon.addFile(":/LDFEditorIcons/Resources/icons/16x16/Coding.png", QSize(16, 16));
    ouWindowIcon.addFile(":/LDFEditorIcons/Resources/icons/22x22/Coding.png", QSize(16, 16));
    ouWindowIcon.addFile(":/LDFEditorIcons/Resources/icons/32x32/Coding.png", QSize(16, 16));

    setWindowIcon(ouWindowIcon);
}
QIcon StyleHelper::loadIcon(const QString& strName)
{
    QString strIconNormal = ::WizGetSkinResourceFileName(themeName(), strName);
    QString strIconActive1 = ::WizGetSkinResourceFileName(themeName(), strName+ "_on");
    QString strIconActive2 = ::WizGetSkinResourceFileName(themeName(), strName+ "_selected");

    if (!QFile::exists(strIconNormal)) {
        qDebug() << "load icon failed, filePath:" << strIconNormal;
        return QIcon();
    }

    QIcon icon;
    icon.addFile(strIconNormal, QSize(), QIcon::Normal, QIcon::Off);

    // used for check state
    if (QFile::exists(strIconActive1)) {
        icon.addFile(strIconActive1, QSize(), QIcon::Active, QIcon::On);
    }

    // used for sunken state
    if (QFile::exists(strIconActive2)) {
        icon.addFile(strIconActive2, QSize(), QIcon::Active, QIcon::Off);
    }

    return icon;
}
Exemple #14
0
void SvRepositories::createActions()
{
  QIcon icon;
  /** *********** actions ************** **/
  /// репозитории              
  icon.addFile(QStringLiteral(":/munich/icons/munich-icons/ico/blue/database_new.ico"), QSize(), QIcon::Normal, QIcon::Off);
  actionNewRepository = new QAction(this);
  actionNewRepository->setObjectName(QStringLiteral("actionNewRepository"));
  actionNewRepository->setIcon(icon);
  actionNewRepository->setText("Новый репозиторий");
  connect(actionNewRepository, &QAction::triggered, this, &SvRepositories::newRepository);
  
  icon.addFile(QStringLiteral(":/munich/icons/munich-icons/ico/blue/database_edit.ico"), QSize(), QIcon::Normal, QIcon::Off);
  actionEditRepository = new QAction(this);
  actionEditRepository->setObjectName(QStringLiteral("actionEditRepository"));
  actionEditRepository->setIcon(icon);
  actionEditRepository->setText("Редактировать");
  connect(actionEditRepository, &QAction::triggered, this, &SvRepositories::editRepository);
    
  icon.addFile(QStringLiteral(":/munich/icons/munich-icons/ico/blue/database_delete.ico"), QSize(), QIcon::Normal, QIcon::Off);
  actionDeleteRepository = new QAction(this);
  actionDeleteRepository->setObjectName(QStringLiteral("actionDeleteRepository"));
  actionDeleteRepository->setIcon(icon);
  actionDeleteRepository->setText("Удалить устройство");
  connect(actionDeleteRepository, &QAction::triggered, this, &SvRepositories::deleteRepository);
}
Exemple #15
0
/*
 * helper to load a icon from either the icon theme the desktop provides or from
 * the apps Qt resources.
 */
QIcon Theme::themeIcon( const QString& name, bool sysTray ) const
{
    QString flavor;
    if (sysTray && _mono) {
#ifdef Q_OS_MAC
        flavor = QLatin1String("black");
#else
        flavor = QLatin1String("white");
#endif
    } else {
        flavor = QLatin1String("colored");
    }

    QIcon icon;
    if( QIcon::hasThemeIcon( name )) {
        // use from theme
        icon = QIcon::fromTheme( name );
    } else {
        QList<int> sizes;
        sizes <<16 << 22 << 32 << 48 << 64 << 128;
        foreach (int size, sizes) {
            QString pixmapName = QString::fromLatin1(":/mirall/theme/%1/%2-%3.png").arg(flavor).arg(name).arg(size);
            if (QFile::exists(pixmapName)) {
                icon.addFile(pixmapName, QSize(size, size));
            }
        }
        if (icon.isNull()) {
            foreach (int size, sizes) {
                QString pixmapName = QString::fromLatin1(":/mirall/resources/%1-%2.png").arg(name).arg(size);
                if (QFile::exists(pixmapName)) {
                    icon.addFile(pixmapName, QSize(size, size));
                }
            }
QVariant Weight_property_proxy_model::data(const QModelIndex &index, int role) const
{
    if (!index.isValid())
        return QVariant();

    if (role == Qt::DecorationRole) {
    	QIcon icon;
    	GsTL_object_item *item = static_cast<GsTL_object_item*>(index.internalPointer());
    	QString type = item->item_data(1).toString();
    	if(type == "CategoricalProperty") {
    		icon.addFile(QString::fromUtf8(":/icons/appli/Pixmaps/cat_property.svg"), QSize(), QIcon::Normal, QIcon::Off);
    	}
    	else if(type == "ContinuousProperty") {
    		icon.addFile(QString::fromUtf8(":/icons/appli/Pixmaps/cont_property.svg"), QSize(), QIcon::Normal, QIcon::Off);
    	}
    	return icon;
    }

    if( role == Qt::DisplayRole ) {
    	GsTL_object_item *item = static_cast<GsTL_object_item*>(index.internalPointer());
    	return item->item_data(index.column());
    }

    return QVariant();
}
void LoggerWindow::logging ( const QString &sInfo, const VimbaViewerLogCategory &logCategory )
{
    QIcon icon;

    QListWidgetItem *item = new QListWidgetItem(QTime::currentTime().toString("hh:mm:ss.zzz")+"   "+ sInfo);

    switch(logCategory)
    {
        case VimbaViewerLogCategory_OK: 
            icon.addFile(QString::fromUtf8(":/VimbaViewer/Images/okay.png"), QSize(), QIcon::Normal, QIcon::Off);
            break;

        case VimbaViewerLogCategory_WARNING:
            icon.addFile(QString::fromUtf8(":/VimbaViewer/Images/warning.png"), QSize(), QIcon::Normal, QIcon::Off);
            break;

        case VimbaViewerLogCategory_ERROR:
            icon.addFile( QString::fromUtf8(":/VimbaViewer/Images/error.png"), QSize(), QIcon::Normal, QIcon::Off);
            break;

        case VimbaViewerLogCategory_INFO:
            icon.addFile( QString::fromUtf8(":/VimbaViewer/Images/info.png"), QSize(), QIcon::Normal, QIcon::Off);
            break;

        default: break;
    }
    
    item->setIcon(icon);
    this->addItem(item);
    this->scrollToBottom();
}
KeyframeNavigator::KeyframeNavigator(QWidget *parent, TFrameHandle *frameHandle)
	: QToolBar(parent), m_frameHandle(frameHandle)
{
	setLayoutDirection(Qt::LeftToRight);

	setIconSize(QSize(15, 23));

	setObjectName("keyFrameNavigator");

	QIcon previewActIcon = createQIconPNG("prevkey");
	previewActIcon.addFile(QString(":Resources/prevkey_disabled.png"), QSize(), QIcon::Disabled);
	m_actPreviewKey = new QAction(previewActIcon, tr("Previous Key"), this);
	connect(m_actPreviewKey, SIGNAL(triggered()), SLOT(togglePrevKeyAct()));
	addAction(m_actPreviewKey);

	m_actKeyNo = new QAction(createQIconPNG("key_no"), tr("Set Key"), this);
	connect(m_actKeyNo, SIGNAL(triggered()), SLOT(toggleKeyAct()));
	addAction(m_actKeyNo);

	m_actKeyPartial = new QAction(createQIconPNG("key_partial"), tr("Set Key"), this);
	connect(m_actKeyPartial, SIGNAL(triggered()), SLOT(toggleKeyAct()));
	addAction(m_actKeyPartial);

	m_actKeyTotal = new QAction(createQIconPNG("key_total"), tr("Set Key"), this);
	connect(m_actKeyTotal, SIGNAL(triggered()), SLOT(toggleKeyAct()));
	addAction(m_actKeyTotal);

	QIcon nextActIcon = createQIconPNG("nextkey");
	nextActIcon.addFile(QString(":Resources/nextkey_disabled.png"), QSize(), QIcon::Disabled);
	m_actNextKey = new QAction(nextActIcon, tr("Next Key"), this);
	connect(m_actNextKey, SIGNAL(triggered()), SLOT(toggleNextKeyAct()));
	addAction(m_actNextKey);
}
QgsSymbolV2SelectorDialog::QgsSymbolV2SelectorDialog( QgsSymbolV2* symbol, QgsStyleV2* style, const QgsVectorLayer* vl, QWidget* parent, bool embedded )
    : QDialog( parent )
    , mAdvancedMenu( NULL )
    , mVectorLayer( vl )
    , mMapCanvas( 0 )
{
#ifdef Q_OS_MAC
  setWindowModality( Qt::WindowModal );
#endif
  mStyle = style;
  mSymbol = symbol;
  mPresentWidget = NULL;

  setupUi( this );

  QSettings settings;
  restoreGeometry( settings.value( "/Windows/SymbolSelectorDialog/geometry" ).toByteArray() );

  // can be embedded in renderer properties dialog
  if ( embedded )
  {
    buttonBox->hide();
    layout()->setContentsMargins( 0, 0, 0, 0 );
  }
  // setup icons
  btnAddLayer->setIcon( QIcon( QgsApplication::iconPath( "symbologyAdd.svg" ) ) );
  btnRemoveLayer->setIcon( QIcon( QgsApplication::iconPath( "symbologyRemove.svg" ) ) );
  QIcon iconLock;
  iconLock.addFile( QgsApplication::iconPath( "locked.svg" ), QSize(), QIcon::Normal, QIcon::On );
  iconLock.addFile( QgsApplication::iconPath( "unlocked.svg" ), QSize(), QIcon::Normal, QIcon::Off );
  btnLock->setIcon( iconLock );
  btnUp->setIcon( QIcon( QgsApplication::iconPath( "symbologyUp.svg" ) ) );
  btnDown->setIcon( QIcon( QgsApplication::iconPath( "symbologyDown.svg" ) ) );

  model = new QStandardItemModel( layersTree );
  // Set the symbol
  layersTree->setModel( model );
  layersTree->setHeaderHidden( true );

  QItemSelectionModel* selModel = layersTree->selectionModel();
  connect( selModel, SIGNAL( currentChanged( const QModelIndex&, const QModelIndex& ) ), this, SLOT( layerChanged() ) );

  loadSymbol( symbol, static_cast<SymbolLayerItem*>( model->invisibleRootItem() ) );
  updatePreview();

  connect( btnUp, SIGNAL( clicked() ), this, SLOT( moveLayerUp() ) );
  connect( btnDown, SIGNAL( clicked() ), this, SLOT( moveLayerDown() ) );
  connect( btnAddLayer, SIGNAL( clicked() ), this, SLOT( addLayer() ) );
  connect( btnRemoveLayer, SIGNAL( clicked() ), this, SLOT( removeLayer() ) );
  connect( btnLock, SIGNAL( clicked() ), this, SLOT( lockLayer() ) );
  connect( btnSaveSymbol, SIGNAL( clicked() ), this, SLOT( saveSymbol() ) );

  updateUi();

  // set symbol as active item in the tree
  QModelIndex newIndex = layersTree->model()->index( 0, 0 );
  layersTree->setCurrentIndex( newIndex );
}
Exemple #20
0
QIcon IconLoader::loadingPointmakerIcon()
{
    QIcon pointmakerIcon;
    pointmakerIcon.addFile(":/img/pointmaker-8.png", QSize(8, 8));
    pointmakerIcon.addFile(":/img/pointmaker-16.png", QSize(16, 16));
    pointmakerIcon.addFile(":/img/pointmaker-24.png", QSize(24, 24));
    pointmakerIcon.addFile(":/img/pointmaker-32.png", QSize(32, 32));
    return pointmakerIcon;
}
Exemple #21
0
void GameStyleModel::loadGameStyles()
{
    beginResetModel();

    QIcon dlcIcon;
    dlcIcon.addFile(":/res/dlcMarker.png", QSize(), QIcon::Normal, QIcon::On);
    dlcIcon.addFile(":/res/dlcMarkerSelected.png", QSize(), QIcon::Selected, QIcon::On);
    QPixmap emptySpace = QPixmap(7, 15);
    emptySpace.fill(QColor(0, 0, 0, 0));
    QIcon notDlcIcon = QIcon(emptySpace);

    // empty list, so that we can (re)fill it
    QStandardItemModel::clear();

    QList<QStandardItem * > items;
    items.append(new QStandardItem(notDlcIcon, "Normal"));

    // define a separator item
    QStandardItem * separator = new QStandardItem("---");
    separator->setData(QLatin1String("separator"), Qt::AccessibleDescriptionRole);
    separator->setFlags(separator->flags() & ~( Qt::ItemIsEnabled | Qt::ItemIsSelectable ) );

    items.append(separator);


    QStringList scripts = DataManager::instance().entryList(
                             QString("Scripts/Multiplayer"),
                             QDir::Files,
                             QStringList("*.lua")
                         );

    foreach(QString script, scripts)
    {
        script = script.remove(".lua", Qt::CaseInsensitive);

        QFile scriptCfgFile(QString("physfs://Scripts/Multiplayer/%2.cfg").arg(script));

        QString name = script;
        name = name.replace("_", " ");

        QString scheme = "locked";
        QString weapons = "locked";

        if (scriptCfgFile.exists() && scriptCfgFile.open(QFile::ReadOnly))
        {
            QTextStream input(&scriptCfgFile);
            input >> scheme;
            input >> weapons;
            scriptCfgFile.close();

            if (!scheme.isEmpty())
                scheme.replace("_", " ");

            if (!weapons.isEmpty())
                weapons.replace("_", " ");
        }
CWizCategoryViewJionedGroupRootItem::CWizCategoryViewJionedGroupRootItem(CWizExplorerApp& app)
    : CWizCategoryViewGroupsRootItem(app, CATEGORY_OTHER_GROUPS)
{
    QIcon icon;
    icon.addFile(WizGetSkinResourceFileName(app.userSettings().skin(), "group_normal"),
                 QSize(16, 16), QIcon::Normal);
    icon.addFile(WizGetSkinResourceFileName(app.userSettings().skin(), "group_selected"),
                 QSize(16, 16), QIcon::Selected);
    setIcon(0, icon);
}
Exemple #23
0
NMainWindow::NMainWindow(const QString &uiFile, QWidget *parent) : QDialog(parent)
{
#ifdef Q_WS_WIN
    m_framelessShadow = false;
#endif

    setObjectName("mainWindow");

#ifndef _N_NO_SKINS_
    QUiLoader loader;
    QFile formFile(uiFile);
    formFile.open(QIODevice::ReadOnly);
    QWidget *form = loader.load(&formFile);
    formFile.close();

    QVBoxLayout *layout = new QVBoxLayout;
    layout->addWidget(form->layout()->itemAt(0)->widget());
    layout->setContentsMargins(0, 0, 0, 0);
    setLayout(layout);
    setStyleSheet(form->styleSheet());
    form->setStyleSheet("");
#else
    Q_UNUSED(uiFile)
    ui.setupUi(this);
#endif

    m_unmaximizedSize = QSize();
    m_unmaximizedPos = QPoint();
    m_isFullScreen = false;
    m_dragActive = false;
    m_resizeActive = false;
    m_resizeSection = Qt::NoSection;

    // enabling dragging window from any point
    QList<QWidget *> widgets = findChildren<QWidget *>();
    foreach (QWidget *widget, widgets)
        widget->installEventFilter(this);

    QIcon icon;
#ifdef Q_WS_X11
    icon = QIcon::fromTheme("nulloy");
#endif
#ifndef Q_WS_MAC
    if (icon.isNull()) {
        QStringList files = QDir(":").entryList(QStringList() << "icon-*", QDir::Files);
        foreach (QString fileName, files)
            icon.addFile(":" + fileName);
    }
#else
    icon.addFile(":icon-16.png");
#endif
    setWindowIcon(icon);

    QMetaObject::connectSlotsByName(this);
}
Exemple #24
0
QgsSymbolV2SelectorWidget::QgsSymbolV2SelectorWidget( QgsSymbolV2* symbol, QgsStyleV2* style, const QgsVectorLayer* vl, QWidget* parent )
    : QgsPanelWidget( parent )
    , mAdvancedMenu( nullptr )
    , mVectorLayer( vl )
    , mMapCanvas( nullptr )
{
#ifdef Q_OS_MAC
  setWindowModality( Qt::WindowModal );
#endif
  mStyle = style;
  mSymbol = symbol;
  mPresentWidget = nullptr;

  setupUi( this );

  // setup icons
  btnAddLayer->setIcon( QIcon( QgsApplication::iconPath( "symbologyAdd.svg" ) ) );
  btnRemoveLayer->setIcon( QIcon( QgsApplication::iconPath( "symbologyRemove.svg" ) ) );
  QIcon iconLock;
  iconLock.addFile( QgsApplication::iconPath( "locked.svg" ), QSize(), QIcon::Normal, QIcon::On );
  iconLock.addFile( QgsApplication::iconPath( "locked.svg" ), QSize(), QIcon::Active, QIcon::On );
  iconLock.addFile( QgsApplication::iconPath( "unlocked.svg" ), QSize(), QIcon::Normal, QIcon::Off );
  iconLock.addFile( QgsApplication::iconPath( "unlocked.svg" ), QSize(), QIcon::Active, QIcon::Off );
  btnLock->setIcon( iconLock );
  btnDuplicate->setIcon( QIcon( QgsApplication::iconPath( "mActionDuplicateLayer.svg" ) ) );
  btnUp->setIcon( QIcon( QgsApplication::iconPath( "symbologyUp.svg" ) ) );
  btnDown->setIcon( QIcon( QgsApplication::iconPath( "symbologyDown.svg" ) ) );

  model = new QStandardItemModel( layersTree );
  // Set the symbol
  layersTree->setModel( model );
  layersTree->setHeaderHidden( true );

  QItemSelectionModel* selModel = layersTree->selectionModel();
  connect( selModel, SIGNAL( currentChanged( const QModelIndex&, const QModelIndex& ) ), this, SLOT( layerChanged() ) );

  loadSymbol( symbol, static_cast<SymbolLayerItem*>( model->invisibleRootItem() ) );
  updatePreview();

  connect( btnUp, SIGNAL( clicked() ), this, SLOT( moveLayerUp() ) );
  connect( btnDown, SIGNAL( clicked() ), this, SLOT( moveLayerDown() ) );
  connect( btnAddLayer, SIGNAL( clicked() ), this, SLOT( addLayer() ) );
  connect( btnRemoveLayer, SIGNAL( clicked() ), this, SLOT( removeLayer() ) );
  connect( btnLock, SIGNAL( clicked() ), this, SLOT( lockLayer() ) );
  connect( btnDuplicate, SIGNAL( clicked() ), this, SLOT( duplicateLayer() ) );
  connect( this, SIGNAL( symbolModified() ), this, SIGNAL( widgetChanged() ) );

  updateUi();

  // set symbol as active item in the tree
  QModelIndex newIndex = layersTree->model()->index( 0, 0 );
  layersTree->setCurrentIndex( newIndex );

  setPanelTitle( tr( "Symbol selector" ) );
}
CWizCategoryViewGroupsRootItem::CWizCategoryViewGroupsRootItem(CWizExplorerApp& app, const QString& strName)
    : CWizCategoryViewItemBase(app, strName, "")
{
    QIcon icon;
    icon.addFile(WizGetSkinResourceFileName(app.userSettings().skin(), "group_normal"),
                 QSize(16, 16), QIcon::Normal);
    icon.addFile(WizGetSkinResourceFileName(app.userSettings().skin(), "group_selected"),
                 QSize(16, 16), QIcon::Selected);
    setIcon(0, icon);
    setText(0, strName);
}
Exemple #26
0
//----------------------------------------------------
void CPhoto::CreateActions()
{
    QIcon icon ;

    m_pMoveUpAct = new QAction( "", this) ;
    icon.addFile( "icons/arrow_up.png") ;
    m_pMoveUpAct->setIcon( icon) ;
    connect( m_pMoveUpAct, SIGNAL( triggered()), this, SLOT( OnMoveCurrUp())) ;

    m_pMoveDownAct = new QAction( "", this) ;
    icon.addFile( "icons/arrow_down.png") ;
    m_pMoveDownAct->setIcon( icon) ;
    connect( m_pMoveDownAct, SIGNAL( triggered()), this, SLOT( OnMoveCurrDown())) ;

    m_pZoomAllAct = new QAction( "", this) ;
    icon.addFile( "icons/zoom.png") ;
    m_pZoomAllAct->setIcon( icon) ;
    connect( m_pZoomAllAct, SIGNAL( triggered()), this, SLOT( OnZoomAll())) ;

    m_pConfigAct = new QAction( "", this) ;
    icon.addFile( "icons/wrench.png") ;
    m_pConfigAct->setIcon( icon) ;
    connect( m_pConfigAct, SIGNAL( triggered()), this, SLOT( OnConfig())) ;

    m_pStartSlideShowAct = new QAction( "", this) ;
    icon.addFile( "icons/control_play_blue.png") ;
    m_pStartSlideShowAct->setIcon( icon) ;
    connect( m_pStartSlideShowAct, SIGNAL( triggered()), this, SLOT( OnStartSlideShow())) ;

    m_pEndSlideShowAct = new QAction( "", this) ;
    icon.addFile( "icons/control_stop_blue.png") ;
    m_pEndSlideShowAct->setIcon( icon) ;
    connect( m_pEndSlideShowAct, SIGNAL( triggered()), this, SLOT( OnEndSlideShow())) ;

    m_pPauseSlideShowAct = new QAction( "", this) ;
    icon.addFile( "icons/control_pause_blue.png") ;
    m_pPauseSlideShowAct->setIcon( icon) ;
    connect( m_pPauseSlideShowAct, SIGNAL( triggered()), this, SLOT( OnPauseSlideShow())) ;

    m_pShowFullScreen = new QAction( "", this) ;
    icon.addFile( "icons/monitor.png") ;
    m_pShowFullScreen->setIcon( icon) ;
    connect( m_pShowFullScreen, SIGNAL( triggered()), this, SLOT( SwitchFullScreen())) ;

    m_pExitFullScreen = new QAction( "", this) ;
    icon.addFile( "icons/monitor_go.png") ;
    m_pExitFullScreen->setIcon( icon) ;
    connect( m_pExitFullScreen, SIGNAL( triggered()), this, SLOT( SwitchFullScreen())) ;

    m_pEditNotesAct = new QAction( "", this) ;
    icon.addFile( "icons/picture_edit.png") ;
    m_pEditNotesAct->setIcon( icon) ;
    connect( m_pEditNotesAct, SIGNAL( triggered()), this, SLOT( OnStartEditNotes())) ;
}
CWizCategoryViewTrashItem::CWizCategoryViewTrashItem(CWizExplorerApp& app,
                                                     const QString& strKbGUID)
    : CWizCategoryViewFolderItem(app, "/Deleted Items/", strKbGUID)
{
    QIcon icon;
    icon.addFile(WizGetSkinResourceFileName(app.userSettings().skin(), "trash_normal"),
                 QSize(16, 16), QIcon::Normal);
    icon.addFile(WizGetSkinResourceFileName(app.userSettings().skin(), "trash_selected"),
                 QSize(16, 16), QIcon::Selected);
    setIcon(0, icon);
    setText(0, PREDEFINED_TRASH);
}
/* --------------------- CWizCategoryViewGroupNoTagItem --------------------- */
CWizCategoryViewGroupNoTagItem::CWizCategoryViewGroupNoTagItem(CWizExplorerApp& app,
                                                               const QString& strKbGUID)
    : CWizCategoryViewItemBase(app, PREDEFINED_UNCLASSIFIED, strKbGUID)
{
    QIcon icon;
    icon.addFile(WizGetSkinResourceFileName(app.userSettings().skin(), "folder_normal"),
                 QSize(16, 16), QIcon::Normal);
    icon.addFile(WizGetSkinResourceFileName(app.userSettings().skin(), "folder_selected"),
                 QSize(16, 16), QIcon::Selected);
    setIcon(0, icon);
    setText(0, PREDEFINED_UNCLASSIFIED);
}
/* ------------------------------ CWizCategoryViewGroupRootItem ------------------------------ */
CWizCategoryViewBizGroupRootItem::CWizCategoryViewBizGroupRootItem(CWizExplorerApp& app,
                                                                   const WIZBIZDATA& biz)
    : CWizCategoryViewGroupsRootItem(app, biz.bizName)
    , m_biz(biz)
{
    QIcon icon;
    icon.addFile(WizGetSkinResourceFileName(app.userSettings().skin(), "group_biz_normal"),
                 QSize(16, 16), QIcon::Normal);
    icon.addFile(WizGetSkinResourceFileName(app.userSettings().skin(), "group_biz_selected"),
                 QSize(16, 16), QIcon::Selected);
    setIcon(0, icon);
}
Exemple #30
0
void PlayerVideo::load(Nameable *_tag, bool _isVideo, const QString &filename) {
    tag     = _tag;
    isVideo = _isVideo;
    if(!isVideo) {
        QIcon icon;
        icon.addFile(QString::fromUtf8(":/icons/res_icon_audio_off.png"), QSize(), QIcon::Normal, QIcon::Off);
        icon.addFile(QString::fromUtf8(":/icons/res_icon_audio_on.png"),  QSize(), QIcon::Normal, QIcon::On);
        ui->showVideo->setIcon(icon);
    }
    ui->playerVideo->load(MediaSource(filename));
    refreshControls();
}