当前位置: 首页>>代码示例>>C++>>正文


C++ QAccel类代码示例

本文整理汇总了C++中QAccel的典型用法代码示例。如果您正苦于以下问题:C++ QAccel类的具体用法?C++ QAccel怎么用?C++ QAccel使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了QAccel类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: QDialog

symbolDialog::symbolDialog(CharSet charsSet, QWidget* parent, const char* name, bool modal, WFlags fl )
    : QDialog( parent, name, modal, fl )
{
    if ( !name )
	setName( "symbolDialog" );
    setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, sizePolicy().hasHeightForWidth() ) );
    setSizeGripEnabled( FALSE );

	GroupBox1 = new QButtonGroup(5, QGroupBox::Horizontal,tr(""), this,"GroupBox1" );
	GroupBox1->setFlat ( true );
	GroupBox1->setLineWidth ( 0 );
	GroupBox1->moveFocus (0);

	if (!charsSet)
		initMinGreekChars();
	else
		initMajGreekChars();

	QHBoxLayout* hlayout = new QHBoxLayout(this, 0, 0, "hlayout2");
    hlayout->addWidget(GroupBox1);

    languageChange();

	connect (GroupBox1, SIGNAL(clicked(int)), this, SLOT(getChar(int)));

	QAccel *accel = new QAccel(this);
	accel->connectItem( accel->insertItem( Key_Return ),
                            this, SLOT(addCurrentChar()) );
}
开发者ID:BackupTheBerlios,项目名称:qtiplot-svn,代码行数:29,代码来源:symbolDialog.cpp

示例2: QWidget

Window::Window()
: QWidget(0) {
	setCaption(i18n("Switcha"));

	// Line edit
	mLineEdit = new ListViewSearchLine(this);
	connect(mLineEdit, SIGNAL(returnPressed()), SLOT(slotReturnPressed()) );
	mLineEdit->installEventFilter(this);

	// View
	mView = new KListView(this);
	mView->header()->hide();
	mView->addColumn("");
	mView->setResizeMode(QListView::LastColumn);
	connect(mView, SIGNAL(clicked(QListViewItem*)), SLOT(switchToWindow(QListViewItem*)) );

	mLineEdit->setListView(mView);

	// Layout
	QVBoxLayout* layout = new QVBoxLayout(this);
	layout->setMargin(6);
	layout->setSpacing(6);
	layout->addWidget(mLineEdit);
	layout->addWidget(mView);

	// Hide with esc
	QAccel* accel = new QAccel(this);
	accel->connectItem(
		accel->insertItem(Key_Escape),
		this, SLOT(hide()) );
}
开发者ID:agateau,项目名称:switcha,代码行数:31,代码来源:window.cpp

示例3: QDialog

FieldSelect::FieldSelect(Procview *pv, Proc *proc)
            : QDialog(0, "select fields"),
	      nbuttons(proc->cats.size()),
	      disp_fields(nbuttons),
	      procview(pv)
{
    QVBoxLayout *tl = new QVBoxLayout(this, 10, 10);

    updating = FALSE;
    setCaption("qps: select fields");
    buts = new QCheckBox*[nbuttons];

    QGridLayout *l1 = new QGridLayout((nbuttons + 1) / 2, 5, 0);
    tl->addLayout(l1, 1);
    l1->addColSpacing(2, 15);

    int half = (nbuttons + 1) / 2;
    for(int i = 0; i < nbuttons; i++) {
      QCheckBox *but = new QCheckBox(proc->cats[i]->name, this);
	QLabel *desc = new QLabel(proc->cats[i]->help, this);
	but->setMinimumSize(but->sizeHint());
	desc->setMinimumSize(desc->sizeHint());

	if(i < half) {
	  l1->addWidget(but, i, 0);
	  l1->addWidget(desc, i, 1);
	} else {
	  l1->addWidget(but, i-half, 3);
	  l1->addWidget(desc, i-half, 4);
	}
	buts[i] = but;
	connect(but, SIGNAL(toggled(bool)), this, SLOT(field_toggled(bool)));
    }
    update_boxes();

    KButtonBox *bbox = new KButtonBox(this);
    bbox->addStretch(1);
    QPushButton *closebut = bbox->addButton(i18n("Close"));
    closebut->setDefault(TRUE);
    closebut->setFocus();
    closebut->setFixedSize(closebut->sizeHint());
    bbox->layout();
    tl->addWidget(bbox);

    connect(closebut, SIGNAL(clicked()), SLOT(closed()));

    QAccel *acc = new QAccel(this);
    acc->connectItem(acc->insertItem(CTRL + Key_W),
		     this, SLOT(closed()));
    tl->freeze();
}
开发者ID:kthxbyte,项目名称:KDE1-Linaro,代码行数:51,代码来源:fieldsel.C

