Example #1
0
VectorTab::VectorTab(ObjectStore *store, QWidget *parent)
  : DataTab(parent), validating(false), _mode(DataVector), _store(store), _initField(QString()), _requestID(0), _valid(false) {

  setupUi(this);
  setTabTitle(tr("Vector"));

  connect(_generatedVectorGroup, SIGNAL(clicked(bool)), this, SLOT(generateClicked()));
  connect(_dataVectorGroup, SIGNAL(clicked(bool)), this, SLOT(readFromSourceClicked()));
  connect(_fileName, SIGNAL(changed(QString)), this, SLOT(fileNameChanged(QString)));
  connect(_configure, SIGNAL(clicked()), this, SLOT(showConfigWidget()));
  connect(_field, SIGNAL(editTextChanged(QString)), this, SIGNAL(fieldChanged()));

  connect(_dataRange, SIGNAL(modified()), this, SIGNAL(modified()));
  connect(_numberOfSamples, SIGNAL(valueChanged(int)), this, SIGNAL(modified()));
  connect(_from, SIGNAL(textChanged(QString)), this, SIGNAL(modified()));
  connect(_to, SIGNAL(textChanged(QString)), this, SIGNAL(modified()));

  // embed data range in the data source box
  _dataRange->groupBox2->setFlat(true);
  _dataRange->groupBox2->setTitle("");
  int top_margin;
  _dataRange->groupBox2->layout()->getContentsMargins(NULL,&top_margin,NULL,NULL);
  _dataRange->groupBox2->layout()->setContentsMargins(0,top_margin,0,0); 

  _connect->setVisible(false);

  _updateBox->addItem(tr("Time Interval", "update periodically"));
  _updateBox->addItem(tr("Change Detection", "update when a change is detected"));
  _updateBox->addItem(tr("No Update", "do not update the file"));
  updateUpdateBox();
  connect(_updateBox, SIGNAL(currentIndexChanged(int)), this, SLOT(updateTypeActivated(int)));
  connect(_updateBox, SIGNAL(currentIndexChanged(int)), this, SIGNAL(modified()));
}
Example #2
0
void AddTaskDialog::construct()
{
    ++obj_cnt;
    upd_mode = false;
    additional_flag = false;
    setAttribute(Qt::WA_DeleteOnClose);
    setWindowTitle("REXLoader - "+tr("Новое задание"));
    priority = 2; //нормальный приоритет
    if(!parent())setWindowIcon(QIcon(":/appimages/trayicon.png"));
    FileNameValidator *validator = new FileNameValidator(this);
    gui->fileName->setValidator(validator);
    gui->categoryBox->setValidator(validator);
    gui->saveFrame->setVisible(false);
    urlValidator();

    loadDatabaseData();
    connect(gui->categoryBox,SIGNAL(currentIndexChanged(int)),this,SLOT(updateLocation(int)));
    connect(gui->urlBox,SIGNAL(editTextChanged(QString)),this,SLOT(urlValidator()));
    connect(gui->browseButton,SIGNAL(released()),this,SLOT(openDirDialog()));
    connect(gui->startNowBtn,SIGNAL(released()),this,SLOT(startNow()));
    connect(gui->startLaterBtn,SIGNAL(released()),this,SLOT(startLater()));
    connect(gui->urlBox,SIGNAL(activated(QString)),this,SLOT(getCategory(QString)));
    connect(gui->saveButton,SIGNAL(released()),this,SLOT(updateTaskInfo()));
    connect(gui->cancelButton_2,SIGNAL(released()),this,SLOT(reject()));

    QDesktopWidget ds;
    QRect desktop = ds.availableGeometry();
    QPoint top_left = QPoint((desktop.bottomRight().x()-size().width())/2+20*(obj_cnt-1),(desktop.bottomRight().y()-size().height())/2+20*(obj_cnt-1));
    move(top_left);

    setAttribute(Qt::WA_AlwaysShowToolTips);
    gui->errorFrame->setHidden(true);

    scanClipboard();
}
Example #3
0
KraftDocFooterEdit::KraftDocFooterEdit( QWidget *parent )
  : KraftDocEdit( parent ),
  mDocFooterEdit( 0 ),
  mCustomGreetingIndex(-1)
{
  QVBoxLayout *topLayout = new QVBoxLayout;
  Q_ASSERT( parent );
  setLayout( topLayout );

  mDocFooterEdit = new Ui::DocFooterEdit;
  QWidget *w = new QWidget;
  mDocFooterEdit->setupUi(w);
  topLayout->addWidget(w);

  mDocFooterEdit->m_cbGreeting->insertItems(-1, KraftDB::self()->wordList( "greeting" ) );

  connect( mDocFooterEdit->m_cbGreeting, SIGNAL( activated( int ) ),
           SLOT( slotModified() ) );
  connect( mDocFooterEdit->m_cbGreeting, SIGNAL(currentIndexChanged(int)),
           this, SLOT(slotGreeterIndexChanged(int)));
  connect( mDocFooterEdit->m_cbGreeting, SIGNAL(editTextChanged(QString)),
           this, SLOT(slotGreeterEditTextChanged(QString)));
  connect( mDocFooterEdit->m_teSummary, SIGNAL( textChanged() ),
           SLOT( slotModified() ) );

  setTitle( i18n( "Document Footer" ) );
  setColor( "#f0ff9a" );
}
Example #4
0
SqlStorageHelper::SqlStorageHelper(StorageSql * storage, VisibleOptions visibleOptions) :
    CuteReport::StorageHelperInterface(storage, visibleOptions),
    ui(new Ui::SqlStorageHelper),
    m_storage(storage)
{
    ui->setupUi(this);

    ui->cmbDriver->addItems(QSqlDatabase::drivers());
    connect(ui->ckUseDefault, SIGNAL(toggled(bool)), ui->edConnection, SLOT(setDisabled(bool)));

    load();

    // sync signals
    connect(ui->edHost, SIGNAL(editingFinished()), this, SLOT(save()));
    connect(ui->cmbDriver, SIGNAL(editTextChanged(QString)), this, SLOT(save()));
    connect(ui->edPort, SIGNAL(valueChanged(int)), this, SLOT(save()));
    connect(ui->edUser, SIGNAL(editingFinished()), this, SLOT(save()));
    connect(ui->edPassword, SIGNAL(editingFinished()), this, SLOT(save()));
    connect(ui->edDatabase, SIGNAL(editingFinished()), this, SLOT(save()));
    connect(ui->edTable, SIGNAL(editingFinished()), this, SLOT(save()));
    connect(ui->edColId, SIGNAL(editingFinished()), this, SLOT(save()));
    connect(ui->edColData, SIGNAL(editingFinished()), this, SLOT(save()));
    connect(ui->ckUseDefault, SIGNAL(toggled(bool)), this, SLOT(save()));
    connect(ui->edConnection, SIGNAL(editingFinished()), this, SLOT(save()));

    connectObject();
}
Example #5
0
void EditEntryWidget::setupAutoType()
{
    m_autoTypeUi->setupUi(m_autoTypeWidget);
    add(tr("Auto-Type"), m_autoTypeWidget);

    m_autoTypeDefaultSequenceGroup->addButton(m_autoTypeUi->inheritSequenceButton);
    m_autoTypeDefaultSequenceGroup->addButton(m_autoTypeUi->customSequenceButton);
    m_autoTypeWindowSequenceGroup->addButton(m_autoTypeUi->defaultWindowSequenceButton);
    m_autoTypeWindowSequenceGroup->addButton(m_autoTypeUi->customWindowSequenceButton);
    m_autoTypeAssocModel->setAutoTypeAssociations(m_autoTypeAssoc);
    m_autoTypeUi->assocView->setModel(m_autoTypeAssocModel);
    m_autoTypeUi->assocView->setColumnHidden(1, true);
    connect(m_autoTypeUi->enableButton, SIGNAL(toggled(bool)), SLOT(updateAutoTypeEnabled()));
    connect(m_autoTypeUi->customSequenceButton, SIGNAL(toggled(bool)),
            m_autoTypeUi->sequenceEdit, SLOT(setEnabled(bool)));
    connect(m_autoTypeUi->customWindowSequenceButton, SIGNAL(toggled(bool)),
            m_autoTypeUi->windowSequenceEdit, SLOT(setEnabled(bool)));
    connect(m_autoTypeUi->assocAddButton, SIGNAL(clicked()), SLOT(insertAutoTypeAssoc()));
    connect(m_autoTypeUi->assocRemoveButton, SIGNAL(clicked()), SLOT(removeAutoTypeAssoc()));
    connect(m_autoTypeUi->assocView->selectionModel(), SIGNAL(currentRowChanged(QModelIndex,QModelIndex)),
            SLOT(updateAutoTypeEnabled()));
    connect(m_autoTypeAssocModel, SIGNAL(modelReset()), SLOT(updateAutoTypeEnabled()));
    connect(m_autoTypeUi->assocView->selectionModel(), SIGNAL(currentRowChanged(QModelIndex,QModelIndex)),
            SLOT(loadCurrentAssoc(QModelIndex)));
    connect(m_autoTypeAssocModel, SIGNAL(modelReset()), SLOT(clearCurrentAssoc()));
    connect(m_autoTypeUi->windowTitleCombo, SIGNAL(editTextChanged(QString)),
            SLOT(applyCurrentAssoc()));
    connect(m_autoTypeUi->defaultWindowSequenceButton, SIGNAL(toggled(bool)),
            SLOT(applyCurrentAssoc()));
    connect(m_autoTypeUi->windowSequenceEdit, SIGNAL(textChanged(QString)),
            SLOT(applyCurrentAssoc()));
}
FormattedTextWidget::FormattedTextWidget( QWidget *parent ) :
    QWidget( parent ),
    d( new Private() )
{
    d->setupUi( this );

    d->m_formattedTextToolBar->insertSeparator( d->m_actionAddImage );
    QPixmap textColorPixmap(20, 20);
    textColorPixmap.fill( d->m_description->textCursor().charFormat().foreground().color() );
    d->m_actionColor->setIcon( textColorPixmap );
    d->m_textColorDialog = new QColorDialog( this );
    d->m_textColorDialog->setOption( QColorDialog::ShowAlphaChannel );
    d->m_textColorDialog->setCurrentColor( d->m_description->textCursor().charFormat().foreground().color() );
    d->m_fontSize->setValidator( new QIntValidator( 1, 9000, this ) );
    int index = d->m_fontSize->findText( QString::number( d->m_description->textCursor().charFormat().font().pointSize() ) );
    if( index != -1 ) {
        d->m_fontSize->setCurrentIndex( index );
    } else {
        d->m_fontSize->lineEdit()->setText( QString::number( d->m_description->textCursor().charFormat().font().pointSize() ) );
    }
    connect( d->m_actionColor, SIGNAL(triggered()), d->m_textColorDialog, SLOT(exec()) );
    connect( d->m_textColorDialog, SIGNAL(colorSelected(QColor)), this, SLOT(setTextCursorColor(QColor)) );
    connect( d->m_isFormattedTextMode, SIGNAL(toggled(bool)), this, SLOT(toggleDescriptionEditMode(bool)) );
    connect( d->m_fontFamily, SIGNAL(currentFontChanged(QFont)), this, SLOT(setTextCursorFont(QFont)) );
    connect( d->m_fontSize, SIGNAL(editTextChanged(QString)), this, SLOT(setTextCursorFontSize(QString)) );
    connect( d->m_actionBold, SIGNAL(toggled(bool)), this, SLOT(setTextCursorBold(bool)) );
    connect( d->m_actionItalics, SIGNAL(toggled(bool)), this, SLOT(setTextCursorItalic(bool)) );
    connect( d->m_actionUnderlined, SIGNAL(toggled(bool)), this, SLOT(setTextCursorUnderlined(bool)) );
    connect( d->m_actionAddImage, SIGNAL(triggered()), this, SLOT(addImageToDescription()) );
    connect( d->m_actionAddLink, SIGNAL(triggered()), this, SLOT(addLinkToDescription()) );
    connect( d->m_description, SIGNAL(cursorPositionChanged()), this, SLOT(updateDescriptionEditButtons()) );
}
Example #7
0
    // build new widgets if needed
    foreach (QString arg, args)
    {
        if (!labelMap.contains(arg))
        {
            labelMap[arg] = new QLabel(QString("%1:").arg(arg), this);
        }
        else
        {
            labelMap.value(arg)->setVisible(true);
        }
        if (!comboMap.contains(arg))
        {
            comboMap[arg] = new QComboBox(this);

            comboMap[arg]->setEditable(true);
            comboMap[arg]->setLineEdit(new DropLineEdit(comboMap[arg]));
            comboMap[arg]->setSizeAdjustPolicy(QComboBox::AdjustToContents);
            comboMap[arg]->setMinimumSize(100, comboMap[arg]->minimumHeight());
            connect(comboMap[arg], SIGNAL(editTextChanged(QString)),this,SLOT(setRunButtonIcon()));
        }
        else
        {
            comboMap.value(arg)->setVisible(true);
        }
    }
