コード例 #1
0
void QwtPlot::updateTabOrder()
{
    if ( d_data->canvas->focusPolicy() == Qt::NoFocus )
        return;
    if ( d_data->legend.isNull()
        || d_data->layout->legendPosition() == ExternalLegend
        || d_data->legend->legendItems().count() == 0 )
    {
        return;
    }

    // Depending on the position of the legend the
    // tab order will be changed that the canvas is
    // next to the last legend item, or before
    // the first one.

    const bool canvasFirst =
        d_data->layout->legendPosition() == QwtPlot::BottomLegend ||
        d_data->layout->legendPosition() == QwtPlot::RightLegend;

    QWidget *previous = NULL;

    QWidget *w = d_data->canvas;
    while ( ( w = w->nextInFocusChain() ) != d_data->canvas )
    {
        bool isLegendItem = false;
        if ( w->focusPolicy() != Qt::NoFocus
            && w->parent() && w->parent() == d_data->legend->contentsWidget() )
        {
            isLegendItem = true;
        }

        if ( canvasFirst )
        {
            if ( isLegendItem )
                break;

            previous = w;
        }
        else
        {
            if ( isLegendItem )
                previous = w;
            else
            {
                if ( previous )
                    break;
            }
        }
    }

    if ( previous && previous != d_data->canvas )
        setTabOrder( previous, d_data->canvas );
}
コード例 #2
0
ファイル: CGUICheckBox.cpp プロジェクト: Badcreature/sagcg
//! constructor
CGUICheckBox::CGUICheckBox(bool checked, IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect<s32> rectangle)
: IGUICheckBox(environment, parent, id, rectangle), checkTime(0), Pressed(false), Checked(checked)
{
	#ifdef _DEBUG
	setDebugName("CGUICheckBox");
	#endif

	// this element can be tabbed into
	setTabStop(true);
	setTabOrder(-1);
}
コード例 #3
0
	//! constructor
	CGUIWindow::CGUIWindow(IGUIEnvironment* environment, IGUIElement* parent, SINT32 id, rect<SINT32> rectangle)
		: IGUIWindow(environment, parent, id, rectangle), Dragging(false), IsDraggable(true), DrawBackground(true), DrawTitlebar(true), IsActive(false)
	{
#ifdef _DEBUG
		setDebugName("CGUIWindow");
#endif

		IGUISkin* skin = 0;
		if (environment)
			skin = environment->getSkin();

		CurrentIconColor = ColourValue::getColourValue(255, 255, 255, 255);

		SINT32 buttonw = 15;
		if (skin)
		{
			buttonw = skin->getSize(EGDS_WINDOW_BUTTON_WIDTH);
		}
		SINT32 posx = RelativeRect.getWidth() - buttonw - 4;

		CloseButton = Environment->addButton(rect<SINT32>(posx, 3, posx + buttonw, 3 + buttonw), this, -1,
			L"", skin ? skin->getDefaultText(EGDT_WINDOW_CLOSE) : L"Close");
		CloseButton->setSubElement(true);
		CloseButton->setTabStop(false);
		CloseButton->setAlignment(EGUIA_LOWERRIGHT, EGUIA_LOWERRIGHT, EGUIA_UPPERLEFT, EGUIA_UPPERLEFT);
		posx -= buttonw + 2;

		RestoreButton = Environment->addButton(rect<SINT32>(posx, 3, posx + buttonw, 3 + buttonw), this, -1,
			L"", skin ? skin->getDefaultText(EGDT_WINDOW_RESTORE) : L"Restore");
		RestoreButton->setVisible(false);
		RestoreButton->setSubElement(true);
		RestoreButton->setTabStop(false);
		RestoreButton->setAlignment(EGUIA_LOWERRIGHT, EGUIA_LOWERRIGHT, EGUIA_UPPERLEFT, EGUIA_UPPERLEFT);
		posx -= buttonw + 2;

		MinButton = Environment->addButton(rect<SINT32>(posx, 3, posx + buttonw, 3 + buttonw), this, -1,
			L"", skin ? skin->getDefaultText(EGDT_WINDOW_MINIMIZE) : L"Minimize");
		MinButton->setVisible(false);
		MinButton->setSubElement(true);
		MinButton->setTabStop(false);
		MinButton->setAlignment(EGUIA_LOWERRIGHT, EGUIA_LOWERRIGHT, EGUIA_UPPERLEFT, EGUIA_UPPERLEFT);

		MinButton->grab();
		RestoreButton->grab();
		CloseButton->grab();

		// this element is a tab group
		setTabGroup(true);
		setTabStop(true);
		setTabOrder(-1);

		refreshSprites();
		updateClientRect();
	}