示例4: activateAmbiguously

void QAccelPrivate::activateAmbiguously( QAccelItem* item )
{
    if ( item->signal )
	item->signal->activate();
    else
	emit parent->activatedAmbiguously( item->id );
}
开发者ID:OS2World,项目名称:LIB-QT3_Toolkit_Vbox,代码行数:7,代码来源:qaccel.cpp

示例5: QPoint

void QProgressDialog::setCancelButton( QPushButton *cancelButton )
{
    delete d->cancel;
    d->cancel = cancelButton;
    if (cancelButton) {
	if ( cancelButton->parentWidget() == this ) {
	    cancelButton->hide(); // until we resize
	} else {
	    cancelButton->recreate( this, 0, QPoint(0,0), FALSE );
	}
	connect( d->cancel, SIGNAL(clicked()), this, SIGNAL(cancelled()) );
	QAccel *accel = new QAccel( this );
	accel->connectItem( accel->insertItem(Key_Escape),
			    d->cancel, SIGNAL(clicked()) );
    }
    resize(sizeHint());
    if (cancelButton)
	cancelButton->show();
}
开发者ID:kthxbyte,项目名称:Qt1.45-Linaro,代码行数:19,代码来源:qprogressdialog.cpp

示例6: QMenuBar

/**
 * Constructor of CommandManager.
 *
 * @param parent parent widget
 */
CommandManager::CommandManager(QWidget *parent)
    : QMenuBar(parent)
{
    actionMenu = new QPopupMenuExt(parent);
    goMenu = new QPopupMenuExt(parent);
    helpMenu = new QPopupMenuExt(parent);

    // Listen on menu item selection
    connect(actionMenu, SIGNAL(activated(int)), SLOT(commandActivated(int)));
    connect(goMenu, SIGNAL(activated(int)), SLOT(commandActivated(int)));
    connect(helpMenu, SIGNAL(activated(int)), SLOT(commandActivated(int)));
    
#ifndef QT_NO_ACCEL
    QAccel* focusAccel = new QAccel(this, "focus-change accelerator");
    focusAccel->connectItem(focusAccel->insertItem(MOVE_FOCUS, 0), 
        this, SLOT(moveFocus()));
#endif

}
开发者ID:AllBinary,项目名称:phoneme-components-midp,代码行数:24,代码来源:lfpport_qte_command.cpp

示例7: KTextBrowser

KNSourceViewWindow::KNSourceViewWindow(const QString &text)
    : KTextBrowser(0)
{
    setWFlags(WType_TopLevel | WDestructiveClose);
    QAccel *accel = new QAccel(this, "browser close-accel");
    accel->connectItem(accel->insertItem(Qt::Key_Escape), this , SLOT(close()));
    KNConfig::Appearance *app = knGlobals.configManager()->appearance();

    setTextFormat(PlainText);

    setCaption(kapp->makeStdCaption(i18n("Article Source")));
    setPaper(QBrush(app->backgroundColor()));
    setFont(app->articleFixedFont());
    setColor(app->textColor());
    setWordWrap(KTextBrowser::NoWrap);

    setText(text);
    KNHelper::restoreWindowSize("sourceWindow", this, QSize(500, 300));
    show();
}
开发者ID:serghei,项目名称:kde3-kdepim,代码行数:20,代码来源:knsourceviewwindow.cpp

