Ejemplo n.º 1
0
//! [0]
Window::Window(QWidget *parent)
    : QWidget(parent)
{
    browseButton = createButton(tr("&Browse..."), SLOT(browse()));
    findButton = createButton(tr("&Find"), SLOT(find()));

    fileComboBox = createComboBox(tr("*"));
    textComboBox = createComboBox();
    directoryComboBox = createComboBox(QDir::currentPath());

    fileLabel = new QLabel(tr("Named:"));
    textLabel = new QLabel(tr("Containing text:"));
    directoryLabel = new QLabel(tr("In directory:"));
    filesFoundLabel = new QLabel;

    createFilesTable();
//! [0]

//! [1]
    QGridLayout *mainLayout = new QGridLayout;
    mainLayout->addWidget(fileLabel, 0, 0);
    mainLayout->addWidget(fileComboBox, 0, 1, 1, 2);
    mainLayout->addWidget(textLabel, 1, 0);
    mainLayout->addWidget(textComboBox, 1, 1, 1, 2);
    mainLayout->addWidget(directoryLabel, 2, 0);
    mainLayout->addWidget(directoryComboBox, 2, 1);
    mainLayout->addWidget(browseButton, 2, 2);
    mainLayout->addWidget(filesTable, 3, 0, 1, 3);
    mainLayout->addWidget(filesFoundLabel, 4, 0, 1, 2);
    mainLayout->addWidget(findButton, 4, 2);
    setLayout(mainLayout);

    setWindowTitle(tr("Find Files"));
    resize(700, 300);
}
Ejemplo n.º 2
0
void MainWindow::init(){
    browseButton = new QPushButton(tr("&Parcourir..."), this);
    connect(browseButton, &QAbstractButton::clicked, this, &MainWindow::browse);
    compressButton = new QPushButton(tr("&Compresser"), this);
    connect(compressButton, &QAbstractButton::clicked, this, &MainWindow::compress);

    toComboBox = createComboBox();
    fromComboBox = createComboBox();

    toLabel = new QLabel(tr("vers :"));
    fromLabel = new QLabel(tr("Dossier à compresser :"));

    progressBar = new QProgressBar(this);
    progressBar->setValue(0);

    QGridLayout *mainLayout = new QGridLayout;
       mainLayout->addWidget(fromLabel, 0, 0);
       mainLayout->addWidget(fromComboBox, 0, 1);
       mainLayout->addWidget(browseButton, 0, 2);
       mainLayout->addWidget(toLabel, 1, 0);
       mainLayout->addWidget(toComboBox, 1, 1, 1, 2);
       mainLayout->addWidget(progressBar, 4, 0,1, 3);
       mainLayout->addWidget(compressButton, 3, 2);
       setLayout(mainLayout);

       setWindowTitle(tr("My EPSI File Compressor"));
       resize(500, 105);
}
Ejemplo n.º 3
0
//! [0]
Window::Window(QWidget *parent)
    : QWidget(parent)
{
    confBrowseButton = createButton(tr("&Browse..."), SLOT(browse()));
    startButton = createButton(tr("&Start"), SLOT(goDarc()));
    startButton->setEnabled(false);
    cancelButton = createButton(tr("&Cancel"), SLOT(cancel()));

    homePath = QDir::homePath()+tr("/lotuce2/conf/");
    configFileComboBox = createComboBox(homePath);

    configFileLabel = new QLabel(tr("Darc Config File:"));

//! [0]

//! [1]
    QGridLayout *mainLayout = new QGridLayout;

    mainLayout->addWidget(configFileLabel, 0, 0);
    mainLayout->addWidget(configFileComboBox, 0, 1);
    mainLayout->addWidget(confBrowseButton, 0, 2);

    mainLayout->addWidget(cancelButton, 1, 2);
    mainLayout->addWidget(startButton, 1, 3);
    setLayout(mainLayout);

    setWindowTitle(tr("Lotuce2"));
    resize(700, 300);
}
Ejemplo n.º 4
0
QGroupBox* UiGenerator::createCheckBoxGroup(scheme::Para &para, QWidget* parent, QButtonGroup* buttonGroupPtr) {
    auto groupBoxPtr = new QGroupBox(parent);
    QGridLayout* gridLayout = new QGridLayout(groupBoxPtr);
    if(buttonGroupPtr == nullptr)
        buttonGroupPtr = createButtonGroup(para, parent);
    for(auto paraPtr : para.getOrParas()) {
        auto button = new QCheckBox(paraPtr->getName(), parent);
        buttonGroupPtr->addButton(button);
        button->setChecked(util::isSelected(*paraPtr));
        auto ptr = paraPtr.get();
        QObject::connect(button, &QCheckBox::stateChanged, [this, ptr](bool val){
            mParasManager->setVal(val, ptr);
        });
        int row = gridLayout->rowCount();
        int col = 0;
        gridLayout->addWidget(button, row, col++);
        if(util::hasComboBox(*paraPtr)) {
            auto comboBox = createComboBox(*paraPtr, parent);
            QObject::connect(button, &QCheckBox::toggled, comboBox, &QComboBox::setEnabled);
            gridLayout->addWidget(comboBox, row, col);
        }
    }
    groupBoxPtr->setLayout(gridLayout);
    return groupBoxPtr;
}
Ejemplo n.º 5
0
//! [0]
Window::Window(QWidget *parent)
    : QWidget(parent)
{
    browseButton = createButton(tr("&Browse..."), SLOT(browse()));
    findButton = createButton(tr("&Find"), SLOT(find()));
    tinyAllButton = createButton(tr("&Tiny"), SLOT(tinyAll()));
    outBrowseButton = createButton(tr("&Browse..."), SLOT(browse2()));

    fileComboBox = createComboBox(tr("*"));
    textComboBox = createComboBox();
    directoryComboBox = createComboBox(QDir::currentPath());
    outDirectoryComboBox = createComboBox(QDir::currentPath());
    tokenComboBox = createComboBox(tr("HyDxVk41AiyRezVSYFaycTqq1jwgDmm9"));

    fileLabel = new QLabel(tr("Named:"));
    textLabel = new QLabel(tr("Containing text:"));
    tokenLabel = new QLabel(tr("Token:"));
    directoryLabel = new QLabel(tr("In directory:"));
    outDirecotryLabel = new QLabel(tr("Out Directory"));
    filesFoundLabel = new QLabel;

    createFilesTable();
//! [0]

//! [1]
    QGridLayout *mainLayout = new QGridLayout;
    mainLayout->addWidget(fileLabel, 0, 0);
    mainLayout->addWidget(fileComboBox, 0, 1, 1, 2);
    mainLayout->addWidget(textLabel, 1, 0);
    mainLayout->addWidget(textComboBox, 1, 1, 1, 2);
    mainLayout->addWidget(tokenLabel, 2, 0);
    mainLayout->addWidget(tokenComboBox, 2, 1, 1, 2);
    mainLayout->addWidget(directoryLabel, 3, 0);
    mainLayout->addWidget(directoryComboBox, 3, 1);
    mainLayout->addWidget(browseButton, 3, 2);
    mainLayout->addWidget(outDirecotryLabel, 4, 0);
    mainLayout->addWidget(outDirectoryComboBox, 4, 1);
    mainLayout->addWidget(outBrowseButton, 4, 2);
    mainLayout->addWidget(filesTable, 5, 0, 1, 3);
    mainLayout->addWidget(filesFoundLabel, 6, 1, 1, 2);
    mainLayout->addWidget(tinyAllButton, 6, 2);
    mainLayout->addWidget(findButton, 6, 0);
    setLayout(mainLayout);

    setWindowTitle(tr("*・゜゚・*:.。..。.:*・'(*゚▽゚*)'・*:.。. .。.:*・゜゚・*"));
    resize(700, 700);
}
ChoicePropertyComponent::ChoicePropertyComponent (const Value& valueToControl,
                                                  const String& name,
                                                  const StringArray& choiceList,
                                                  const Array<var>& correspondingValues)
    : ChoicePropertyComponent (name, choiceList, correspondingValues)
{
    createComboBox();

    comboBox.getSelectedIdAsValue().referTo (Value (new RemapperValueSource (valueToControl,
                                                                             correspondingValues)));
}
Ejemplo n.º 7
0
Window::Window(QWidget *parent)
	: QDialog(parent)
{
	findButton = createButton("&Find", SLOT(find()));
	findButton->setDefault(true);

	browseButton = createButton("&Browse...", SLOT(browse()));
	
	fileComboBox = createComboBox("*");
	textComboBox = createComboBox();
	directoryComboBox = createComboBox(QDir::currentPath());

	fileLabel = new QLabel("Named:");
	textLabel = new QLabel("containing text:");
	directoryLabel = new QLabel("In directory");
	filesFoundLabel = new QLabel;

	createFilesTable();
	
	QHBoxLayout	*buttonsLayout = new QHBoxLayout;
	buttonsLayout->addStretch();
	buttonsLayout->addWidget(findButton);
	
	QGridLayout *mainLayout = new QGridLayout;
	mainLayout->addWidget(fileLabel, 0, 0);
	mainLayout->addWidget(fileComboBox, 0, 1, 1,2);
	mainLayout->addWidget(textLabel, 1, 0);
	mainLayout->addWidget(textComboBox, 1, 1, 1,2);
	mainLayout->addWidget(directoryLabel, 2, 0);
	mainLayout->addWidget(directoryComboBox, 2, 1);
	mainLayout->addWidget(browseButton, 2, 2);
	mainLayout->addWidget(filesTable, 3, 0, 1, 3);
	mainLayout->addWidget(filesFoundLabel, 4, 0);
	mainLayout->addLayout(buttonsLayout, 5, 0, 1, 3);

	setLayout(mainLayout);
	
	setWindowTitle("Find Files");
	
	resize(700, 300);
}
Ejemplo n.º 8
0
//! [0]
Window::Window(QWidget *parent) : QWidget(parent) {
  setWindowTitle(tr("Find Files"));
  QPushButton *browseButton = new QPushButton(tr("&Browse..."), this);
  connect(browseButton, &QAbstractButton::clicked, this, &Window::browse);
  findButton = new QPushButton(tr("&Find"), this);
  connect(findButton, &QAbstractButton::clicked, this, &Window::find);

  fileComboBox = createComboBox(tr("*"));
  connect(fileComboBox->lineEdit(), &QLineEdit::returnPressed, this,
          &Window::animateFindClick);
  textComboBox = createComboBox();
  connect(textComboBox->lineEdit(), &QLineEdit::returnPressed, this,
          &Window::animateFindClick);
  directoryComboBox =
      createComboBox(QDir::toNativeSeparators(QDir::currentPath()));
  connect(directoryComboBox->lineEdit(), &QLineEdit::returnPressed, this,
          &Window::animateFindClick);

  filesFoundLabel = new QLabel;

  createFilesTable();

  QGridLayout *mainLayout = new QGridLayout(this);
  mainLayout->addWidget(new QLabel(tr("Named:")), 0, 0);
  mainLayout->addWidget(fileComboBox, 0, 1, 1, 2);
  mainLayout->addWidget(new QLabel(tr("Containing text:")), 1, 0);
  mainLayout->addWidget(textComboBox, 1, 1, 1, 2);
  mainLayout->addWidget(new QLabel(tr("In directory:")), 2, 0);
  mainLayout->addWidget(directoryComboBox, 2, 1);
  mainLayout->addWidget(browseButton, 2, 2);
  mainLayout->addWidget(filesTable, 3, 0, 1, 3);
  mainLayout->addWidget(filesFoundLabel, 4, 0, 1, 2);
  mainLayout->addWidget(findButton, 4, 2);
  //! [0]

  //! [1]
  connect(new QShortcut(QKeySequence::Quit, this), &QShortcut::activated, qApp,
          &QApplication::quit);
  //! [1]
}
QMathMLFileViewer::QMathMLFileViewer( QWidget *parent )
    : QDockWidget( tr("MathML Documents Explorer"), parent )
{
	m_iconSize = QSize(16, 16);
	m_isRecursiveSearch = true;

	m_currentDir.setPath( QDir::currentPath() );

	directoryComboBox = createComboBox( m_currentDir.absolutePath() );
	directoryComboBox->setMinimumWidth(150);
	QDirModel *dirModelCompleter = new QDirModel(this);
	dirModelCompleter->setFilter( QDir::AllDirs/*QDir::Dirs*/ );
	QCompleter *completer = new QCompleter( this );
    completer->setModel( dirModelCompleter );
    directoryComboBox->setCompleter( completer );
	connect(directoryComboBox, SIGNAL(currentIndexChanged(const QString&)), this, SLOT(changeDir(const QString&)));

	QToolButton *btnBrowse = new QToolButton();
	btnBrowse->setIcon(QIcon(":/images/folderopen.png"));
	//btnBrowse->setIconSize( m_iconSize );
	btnBrowse->setToolTip(tr("Select a new folder"));
	connect(btnBrowse, SIGNAL(clicked()), this, SLOT(browse()));

	QToolButton *btnBrowseUp = new QToolButton();
	btnBrowseUp->setIcon(QIcon(":/images/up.png"));
	//btnBrowseUp->setIconSize( m_iconSize );
	btnBrowseUp->setToolTip(tr("Navagate one level up"));
	connect(btnBrowseUp, SIGNAL(clicked()), this, SLOT(browseUp()));

	QHBoxLayout *dirLayout = new QHBoxLayout();
	dirLayout->addWidget(directoryComboBox);
	dirLayout->addWidget(btnBrowseUp);
	dirLayout->addWidget(btnBrowse);
	dirLayout->addStretch(1);

	createFilesTree();
	createFilesTable();
	foundMessage = new QLabel(tr("No search results"));

	QHBoxLayout *toolLayout = setupToolLayout();
    QVBoxLayout *mainLayout = new QVBoxLayout();
    mainLayout->addLayout(toolLayout);
    mainLayout->addLayout(dirLayout);
    mainLayout->addWidget(m_dirTree);
    mainLayout->addWidget(filesTable);
	mainLayout->addWidget(foundMessage);

	QDialog *centralDlg = new QDialog();
	centralDlg->setModal( false );
	centralDlg->setLayout( mainLayout );
	setWidget( centralDlg );
}
//==============================================================================
void ChoicePropertyComponent::refresh()
{
    if (isCustomClass)
    {
        if (! comboBox.isVisible())
        {
            createComboBox();
            comboBox.addListener (this);
        }

        comboBox.setSelectedId (getIndex() + 1, dontSendNotification);
    }
}
//==============================================================================
void ChoicePropertyComponent::refresh()
{
    if (isCustomClass)
    {
        if (! comboBox.isVisible())
        {
            createComboBox();
            comboBox.onChange = [this] { changeIndex(); };
        }

        comboBox.setSelectedId (getIndex() + 1, dontSendNotification);
    }
}
ChoicePropertyComponent::ChoicePropertyComponent (const Value& valueToControl,
                                                  const String& name,
                                                  const StringArray& choices_,
                                                  const Array <var>& correspondingValues)
    : PropertyComponent (name),
      choices (choices_),
      isCustomClass (false)
{
    // The array of corresponding values must contain one value for each of the items in
    // the choices array!
    jassert (correspondingValues.size() == choices.size());

    createComboBox();

    comboBox.getSelectedIdAsValue().referTo (Value (new RemapperValueSource (valueToControl, correspondingValues)));
}
Ejemplo n.º 13
0
/**
 * @fn Reportabug
 */