コード例 #4
0
ファイル: webbrowser.cpp プロジェクト: keinkurt/rssguard
WebBrowser::WebBrowser(QWidget *parent) : TabContent(parent),
  m_layout(new QVBoxLayout(this)),
  m_toolBar(new QToolBar(tr("Navigation panel"), this)),
  m_webView(new WebViewer(this)),
  m_txtLocation(new LocationLineEdit(this)),
  m_btnDiscoverFeeds(new DiscoverFeedsButton(this)),
  m_actionBack(m_webView->pageAction(QWebEnginePage::Back)),
  m_actionForward(m_webView->pageAction(QWebEnginePage::Forward)),
  m_actionReload(m_webView->pageAction(QWebEnginePage::Reload)),
  m_actionStop(m_webView->pageAction(QWebEnginePage::Stop)) {

  // Initialize the components and layout.
  initializeLayout();

  setTabOrder(m_txtLocation, m_toolBar);
  setTabOrder(m_toolBar, m_webView);

  createConnections();
  reloadFontSettings();
}
コード例 #5
0
void KPasswordDialog::setKnownLogins(const QMap<QString, QString> &knownLogins)
{
    const int nr = knownLogins.count();
    if (nr == 0) {
        return;
    }

    if (nr == 1) {
        d->ui.userEdit->setText(knownLogins.begin().key());
        setPassword(knownLogins.begin().value());
        return;
    }

    Q_ASSERT(!d->ui.userEdit->isReadOnly());
    if (!d->userEditCombo) {
        int row = -1;
        QFormLayout::ItemRole userEditRole = QFormLayout::FieldRole;

        d->ui.formLayout->getWidgetPosition(d->ui.userEdit, &row, &userEditRole);
        d->ui.formLayout->removeWidget(d->ui.userEdit);
        delete d->ui.userEdit;
        d->userEditCombo = new QComboBox(d->ui.credentialsGroup);
        d->userEditCombo->setEditable(true);
        d->ui.userEdit = d->userEditCombo->lineEdit();
        d->ui.userNameLabel->setBuddy(d->userEditCombo);
        d->ui.formLayout->setWidget(row > -1 ? row : 0, userEditRole, d->userEditCombo);

        setTabOrder(d->ui.userEdit, d->ui.anonymousRadioButton);
        setTabOrder(d->ui.anonymousRadioButton, d->ui.domainEdit);
        setTabOrder(d->ui.domainEdit, d->ui.passEdit);
        setTabOrder(d->ui.passEdit, d->ui.keepCheckBox);
        connect(d->ui.userEdit, SIGNAL(returnPressed()), d->ui.passEdit, SLOT(setFocus()));
    }

    d->knownLogins = knownLogins;
    d->userEditCombo->addItems(knownLogins.keys());
    d->userEditCombo->setFocus();

    connect(d->userEditCombo, SIGNAL(activated(QString)),
            this, SLOT(activated(QString)));
}
コード例 #6
0
ファイル: query.cpp プロジェクト: pvanek/scribus-cuba-1.5.0
Query::Query( QWidget* parent,  const char* name, bool modal, Qt::WFlags fl, QString text, QString titel )
		: QDialog( parent )
{
	setWindowTitle( titel );
	setWindowIcon(loadIcon("AppIcon.png"));
	setModal(modal);
	queryLayout = new QVBoxLayout( this );
	queryLayout->setMargin(5);
	queryLayout->setSpacing(10);
	editLayout = new QHBoxLayout;
	editLayout->setSpacing( 5 );
	editLayout->setMargin( 0 );
	answerEdit = new QLineEdit( this );
	questionLabel = new QLabel( text, this );
	questionLabel->setBuddy(answerEdit);
	questionLabel->adjustSize();
	editLayout->addWidget( questionLabel );
	editLayout->addWidget( answerEdit );
	queryLayout->addLayout( editLayout );
	okCancelLayout = new QHBoxLayout;
	okCancelLayout->setSpacing( 5 );
	okCancelLayout->setMargin( 0 );
	QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
	okCancelLayout->addItem( spacer );
	okButton = new QPushButton( CommonStrings::tr_OK, this);
	okButton->setDefault( true );
	okCancelLayout->addWidget( okButton );
	cancelButton = new QPushButton( CommonStrings::tr_Cancel, this );
	okCancelLayout->addWidget( cancelButton );
	queryLayout->addLayout( okCancelLayout );
	setMaximumSize(sizeHint());
	answerEdit->setFocus();

	// signals and slots connections
	connect( okButton, SIGNAL( clicked() ), this, SLOT( Leave() ) );
	connect( cancelButton, SIGNAL( clicked() ), this, SLOT( reject() ) );

	// tab order
	setTabOrder( answerEdit, okButton );
	setTabOrder( okButton, cancelButton );
}
コード例 #7
0
void UIMachineSettingsGeneral::setOrderAfter (QWidget *aWidget)
{
    /* Basic tab-order */
    setTabOrder (aWidget, mTwGeneral->focusProxy());
    setTabOrder (mTwGeneral->focusProxy(), m_pNameAndSystemEditor);

    /* Advanced tab-order */
    setTabOrder (m_pNameAndSystemEditor, mPsSnapshot);
    setTabOrder (mPsSnapshot, mCbClipboard);
    setTabOrder (mCbClipboard, mCbDragAndDrop);
    setTabOrder (mCbDragAndDrop, mCbSaveMounted);
    setTabOrder (mCbSaveMounted, mCbShowToolBar);
    setTabOrder (mCbShowToolBar, mCbToolBarAlignment);

    /* Description tab-order */
    setTabOrder (mCbToolBarAlignment, mTeDescription);
}
コード例 #8
0
CDlgSetMashen::CDlgSetMashen(QWidget * parent,QWidget *pMain):QDialog(parent)
{
    setupUi(this);
    pMainForm = pMain;
    QComboBox *cmb[DLG_SET_MASHEN_COMBOBOX_NUM];
    cmb[0] = m_cmbb_ap;
    cmb[1] =m_cmbb_speed;


    //增加选择项
     QStringList items;
     items<<"±10μv"<<"±20μv"<<"±40μv"
         <<"±80μv"<<"±100μv"<<"±150μv"<<"±200μv";
    cmb[0]->addItems(items);
    items.clear();
    items<<"6.25mm/s"<<"12.5mm/s"<<"25mm/s";
    cmb[1]->addItems(items);

    for(int i=0;i< DLG_SET_MASHEN_COMBOBOX_NUM;i++)
    {
        cmb[i]->installEventFilter(this);
        //设置光标顺序
        if(i == (DLG_SET_MASHEN_COMBOBOX_NUM-1))
            break;
        setTabOrder(cmb[i],cmb[i+1]);
    }
    setTabOrder(cmb[DLG_SET_MASHEN_COMBOBOX_NUM-1],m_btn_ok);
    setTabOrder(m_btn_ok,m_btn_cancel);
    setTabOrder(m_btn_cancel,cmb[0]);
    cmb[0]->setFocus();
    stAnaesDepModuCfg cfg;
    g_AnaesModule->f_get_cfg(&cfg);
    m_cmbb_ap->setCurrentIndex(cfg.m_wave_amp);
    m_cmbb_speed->setCurrentIndex(cfg.m_wave_speed);
    iCursor = 0;
    bCursorSta = false;
    m_btn_ok->installEventFilter(this);
    m_btn_cancel->installEventFilter(this);
     connect(m_btn_ok,SIGNAL(clicked()),this,SLOT(do_ok_clicked()));
     connect(m_btn_cancel,SIGNAL(clicked()),this,SLOT(do_cancel_clicked()));
}
コード例 #9
0
ファイル: popularurls.cpp プロジェクト: aremai/krusader
// ===================================== PopularUrlsDlg ======================================
PopularUrlsDlg::PopularUrlsDlg():
        QDialog(krMainWindow)
{
    setWindowTitle(i18n("Popular URLs"));
    setWindowModality(Qt::WindowModal);

    QVBoxLayout *mainLayout = new QVBoxLayout;
    setLayout(mainLayout);

    QGridLayout *layout = new QGridLayout;
    layout->setContentsMargins(0, 0, 0, 0);

    // listview to contain the urls
    urls = new KrTreeWidget(this);
    urls->header()->hide();
    urls->setSortingEnabled(false);
    urls->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);

    // quick search
    search = new KTreeWidgetSearchLine(this, urls);
    QLabel *lbl = new QLabel(i18n("&Search:"), this);
    lbl->setBuddy(search);

    layout->addWidget(lbl, 0, 0);
    layout->addWidget(search, 0, 1);
    layout->addWidget(urls, 1, 0, 1, 2);

    mainLayout->addLayout(layout);

    QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Close);
    mainLayout->addWidget(buttonBox);

    setTabOrder(search, urls);
    setTabOrder((QWidget *)urls, buttonBox->button(QDialogButtonBox::Close));

    connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
    connect(urls, SIGNAL(activated(const QModelIndex &)),
            this, SLOT(slotItemSelected(const QModelIndex &)));
    connect(search, SIGNAL(hiddenChanged(QTreeWidgetItem *, bool)),
            this, SLOT(slotVisibilityChanged()));
}
コード例 #10
0
ファイル: DatabaseConfig.cpp プロジェクト: ErrAza/amarok
DatabaseConfig::DatabaseConfig( QWidget* parent )
    : ConfigDialogBase( parent )
{
    setupUi( this );

    // Fix some weird tab orderness
    setTabOrder( kcfg_Host,     kcfg_Port );        // host to port
    setTabOrder( kcfg_Port,     kcfg_User );        // port to username
    setTabOrder( kcfg_User,     kcfg_Password );    // username to password
    setTabOrder( kcfg_Password, kcfg_Database );    // password to database

    connect( kcfg_UseServer, SIGNAL( stateChanged(int) ), SLOT( toggleExternalConfigAvailable(int) ) );

    connect( kcfg_Database, SIGNAL( textChanged(const QString &) ), SLOT( updateSQLQuery() ) );
    connect( kcfg_User,     SIGNAL( textChanged(const QString &) ), SLOT( updateSQLQuery() ) );
    connect( kcfg_Host,     SIGNAL( textChanged(const QString &) ), SLOT( updateSQLQuery() ) );

    toggleExternalConfigAvailable( kcfg_UseServer->checkState() );

    updateSQLQuery();
}
コード例 #11
0
ファイル: newdatabasedlg.cpp プロジェクト: seanet7or/mosaicit
NewDatabaseDlg::NewDatabaseDlg(QWidget *parent) :
        QDialog(parent),
        ui(new Ui::NewDatabaseDlg)
{
    ui->setupUi(this);

    setTabOrder(ui->nameEdit, ui->selectFileButton);
    setTabOrder(ui->selectFileButton, ui->directoryEdit);
    setTabOrder(ui->directoryEdit, ui->selectDirButton);
    setTabOrder(ui->selectDirButton, ui->includeSubdirectories);
    setTabOrder(ui->includeSubdirectories, ui->buildButton);
    setTabOrder(ui->buildButton, ui->cancelButton);

    m_canceled = true;

    connect(ui->buildButton,
            SIGNAL(pressed()),
            this,
            SLOT(buildButtonPressed()));
    connect(ui->selectDirButton,
            SIGNAL(pressed()),
            this,
            SLOT(selectDirButtonPressed()));
    connect(ui->cancelButton,
            SIGNAL(pressed()),
            this,
            SLOT(cancelButtonPressed()));
    connect(ui->selectFileButton,
            SIGNAL(pressed()),
            this,
            SLOT(selectFileButtonPressed()));
    this->readSettings();
}
コード例 #12
0
ファイル: CGUIComboBox.cpp プロジェクト: vgck/irrnacht
//! constructor
CGUIComboBox::CGUIComboBox(IGUIEnvironment* environment, IGUIElement* parent,
	s32 id, core::rect<s32> rectangle)
	: IGUIComboBox(environment, parent, id, rectangle),
	ListButton(0), SelectedText(0), ListBox(0), LastFocus(0),
	Selected(-1), HAlign(EGUIA_UPPERLEFT), VAlign(EGUIA_CENTER), MaxSelectionRows(5), HasFocus(false),
	ActiveFont(0)
{
	#ifdef _DEBUG
	setDebugName("CGUIComboBox");
	#endif

	IGUISkin* skin = Environment->getSkin();

	s32 width = 15;
	if (skin)
		width = skin->getSize(EGDS_WINDOW_BUTTON_WIDTH);

	core::rect<s32> r;
	r.UpperLeftCorner.X = rectangle.getWidth() - width - 2;
	r.LowerRightCorner.X = rectangle.getWidth() - 2;

	r.UpperLeftCorner.Y = 2;
	r.LowerRightCorner.Y = rectangle.getHeight() - 2;

	ListButton = Environment->addButton(r, this, -1, L"");
	if (skin && skin->getSpriteBank())
	{
		ListButton->setSpriteBank(skin->getSpriteBank());
		ListButton->setSprite(EGBS_BUTTON_UP, skin->getIcon(EGDI_CURSOR_DOWN), skin->getColor(EGDC_WINDOW_SYMBOL));
		ListButton->setSprite(EGBS_BUTTON_DOWN, skin->getIcon(EGDI_CURSOR_DOWN), skin->getColor(EGDC_WINDOW_SYMBOL));
	}
	ListButton->setAlignment(EGUIA_LOWERRIGHT, EGUIA_LOWERRIGHT, EGUIA_UPPERLEFT, EGUIA_LOWERRIGHT);
	ListButton->setSubElement(true);
	ListButton->setTabStop(false);

	r.UpperLeftCorner.X = 2;
	r.UpperLeftCorner.Y = 2;
	r.LowerRightCorner.X = RelativeRect.getWidth() - (ListButton->getAbsolutePosition().getWidth() + 2);
	r.LowerRightCorner.Y = RelativeRect.getHeight() - 2;

	SelectedText = Environment->addStaticText(L"", r, false, false, this, -1, false);
	SelectedText->setSubElement(true);
	SelectedText->setAlignment(EGUIA_UPPERLEFT, EGUIA_LOWERRIGHT, EGUIA_UPPERLEFT, EGUIA_LOWERRIGHT);
	SelectedText->setTextAlignment(EGUIA_UPPERLEFT, EGUIA_CENTER);
	if (skin)
		SelectedText->setOverrideColor(skin->getColor(EGDC_BUTTON_TEXT));
	SelectedText->enableOverrideColor(true);

	// this element can be tabbed to
	setTabStop(true);
	setTabOrder(-1);
}
コード例 #13
0
void KPasswordDialog::setKnownLogins( const QMap<QString, QString>& knownLogins )
{
    const int nr = knownLogins.count();
    if ( nr == 0 ) {
        return;
    }

    if ( nr == 1 ) {
        d->ui.userEdit->setText( knownLogins.begin().key() );
        setPassword( knownLogins.begin().value() );
        return;
    }

    Q_ASSERT( !d->ui.userEdit->isReadOnly() );
    if ( !d->userEditCombo ) {
        d->ui.formLayout->removeWidget(d->ui.userEdit);
        delete d->ui.userEdit;
        d->userEditCombo = new QComboBox(this);
        d->userEditCombo->setEditable(true);
        d->ui.userEdit = d->userEditCombo->lineEdit();
//        QSize s = d->userEditCombo->sizeHint();
//        d->ui.userEditCombo->setFixedHeight( s.height() );
//        d->ui.userEditCombo->setMinimumWidth( s.width() );
        d->ui.userNameLabel->setBuddy( d->userEditCombo );
        d->ui.formLayout->setWidget( d->commentRow, QFormLayout::FieldRole, d->userEditCombo );
        setTabOrder( d->ui.userEdit, d->ui.anonymousCheckBox );
        setTabOrder( d->ui.anonymousCheckBox, d->ui.domainEdit );
        setTabOrder( d->ui.domainEdit, d->ui.passEdit );
        setTabOrder( d->ui.passEdit, d->ui.keepCheckBox );
        connect( d->ui.userEdit, SIGNAL(returnPressed()), d->ui.passEdit, SLOT(setFocus()) );
    }

    d->knownLogins = knownLogins;
    d->userEditCombo->addItems( knownLogins.keys() );
    d->userEditCombo->setFocus();

    connect( d->userEditCombo, SIGNAL(activated(QString)),
             this, SLOT(activated(QString)) );
}
コード例 #14
0
QWidget* UIMachineSettingsSerial::setOrderAfter (QWidget *aAfter)
{
    setTabOrder (aAfter, mGbSerial);
    setTabOrder (mGbSerial, mCbNumber);
    setTabOrder (mCbNumber, mLeIRQ);
    setTabOrder (mLeIRQ, mLeIOPort);
    setTabOrder (mLeIOPort, mCbMode);
    setTabOrder (mCbMode, mCbPipe);
    setTabOrder (mCbPipe, mLePath);
    return mLePath;
}
コード例 #15
0
ファイル: snippetdlg.cpp プロジェクト: serghei/kde3-kdepim
/*
 *  Constructs a SnippetDlg as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 *
 *  The dialog will by default be modeless, unless you set 'modal' to
 *  TRUE to construct a modal dialog.
 */