示例8: activate

void QAccelPrivate::activate( QAccelItem* item )
{
#ifndef QT_NO_WHATSTHIS
    if ( QWhatsThis::inWhatsThisMode() && !ignorewhatsthis ) {
	QWhatsThis::leaveWhatsThisMode( item->whatsthis );
	return;
    }
#endif
    if ( item->signal )
	item->signal->activate();
    else
	emit parent->activated( item->id );
}
开发者ID:OS2World,项目名称:LIB-QT3_Toolkit_Vbox,代码行数:13,代码来源:qaccel.cpp

示例9: QPoint

void QProgressDialog::setCancelButton( QPushButton *cancelButton )
{
    delete d->cancel;
    d->cancel = cancelButton;
    if (cancelButton) {
	if ( cancelButton->parentWidget() == this ) {
	    cancelButton->hide(); // until we resize
	} else {
	    cancelButton->reparent( this, 0, QPoint(0,0), FALSE );
	}
	connect( d->cancel, SIGNAL(clicked()), this, SIGNAL(canceled()) );
#ifndef QT_NO_ACCEL
	QAccel *accel = new QAccel( this );
	accel->connectItem( accel->insertItem(Key_Escape),
			    d->cancel, SIGNAL(clicked()) );
#endif
    }
    int w = QMAX( isVisible() ? width() : 0, sizeHint().width() );
    int h = QMAX( isVisible() ? height() : 0, sizeHint().height() );
    resize( w, h );
    if (cancelButton)
	cancelButton->show();
}
开发者ID:aroraujjwal,项目名称:qt3,代码行数:23,代码来源:qprogressdialog.cpp

示例10: QWidget

TestPage::TestPage (QWidget *w, MainMenubar *mb, DBIndex *i) : QWidget (w)
{
  chartIndex = i;
  menubar = mb;
  idir.setFilter(QDir::Dirs);

  QVBoxLayout *vbox = new QVBoxLayout(this);
  vbox->setMargin(0);
  vbox->setSpacing(5);
  
  search = new QLineEdit(this);
  search->setText("*");
  connect(search, SIGNAL(textChanged(const QString &)), this, SLOT(searchChanged(const QString &)));
  QToolTip::add(search, tr("List Filter, e.g. s* or sb*"));
  vbox->addWidget(search);

  list = new QListBox(this);
  connect(list, SIGNAL(contextMenuRequested(QListBoxItem *, const QPoint &)), this,
          SLOT(rightClick(QListBoxItem *)));
  connect(list, SIGNAL(highlighted(const QString &)), this, SLOT(testSelected(const QString &)));
  connect(list, SIGNAL(doubleClicked(QListBoxItem *)), this, SLOT(doubleClick(QListBoxItem *)));
  vbox->addWidget(list);
  
  menu = new QPopupMenu(this);
  menu->insertItem(QPixmap(newchart), tr("&New Rule		Ctrl+N"), this, SLOT(newTest()));
  menu->insertItem(QPixmap(open), tr("&Open Rule		Ctrl+O"), this, SLOT(openTest()));
  menu->insertItem(QPixmap(deleteitem), tr("&Delete Rule	Ctrl+D"), this, SLOT(deleteTest()));
  menu->insertItem(QPixmap(renam), tr("&Rename Rule		Ctrl+R"), this, SLOT(renameTest()));
  menu->insertItem(QPixmap(copypic), tr("&Copy Rule		Ctrl+Y"), this, SLOT(copyTest()));
  menu->insertSeparator(-1);
  menu->insertItem(QPixmap(help), tr("&Help		Ctrl+H"), this, SLOT(slotHelp()));

  QAccel *a = new QAccel(this);
  connect(a, SIGNAL(activated(int)), this, SLOT(slotAccel(int)));
  a->insertItem(CTRL+Key_N, NewTest);
  a->insertItem(CTRL+Key_O, OpenTest);
  a->insertItem(CTRL+Key_D, DeleteTest);
  a->insertItem(CTRL+Key_R, RenameTest);
  a->insertItem(CTRL+Key_Y, CopyTest);
  a->insertItem(CTRL+Key_H, Help);
  
  updateList();
  testNoSelection();
}
开发者ID:botvs,项目名称:FinancialAnalytics,代码行数:44,代码来源:TestPage.cpp