Reportabug::Reportabug(QWidget *parent, bool debugCmd, QMap<QString, QString> params)
    : QMainWindow(parent),
      debug(debugCmd),
      dynamic(params),
      ui(new Ui::Reportabug)
{
    // read settings
    // main
    if (!dynamic.contains(QString("OWNER")))
        dynamic[QString("OWNER")] = QString(OWNER);
    if (!dynamic.contains(QString("PROJECT")))
        dynamic[QString("PROJECT")] = QString(PROJECT);
    if (!dynamic.contains(QString("TAG_ASSIGNEE")))
        dynamic[QString("TAG_ASSIGNEE")] = QString(TAG_ASSIGNEE);
    if (!dynamic.contains(QString("TAG_BODY")))
        dynamic[QString("TAG_BODY")] = QString(TAG_BODY);
    if (!dynamic.contains(QString("TAG_LABELS")))
        dynamic[QString("TAG_LABELS")] = QString(TAG_LABELS);
    if (!dynamic.contains(QString("TAG_MILESTONE")))
        dynamic[QString("TAG_MILESTONE")] = QString(TAG_MILESTONE);
    if (!dynamic.contains(QString("TAG_TITLE")))
        dynamic[QString("TAG_TITLE")] = QString(TAG_TITLE);
    // github module
    if (!dynamic.contains(QString("GITHUB_COMBOBOX")))
        dynamic[QString("GITHUB_COMBOBOX")] = QString(GITHUB_COMBOBOX);
    if (!dynamic.contains(QString("ISSUES_URL")))
        dynamic[QString("ISSUES_URL")] = QString(ISSUES_URL);
    // gitreport module
    if (!dynamic.contains(QString("CAPTCHA_URL")))
        dynamic[QString("CAPTCHA_URL")] = QString(CAPTCHA_URL);
    if (!dynamic.contains(QString("GITREPORT_COMBOBOX")))
        dynamic[QString("GITREPORT_COMBOBOX")] = QString(GITREPORT_COMBOBOX);
    if (!dynamic.contains(QString("PUBLIC_URL")))
        dynamic[QString("PUBLIC_URL")] = QString(PUBLIC_URL);

    ui->setupUi(this);
    initModules();
    createComboBox();
    createActions();
}
Ejemplo n.º 14
0
void GrepWidget::InitWidget()
{
    textLabel = new QLabel(tr("Containing text:"));
    textComboBox = createComboBox();

    QLineEdit *edit = textComboBox->lineEdit();
    Q_ASSERT(connect(edit, SIGNAL(returnPressed ()), this, SLOT(SlotTextEdited())));


    findButton = createButton(tr("&Find"), SLOT(find()));
    createOutput();


    QGridLayout *mainLayout = new QGridLayout;
    mainLayout->setSizeConstraint(QLayout::SetNoConstraint);

    mainLayout->addWidget(textLabel, 0, 0);
    mainLayout->addWidget(textComboBox, 0, 1, 1, 2);
    mainLayout->addWidget(output, 2, 0,1,3);
    mainLayout->addWidget(findButton, 3, 2);
    setLayout(mainLayout);
}
Ejemplo n.º 15
0
Archivo: ffcp.cpp Proyecto: sylzd/FFCP
FFCP::FFCP(QWidget *parent) :
QMainWindow(parent)
{   
	this->resize(830, 500);
	
	this->setWindowTitle(tr("异构嵌入式流程图开发平台"));

	flowWidget = new FlowWidget(this);
	setCentralWidget(flowWidget);
	connect(flowWidget, SIGNAL(triggerSignal()), this, SLOT(changeCode()));   //建立定义变量与代码查看器的连接
	
	hardWidget = new HardWidget(this);
	connect(hardWidget, SIGNAL(triggerSignal()), this, SLOT(changeCode()));   //建立定义变量与代码查看器的连接

		
	createActions();
	createMenus();
	createToolBars();
	createStatusBars();
	createDockWidget();
	createComboBox();   //创建组合框	
	
}
QHBoxLayout* QMathMLFileViewer::setupToolLayout()
{
	QHBoxLayout *toolLayout = new QHBoxLayout();

	QToolButton *btnRefresh = new QToolButton();
	btnRefresh->setIcon(QIcon(":/images/reload.png"));
	//btnRefresh->setIconSize(m_iconSize);
	btnRefresh->setToolTip(tr("Refresh contents of the current directory"));
	connect(btnRefresh, SIGNAL(clicked()), this, SLOT(fileRefresh()));
	toolLayout->addWidget( btnRefresh );

	QToolButton *btnView = new QToolButton();
	btnView->setIcon(QIcon(":/images/printpreview.png"));
	//btnView->setIconSize(m_iconSize);
	btnView->setToolTip(tr("Open the selected file as a new read-only window in the editor - for viewing purposes only"));
	connect(btnView, SIGNAL(clicked()), this, SLOT(fileLoad()));
	connect(this, SIGNAL(hasSelectedItem(bool)), btnView, SLOT(setEnabled(bool)));
	btnView->setEnabled( false );
	toolLayout->addWidget( btnView );

	QToolButton *btnOpen = new QToolButton();
	btnOpen->setIcon(QIcon(":/images/open.png"));
	//btnOpen->setIconSize(m_iconSize);
	btnOpen->setToolTip(tr("Open the selected file as a new window in the editor"));
	connect(btnOpen, SIGNAL(clicked()), this, SLOT(fileOpen()));
	connect(this, SIGNAL(hasSelectedItem(bool)), btnOpen, SLOT(setEnabled(bool)));
	btnOpen->setEnabled( false );
	toolLayout->addWidget( btnOpen );

	toolLayout->addSpacing( 12 );

	QLabel *labelMask = new QLabel(tr("Mask:"));
    fileComboBox = createComboBox(tr(DEFAULT_MASK));
	fileComboBox->setMinimumWidth( 80 );
	//fileComboBox->setIconSize(m_iconSize);
	toolLayout->addWidget( labelMask );
	toolLayout->addWidget( fileComboBox );

	QToolButton *btnFind = new QToolButton();
	btnFind->setIcon(QIcon(":/images/find.png"));
	//btnFind->setIconSize(m_iconSize);
	btnFind->setToolTip(tr("Find all files with a given name starting from the current directory"));
	connect(btnFind, SIGNAL(clicked()), this, SLOT(fileFind()));
	toolLayout->addWidget( btnFind );

	btnRecursive = new QToolButton();
	btnRecursive->setObjectName("__qt__fmlide_widget_QMathMLFileViewer_button_Recursive");
	btnRecursive->setIcon(QIcon(":/images/contents.png"));
	btnRecursive->setToolTip(tr("Set on/off recursive search from the current folder"));
	btnRecursive->setToolButtonStyle( Qt::ToolButtonIconOnly );
	btnRecursive->setCheckable( true );
	btnRecursive->setChecked( isRecursive() );
	connect(btnRecursive, SIGNAL(toggled(bool)), this, SLOT(setRecursive(bool)));
	toolLayout->addWidget( btnRecursive );

	QToolButton *btnBack = new QToolButton();
	btnBack->setIcon(QIcon(":/images/back.png"));
	//btnBack->setIconSize(m_iconSize);
	btnBack->setToolTip(tr("Select the previous found file"));
	connect(btnBack, SIGNAL(clicked()), this, SLOT(fileBack()));
	connect(this, SIGNAL(hasFound(bool)), btnBack, SLOT(setEnabled(bool)));
	btnBack->setEnabled( false );
	toolLayout->addWidget( btnBack );

	QToolButton *btnForward = new QToolButton();
	btnForward->setIcon(QIcon(":/images/forward.png"));
	//btnForward->setIconSize(m_iconSize);
	btnForward->setToolTip(tr("Select the next found file"));
	connect(btnForward, SIGNAL(clicked()), this, SLOT(fileForward()));
	connect(this, SIGNAL(hasFound(bool)), btnForward, SLOT(setEnabled(bool)));
	btnForward->setEnabled( false );
	toolLayout->addWidget( btnForward );

	toolLayout->addStretch( 1 );

	return toolLayout;
}