SnippetDlg::SnippetDlg(KActionCollection *ac, QWidget *parent, const char *name, bool modal, WFlags fl)
    : SnippetDlgBase(parent, name, modal, fl), actionCollection(ac)
{
    if(!name)
        setName("SnippetDlg");

    textLabel3 = new QLabel(this, "textLabel3");
    keyButton = new KKeyButton(this);
    connect(keyButton, SIGNAL(capturedShortcut(const KShortcut &)),
            this, SLOT(slotCapturedShortcut(const KShortcut &)));

    layout3->addWidget(textLabel3, 7, 0);
    layout3->addWidget(keyButton, 7, 1);

    // tab order
    setTabOrder(snippetText, keyButton);
    setTabOrder(keyButton, btnAdd);
    setTabOrder(btnAdd, btnCancel);

    textLabel3->setBuddy(keyButton);
    languageChange();
}
コード例 #16
0
ファイル: dlg_alm_co2.cpp プロジェクト: zyzzyva8421/monitor
CDlgAlmCO2::CDlgAlmCO2(QWidget * parent,QWidget *pMain):QDialog(parent)
{
    setupUi(this);
    iCursor = 0;
    bCursorSta = false;
    pMainForm = pMain;
    QComboBox *cmb[DLG_ALM_CO2_COMBOBOX_NUM];
    cmb[0] = m_cmbb_huxilv;
    cmb[1] =m_cmbb_hu;
    cmb[2] =m_cmbb_xi;
    QSpinBox * spb[DLG_ALM_CO2_SPB_NUM];
    spb[0] = m_spb_huxi_high;
    spb[1] = m_spb_huxi_low;
    spb[2] = m_spb_hu_high;
    spb[3] = m_spb_hu_low;
    spb[4] = m_spb_xi_high;
    spb[5] = m_spb_xi_low;

    //增加选择项
     QStringList items;
     items<<"关"<<"开";

    for(int i=0;i< DLG_ALM_CO2_COMBOBOX_NUM;i++)
    {
        cmb[i]->installEventFilter(this);
        cmb[i]->addItems(items);
        //设置光标顺序
        setTabOrder(cmb[i],spb[i*2]);
        setTabOrder(spb[i*2],spb[i*2+1]);

        if(i == (DLG_ALM_CO2_COMBOBOX_NUM-1))
            break;
        setTabOrder(spb[i*2+1],cmb[i+1]);
    }
     setTabOrder(spb[DLG_ALM_CO2_SPB_NUM-1],m_btn_ok);
     setTabOrder(m_btn_ok,m_btn_cancel);
     setTabOrder(m_btn_cancel,cmb[0]);
    cmb[0]->setFocus();
    stCO2ModuCfg cfg;
    g_CO2Module->f_get_cfg(&cfg);
     m_cmbb_huxilv->setCurrentIndex(cfg.m_alarm_breathrate_en);
     m_spb_huxi_high->setValue(cfg.m_alarm_breathrate_high);
     m_spb_huxi_low->setValue(cfg.m_alarm_breathrate_low);
     m_cmbb_hu->setCurrentIndex(cfg.m_alarm_humo_en);
     m_spb_hu_high->setValue(cfg.m_alarm_humo_high);
     m_spb_hu_low->setValue(cfg.m_alarm_humo_low);
     m_cmbb_xi->setCurrentIndex(cfg.m_alarm_xiru_en);
     m_spb_xi_high->setValue(cfg.m_alarm_xiru_high);
     m_spb_xi_low->setValue(cfg.m_alarm_xiru_low);
     for(int i = 0; i<DLG_ALM_CO2_SPB_NUM;i++)
     {
         spb[i]->installEventFilter(this);
     }
     m_btn_ok->installEventFilter(this);
     m_btn_cancel->installEventFilter(this);
     connect(m_btn_ok,SIGNAL(clicked()),this,SLOT(do_ok_clicked()));
     connect(m_btn_cancel,SIGNAL(clicked()),this,SLOT(do_cancel_clicked()));
}
コード例 #17
0
ChatWindow::ChatWindow(QWidget *parent)
  : QWidget(parent)
{
  QVBoxLayout *lay = new QVBoxLayout(this);
  QSplitter *splitter = new QSplitter(Qt::Vertical, this);
  lay->addWidget(splitter);
  conversationView = new QTextBrowser;
  chatEdit = new QTextEdit;
  splitter->addWidget(conversationView);
  splitter->addWidget(chatEdit);
  chatEdit->installEventFilter(this);
  setWindowTitle(tr("Chat Window"));
  setTabOrder(chatEdit, conversationView);
};
コード例 #18
0
//! constructor
CGUIEditBox::CGUIEditBox(const wchar_t* text, bool border,
        IGUIEnvironment* environment, IGUIElement* parent, s32 id,
        const core::rect<s32>& rectangle, bool is_rtl)
    : IGUIEditBox(environment, parent, id, rectangle), MouseMarking(false),
    Border(border), OverrideColorEnabled(false), MarkBegin(0), MarkEnd(0),
    OverrideColor(video::SColor(101,255,255,255)), OverrideFont(0), LastBreakFont(0),
    Operator(0), BlinkStartTime(0), CursorPos(0), HScrollPos(0), VScrollPos(0), Max(0),
    WordWrap(false), MultiLine(false), AutoScroll(true), PasswordBox(false),
    PasswordChar(L'*'), HAlign(EGUIA_UPPERLEFT), VAlign(EGUIA_CENTER),
    CurrentTextRect(0,0,1,1), FrameRect(rectangle)
{
    //m_rtl = is_rtl;
    m_rtl = false;
    // FIXME quick hack to enable mark movement with keyboard and mouse for rtl language,
    // don't know why it's disabled in the first place, because STK fail
    // to input unicode characters before?

    #ifdef _DEBUG
    setDebugName("CGUIEditBox");
    #endif

    Text = text;

    if (Environment)
        Operator = Environment->getOSOperator();

    if (Operator)
        Operator->grab();

    // this element can be tabbed to
    setTabStop(true);
    setTabOrder(-1);

    IGUISkin *skin = 0;
    if (Environment)
        skin = Environment->getSkin();
    if (Border && skin)
    {
        FrameRect.UpperLeftCorner.X += skin->getSize(EGDS_TEXT_DISTANCE_X)+1;
        FrameRect.UpperLeftCorner.Y += skin->getSize(EGDS_TEXT_DISTANCE_Y)+1;
        FrameRect.LowerRightCorner.X -= skin->getSize(EGDS_TEXT_DISTANCE_X)+1;
        FrameRect.LowerRightCorner.Y -= skin->getSize(EGDS_TEXT_DISTANCE_Y)+1;
    }

    breakText();

    calculateScrollPos();
}
コード例 #19
0
ファイル: shortcutbutton.cpp プロジェクト: m4r71n/CopyQ
void ShortcutButton::addShortcut(const QKeySequence &shortcut)
{
    if ( shortcut.isEmpty() || shortcuts().contains(shortcut) )
        return;

    auto button = new QPushButton(this);
    const int buttonIndex = shortcutCount();
    m_layout->insertWidget(buttonIndex, button, 1);

    setTabOrder(m_buttonAddShortcut, button);

    connect( button, &QAbstractButton::clicked,
             this, &ShortcutButton::onShortcutButtonClicked );
    setButtonShortcut(button, shortcut);
    emit shortcutAdded(shortcut);
}
コード例 #20
0
/*
 *  Constructs a ConfigDialog as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 */