Example #8
0
Properties_Window::Properties_Window( QWidget *parent )
	: QDialog( parent )
{
	ui.setupUi( this );
	
	HDD_Info = new HDD_Image_Info();
	
	connect( ui.CB_FD_Devices, SIGNAL(editTextChanged(QString)),
			 this, SLOT(on_Button_Update_Info_clicked()) );
	
	connect( ui.CB_CDROM_Devices, SIGNAL(editTextChanged(QString)),
			 this, SLOT(on_Button_Update_Info_clicked()) );
	
	connect( ui.Edit_HDD_Image_Path, SIGNAL(textChanged(QString)),
			 this, SLOT(on_Button_Update_Info_clicked()) );
}
Example #9
0
MsgEdit::MsgEdit(QWidget *parent, UserWnd *userWnd)
        : QMainWindow(parent, NULL, 0)
{
    m_userWnd	= userWnd;
    m_msg		= NULL;
    m_bTyping	= false;
    m_type		= NO_TYPE;
    m_flags		= 0;
    m_retry.msg = NULL;
    m_bReceived = false;
    m_processor = NULL;
    m_recvProcessor = NULL;
    m_cmd.param = NULL;

    connect(CorePlugin::m_plugin, SIGNAL(modeChanged()), this, SLOT(modeChanged()));

    m_frame = new QFrame(this);
    setCentralWidget(m_frame);
    m_layout = new QVBoxLayout(m_frame);

    m_edit = new MsgTextEdit(this, m_frame);
    m_edit->setBackground(QColor(CorePlugin::m_plugin->getEditBackground() & 0xFFFFFF));
    m_edit->setForeground(QColor(CorePlugin::m_plugin->getEditForeground() & 0xFFFFFF), true);
    m_edit->setFont(CorePlugin::m_plugin->editFont);
    m_edit->setCtrlMode(!CorePlugin::m_plugin->getSendOnEnter());
	setFocusProxy(m_edit);

    QStyleSheet *style = new QStyleSheet(m_edit);
    QStyleSheetItem *style_p = style->item("p");
    // Disable top and bottom margins for P tags. This will make sure
    // paragraphs have no more spacing than regular lines, thus matching
    // RTFs defaut look for paragraphs.
    style_p->setMargin(QStyleSheetItem::MarginTop, 0);
    style_p->setMargin(QStyleSheetItem::MarginBottom, 0);
    m_edit->setStyleSheet(style);

    connect(m_edit, SIGNAL(lostFocus()), this, SLOT(editLostFocus()));
    connect(m_edit, SIGNAL(textChanged()), this, SLOT(editTextChanged()));
    connect(m_edit, SIGNAL(ctrlEnterPressed()), this, SLOT(editEnterPressed()));
    connect(m_edit, SIGNAL(colorsChanged()), this, SLOT(colorsChanged()));
    connect(m_edit, SIGNAL(finished()), this, SLOT(editFinished()));
    connect(m_edit, SIGNAL(fontSelected(const QFont&)), this, SLOT(editFontChanged(const QFont&)));

    QFontMetrics fm(m_edit->font());
    m_edit->setMinimumSize(QSize(fm.maxWidth(), fm.height() + 10));
    m_layout->addWidget(m_edit);

    BarShow b;
    b.bar_id = ToolBarMsgEdit;
    b.parent = this;
    Event e(EventShowBar, &b);
    m_bar = (CToolBar*)(e.process());
    m_bar->setParam(this);

    if (CorePlugin::m_plugin->getContainerMode() == 0)
        showCloseSend(false);

    setDockEnabled(m_bar, Left, false);
    setDockEnabled(m_bar, Right, false);
}
Example #10
0
DialogBare::DialogBare(QWidget *parent) :
    QWidget(parent),
    loading(false),
    ui(new Ui::DialogBare),
    worker(NULL),
    boardFoundWidget(NULL)
{
    ui->setupUi(this);

    foreach (QextPortInfo info, QextSerialEnumerator::getPorts())
        if (!info.portName.isEmpty())
            ui->portBox->addItem(info.portName);
    //make sure user can input their own port name!
    ui->portBox->setEditable(true);

//    ui->led->turnOff();

    PortSettings settings = {BAUD9600, DATA_8, PAR_NONE, STOP_1, FLOW_OFF, 10};
    port = new QextSerialPort(ui->portBox->currentText(), settings, QextSerialPort::Polling);

    enumerator = new QextSerialEnumerator(this);
    enumerator->setUpNotifications();

    ui->boardComboBox->addItem("PX4FMU v1.6+", 5);
    ui->boardComboBox->addItem("PX4FLOW v1.1+", 6);
    ui->boardComboBox->addItem("PX4IO v1.3+", 7);
    ui->boardComboBox->addItem("PX4 board #8", 8);
    ui->boardComboBox->addItem("PX4 board #9", 9);
    ui->boardComboBox->addItem("PX4 board #10", 10);
    ui->boardComboBox->addItem("PX4 board #11", 11);

    connect(ui->portBox, SIGNAL(editTextChanged(QString)), SLOT(onPortNameChanged(QString)));
    connect(ui->flashButton, SIGNAL(clicked()), SLOT(onUploadButtonClicked()));
    connect(ui->scanButton, SIGNAL(clicked()), SLOT(onDetect()));
    connect(ui->selectFileButton, SIGNAL(clicked()), SLOT(onFileSelectRequested()));
    connect(ui->cancelButton, SIGNAL(clicked()), SLOT(onCancelButtonClicked()));

    connect(ui->advancedCheckBox, SIGNAL(clicked(bool)), this, SLOT(onToggleAdvancedMode(bool)));

    connect(enumerator, SIGNAL(deviceDiscovered(QextPortInfo)), SLOT(onPortAddedOrRemoved()));
    connect(enumerator, SIGNAL(deviceRemoved(QextPortInfo)), SLOT(onPortAddedOrRemoved()));

    setWindowTitle(tr("QUpgrade Firmware Upload / Configuration Tool"));

    // Adjust the size
    const int screenHeight = qMin(1000, QApplication::desktop()->height() - 100);

    resize(700, qMax(screenHeight, 550));

    // load settings
    loadSettings();

    // Set up initial state
    if (!lastFilename.isEmpty()) {
        ui->flashButton->setEnabled(true);
    } else {
        ui->flashButton->setEnabled(false);
    }
}
CInputDialogOrdering::CInputDialogOrdering(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::CInputDialogOrdering)
{
    ui->setupUi(this);
    m_pThread=NULL;
    m_iNewDealerId=m_iMarkId=-1;
    ui->pushButtonEdit->setEnabled(false),
    ui->pushButtonDelete->setEnabled(false);
    ui->dateEdit->setDate(QDate().currentDate());//set current date
    ui->lineEditOrderingnumber->setFocus();
    ui->pushButtonOk->setEnabled(false);

    //disable auto default buttons
    ui->pushButtonAddBarcode->setAutoDefault(false);
    ui->pushButtonCancel->setAutoDefault(false);
    ui->pushButtonDelete->setAutoDefault(false);
    ui->pushButtonEdit->setAutoDefault(false);
    ui->pushButtonNew->setAutoDefault(false);
    ui->pushButtonOk->setAutoDefault(false);

    //date
    QDate dt=QDate().currentDate();
    ui->dateEdit->setMaximumDate(dt);
    dt=QDate(2009,1,1);
    ui->dateEdit->setMinimumDate(dt);

    check_user_input();
    settings(false);//load & set settings

    //context menu
    ui->tableWidgetWares->setContextMenuPolicy(Qt::CustomContextMenu);
    m_pContextMenu=new QMenu(QString("context_default"),this);
    if(m_pContextMenu!=NULL)
    {
        m_pContextMenu->addAction(QString::fromUtf8("Hinzufügen"));
        m_pContextMenu->addAction(QString("Bearbeiten"));
        m_pContextMenu->addAction(QString::fromUtf8("Löschen"));
    }

    //connects context menus
    connect(m_pContextMenu,SIGNAL(triggered(QAction*)),this,SLOT(receiv_context_menu(QAction*)));
    connect(ui->tableWidgetWares,SIGNAL(customContextMenuRequested(QPoint)),this,SLOT(open_context_menu()));

    //connects
    connect(ui->pushButtonNew,SIGNAL(clicked()),this,SLOT(add_ware()));
    connect(ui->pushButtonAddBarcode,SIGNAL(clicked()),this,SLOT(add_ware_barcode()));
    connect(ui->pushButtonDelete,SIGNAL(clicked()),this,SLOT(delete_ware()));
    connect(ui->pushButtonEdit,SIGNAL(clicked()),this,SLOT(edit_ware()));
    connect(ui->tableWidgetWares,SIGNAL(itemSelectionChanged()),this,SLOT(check_user_input()));
    connect(ui->tableWidgetWares,SIGNAL(itemDoubleClicked(QTableWidgetItem*)),this,SLOT(edit_ware()));
    connect(ui->comboBoxDealer,SIGNAL(editTextChanged(QString)),this,SLOT(edit_maker_combobox(QString)));
    connect(ui->pushButtonOk,SIGNAL(clicked()),this,SLOT(press_ok()));
    connect(ui->pushButtonCancel,SIGNAL(clicked()),this,SLOT(press_cancel()));
    //-
    setMaximumSize(width(),height());
    setMinimumSize(width(),height());
}
Example #12
0
GTFSDialog::GTFSDialog(QString pathname, QWidget *parent) :
    QDialog(parent),
    ui(new Ui::GTFSDialog),
    _pathname(pathname)
{
    ui->setupUi(this);

    // Set default values
    ui->buttonBox->button(QDialogButtonBox::Ok)->setText(tr("Import"));
    ui->buttonBox->button(QDialogButtonBox::Ok)->setDisabled(true);
    ui->lineEditTrace->setText((new QFileInfo(pathname))->fileName());

    // check whether the shape file exists
    QFileInfo checkShapeFileTXT(pathname+"/shapes.txt");
    QFileInfo checkShapeFileCSV(pathname+"/shapes.csv");
    if((checkShapeFileCSV.exists() && checkShapeFileCSV.isFile()) || (checkShapeFileTXT.exists() && checkShapeFileTXT.isFile())) {
        ui->snapToShapeCheckBox->setEnabled(true);
        ui->snapToShapeCheckBox->setChecked(true);
    } else {
        ui->snapToShapeCheckBox->setEnabled(false);
        ui->snapToShapeCheckBox->setChecked(false);
    }

    QSettings settings;

    _projIns = settings.value("savedProjInsGTFS", QStringList()).toStringList();
    if(_projIns.count() > 0) {
        ui->comboBoxInputProj->addItems(_projIns);
    }
    _projIn = ui->comboBoxInputProj->currentText();

    _projOuts = settings.value("savedProjOutsGTFS", QStringList()).toStringList();
    if(_projOuts.count() > 0) {
        ui->comboBoxOutputProj->addItems(_projOuts);
    }
    _projOut = ui->comboBoxOutputProj->currentText();

    connect(ui->buttonBox, SIGNAL(accepted()), this, SLOT(onAccepted()));
    connect(ui->comboBoxInputProj,  SIGNAL(editTextChanged(QString)), this, SLOT(projInEdited(QString)));
    connect(ui->comboBoxOutputProj, SIGNAL(editTextChanged(QString)), this, SLOT(projOutEdited(QString)));
    connect(ui->snapToShapeCheckBox, SIGNAL(stateChanged(int)), this, SLOT(snapToShapeChanged()));

    projInEdited(_projIn);
    projOutEdited(_projOut);
}
Example #13
0
QueryEditor::QueryEditor(QWidget* parent, Qt::WindowFlags fl)
    : QDialog(parent, fl)
{
  setupUi(this);

  // signals and slots connections
  connect(_metasql, SIGNAL(toggled(bool)), this, SLOT(mqlToggled(bool)));
  connect(_mqlGroup, SIGNAL(editTextChanged(QString)), this, SLOT(groupEditTextChanged(QString)));
  connect(_mqlName, SIGNAL(editTextChanged(QString)), this, SLOT(nameEditTextChanged(QString)));

  XSqlQuery xqry;
  if(xqry.exec("SELECT distinct metasql_group FROM metasql ORDER BY metasql_group;"))
  {
    _mqlGroup->clear();
    while(xqry.next())
      _mqlGroup->addItem(xqry.value(0).toString());
  }
}
Example #14
0
//-----------------------------------------------------------------------------
void ctkPathLineEditPrivate::init()
{
  Q_Q(ctkPathLineEdit);
  this->ComboBox = new QComboBox(q);
  QHBoxLayout* layout = new QHBoxLayout(q);
  layout->addWidget(this->ComboBox);
  layout->setContentsMargins(0,0,0,0);

  this->ComboBox->setEditable(true);
  q->setSizePolicy(QSizePolicy(
                     QSizePolicy::Expanding, QSizePolicy::Fixed,
                     QSizePolicy::LineEdit));

  QObject::connect(this->ComboBox,SIGNAL(editTextChanged(QString)),
                   q, SLOT(setCurrentDirectory(QString)));
  QObject::connect(this->ComboBox,SIGNAL(editTextChanged(QString)),
                   q, SLOT(updateHasValidInput()));
}
Example #15
0
// slot para o signal "textChanged" do "lineEdit" deste "form";
// - capturar aqui qualquer mudança de texto do lineEdit:
void Form1::on_lineEdit_textChanged(const QString&text)
{
	// emite um signal, que disponibiliza o texto do "lineEdit"
	// para o mundo externo à classe:
	emit editTextChanged( text );
	// neste exemplo, este signal será conectado a um slot de "Form2";
	// e, nesse slot, o "Form2" irá adicionar esse texto a sua "comboBox"
	// (ver "form2.h/form2.cpp")
}
AnalogDigitalComboBox::AnalogDigitalComboBox(QWidget *parent) : QComboBox(parent)
{
    // Fill on creation
    this->insertItem(0, "Analog (pot)", 0);
    this->insertItem(1, "Digital (switch)",1);

    // Connect to my custom signal
    connect(this, SIGNAL(editTextChanged(QString)), this, SLOT(AnalogDigitalChangedSlot(QString)));
    connect(this, SIGNAL(currentIndexChanged(QString)), this, SLOT(AnalogDigitalChangedSlot(QString)));
}
DatabaseOpenWidget::DatabaseOpenWidget(QWidget* parent)
    : DialogyWidget(parent)
    , m_ui(new Ui::DatabaseOpenWidget())
    , m_db(nullptr)
{
    m_ui->setupUi(this);

    m_ui->messageWidget->setHidden(true);

    QFont font = m_ui->labelHeadline->font();
    font.setBold(true);
    font.setPointSize(font.pointSize() + 2);
    m_ui->labelHeadline->setFont(font);

    m_ui->buttonTogglePassword->setIcon(filePath()->onOffIcon("actions", "password-show"));
    connect(m_ui->buttonTogglePassword, SIGNAL(toggled(bool)), m_ui->editPassword, SLOT(setShowPassword(bool)));
    connect(m_ui->buttonBrowseFile, SIGNAL(clicked()), SLOT(browseKeyFile()));

    connect(m_ui->editPassword, SIGNAL(textChanged(QString)), SLOT(activatePassword()));
    connect(m_ui->comboKeyFile, SIGNAL(editTextChanged(QString)), SLOT(activateKeyFile()));

    connect(m_ui->buttonBox, SIGNAL(accepted()), SLOT(openDatabase()));
    connect(m_ui->buttonBox, SIGNAL(rejected()), SLOT(reject()));

#ifdef WITH_XC_YUBIKEY
    m_ui->yubikeyProgress->setVisible(false);
    QSizePolicy sp = m_ui->yubikeyProgress->sizePolicy();
    sp.setRetainSizeWhenHidden(true);
    m_ui->yubikeyProgress->setSizePolicy(sp);

    connect(m_ui->buttonRedetectYubikey, SIGNAL(clicked()), SLOT(pollYubikey()));
    connect(m_ui->comboChallengeResponse, SIGNAL(activated(int)), SLOT(activateChallengeResponse()));
#else
    m_ui->checkChallengeResponse->setVisible(false);
    m_ui->buttonRedetectYubikey->setVisible(false);
    m_ui->comboChallengeResponse->setVisible(false);
    m_ui->yubikeyProgress->setVisible(false);
#endif

#ifdef Q_OS_MACOS
    // add random padding to layouts to align widgets properly
    m_ui->dialogButtonsLayout->setContentsMargins(10, 0, 15, 0);
    m_ui->gridLayout->setContentsMargins(10, 0, 0, 0);
    m_ui->labelLayout->setContentsMargins(10, 0, 10, 0);
#endif

#ifndef WITH_XC_TOUCHID
    m_ui->checkTouchID->setVisible(false);
#else
    if (!TouchID::getInstance().isAvailable()) {
        m_ui->checkTouchID->setVisible(false);
    }
#endif
}
Example #18
0
void Delegate::setEditorData(QWidget *editor, const QModelIndex &index) const
{
    /*int value = index.model()->data(index, Qt::EditRole).toInt();
    QSpinBox *spinBox = static_cast<QSpinBox*>(editor);
    spinBox->setValue(value);*/
    QString value = index.model()->data(index, Qt::DisplayRole).toString();
    QComboBox *cmbBox = static_cast<QComboBox*>(editor);
    cmbBox->setCurrentIndex(cmbBox->findText(value, Qt::MatchCaseSensitive));
    temp_editor = cmbBox;
    //connect(cmbBox, SIGNAL(valueChanged(int)), this, SLOT(indexChanged(int)));
    connect(cmbBox, SIGNAL(currentIndexChanged(int)), this, SLOT(indexChanged(int)));
    connect(cmbBox, SIGNAL(editTextChanged(QString)), this, SLOT(editTextChangedSlot(QString)));
}
Example #19
0
JumpToDialog::JumpToDialog(void)
{
    int i = 0;
    
    setupUi(this);
    
    GlFuncValidator *v = new GlFuncValidator(cbFunctions);
    cbFunctions->setValidator(v);
    while (glFunctions[i].fname != NULL) {
        cbFunctions->addItem(glFunctions[i].fname);
        i++;
    }
    connect(cbFunctions, SIGNAL(editTextChanged(QString)), this, SLOT(checkValidity()));
}
Example #20
0
GComboBox::GComboBox(QWidget *parent,VM *pVM)  : QComboBox(parent)
{
	this->pVM = pVM;
	strcpy(this->cactivatedEvent,"");
	strcpy(this->ccurrentIndexChangedEvent,"");
	strcpy(this->ceditTextChangedEvent,"");
	strcpy(this->chighlightedEvent,"");

	QObject::connect(this, SIGNAL(activated(int)),this, SLOT(activatedSlot()));
	QObject::connect(this, SIGNAL(currentIndexChanged(int)),this, SLOT(currentIndexChangedSlot()));
	QObject::connect(this, SIGNAL(editTextChanged(QString)),this, SLOT(editTextChangedSlot()));
	QObject::connect(this, SIGNAL(highlighted(int)),this, SLOT(highlightedSlot()));

}
Example #21
0
//! Connects the signals of widgets in the main layout to the appropriate slots.
//! @see createMainLayout()
void Window::mainLayoutCreateConnections() const
{
	connect(comboInfile, SIGNAL(editTextChanged(QString)), this,
			SLOT(updateDisplay()));
	connect(comboOutfile, SIGNAL(editTextChanged(QString)), this,
			SLOT(updateDisplay()));
	connect(spinColumns, SIGNAL(valueChanged(int)), this,
			SLOT(updateColumnList()));
	connect(spinColumns, SIGNAL(valueChanged(int)), this,
			SLOT(updateDisplay()));
	connect(buttonBrowseInput, SIGNAL(clicked()), this,
			SLOT(openFileDialog()));
	connect(buttonBrowseOutput, SIGNAL(clicked()), this,
			SLOT(saveFileDialog()));
	connect(buttonProcessData, SIGNAL(clicked()), this,
			SLOT(dataToCsv()));
	connect(comboRowLimit, SIGNAL(editTextChanged(const QString&)), this,
			SLOT(filterLimitRowsName(const QString&)));
	connect(comboRowLimit, SIGNAL(editTextChanged(const QString&)), this,
			SLOT(updateDisplay()));
	connect(statusBarMessage, SIGNAL(linkActivated(QString)), this,
			SLOT(openSystemWebBrowser(QString)));
}
Example #22
0
/* TODO: rename _nonxTupleDB to _isxTupleDB internally and
         set it based on db contents, not command line parameter input
 */