示例11: QAccel

void KMix::createMenu()
{

  QAccel *qAcc = new QAccel( this );

  // Global "Help"-Key
  qAcc->connectItem( qAcc->insertItem(Key_F1),this, SLOT(launchHelpCB()));
  qAcc->connectItem( qAcc->insertItem(Key_1), this,  SLOT(slotReadSet1()));
  qAcc->connectItem( qAcc->insertItem(Key_2), this,  SLOT(slotReadSet2()));
  qAcc->connectItem( qAcc->insertItem(Key_3), this,  SLOT(slotReadSet3()));
  qAcc->connectItem( qAcc->insertItem(Key_4), this,  SLOT(slotReadSet4()));
  qAcc->connectItem( qAcc->insertItem(CTRL+Key_1), this,  SLOT(slotWriteSet1()));
  qAcc->connectItem( qAcc->insertItem(CTRL+Key_2), this,  SLOT(slotWriteSet2()));
  qAcc->connectItem( qAcc->insertItem(CTRL+Key_3), this,  SLOT(slotWriteSet3()));
  qAcc->connectItem( qAcc->insertItem(CTRL+Key_4), this,  SLOT(slotWriteSet4()));




  Mfile = new QPopupMenu;
  CHECK_PTR( Mfile );
  Mfile->insertItem(i18n("&Hide Menubar")    , this, SLOT(hideMenubarCB()) , CTRL+Key_M);
  qAcc->connectItem( qAcc->insertItem(CTRL+Key_M),this, SLOT(hideMenubarCB()));

  Mfile->insertItem(i18n("&Tickmarks On/Off"), this, SLOT(tickmarksTogCB()), CTRL+Key_T);
  qAcc->connectItem( qAcc->insertItem(CTRL+Key_T),this, SLOT(tickmarksTogCB()));

  Mfile->insertItem( i18n("&Options...")       , this, SLOT(showOptsCB()) );
  Mfile->insertSeparator();
  Mfile->insertItem( i18n("E&xit")          , this, SLOT(quitClickedCB()) , CTRL+Key_Q);
  qAcc->connectItem( qAcc->insertItem(CTRL+Key_Q),this, SLOT(quitClickedCB()));

  QString msg,head;

  msg  = "KMix ";
  msg += APP_VERSION;
  msg += i18n("\n(C) 1997-1998 by Christian Esken ([email protected]).\n\n" \
    "Sound mixer panel for the KDE Desktop Environment.\n"\
    "This program is in the GPL.\n"\
    "SGI Port done by Paul Kendall ([email protected]).\n"\
    "*BSD fixes by Sebestyen Zoltan ([email protected])\n"\
    "and Lennart Augustsson ([email protected]).\n"\
    "ALSA port by Nick Lopez ([email protected]).");
  head += APP_VERSION;

  Mhelp = globalKapp->getHelpMenu(true,msg);
  CHECK_PTR( Mhelp );

  mainmenu = new KMenuBar( this, "main menu");
  CHECK_PTR( mainmenu );
  mainmenu->insertItem( i18n("&File"), Mfile );
  mainmenu->insertSeparator();
  mainmenu->insertItem( i18n("&Help"), Mhelp );

  Mbalancing = new QPopupMenu;
  CHECK_PTR( Mbalancing );
  Mbalancing->insertItem(i18n("&Left")  , this, SLOT(MbalLeftCB()));
  Mbalancing->insertItem(i18n("&Center"), this, SLOT(MbalCentCB()));
  Mbalancing->insertItem(i18n("&Right") , this, SLOT(MbalRightCB()));
}
开发者ID:kthxbyte,项目名称:KDE1-Linaro,代码行数:60,代码来源:kmix.cpp