ConfigDialog::ConfigDialog( QWidget* parent, const char* name, WFlags fl )
    : QWidget( parent, name, fl )
{
    if ( !name )
	setName( "ConfigDialog" );
    ConfigDialogLayout = new QHBoxLayout( this, 11, 6, "ConfigDialogLayout"); 

    layout1 = new QGridLayout( 0, 1, 1, 0, 6, "layout1"); 

    titleAlign = new QButtonGroup( this, "titleAlign" );
    titleAlign->setColumnLayout(0, Qt::Vertical );
    titleAlign->layout()->setSpacing( 6 );
    titleAlign->layout()->setMargin( 11 );
    titleAlignLayout = new QHBoxLayout( titleAlign->layout() );
    titleAlignLayout->setAlignment( Qt::AlignTop );

    AlignLeft = new QRadioButton( titleAlign, "AlignLeft" );
    titleAlignLayout->addWidget( AlignLeft );

    AlignHCenter = new QRadioButton( titleAlign, "AlignHCenter" );
    titleAlignLayout->addWidget( AlignHCenter );

    AlignRight = new QRadioButton( titleAlign, "AlignRight" );
    titleAlignLayout->addWidget( AlignRight );

    layout1->addMultiCellWidget( titleAlign, 0, 0, 0, 4 );

    highContrastButtons = new QCheckBox( this, "highContrastButtons" );

    layout1->addMultiCellWidget( highContrastButtons, 3, 3, 0, 2 );

    designatedTitlebarColor = new QCheckBox( this, "designatedTitlebarColor" );

    layout1->addMultiCellWidget( designatedTitlebarColor, 1, 1, 0, 4 );

    bordersBlendColor = new QCheckBox( this, "bordersBlendColor" );

    layout1->addMultiCellWidget( bordersBlendColor, 2, 2, 0, 3 );

    titleShadow = new QCheckBox( this, "titleShadow" );

    layout1->addMultiCellWidget( titleShadow, 4, 4, 0, 4 );
    ConfigDialogLayout->addLayout( layout1 );
    languageChange();
    resize( QSize(541, 194).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // tab order
    setTabOrder( AlignLeft, AlignHCenter );
    setTabOrder( AlignHCenter, AlignRight );
    setTabOrder( AlignRight, designatedTitlebarColor );
    setTabOrder( designatedTitlebarColor, bordersBlendColor );
    setTabOrder( bordersBlendColor, highContrastButtons );
    setTabOrder( highContrastButtons, titleShadow );
}
コード例 #21
0
//! constructor
CGUIButton::CGUIButton(IGUIEnvironment* environment, IGUIElement* parent,
			s32 id, core::rect<s32> rectangle, bool noclip)
: IGUIButton(environment, parent, id, rectangle),
	SpriteBank(0), OverrideFont(0),
	ClickTime(0), HoverTime(0), FocusTime(0),
	IsPushButton(false), Pressed(false),
	UseAlphaChannel(false), DrawBorder(true), ScaleImage(false)
{
	#ifdef _DEBUG
	setDebugName("CGUIButton");
	#endif
	setNotClipped(noclip);

	// This element can be tabbed.
	setTabStop(true);
	setTabOrder(-1);
}
コード例 #22
0
QAdakDate::QAdakDate(QWidget * parent) : QWidget(parent)
{
    line_edit    = new QLineEdit(this);
    line_edit->setObjectName("adak_date_line_edit");
    line_edit->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Fixed);
    line_edit->installEventFilter(this);
    line_edit->setMaxLength(100);
    connect(line_edit,SIGNAL(editingFinished()),this,SLOT(SLOT_SET_DATE()));

    tool_button  = new QToolButton(this);
    tool_button->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed);
    tool_button->setToolButtonStyle(Qt::ToolButtonIconOnly);
    tool_button->setIcon(QIcon(":/kernel_icons/kernel_calendar_ikonu.png"));
    tool_button->setObjectName("adak_date_tool_button");
    tool_button->setMaximumSize(32,line_edit->height() - 9);
    tool_button->setIconSize(QSize(tool_button->width(),line_edit->height() - 9));
    tool_button->setFocusPolicy(Qt::ClickFocus);
    connect(tool_button,SIGNAL(clicked()),this,SLOT(SLOT_POPUP_BUTTON_CLICKED()));

    calendar_widget = new QCalendarWidget(this);
    calendar_widget->setFirstDayOfWeek ( Qt::Monday );
    calendar_widget->setDateRange(MALI_YIL_FIRST_DATE(), MALI_ARRAY_LAST_DATE());
    calendar_widget->setWindowFlags(Qt::Popup);
    calendar_widget->close();
    connect(calendar_widget,SIGNAL(clicked(QDate)),this,SLOT(SLOT_POPUP_DATE_SELECTED(QDate)));

    h_box_layout = new QHBoxLayout(this);
    h_box_layout->setContentsMargins(0,0,0,0);
    h_box_layout->setSpacing(0);
    h_box_layout->addWidget(line_edit);
    h_box_layout->addWidget(tool_button);

    setLayout       (h_box_layout);
    setFocusPolicy  (Qt::StrongFocus);
    setFocusProxy   (line_edit);
    setMaximumHeight(line_edit->height());
    setTabOrder     (line_edit,tool_button);

    m_mali_yil_disable  = false;
    m_date_changed      = false;
    m_current_date      = QDate::currentDate();
    m_old_date          = QDate::currentDate();

    SET_DATE_FORMAT ("dd MMMM yyyy dddd");
    SET_DATE        (QDate::currentDate());
}
コード例 #23
0
ファイル: addcontactbox.cpp プロジェクト: Igevorse/tdesktop
void AddContactBox::prepare() {
	if (_invertOrder) {
		setTabOrder(_last, _first);
	}
	if (_user) {
		setTitle(lang(lng_edit_contact_title));
	} else {
		bool readyToAdd = !_phone->getLastText().isEmpty() && (!_first->getLastText().isEmpty() || !_last->getLastText().isEmpty());
		setTitle(lang(readyToAdd ? lng_confirm_contact_data : lng_enter_contact_data));
	}
	updateButtons();

	connect(_first, SIGNAL(submitted(bool)), this, SLOT(onSubmit()));
	connect(_last, SIGNAL(submitted(bool)), this, SLOT(onSubmit()));
	connect(_phone, SIGNAL(submitted(bool)), this, SLOT(onSubmit()));

	setDimensions(st::boxWideWidth, st::contactPadding.top() + _first->height() + st::contactSkip + _last->height() + st::contactPhoneSkip + _phone->height() + st::contactPadding.bottom() + st::boxPadding.bottom());
}
コード例 #24
0
ファイル: dlg_alm_ecg.cpp プロジェクト: zyzzyva8421/monitor
CDlgAlmECG::CDlgAlmECG(QWidget * parent,QWidget *pMain):QDialog(parent)
{
    setupUi(this);
    iCursor = 0;
    bCursorSta = false;
    pMainForm = pMain;
    QComboBox *cmb[DLG_ALM_ECG_COMBOBOX_NUM];
    cmb[0] = m_cmbb_xinlv;
    cmb[1] =m_cmbb_st;

    QSpinBox * spb[DLG_ALM_ECG_SPB_NUM];
    spb[0] = m_spb_xinlv_high;
    spb[1] = m_spb_xinlv_low;
    spb[2] = m_spb_st_high;
    spb[3] = m_spb_st_low;


    //增加选择项
     QStringList items;
     items<<"关"<<"开";
    for(int i=0;i< DLG_ALM_ECG_COMBOBOX_NUM;i++)
    {
        cmb[i]->installEventFilter(this);
        //设置选择项
         cmb[i]->addItems(items);
        //设置光标顺序
        setTabOrder(cmb[i],spb[i*2]);
        setTabOrder(spb[i*2],spb[i*2+1]);

        if(i == (DLG_ALM_ECG_COMBOBOX_NUM-1))
            break;
        setTabOrder(spb[i*2+1],cmb[i+1]);
    }
    for(int i = 0;i<DLG_ALM_ECG_SPB_NUM;i++)
    {
        spb[i]->installEventFilter(this);
    }
     setTabOrder(spb[DLG_ALM_ECG_SPB_NUM-1],m_btn_ok);
     setTabOrder(m_btn_ok,m_btn_cancel);
     setTabOrder(m_btn_cancel,cmb[0]);
    cmb[0]->setFocus();
    CEcgModuleCfg cfg;
    g_EcgModule->f_get_ecg_cfg(&cfg);
    m_spb_xinlv_high->setValue(cfg.m_alarm_br_high);
    m_spb_xinlv_low->setValue(cfg.m_alarm_br_low);
    m_spb_st_high->setValue(cfg.m_alarm_st_high);
    m_spb_st_low->setValue(cfg.m_alarm_st_low);
    m_btn_ok->installEventFilter(this);
    m_btn_cancel->installEventFilter(this);
     connect(m_btn_ok,SIGNAL(clicked()),this,SLOT(do_ok_clicked()));
     connect(m_btn_cancel,SIGNAL(clicked()),this,SLOT(do_cancel_clicked()));
}
コード例 #25
0
ファイル: introsignup.cpp プロジェクト: GRIM2D/tdesktop
IntroSignup::IntroSignup(IntroWidget *parent) : IntroStage(parent),
	errorAlpha(0), a_photo(0),
	next(this, lang(lng_intro_finish), st::btnIntroNext),
	first(this, st::inpIntroName, lang(lng_signup_firstname)),
	last(this, st::inpIntroName, lang(lng_signup_lastname)),
	_invertOrder(langFirstNameGoesSecond()) {
	setVisible(false);
	setGeometry(parent->innerRect());

	connect(&next, SIGNAL(clicked()), this, SLOT(onSubmitName()));
	connect(&checkRequest, SIGNAL(timeout()), this, SLOT(onCheckRequest()));

	if (_invertOrder) {
		setTabOrder(&last, &first);
	}

	setMouseTracking(true);
}
コード例 #26
0
ファイル: searchwidget.cpp プロジェクト: BinChengfei/cantata
SearchWidget::SearchWidget(QWidget *p)
     : QWidget(p)
     , cat(0)
     , widgetIsActive(false)
{
    QGridLayout *l=new QGridLayout(this);
    int spacing=qMin(2, Utils::layoutSpacing(this));
    #ifdef Q_OS_MAC
    l->setSpacing(2);
    l->setContentsMargins(0, spacing, spacing, spacing);
    bool closeOnLeft=true;
    #else
    l->setSpacing(0);
    l->setContentsMargins(0, spacing, 0, spacing);
    bool closeOnLeft=Utils::Unity==Utils::currentDe();
    #endif
    label=new SqueezedTextLabel(this);
    edit=new LineEdit(this);
    edit->setPlaceholderText(i18n("Search..."));
    closeButton=new ToolButton(this);
    closeButton->setToolTip(i18n("Close Search Bar")+QLatin1String(" (")+QKeySequence(Qt::Key_Escape).toString()+QLatin1Char(')'));

    l->addWidget(label, 0, 0, 1, 3);
    if (closeOnLeft) {
        l->addWidget(closeButton, 1, 1);
        l->addWidget(edit, 1, 2);
    } else {
        l->addWidget(edit, 1, 1);
        l->addWidget(closeButton, 1, 2);
    }

    closeButton->setIcon(Icon::std(Icon::Close));
    Icon::init(closeButton);
    connect(closeButton, SIGNAL(clicked()), this, SLOT(close()));
    connect(edit, SIGNAL(textChanged(QString)), SIGNAL(textChanged(QString)));
    connect(edit, SIGNAL(returnPressed()), SIGNAL(returnPressed()));
    installEventFilter(new EscKeyEventHandler(this));
    label->setVisible(false);
    label->setAlignment(Qt::AlignTop);
    QFont f(font());
    f.setBold(true);
    label->setFont(f);
    setTabOrder(edit, closeButton);
}
コード例 #27
0
ファイル: logform.cpp プロジェクト: dmm/cegis
/*
*  Constructs a logForm as a child of 'parent', with the
*  name 'name' and widget flags set to 'f'.
*
*  The dialog will by default be modeless, unless you set 'modal' to
*  TRUE to construct a modal dialog.
*/
logForm::logForm( QWidget* parent, bool modal, Qt::WFlags fl )
: QDialog( parent, fl )
{
   setModal( modal );
	setObjectName( "logForm" );

   //setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, sizePolicy().hasHeightForWidth() ) );
   setSizePolicy( QSizePolicy::Preferred , QSizePolicy::Preferred );
   setMinimumSize( QSize( 300, 300 ) );
   setMaximumSize( QSize( 600, 600 ) );
   setBaseSize( QSize( 400, 375 ) );
   logFormLayout = new QGridLayout( this ); //, 1, 1, 11, 6, "logFormLayout"); 

   layout3 = new QHBoxLayout( 0 ); 
   layout3->setSpacing( 6 );	
   spacer1 = new QSpacerItem( 210, 21, QSizePolicy::Expanding, QSizePolicy::Minimum );
   layout3->addItem( spacer1 );

   saveButton = new QPushButton( this );
   layout3->addWidget( saveButton );

   okButton = new QPushButton( this );
   layout3->addWidget( okButton );

   logFormLayout->addLayout( layout3, 1, 0 );

   logViewer = new QTextEdit( this );

   logFormLayout->addWidget( logViewer, 0, 0 );
   languageChange();
   resize( QSize(361, 365).expandedTo(minimumSizeHint()) );

   // signals and slots connections
   connect( okButton, SIGNAL( clicked() ), this, SLOT( accept() ) );
   connect( saveButton, SIGNAL( clicked() ), this, SLOT( saveLog() ) );

   // tab order
   setTabOrder( okButton, saveButton );

   if( QFile::exists( logFile ) )
      loadLog();
   else 
      QMessageBox::warning( this, "Error", "MapIMG Log File Not Found." );
}
コード例 #28
0
ファイル: MdsFindDialog.cpp プロジェクト: mr-c/bioapi-linux
/*
 *  Constructs a MdsFindDialog as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 *
 *  The dialog will by default be modeless, unless you set 'modal' to
 *  TRUE to construct a modal dialog.
 */