login2::login2(QWidget* parent, const char* name, bool modal, Qt::WFlags fl)
    : QDialog(parent, modal ? (fl | Qt::Dialog) : fl)
{
  setObjectName(name);
  Q_INIT_RESOURCE(xTupleCommon);
  setupUi(this);

  //_options = _buttonBox->addButton(tr("Options..."), QDialogButtonBox::ActionRole);
  _recent = _buttonBox->addButton(tr("Recent"), QDialogButtonBox::ActionRole);
  //_options->setEnabled(false);
  _recent->setEnabled(false);
  _buttonBox->button(QDialogButtonBox::Ok)->setText(tr("Login"));

  connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sLogin()));
  connect(_buttonBox, SIGNAL(helpRequested()), this, SLOT(sOpenHelp()));
  //connect(_options, SIGNAL(clicked()), this, SLOT(sOptions()));
  connect(_server, SIGNAL(editingFinished()), this, SLOT(sChangeURL()));
  connect(_database, SIGNAL(editTextChanged(QString)), this, SLOT(sChangeURL()));
  connect(_port, SIGNAL(editingFinished()), this, SLOT(sChangeURL()));
  //connect(_otherOption, SIGNAL(toggled(bool)), _options, SLOT(setEnabled(bool)));
  //connect(_otherOption, SIGNAL(toggled(bool)), _recent, SLOT(setEnabled(bool)));
  //connect(_otherOption, SIGNAL(toggled(bool)), this, SLOT(sHandleButton()));

  _splash = 0;

  _captive = false; _nonxTupleDB = false;
  _multipleConnections = false;
  _setSearchPath = false;
  _cloudDatabaseURL= "pgsql://%1.xtuplecloud.com:5432/%1_%2";

  _password->setEchoMode(QLineEdit::Password);

  //updateRecentOptionsActions();
  _databaseURL = xtsettingsValue("/xTuple/_databaseURL", "pgsql://:5432/demo").toString();
  /*
  if(xtsettingsValue("/xTuple/_demoOption", false).toBool())
    _demoOption->setChecked(true);
  else
    _prodOption->setChecked(true);

  if(xtsettingsValue("/xTuple/_cloudOption", false).toBool())
    _cloudOption->setChecked(true);
  else
    _otherOption->setChecked(true);
  _company->setText(xtsettingsValue("/xTuple/cloud_company", "").toString());
  */

  adjustSize();
}
void WidgetConfigTransmission::createConnections()
{
    connect(d_hponic.data(), SIGNAL(transmissionStatusChanged(Transmission::Status)),
            this, SLOT(onTransmissionStatusChanged(Transmission::Status)), Qt::DirectConnection);

    connect(d_hponic.data(), SIGNAL(addressProgramStarted()),
            this, SLOT(onAddressProgramStarted()), Qt::DirectConnection);
    connect(d_hponic.data(), SIGNAL(addressProgramFinished(bool,quint8)),
            this, SLOT(onAddressProgramFinished(bool,quint8)), Qt::DirectConnection);

    connect(ui->cbPort, SIGNAL(editTextChanged(QString)), this, SLOT(onPortChanged(QString)), Qt::DirectConnection);
    connect(ui->sbAddress, SIGNAL(valueChanged(int)), this, SLOT(onAddressChanged(int)), Qt::DirectConnection);
    connect(ui->pbConnect, SIGNAL(clicked(bool)), this, SLOT(startStopTransmission()), Qt::DirectConnection);
    connect(ui->pbProgramAddress, SIGNAL(clicked(bool)), this, SLOT(programAddress()), Qt::DirectConnection);
}
void PropertyWidget_ParEffect::disconnectSignals()
{
	disconnect(peCombo, SIGNAL(activated(int)), this, SLOT(handleParEffectUse()));
	disconnect(dropCapLines, SIGNAL(valueChanged(int)), this, SLOT(handleDropCapLines(int)));
	disconnect(bulletStrEdit, SIGNAL(editTextChanged(QString)), this, SLOT(handleBulletStr(QString)));
	disconnect(numComboBox, SIGNAL(activated(QString)), this, SLOT(handleNumName(QString)));
	disconnect(numLevelSpin, SIGNAL(valueChanged(int)), this, SLOT(handleNumLevel(int)));
	disconnect(numFormatCombo, SIGNAL(activated(int)), this, SLOT(handleNumFormat(int)));
	disconnect(numPrefix, SIGNAL(textChanged(QString)), this, SLOT(handleNumPrefix(QString)));
	disconnect(numSuffix, SIGNAL(textChanged(QString)), this, SLOT(handleNumSuffix(QString)));
	disconnect(numStart, SIGNAL(valueChanged(int)), this, SLOT(handleNumStart(int)));
	disconnect(peOffset, SIGNAL(valueChanged(double)), this, SLOT(handlePEOffset(double)));
	disconnect(peIndent, SIGNAL(toggled(bool)), this, SLOT(handlePEIndent(bool)));
	disconnect(peCharStyleCombo, SIGNAL(newStyle(QString)), this, SLOT(handlePECharStyle(QString)));
}
Example #25
0
EditDialog::EditDialog(QWidget* parent)
    : QDialog(parent),
      ui(new Ui::EditDialog),
      currentIndex(QModelIndex()),
      dataSource(TextBuffer),
      dataType(Null),
      isReadOnly(true)
{
    ui->setupUi(this);

    // Add Ctrl-Enter (Cmd-Enter on OSX) as a shortcut for the Apply button
    ui->buttonApply->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_Return));
    ui->buttonApply->setToolTip(ui->buttonApply->toolTip() + " [" + ui->buttonApply->shortcut().toString(QKeySequence::NativeText) + "]");

    QHBoxLayout* hexLayout = new QHBoxLayout(ui->editorBinary);
    hexEdit = new QHexEdit(this);
    hexLayout->addWidget(hexEdit);
    hexEdit->setOverwriteMode(false);

    QHBoxLayout* sciLayout = new QHBoxLayout(ui->editorSci);
    sciEdit = new DockTextEdit(this);
    sciLayout->addWidget(sciEdit);

    QShortcut* ins = new QShortcut(QKeySequence(Qt::Key_Insert), this);
    connect(ins, SIGNAL(activated()), this, SLOT(toggleOverwriteMode()));

    connect(ui->editorText, SIGNAL(textChanged()), this, SLOT(updateApplyButton()));
    connect(hexEdit, SIGNAL(dataChanged()), this, SLOT(updateApplyButton()));

    connect(sciEdit, SIGNAL(textChanged()), this, SLOT(updateApplyButton()));
    connect(sciEdit, SIGNAL(textChanged()), this, SLOT(editTextChanged()));

    // Create shortcuts for the widgets that doesn't have its own print action or printing mechanism.
    QShortcut* shortcutPrintText = new QShortcut(QKeySequence::Print, ui->editorText, nullptr, nullptr, Qt::WidgetShortcut);
    connect(shortcutPrintText, &QShortcut::activated, this, &EditDialog::openPrintDialog);

    // Add actions to editors that have a context menu based on actions. This also activates the shortcuts.
    ui->editorImage->addAction(ui->actionPrintImage);
    ui->editorBinary->addAction(ui->actionPrint);
    ui->editorBinary->addAction(ui->actionCopyHexAscii);

    mustIndentAndCompact = Settings::getValue("databrowser", "indent_compact").toBool();
    ui->buttonIndent->setChecked(mustIndentAndCompact);

    ui->buttonAutoSwitchMode->setChecked(Settings::getValue("databrowser", "auto_switch_mode").toBool());

    reloadSettings();
}
Example #26
0
DepthComboBox::DepthComboBox( QWidget * parent)
    : QComboBox(parent)
{
    // Add the bedrock and specify depth items
    addItem(tr("Specify depth..."));
    addItem(tr("Bedrock"));

    // Set the insert policy to that "specify depth..." is over-written
    setInsertPolicy(InsertAtCurrent);
    
    setValidator(new QDoubleValidator(this));
    setCurrentIndex(-1);

    connect( this, SIGNAL(currentIndexChanged(int)), SLOT(updateEditable(int)));
    connect( this, SIGNAL(editTextChanged(QString)), SLOT(toDouble(QString)));
}
Example #27
0
CSVAtlasWindow::CSVAtlasWindow(QWidget *parent) : QMainWindow(parent)
{
    setupUi(this);

    _atlas       = new CSVAtlas();
    _currentDir  = QString::null;
    _filename    = QString::null;
    _msghandler  = new InteractiveMessageHandler(this);
    _selectedMap = QString::null;

    sMapChanged(0);

    MetaSQLHighlighter *tmp = new MetaSQLHighlighter(_preSql);
    tmp = new MetaSQLHighlighter(_postSql);
    connect(_delimiter, SIGNAL(editTextChanged(QString)), this, SIGNAL(delimiterChanged(QString)));
}
Example #28
0
MainWindow::MainWindow(QWidget *parent) :
	QMainWindow(parent),
	ui(new Ui::MainWindow)
{
	ui->setupUi(this);

	device = NULL;

	connect(ui->portCombo, SIGNAL(currentIndexChanged(QString)), this, SLOT(serialPortPathChangeSlot(QString)));
	connect(ui->portCombo, SIGNAL(editTextChanged(QString)), this, SLOT(serialPortPathChangeSlot(QString)));
	connect(ui->portOpenButton, SIGNAL(clicked()), this, SLOT(openPortSlot()));
	connect(ui->accelAutoRotateCheck, SIGNAL(toggled(bool)), this, SLOT(enableAutoRotateSlot(bool)));
	connect(ui->tabWidget, SIGNAL(currentChanged(int)), this, SLOT(visibleTabChangedSlot(int)));

	populatePortPathCombo();
}
Example #29
0
JumpToDialog::JumpToDialog(QString i_qInitName)
{
    int i = 0;
    
    setupUi(this);
    
    GlFuncValidator *v = new GlFuncValidator(cbFunctions);
    cbFunctions->setValidator(v);
    while (glFunctions[i].fname != NULL) {
        cbFunctions->addItem(glFunctions[i].fname);
        if (i_qInitName.compare(glFunctions[i].fname) == 0) {
            cbFunctions->setCurrentIndex(i);
        }
        i++;
    }
    connect(cbFunctions, SIGNAL(editTextChanged(QString)), this, SLOT(checkValidity()));
}
Example #30
0
PixmapPreviewSelector::PixmapPreviewSelector( QWidget * parent )
  : QWidget( parent )
{
    QHBoxLayout * mainlay = new QHBoxLayout( this );
    mainlay->setMargin( 0 );
    m_comboItems = new KComboBox( this );
    mainlay->addWidget( m_comboItems );
    m_iconLabel = new QLabel( this );
    mainlay->addWidget( m_iconLabel );
    m_iconLabel->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed );
    m_iconLabel->setAlignment( Qt::AlignCenter );
    m_iconLabel->setFrameStyle( QFrame::StyledPanel );
    setPreviewSize( 32 );

    connect( m_comboItems, SIGNAL(currentIndexChanged(QString)), this, SLOT(iconComboChanged(QString)) );
    connect( m_comboItems, SIGNAL(editTextChanged(QString)), this, SLOT(iconComboChanged(QString)) );
}