示例12: setBirthDate

void Matrix::init(int rows, int cols)
{
formula_str = "";
selectedCol=0;
LeftButton=FALSE;
txt_format = 'f';
num_precision = 6;
x_start = 1.0;
x_end = 10.0;
y_start = 1.0; 
y_end = 10.0;
dMatrix = 0;

QDateTime dt = QDateTime::currentDateTime ();
setBirthDate(dt.toString(Qt::LocalDate));

d_table = new QTable (rows, cols, this, "d_table");
d_table->setFocusPolicy(QWidget::StrongFocus);
d_table->setFocus();
d_table->setSelectionMode (QTable::Single);
d_table->setRowMovingEnabled(true);

/*
//!TODO: enable column moving, right now it doesn't work because of the event filter
//installed on hHeader
d_table->setColumnMovingEnabled(true);
connect(hHeader, SIGNAL(indexChange (int, int, int)), this, SLOT(notifyChanges()));
*/

QColor background = QColor(255, 255, 128);
d_table->setPaletteBackgroundColor(background);
d_table->setBackgroundColor(background);

QVBoxLayout* hlayout = new QVBoxLayout(this,0,0);
hlayout->addWidget(d_table);

QHeader* hHeader=(QHeader*)d_table->horizontalHeader();
hHeader->installEventFilter(this);
hHeader->setMouseTracking(TRUE);

QHeader* vHeader=(QHeader*)d_table->verticalHeader();
vHeader->setResizeEnabled (false);
vHeader->installEventFilter(this);

int w, h;
if (cols>3)
	w=3*hHeader->sectionSize(0);
else
	w=cols*hHeader->sectionSize(0);

if (rows>11)
	h=11*vHeader->sectionSize(0);
else
	h=(rows+1)*vHeader->sectionSize(0);
setGeometry(50,50,w+55,h);

QAccel *accel = new QAccel(this);
accel->connectItem( accel->insertItem( Key_Tab ),
                            this, SLOT(moveCurrentCell()));
accel->connectItem( accel->insertItem( CTRL+Key_A ),
                            this, SLOT(selectAll()));

connect(d_table, SIGNAL(valueChanged(int,int)), this, SLOT(cellEdited(int,int)));
connect(vHeader, SIGNAL(indexChange (int, int, int)), this, SLOT(notifyChanges()));
}
开发者ID:BackupTheBerlios,项目名称:qtiplot-svn,代码行数:65,代码来源:matrix.cpp

示例13: QWidget