MdsFindDialog::MdsFindDialog( QWidget* parent, const char* name, bool modal, WFlags fl )
    : QDialog( parent, name, modal, fl )
{
    if ( !name )
	setName( "MdsFindDialog" );
    setIcon( QPixmap::fromMimeSource( "searchfind" ) );

    m_cancelButton = new QPushButton( this, "m_cancelButton" );
    m_cancelButton->setGeometry( QRect( 380, 50, 108, 26 ) );

    m_okButton = new QPushButton( this, "m_okButton" );
    m_okButton->setGeometry( QRect( 380, 10, 108, 26 ) );
    m_okButton->setDefault( TRUE );

    m_scopeFlags = new QGroupBox( this, "m_scopeFlags" );
    m_scopeFlags->setGeometry( QRect( 10, 40, 350, 50 ) );

    m_useAttrName = new QCheckBox( m_scopeFlags, "m_useAttrName" );
    m_useAttrName->setGeometry( QRect( 10, 20, 150, 20 ) );

    m_useAttrValue = new QCheckBox( m_scopeFlags, "m_useAttrValue" );
    m_useAttrValue->setGeometry( QRect( 180, 20, 140, 20 ) );

    m_matchCase = new QCheckBox( this, "m_matchCase" );
    m_matchCase->setGeometry( QRect( 20, 120, 210, 20 ) );

    m_searchString = new QLineEdit( this, "m_searchString" );
    m_searchString->setGeometry( QRect( 70, 10, 290, 22 ) );

    TextLabel1 = new QLabel( this, "TextLabel1" );
    TextLabel1->setGeometry( QRect( 10, 10, 50, 20 ) );

    m_matchWholeString = new QCheckBox( this, "m_matchWholeString" );
    m_matchWholeString->setGeometry( QRect( 20, 100, 210, 20 ) );
    languageChange();
    resize( QSize(500, 148).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( m_okButton, SIGNAL( clicked() ), this, SLOT( accept() ) );
    connect( m_cancelButton, SIGNAL( clicked() ), this, SLOT( reject() ) );
    connect( m_searchString, SIGNAL( returnPressed() ), this, SLOT( accept() ) );

    // tab order
    setTabOrder( m_searchString, m_useAttrName );
    setTabOrder( m_useAttrName, m_useAttrValue );
    setTabOrder( m_useAttrValue, m_matchWholeString );
    setTabOrder( m_matchWholeString, m_matchCase );
    setTabOrder( m_matchCase, m_okButton );
    setTabOrder( m_okButton, m_cancelButton );
}
コード例 #29
0
ファイル: CGUIButton.cpp プロジェクト: Ruw-Van/krkrz
//! constructor
CGUIButton::CGUIButton(IGUIEnvironment* environment, IGUIElement* parent,
                       s32 id, core::rect<s32> rectangle, bool noclip)
    : IGUIButton(environment, parent, id, rectangle), Pressed(false),
      IsPushButton(false), UseAlphaChannel(false), Border(true),
      ClickTime(0), SpriteBank(0), OverrideFont(0), Image(0), PressedImage(0)
{
#ifdef _DEBUG
    setDebugName("CGUIButton");
#endif
    setNotClipped(noclip);

    // Initialize the sprites.
    for (u32 i=0; i<EGBS_COUNT; ++i)
        ButtonSprites[i].Index = -1;

    // This element can be tabbed.
    setTabStop(true);
    setTabOrder(-1);
}
コード例 #30
0
ファイル: qwt_plot.cpp プロジェクト: jiajw0426/easyscada
void QwtPlot::updateTabOrder()
{
    // Depending on the position of the legend the 
    // tab order will be changed that the canvas is
    // next to the last legend item, or directly before
    // the first one. The following code seems much too
    // complicated but is there a better implementation ?

    if ( d_canvas->focusPolicy() == QWidget::NoFocus || focusData() == NULL )
        return;

    // move the cursor to the canvas

    for ( int i = 0; i < focusData()->count(); i++ )
    {
        if ( focusData()->next() == d_canvas )
            break;
    }

    const bool canvasFirst = d_layout->legendPosition() == QwtPlot::Bottom ||
        d_layout->legendPosition() == QwtPlot::Right;

    for ( int j = 0; j < focusData()->count(); j++ )
    {
        QWidget *w = canvasFirst ? focusData()->next() : focusData()->prev();

        if ( w->focusPolicy() != QWidget::NoFocus 
            && w->parent() && w->parent() == d_legend->contentsWidget() )
        {
            if ( canvasFirst )
            {
                do // go back to last non legend item
                {
                    w = focusData()->prev(); // before the first legend item
                } while ( w->focusPolicy() == QWidget::NoFocus );
            }

            if ( w != d_canvas )
                setTabOrder(w, d_canvas);
            break;
        }
    }
}