GameBoard::GameBoard( QWidget *parent, const char *name )
        : QWidget( parent, name )
{
    setMinimumSize( 500, 355 );

    quit = new QPushButton( "Quit", this, "quit" );
    quit->setFont( QFont( "Times", 18, QFont::Bold ) );

    connect( quit, SIGNAL(clicked()), qApp, SLOT(quit()) );

    angle  = new LCDRange( "ANGLE", this, "angle" );
    angle->setRange( 5, 70 );

    force  = new LCDRange( "FORCE", this, "force" );
    force->setRange( 10, 50 );

    frame = new QFrame( this, "cannonFrame" );
    frame->setFrameStyle( QFrame::WinPanel | QFrame::Sunken );

    cannonField = new CannonField( this, "cannonField" );
    cannonField->setBackgroundColor( QColor( 250, 250, 200) );

    connect( angle,SIGNAL(valueChanged(int)), cannonField,SLOT(setAngle(int)));
    connect( cannonField,SIGNAL(angleChanged(int)), angle,SLOT(setValue(int)));

    connect( force,SIGNAL(valueChanged(int)), cannonField,SLOT(setForce(int)));
    connect( cannonField,SIGNAL(forceChanged(int)), force,SLOT(setValue(int)));

    connect( cannonField, SIGNAL(hit()),SLOT(hit()) );
    connect( cannonField, SIGNAL(missed()),SLOT(missed()) );

    angle->setValue( 60 );
    force->setValue( 25 );

    shoot = new QPushButton( "Shoot", this, "shoot" );
    shoot->setFont( QFont( "Times", 18, QFont::Bold ) );

    connect( shoot, SIGNAL(clicked()), SLOT(fire()) );

    restart = new QPushButton( "New Game", this, "newgame" );
    restart->setFont( QFont( "Times", 18, QFont::Bold ) );

    connect( restart, SIGNAL(clicked()), SLOT(newGame()) );

    hits  	       = new QLCDNumber( 2, this, "hits" );
    shotsLeft 	       = new QLCDNumber( 2, this, "shotsleft" );
    QLabel *hitsL      = new QLabel( "HITS", this, "hitsLabel" );
    QLabel *shotsLeftL = new QLabel( "SHOTS LEFT", this, "shotsleftLabel" );

    QAccel *accel = new QAccel( this );
    accel->connectItem( accel->insertItem( Key_Space), this, SLOT(fire()) );
    accel->connectItem( accel->insertItem( Key_Q), qApp, SLOT(quit()) );

    quit->setGeometry( 10, 10, 75, 30 );
    angle->setGeometry( 10, quit->y() + quit->height() + 10, 75, 130 );
    force->setGeometry( 10, angle->y() + angle->height() + 10, 75, 130 );
    frame->move( angle->x() + angle->width() + 10, angle->y() );
    cannonField->move( frame->x() + 2, frame->y() + 2 );
    shoot->setGeometry( 10, 315, 75, 30 );
    restart->setGeometry( 380, 10, 110, 30 );
    hits->setGeometry( 130, 10, 40, 30 );
    hitsL->setGeometry( hits->x() + hits->width() + 5, 10, 60, 30 );
    shotsLeft->setGeometry( 240, 10, 40, 30 );
    shotsLeftL->setGeometry( shotsLeft->x()+shotsLeft->width()+5, 10, 70, 30 );

    newGame();
}
开发者ID:kthxbyte,项目名称:Qt1.45-Linaro,代码行数:67,代码来源:gamebrd.cpp

示例14: QDialog

PasswordDialog::PasswordDialog(const char *head, QWidget* parent, const char* name, bool modal, WFlags wflags)
   : QDialog(parent, name, modal, wflags)
{
    debugT("Here we go!!\n");
    
   _head = head;

   // (David) Layout management
   QVBoxLayout *vLay = new QVBoxLayout(this, 10 /* border */, 5);

   //
   // Bei Bedarf einen kleinen Kommentar als Label einfuegen
   // English please !!! David.
   if (_head)
   {
      QLabel *l;
      
      l = new QLabel(_head, this);
      l->adjustSize();
      l->setMinimumSize(l->size());
      vLay->addWidget(l);
      // l->setGeometry( 10, 10, 200, 20 );
   }

   // The horizontal layout for label + lineedit
   QHBoxLayout *hLay = new QHBoxLayout(5);
   vLay->addLayout(hLay);
   //
   // Die eine oder zwei Zeile(n) mit der Passwortabfrage
   //
   QLabel *l_password = new QLabel(klocale->translate("Password"), this);
   l_password->adjustSize();
   l_password->setMinimumSize(l_password->size());
   hLay->addWidget(l_password,0);
   //l_password->setGeometry( 10, 40, 80, 30 );
   
   _w_password = new QLineEdit( this );
   //_w_password->setGeometry( 90, 40, 100, 30 );
   _w_password->setEchoMode( QLineEdit::Password );
   _w_password->adjustSize();
   _w_password->setFixedHeight(_w_password->height());
   hLay->addWidget(_w_password,10);
   
   //
   // Connect vom LineEdit herstellen und Accelerator
   //
   QAccel *ac = new QAccel(this);
   ac->connectItem( ac->insertItem(Key_Escape), this, SLOT(reject()) );
   
   connect( _w_password, SIGNAL(returnPressed()), SLOT(accept()) );
   
   //
   // Eine vertikale Linie erzeugen
   //
   QFrame *f = new QFrame(this);
   f->setLineWidth(1);
   f->setMidLineWidth(1);
   f->setFrameStyle( QFrame::HLine|QFrame::Raised);
   //f->setGeometry( 10, 80, 180, 2 );
   f->setMinimumHeight(5);
   vLay->addWidget(f,0);
   
   //
   // Die Buttons "OK" & "Cancel" erzeugen
   //
   QHBoxLayout *hBLay = new QHBoxLayout(5);
   vLay->addLayout(hBLay);

   hBLay->addStretch();

   QPushButton *b1, *b2;
   b1 = new QPushButton(klocale->translate("OK"), this);
   //b1->setGeometry( 10, 90, 80, 30 );
   b1->adjustSize();
   b1->setFixedSize(b1->size());   
   hBLay->addWidget(b1);

   hBLay->addStretch();
   //or hBLay->addSpacing(10);
   
   b2 = new QPushButton(klocale->translate("Cancel"), this);
   //b2->setGeometry( 110, 90, 80, 30 );
   b2->adjustSize();
   b2->setFixedSize(b2->size());   
   hBLay->addWidget(b2);

   hBLay->addStretch();
   
   // Buttons mit Funktionaliataet belegen
   connect( b1, SIGNAL(clicked()), SLOT(accept()) );
   connect( b2, SIGNAL(clicked()), SLOT(reject()) );
   
   // Fenstertitel
   setCaption(klocale->translate("Password"));
   
   // Focus
   _w_password->setFocus();
   
   vLay->activate();
   setMinimumSize(200, 50);
//.........这里部分代码省略.........
开发者ID:kthxbyte,项目名称:KDE1-Linaro,代码行数:101,代码来源:passworddialog.cpp

示例15: QDialog

curvesDialog::curvesDialog( QWidget* parent,  const char* name, bool modal, WFlags fl )
    : QDialog( parent, name, modal, fl )
{
    if ( !name )
	setName( "curvesDialog" );
	setMinimumSize(QSize(400,200));
    setCaption( tr( "QtiPlot - Add/Remove curves" ) );
	setFocus();
	
	QHBox *box5 = new QHBox (this, "box5"); 
	box5->setSpacing (5);
	box5->setMargin(5);

	new QLabel("New curves style", box5, "label0");
	boxStyle = new QComboBox (box5, "boxStyle");
	boxStyle->insertItem( QPixmap(lPlot_xpm), tr( " Line" ) );
    boxStyle->insertItem( QPixmap(pPlot_xpm), tr( " Scatter" ) );
    boxStyle->insertItem( QPixmap(lpPlot_xpm), tr( " Line + Symbol" ) );
    boxStyle->insertItem( QPixmap(dropLines_xpm), tr( " Vertical drop lines" ) );
	boxStyle->insertItem( QPixmap(spline_xpm), tr( " Spline" ) );
	boxStyle->insertItem( QPixmap(steps_xpm), tr( " Vertical steps" ) );
	boxStyle->insertItem( QPixmap(area_xpm), tr( " Area" ) );
	boxStyle->insertItem( QPixmap(vertBars_xpm), tr( " Vertical Bars" ) );
	boxStyle->insertItem( QPixmap(hBars_xpm), tr( " Horizontal Bars" ) );

	QHBox  *box0 = new QHBox (this, "box0"); 
	box0->setSpacing (5);

	QVBox  *box1=new QVBox (box0, "box1"); 
	box1->setMargin(5);
	box1->setSpacing (5);
	
	TextLabel1 = new QLabel(box1, "TextLabel1" );
    TextLabel1->setText( tr( "Available data" ) );

    available = new QListBox( box1, "available" );
	available->setSelectionMode (QListBox::Multi);
	
	QVBox  *box2=new QVBox (box0, "box2"); 
	box2->setMargin(5);
	box2->setSpacing (5);

    btnAdd = new QPushButton(box2, "btnAdd" );
    btnAdd->setPixmap( QPixmap(add_xpm) );
	btnAdd->setFixedWidth (35);
	btnAdd->setFixedHeight (30);
	
    btnRemove = new QPushButton(box2, "btnRemove" );
    btnRemove->setPixmap( QPixmap(remove_xpm) );
	btnRemove->setFixedWidth (35);
	btnRemove->setFixedHeight(30);
		
	QVBox  *box3=new QVBox (box0, "box3"); 
	box3->setMargin(5);
	box3->setSpacing (5);
	
	TextLabel2 = new QLabel(box3, "TextLabel2" );
    TextLabel2->setText( tr( "Graph contents" ) );

    contents = new QListBox( box3, "contents" );
	contents->setSelectionMode (QListBox::Multi);

	QVBox  *box4=new QVBox (box0, "box4"); 
	box4->setMargin(5);
	box4->setSpacing (5);

	btnAssociations = new QPushButton(box4, "btnAssociations" );
    btnAssociations->setText( tr( "&Plot Associations..." ) );
	btnAssociations->setEnabled(false);
	
	btnEditFunction = new QPushButton(box4, "btnEditFunction" );
    btnEditFunction->setText( tr( "&Edit Function..." ) );
	btnEditFunction->setEnabled(false);
	
    btnOK = new QPushButton(box4, "btnOK" );
    btnOK->setText( tr( "OK" ) );
	btnOK->setDefault( TRUE );
	
    btnCancel = new QPushButton(box4, "btnCancel" );
    btnCancel->setText( tr( "Close" ) );

	QVBoxLayout* layout = new QVBoxLayout(this,5,5, "hlayout3");
    layout->addWidget(box5);
	layout->addWidget(box0);

connect(btnAssociations, SIGNAL(clicked()),this, SLOT(showPlotAssociations()));
connect(btnEditFunction, SIGNAL(clicked()),this, SLOT(showFunctionDialog()));

connect(btnAdd, SIGNAL(clicked()),this, SLOT(addCurve()));
connect(btnRemove, SIGNAL(clicked()),this, SLOT(removeCurve()));
connect(btnOK, SIGNAL(clicked()),this, SLOT(close()));
connect(btnCancel, SIGNAL(clicked()),this, SLOT(close()));
connect(btnAdd, SIGNAL(clicked()),this, SLOT(enableRemoveBtn()));
connect(btnRemove, SIGNAL(clicked()),this, SLOT(enableRemoveBtn()));

connect(contents, SIGNAL(highlighted (int)), this, SLOT(showCurveBtn(int)));
connect(contents, SIGNAL(rightButtonClicked(QListBoxItem *, const QPoint &)), this, SLOT(deletePopupMenu(QListBoxItem *, const QPoint &)));
connect(available, SIGNAL(rightButtonClicked(QListBoxItem *, const QPoint &)), this, SLOT(addPopupMenu(QListBoxItem *, const QPoint &)));

QAccel *accel = new QAccel(this);
//.........这里部分代码省略.........
开发者ID:BackupTheBerlios,项目名称:qtiplot-svn,代码行数:101,代码来源:curvesDialog.cpp


注:本文中的QAccel类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。