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


C++ Q3GridLayout::setColStretch方法代码示例

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


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

示例1: createFontPage

void Preferences::createFontPage()
{
  // font parms page

  QWidget *w = new QWidget(this);
  Q3VBoxLayout *vbox = new Q3VBoxLayout(w);

  Q3GridLayout *grid = new Q3GridLayout(vbox, 1, 3);
  grid->setMargin(5);
  grid->setSpacing(5);
  grid->setColStretch(1, 1);
  grid->setColStretch(2, 2);

  vbox->insertStretch(-1, 1);

  // plot font
  QLabel *label = new QLabel(tr("Plot Font"), w);
  grid->addWidget(label, 0, 0);

  plotFontButton = new FontButton(w, plotFont);
  grid->addWidget(plotFontButton, 0, 1);
  connect(plotFontButton, SIGNAL(valueChanged()), this, SLOT(slotModified()));

  // app font
  label = new QLabel(tr("App Font"), w);
  grid->addWidget(label, 1, 0);

  appFontButton = new FontButton(w, appFont);
  grid->addWidget(appFontButton, 1, 1);
  connect(appFontButton, SIGNAL(valueChanged()), this, SLOT(slotModified()));

  addTab(w, tr("Fonts"));

}
开发者ID:DigitalPig,项目名称:qtstalker-qt4,代码行数:34,代码来源:Preferences.cpp

示例2: createETPage

void  Preferences::createETPage()
{
  // extra tool bar page

  QWidget *w = new QWidget(this);
  Q3VBoxLayout *vbox = new Q3VBoxLayout(w);

  Q3GridLayout *grid = new Q3GridLayout(vbox, 1, 2);
  grid->setMargin(5);
  grid->setSpacing(5);
  grid->setColStretch(1, 1);

  vbox->insertStretch(-1, 1);

  int i = 0; // count rows
  int j = 0; // "count" cols
  bool tb; // temporary
  RcFile rcfile;

  QLabel *label = new QLabel(tr("Recent charts"), w);
  grid->addWidget(label, i, j);
  recentComboBoxCheck = new QCheckBox(w);
  rcfile.loadData(RcFile::ShowRecentCharts, tb);
  recentComboBoxCheck->setChecked(tb);
  connect(recentComboBoxCheck, SIGNAL(stateChanged(int)), this, SLOT(slotModified()));
  grid->addWidget(recentComboBoxCheck, i++, j + 1);

  addTab(w, tr("ExtraToolbar"));
}
开发者ID:DigitalPig,项目名称:qtstalker-qt4,代码行数:29,代码来源:Preferences.cpp

示例3: initWidget

void QStringOption::initWidget()
{
	Q3GridLayout* qgl = new Q3GridLayout(this,2,2);
  QLabel* label = new QLabel(optionTitle(),this);
	mpOptionLineEdit = new QLineEdit(this);
  connect(mpOptionLineEdit,SIGNAL(textChanged(const QString&)),
          this,SLOT(slotTextChanged(const QString&)));
//create pixmap
  assignPixmap();
	qgl->addMultiCellWidget(pixmapWidget(),0,1,0,0);
	qgl->addWidget(label,0,1);
	qgl->addWidget(mpOptionLineEdit,1,1);
  qgl->setSpacing(5);
	qgl->setColStretch(1,1);
	qgl->activate();
}
开发者ID:arunjalota,项目名称:paperman,代码行数:16,代码来源:qstringoption.cpp

示例4: createColorPage

void Preferences::createColorPage()
{
  // colors parms page

  QWidget *w = new QWidget(this);
  Q3VBoxLayout *vbox = new Q3VBoxLayout(w);

  Q3GridLayout *grid = new Q3GridLayout(vbox, 1, 3);
  grid->setMargin(5);
  grid->setSpacing(5);
  grid->setColStretch(1, 1);
  grid->setColStretch(2, 2);

  vbox->insertStretch(-1, 1);

  // background color
  QLabel *label = new QLabel(tr("Chart Background"), w);
  grid->addWidget(label, 0, 0);

  backgroundColorButton = new ColorButton(w, backgroundColor);
  grid->addWidget(backgroundColorButton, 0, 1);
  backgroundColorButton->setColorButton();
  connect(backgroundColorButton, SIGNAL(valueChanged()), this, SLOT(slotModified()));

  // border color
  label = new QLabel(tr("Chart Border"), w);
  grid->addWidget(label, 1, 0);

  borderColorButton = new ColorButton(w, borderColor);
  grid->addWidget(borderColorButton, 1, 1);
  borderColorButton->setColorButton();
  connect(borderColorButton, SIGNAL(valueChanged()), this, SLOT(slotModified()));

  // grid color
  label = new QLabel(tr("Chart Grid"), w);
  grid->addWidget(label, 2, 0);

  gridColorButton = new ColorButton(w, gridColor);
  grid->addWidget(gridColorButton, 2, 1);
  gridColorButton->setColorButton();
  connect(gridColorButton, SIGNAL(valueChanged()), this, SLOT(slotModified()));

  //FIXME: add adjustment possibility for prefered CO-colors.
  // in this way to add a spinbox to set the amount of colors too

  addTab(w, tr("Colors"));
}
开发者ID:DigitalPig,项目名称:qtstalker-qt4,代码行数:47,代码来源:Preferences.cpp

示例5: initWidget

void SaneIntOption::initWidget()
{
  Q3GridLayout* qgl = new Q3GridLayout(this,3,3);
	mpTitleLabel = new QLabel(optionTitle(),this);
	mpValueSpinBox = new QSpinBox(INT_MIN,INT_MAX,1,this);
  mpValueSpinBox->setFocusPolicy(Qt::StrongFocus);//should get focus after clicking
//create pixmap
  assignPixmap();
	qgl->addMultiCellWidget(pixmapWidget(),0,2,0,0);

	qgl->addWidget(mpTitleLabel,1,1);
	qgl->addWidget(mpValueSpinBox,1,2);
  qgl->setSpacing(5);
  qgl->setColStretch(1,1);
	connect(mpValueSpinBox,SIGNAL(valueChanged(int)),this,SLOT(slotValueChanged(int)));
  qgl->activate();
}
开发者ID:arunjalota,项目名称:paperman,代码行数:17,代码来源:saneintoption.cpp

示例6: TAAWidget

LogVoiceMail::LogVoiceMail
(
	QWidget* parent,
	const char* name
) : TAAWidget(parent)
{
    setCaption( "Voice Mail Logging" );

    // Create the widgets
    QLabel *dateLabel = new QLabel(this);
    dateLabel->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
    dateLabel->setText("D&ate/Time:");

    msgDateTime = new Q3DateTimeEdit(QDateTime::currentDateTime(), this, "MsgDateTime");
    dateLabel->setBuddy(msgDateTime);
    
    QLabel *messageLabel = new QLabel(this);
    messageLabel->setAlignment(Qt::AlignRight|Qt::AlignTop);
    messageLabel->setText("M&essage:");

    message = new Q3MultiLineEdit(this);
    message->setWordWrap(Q3MultiLineEdit::WidgetWidth);
    messageLabel->setBuddy(message);

    saveButton = new QPushButton(this);
    saveButton->setText("&Save");
    connect(saveButton, SIGNAL(clicked()), this, SLOT(saveMessage()));

    closeButton = new QPushButton(this);
    closeButton->setText("&Close");
    connect(closeButton, SIGNAL(clicked()), this, SLOT(closeClicked()));

    statusLabel = new QLabel(this);
    statusLabel->setAlignment(Qt::AlignLeft|Qt::AlignVCenter);
    statusLabel->setFrameStyle(Q3Frame::Panel|Q3Frame::Sunken);
    statusLabel->setMinimumSize(0, 20);

    // Now, create our layouts
    // Date/time area.
    Q3GridLayout *dtl = new Q3GridLayout(2, 4, 3);
    dtl->setColStretch(0, 0);
    dtl->setColStretch(1, 1);
    dtl->setColStretch(2, 0);
    dtl->setColStretch(3, 1);
    dtl->setRowStretch(0, 0);
    dtl->setRowStretch(1, 1);

    dtl->addWidget(dateLabel,               0, 0);
    dtl->addMultiCellWidget(msgDateTime,    0, 0, 1, 3);
    dtl->addWidget(messageLabel,            1, 0);
    dtl->addMultiCellWidget(message,        1, 1, 1, 3);

    // The action button layout.
    Q3BoxLayout *abl = new Q3BoxLayout(Q3BoxLayout::LeftToRight, 5);
    abl->addStretch(1);
    abl->addWidget(saveButton, 0);
    abl->addWidget(closeButton, 0);
    abl->addSpacing(5);

    // The main layout.
    Q3BoxLayout *ml = new Q3BoxLayout(this, Q3BoxLayout::TopToBottom, 0, 0);
    ml->addSpacing(3);
    ml->addLayout(dtl, 1);
    ml->addSpacing(3);
    ml->addLayout(abl, 0);
    ml->addSpacing(3);
    ml->addWidget(statusLabel, 0);

    // Done.

    msgDateTime->setFocus();

    resize(350, 180);
}
开发者ID:gottafixthat,项目名称:tacc,代码行数:74,代码来源:LogVoiceMail.cpp

示例7: TAAWidget

LogCall::LogCall
(
	QWidget* parent,
	const char* name
) : TAAWidget(parent)
{

    setCaption("Call Logger");

    // Create all of our widgets.
    loginID = new QLineEdit(this, "loginID");
    loginID->setMaxLength(16);
    connect(loginID, SIGNAL(textChanged(const QString &)), this, SLOT(loginIDChanged(const QString &)));
    loginIDLabel = new QLabel(loginID, "&Login ID", this);
    loginIDLabel->setAlignment(AlignRight|AlignVCenter);

    searchButton = new QPushButton(this, "searchButton");
    searchButton->setText("&Search");
    connect(searchButton, SIGNAL(clicked()), this, SLOT(findLogin()));
    
    // Searching doesn't really work very well, so lets hide the button for
    // now.
    searchButton->hide();

    callType = new QComboBox(false, this, "callType");
    callType->insertItem("Support");
    callType->insertItem("Sales");
    callType->insertItem("New User");
    callType->insertItem("Accounting");
    connect(callType, SIGNAL(highlighted(int)), this, SLOT(callTypeChanged(int)));
    typeLabel = new QLabel(callType, "&Type", this);
    typeLabel->setAlignment(AlignRight|AlignVCenter);

    reasonList = new Q3ListView(this, "reasonList");
    reasonList->addColumn("Call Subject");
    reasonList->setMaximumHeight(125);
    reasonLabel = new QLabel(reasonList, "&Reason", this);
    reasonLabel->setAlignment(AlignRight|AlignTop);
    
    solutionNotes = new Q3MultiLineEdit(this, "solutionNotes");
    solutionNotes->setWordWrap(Q3MultiLineEdit::WidgetWidth);
    solutionLabel = new QLabel(solutionNotes, "S&olution", this);
    solutionLabel->setAlignment(AlignRight|AlignTop);
    
    // Now, our buttons.
    custWinButton = new QPushButton(this, "custWinButton");
    custWinButton->setText("&Customer Window");
    connect(custWinButton, SIGNAL(clicked()), this, SLOT(loadCustomer()));
    
    clockButton = new QPushButton(this, "clockButton");
    clockButton->setText("Sto&p Timer");
    connect(clockButton, SIGNAL(clicked()), this, SLOT(toggleTimer()));

    doneButton = new QPushButton(this, "doneButton");
    doneButton->setText("&Done");
    connect(doneButton, SIGNAL(clicked()), this, SLOT(hangupCall()));

    statusLabel = new QLabel(this, "statusLabel");
    statusLabel->setFrameStyle(Q3Frame::Sunken|Q3Frame::WinPanel);

    clockArea = new QLCDNumber(this, "clockArea");
    clockArea->setMode(QLCDNumber::DEC);
    clockArea->setSegmentStyle(QLCDNumber::Flat);
    clockArea->setNumDigits(7);

    
    // Main Layout, top to bottom, with a grid and stuff thrown in.
    Q3BoxLayout  *ml = new Q3BoxLayout(this, Q3BoxLayout::TopToBottom, 3, 3);

    Q3GridLayout *gl = new Q3GridLayout(3, 5);
    gl->setRowStretch(0, 0);
    gl->setRowStretch(1, 0);
    gl->setRowStretch(2, 1);
    gl->setColStretch(0, 0);
    gl->setColStretch(1, 1);
    gl->setColStretch(2, 0);
    gl->setColStretch(3, 0);
    gl->setColStretch(4, 0);

    gl->addWidget(loginIDLabel,             0, 0);
    gl->addWidget(loginID,                  0, 1);
    gl->addWidget(searchButton,             0, 2);
    gl->addWidget(typeLabel,                0, 3);
    gl->addWidget(callType,                 0, 4);

    gl->addWidget(reasonLabel,              1, 0);
    gl->addMultiCellWidget(reasonList,      1, 1, 1, 4);
    
    gl->addWidget(solutionLabel,            2, 0);
    gl->addMultiCellWidget(solutionNotes,   2, 2, 1, 4);

    ml->addLayout(gl, 1);

    Q3BoxLayout  *abl = new Q3BoxLayout(Q3BoxLayout::LeftToRight, 0);
    abl->addWidget(custWinButton,  1);
    abl->addWidget(clockButton,  1);
    abl->addWidget(doneButton,  1);

    // These options don't really work very well, so lets disable them for
    // now.
//.........这里部分代码省略.........
开发者ID:gottafixthat,项目名称:tacc,代码行数:101,代码来源:LogCall.cpp

示例8: bd

TesterTestPage::TesterTestPage (QWidget *p) : QWidget (p)
{
  fieldList.append(tr("Open"));
  fieldList.append(tr("Close"));
  fieldList.append(tr("Mid Point"));

  Q3HBoxLayout *hbox = new Q3HBoxLayout(this);
  hbox->setMargin(5);
  hbox->setSpacing(10);

  // left side grid

  Q3GridLayout *grid = new Q3GridLayout(hbox);
  grid->setColStretch(1, 1);
  grid->setSpacing(5);

  // trades area

  tradeLong = new QCheckBox(tr("Long"), this);
  grid->addWidget(tradeLong, 0, 0);

  tradeShort = new QCheckBox(tr("Short"), this);
  grid->addWidget(tradeShort, 1, 0);

  QLabel *label = new QLabel(tr("Trade Delay"), this);
  grid->addWidget(label, 2, 0);

  tradeDelay = new QSpinBox(1, 999999, 1, this);
  tradeDelay->setValue(1);
  grid->addWidget(tradeDelay, 2, 1);

  grid->setRowSpacing(grid->numRows(), 25);

  // account area

  label = new QLabel(tr("Account Balance"), this);
  grid->addWidget(label, 4, 0);

  account = new QSpinBox(0, 999999, 1, this);
  account->setValue(10000);
  grid->addWidget(account, 4, 1);

  label = new QLabel(tr("Futures Margin"), this);
  grid->addWidget(label, 5, 0);

  margin = new QSpinBox(0, 999999, 1, this);
  grid->addWidget(margin, 5, 1);

  label = new QLabel(tr("Volume %"), this);
  grid->addWidget(label, 6, 0);

  volumePercent = new QSpinBox(0, 100, 1, this);
  grid->addWidget(volumePercent, 6, 1);

  grid->setRowSpacing(grid->numRows(), 25);

  // commission area

  commissionType = new QCheckBox(tr("Use Commission %"), this);
  grid->addWidget(commissionType, 8, 0);

  label = new QLabel(tr("Entry"), this);
  grid->addWidget(label, 9, 0);

  QDoubleValidator *dv = new QDoubleValidator(0, 99999999.0, 4, this, 0);
  entryCom = new QLineEdit(QString::number(10), this);
  entryCom->setValidator(dv);
  grid->addWidget(entryCom, 9, 1);

  label = new QLabel(tr("Exit"), this);
  grid->addWidget(label, 10, 0);

  QDoubleValidator *dv2 = new QDoubleValidator(0, 99999999.0, 4, this, 0);
  exitCom = new QLineEdit(QString::number(10), this);
  exitCom->setValidator(dv2);
  grid->addWidget(exitCom, 10, 1);

  grid->setRowStretch(grid->numRows() + 1, 1);

  // vline sperarator

  Q3Frame *line = new Q3Frame(this);
  line->setFrameStyle(Q3Frame::VLine | Q3Frame::Plain);
  hbox->addWidget(line);

  // right side grid

  grid = new Q3GridLayout(hbox);
  grid->setColStretch(1, 1);
  grid->setSpacing(5);

  // test area

  label = new QLabel(tr("Symbol"), this);
  grid->addWidget(label, 0, 0);

  Config config;
  QString s, s2;
  config.getData(Config::DataPath, s);
  symbolButton = new SymbolButton(this, s, s2);
//.........这里部分代码省略.........
开发者ID:DigitalPig,项目名称:qtstalker-qt4,代码行数:101,代码来源:TesterTestPage.cpp

示例9: TAAWidget

MakeDeposits::MakeDeposits
(
	QWidget* parent,
	const char* name
) : TAAWidget(parent)
{
	setCaption( "Make Deposits" );

    // Create our widgets.
    paymentList = new Q3ListView(this, "paymentList");
    int curCol = 1;
    paymentList->addColumn("Date");             curCol++;
    paymentList->addColumn("Cust ID");          curCol++;
    paymentList->addColumn("Customer Name");    curCol++;
    paymentList->addColumn("Check No");         curCol++;
    paymentList->addColumn("Amount");           curCol++;
    paymentList->addColumn("IntID");
    paymentList->setColumnAlignment(curCol++, AlignRight);
    paymentList->setAllColumnsShowFocus(true);
    paymentList->setMultiSelection(true);
    connect(paymentList, SIGNAL(selectionChanged()), this, SLOT(itemSelected()));
    connect(paymentList, SIGNAL(doubleClicked(Q3ListViewItem *)), this, SLOT(itemDoubleClicked(Q3ListViewItem *)));

    QLabel  *selectedItemCountLabel = new QLabel(this, "selectedItemCountLabel");
    selectedItemCountLabel->setText("Items Selected:");
    selectedItemCountLabel->setAlignment(Qt::AlignRight|Qt::AlignVCenter);

    selectedItemCount = new QLabel(this, "selectedItemCount");
    selectedItemCount->setText("0");
    selectedItemCount->setAlignment(Qt::AlignRight|Qt::AlignVCenter);

    QLabel  *undepositedAmountLabel = new QLabel(this, "undepositedAmountLabel");
    undepositedAmountLabel->setText("Undeposted amount:");
    undepositedAmountLabel->setAlignment(AlignRight | AlignVCenter);

    undepositedAmount = new QLabel(this, "undepositedAmount");
    undepositedAmount->setText("$0.00");
    undepositedAmount->setAlignment(AlignRight | AlignVCenter);

    QLabel  *amountSelectedLabel = new QLabel(this, "amountSelectedLabel");
    amountSelectedLabel->setText("Amount selected:");
    amountSelectedLabel->setAlignment(AlignRight | AlignVCenter);

    amountSelected = new QLabel(this, "amountSelected");
    amountSelected->setText("$0.00");
    amountSelected->setAlignment(AlignRight | AlignVCenter);

    QLabel  *targetAccountLabel = new QLabel(this, "targetAccountLabel");
    targetAccountLabel->setText("Target Account:");
    targetAccountLabel->setAlignment(AlignRight | AlignVCenter);

    targetAccountList = new QComboBox(false, this, "targetAccountList");

    QLabel  *transDateLabel = new QLabel(this, "transDateLabel");
    transDateLabel->setText("Desposit Date:");
    transDateLabel->setAlignment(AlignRight | AlignVCenter);

    transDate = new Q3DateEdit(QDate::currentDate(), this, "transDate");

    // Our buttons now.
    QPushButton *printButton = new QPushButton(this, "printButton");
    printButton->setText("&Print");
    connect(printButton, SIGNAL(clicked()), this, SLOT(printSelected()));
    
    QPushButton *selectAllButton = new QPushButton(this, "selectAllButton");
    selectAllButton->setText("Select &All");
    connect(selectAllButton, SIGNAL(clicked()), this, SLOT(selectAll()));

    QPushButton *selectNoneButton = new QPushButton(this, "selectNoneButton");
    selectNoneButton->setText("Select &None");
    connect(selectNoneButton, SIGNAL(clicked()), this, SLOT(selectNone()));

    QPushButton *continueButton = new QPushButton(this, "continueButton");
    continueButton->setText("C&ontinue");
    connect(continueButton, SIGNAL(clicked()), this, SLOT(processSelections()));

    QPushButton *cancelButton = new QPushButton(this, "cancelButton");
    cancelButton->setText("&Cancel");
    connect(cancelButton, SIGNAL(clicked()), this, SLOT(cancelSelected()));

    // Create our layout.
    Q3BoxLayout  *ml = new Q3BoxLayout(this, Q3BoxLayout::TopToBottom, 3, 3);

    ml->addWidget(paymentList, 1);

    // A grid for our labels and account selection.
    Q3GridLayout *asl = new Q3GridLayout(3, 2);
    asl->setColStretch(0, 0);
    asl->setColStretch(1, 1);
    int curRow = 0;

    asl->addWidget(selectedItemCountLabel,          curRow, 0);
    asl->addWidget(selectedItemCount,               curRow, 1);
    asl->setRowStretch(curRow++, 0);
    asl->addWidget(undepositedAmountLabel,          curRow, 0);
    asl->addWidget(undepositedAmount,               curRow, 1);
    asl->setRowStretch(curRow++, 0);
    asl->addWidget(amountSelectedLabel,             curRow, 0);
    asl->addWidget(amountSelected,                  curRow, 1);
    asl->setRowStretch(curRow++, 0);
//.........这里部分代码省略.........
开发者ID:gottafixthat,项目名称:tacc,代码行数:101,代码来源:MakeDeposits.cpp

示例10: TAAWidget

Tab_Logins::Tab_Logins
(
	QWidget* parent,
	const char* name,
	long CustID
) : TAAWidget(parent)
{

	setCaption( "Logins" );
	myCustID = CustID;


    // Create all of our widgets.
    list = new Q3ListView(this, "LoginList");
	list->addColumn("Login ID");
	list->addColumn("Login Type");
	list->addColumn("Contact Name");
	list->addColumn("Last Modified");
	list->addColumn("Disk");
	list->addColumn("Flags");
	list->addColumn("Active");
	list->setAllColumnsShowFocus(TRUE);
	list->setColumnAlignment(4, AlignRight);
	list->setColumnAlignment(5, AlignRight);
	list->setColumnAlignment(6, AlignCenter);
    list->setItemMargin( 2 );

    newButton = new QPushButton(this, "NewButton");
    newButton->setText("&New");
    connect(newButton, SIGNAL(clicked()), this, SLOT(createNewLogin()));

    openCloseButton = new QPushButton(this, "OpenCloseButton");
    openCloseButton->setText("(&De)Activate");
    connect(openCloseButton, SIGNAL(clicked()), this, SLOT(unlockLogin()));

    passwdButton = new QPushButton(this, "PasswdButton");
    passwdButton->setText("&Password");
    connect(passwdButton, SIGNAL(clicked()), this, SLOT(changePassword()));

    QPushButton *loginFlagsButton = new QPushButton(this, "LoginFlagsButton");
    loginFlagsButton->setText("Fla&gs");
    connect(loginFlagsButton, SIGNAL(clicked()), this, SLOT(loginFlagsClicked()));

    editButton = new QPushButton(this, "EditButton");
    editButton->setText("&Edit");
    connect(editButton, SIGNAL(clicked()), this, SLOT(editLogin()));

    modemUsageButton = new QPushButton(this, "Modem Usage Button");
    modemUsageButton->setText("&Modem Usage");
    connect(modemUsageButton, SIGNAL(clicked()), this, SLOT(modemUsageReport()));

    bandwidthButton = new QPushButton(this, "BandwidthButton");
    bandwidthButton->setText("&Bandwidth");
    connect(bandwidthButton, SIGNAL(clicked()), this, SLOT(bandwidthUsageReport()));

    QPushButton *diskSpaceButton = new QPushButton(this, "DiskSpaceButton");
    diskSpaceButton->setText("D&isk Space");
    connect(diskSpaceButton, SIGNAL(clicked()), this, SLOT(diskSpaceClicked()));
    diskSpaceButton->setEnabled(false);
    
    adminMenuArea = new QLabel(this, "Admin Menu Area");
    adminMenu = new Q3PopupMenu;
    adminMenu->insertItem("&Set Primary Login", this, SLOT(setPrimaryLogin()));
    adminMenu->insertItem("&Transfer Login", this, SLOT(transferLogin()));
    if (isAdmin()) adminMenu->insertItem("&Wipe Login", this, SLOT(wipeLogin()));
	
	QMenuBar    *tmpMenu;
	tmpMenu = new QMenuBar(adminMenuArea, "Administrivia");
    tmpMenu->insertItem("&Administrivia", adminMenu);

    hideWiped = new QCheckBox(this, "HideWiped");
    hideWiped->setText("&Hide Wiped");
    hideWiped->setChecked(true);
    connect(hideWiped, SIGNAL(toggled(bool)), this, SLOT(hideWipedChanged(bool)));

    // Create our layouts.  A top to bottom box, with a grid in it.
    Q3BoxLayout *ml = new Q3BoxLayout(this, Q3BoxLayout::TopToBottom, 3, 3);
    ml->addWidget(list, 1);

    Q3GridLayout *bl = new Q3GridLayout(2, 6);
    bl->addWidget(newButton,            0, 0);
    bl->addWidget(openCloseButton,      0, 1);
    bl->addWidget(passwdButton,         0, 2);
    bl->addWidget(loginFlagsButton,     0, 3);
    bl->addWidget(adminMenuArea,        0, 5);
    
    bl->addWidget(editButton,           1, 0);
    bl->addWidget(modemUsageButton,     1, 1);
    bl->addWidget(bandwidthButton,      1, 2);
    bl->addWidget(diskSpaceButton,      1, 3);
    bl->addWidget(hideWiped,            1, 5);

    for (int i = 0 ; i < 5; i++) bl->setColStretch(i, 1);
    bl->setRowStretch(0, 0);
    bl->setRowStretch(1, 0);

    ml->addLayout(bl, 0);

	
	
//.........这里部分代码省略.........
开发者ID:gottafixthat,项目名称:tacc,代码行数:101,代码来源:Tab_Logins.cpp

示例11: createGeneralPage

void Preferences::createGeneralPage()
{
  // general parms page

  QWidget *w = new QWidget(this);
  Q3VBoxLayout *vbox = new Q3VBoxLayout(w);

  Q3GridLayout *grid = new Q3GridLayout(vbox, 1, 3);
  grid->setMargin(5);
  grid->setSpacing(5);
  grid->setColStretch(1, 1); // stretch 2nd col a little
  grid->setColStretch(2, 2); // stretch outer right col more

  vbox->insertStretch(-1, 1);

  // menubar checkbox
  QLabel *label = new QLabel(tr("Main Menubar"), w);
  grid->addWidget(label, 0, 0);

  menubarCheck = new QCheckBox(w);
  menubarCheck->setChecked(menubar);
  connect(menubarCheck, SIGNAL(stateChanged(int)), this, SLOT(slotModified()));
  grid->addWidget(menubarCheck, 0, 1);

  // extraToolbar checkbox
  label = new QLabel(tr("Extra Toolbar"), w);
  grid->addWidget(label, 1, 0);

  extraToolbarCheck = new QCheckBox(w);
  extraToolbarCheck->setChecked(extraToolbar);
  connect(extraToolbarCheck, SIGNAL(stateChanged(int)), this, SLOT(slotModified()));
  grid->addWidget(extraToolbarCheck, 1, 1);

  // bar spacing 1
  label = new QLabel(tr("Bar Spacing 1"), w);
  grid->addWidget(label, 2, 0);

  bs1Spinner = new QSpinBox(2, 99, 1, w);
  bs1Spinner->setValue(ps1Button);
  connect(bs1Spinner, SIGNAL(valueChanged(int)), this, SLOT(slotModified()));
  grid->addWidget(bs1Spinner, 2, 1);

  // bar spacing 2
  label = new QLabel(tr("Bar Spacing 2"), w);
  grid->addWidget(label, 3, 0);

  bs2Spinner = new QSpinBox(2, 99, 1, w);
  bs2Spinner->setValue(ps2Button);
  connect(bs2Spinner, SIGNAL(valueChanged(int)), this, SLOT(slotModified()));
  grid->addWidget(bs2Spinner, 3, 1);

  // bar spacing 3
  label = new QLabel(tr("Bar Spacing 3"), w);
  grid->addWidget(label, 4, 0);

  bs3Spinner = new QSpinBox(2, 99, 1, w);
  bs3Spinner->setValue(ps3Button);
  connect(bs3Spinner, SIGNAL(valueChanged(int)), this, SLOT(slotModified()));
  grid->addWidget(bs3Spinner, 4, 1);

  addTab(w, tr("General"));
}
开发者ID:DigitalPig,项目名称:qtstalker-qt4,代码行数:62,代码来源:Preferences.cpp

示例12: createCTPage

void  Preferences::createCTPage()
{
  // chart tool bar page

  QWidget *w = new QWidget(this);
  Q3VBoxLayout *vbox = new Q3VBoxLayout(w);

  Q3GridLayout *grid = new Q3GridLayout(vbox, 1, 2);
  grid->setMargin(5);
  grid->setSpacing(5);
  grid->setColStretch(1, 1);

  vbox->insertStretch(-1, 1);

  int i = 0; // count rows
  int j = 0; // "count" cols
  bool tb; // temporary
  RcFile rcfile;

  QLabel *label = new QLabel(tr("Compression list"), w);
  grid->addWidget(label, i, j);
  cmpsComboBoxCheck = new QCheckBox(w);
  rcfile.loadData(RcFile::ShowCmpsComboBox, tb);
  cmpsComboBoxCheck->setChecked(tb);
  connect(cmpsComboBoxCheck, SIGNAL(stateChanged(int)), this, SLOT(slotModified()));
  grid->addWidget(cmpsComboBoxCheck, i++, j + 1);

  label = new QLabel(tr("Compression 1 Minute"), w);
  grid->addWidget(label, i, j);
  cmps1MBtnCheck = new QCheckBox(w);
  rcfile.loadData(RcFile::ShowCmps1MBtn, tb);
  cmps1MBtnCheck->setChecked(tb);
  connect(cmps1MBtnCheck, SIGNAL(stateChanged(int)), this, SLOT(slotModified()));
  grid->addWidget(cmps1MBtnCheck, i++, j + 1);

//  label = new QLabel(tr("Compression 2 Minute"), w);
//  grid->addWidget(label, i, j);
//  cmps2MBtnCheck = new QCheckBox(w);
//  rcfile.loadData(RcFile::ShowCmps2MBtn, tb);
//  cmps2MBtnCheck->setChecked(tb);
//  connect(cmps2MBtnCheck, SIGNAL(stateChanged(int)), this, SLOT(slotModified()));
//  grid->addWidget(cmps2MBtnCheck, i++, j + 1);

  label = new QLabel(tr("Compression 5 Minute"), w);
  grid->addWidget(label, i, j);
  cmps5MBtnCheck = new QCheckBox(w);
  rcfile.loadData(RcFile::ShowCmps5MBtn, tb);
  cmps5MBtnCheck->setChecked(tb);
  connect(cmps5MBtnCheck, SIGNAL(stateChanged(int)), this, SLOT(slotModified()));
  grid->addWidget(cmps5MBtnCheck, i++, j + 1);

  label = new QLabel(tr("Compression 10 Minute"), w);
  grid->addWidget(label, i, j);
  cmps10MBtnCheck = new QCheckBox(w);
  rcfile.loadData(RcFile::ShowCmps10MBtn, tb);
  cmps10MBtnCheck->setChecked(tb);
  connect(cmps10MBtnCheck, SIGNAL(stateChanged(int)), this, SLOT(slotModified()));
  grid->addWidget(cmps10MBtnCheck, i++, j + 1);

  label = new QLabel(tr("Compression 15 Minute"), w);
  grid->addWidget(label, i, j);
  cmps15MBtnCheck = new QCheckBox(w);
  rcfile.loadData(RcFile::ShowCmps15MBtn, tb);
  cmps15MBtnCheck->setChecked(tb);
  connect(cmps15MBtnCheck, SIGNAL(stateChanged(int)), this, SLOT(slotModified()));
  grid->addWidget(cmps15MBtnCheck, i++, j + 1);

//  label = new QLabel(tr("Compression 20 Minute"), w);
//  grid->addWidget(label, i, j);
//  cmps20MBtnCheck = new QCheckBox(w);
//  rcfile.loadData(RcFile::ShowCmps20MBtn, tb);
//  cmps20MBtnCheck->setChecked(tb);
//  connect(cmps20MBtnCheck, SIGNAL(stateChanged(int)), this, SLOT(slotModified()));
//  grid->addWidget(cmps20MBtnCheck, i++, j + 1);

  label = new QLabel(tr("Compression 30 Minute"), w);
  grid->addWidget(label, i, j);
  cmps30MBtnCheck = new QCheckBox(w);
  rcfile.loadData(RcFile::ShowCmps30MBtn, tb);
  cmps30MBtnCheck->setChecked(tb);
  connect(cmps30MBtnCheck, SIGNAL(stateChanged(int)), this, SLOT(slotModified()));
  grid->addWidget(cmps30MBtnCheck, i++, j + 1);

  label = new QLabel(tr("Compression 1 Hour"), w);
  grid->addWidget(label, i, j);
  cmps1HBtnCheck = new QCheckBox(w);
  rcfile.loadData(RcFile::ShowCmps1HBtn, tb);
  cmps1HBtnCheck->setChecked(tb);
  connect(cmps1HBtnCheck, SIGNAL(stateChanged(int)), this, SLOT(slotModified()));
  grid->addWidget(cmps1HBtnCheck, i++, j + 1);

//  label = new QLabel(tr("Compression 2 Hour"), w);
//  grid->addWidget(label, i, j);
//  cmps2HBtnCheck = new QCheckBox(w);
//  rcfile.loadData(RcFile::ShowCmps2HBtn, tb);
//  cmps2HBtnCheck->setChecked(tb);
//  connect(cmps2HBtnCheck, SIGNAL(stateChanged(int)), this, SLOT(slotModified()));
//  grid->addWidget(cmps2HBtnCheck, i++, j + 1);

//  label = new QLabel(tr("Compression 4 Hour"), w);
//.........这里部分代码省略.........
开发者ID:DigitalPig,项目名称:qtstalker-qt4,代码行数:101,代码来源:Preferences.cpp

示例13: createMTPage

void  Preferences::createMTPage()
{
  // main tool bar page

  QWidget *w = new QWidget(this);
  Q3VBoxLayout *vbox = new Q3VBoxLayout(w);

  Q3GridLayout *grid = new Q3GridLayout(vbox, 1, 6); // two more cols as needed
  grid->setMargin(5);
  grid->setSpacing(5);
  grid->setColStretch(2, 1); // middle spacing col
  grid->setColStretch(5, 2); // outer right col

  vbox->insertStretch(-1, 1);

  int i = 0; // count rows
  int j = 0; // "count" cols
  bool tb; // temporary
  RcFile rcfile;

  QLabel *label = new QLabel(tr("Quit"), w);
  grid->addWidget(label, i, j);
  quitBtnCheck = new QCheckBox(w);
  rcfile.loadData(RcFile::ShowQuitBtn, tb);
  quitBtnCheck->setChecked(tb);
  connect(quitBtnCheck, SIGNAL(stateChanged(int)), this, SLOT(slotModified()));
  grid->addWidget(quitBtnCheck, i++, j + 1);

  label = new QLabel(tr("Preferences"), w);
  grid->addWidget(label, i, j);
  prefBtnCheck = new QCheckBox(w);
  rcfile.loadData(RcFile::ShowPrefBtn, tb);
  prefBtnCheck->setChecked(tb);
  connect(prefBtnCheck, SIGNAL(stateChanged(int)), this, SLOT(slotModified()));
  grid->addWidget(prefBtnCheck, i++, j + 1);

  label = new QLabel(tr("Side Panel"), w);
  grid->addWidget(label, i, j);
  sidePanelBtnCheck = new QCheckBox(w);
  rcfile.loadData(RcFile::ShowSidePanelBtn, tb);
  sidePanelBtnCheck->setChecked(tb);
  connect(sidePanelBtnCheck, SIGNAL(stateChanged(int)), this, SLOT(slotModified()));
  grid->addWidget(sidePanelBtnCheck, i++, j + 1);

  label = new QLabel(tr("Grid"), w);
  grid->addWidget(label, i, j);
  gridBtnCheck = new QCheckBox(w);
  rcfile.loadData(RcFile::ShowGridBtn, tb);
  gridBtnCheck->setChecked(tb);
  connect(gridBtnCheck, SIGNAL(stateChanged(int)), this, SLOT(slotModified()));
  grid->addWidget(gridBtnCheck, i++, j + 1);

  label = new QLabel(tr("Scale to Screen"), w);
  grid->addWidget(label, i, j);
  scaleToScreenBtnCheck = new QCheckBox(w);
  rcfile.loadData(RcFile::ShowScaleToScreenBtn, tb);
  scaleToScreenBtnCheck->setChecked(tb);
  connect(scaleToScreenBtnCheck, SIGNAL(stateChanged(int)), this, SLOT(slotModified()));
  grid->addWidget(scaleToScreenBtnCheck, i++, j + 1);

  label = new QLabel(tr("CrossHair"), w);
  grid->addWidget(label, i, j);
  crosshairBtnCheck = new QCheckBox(w);
  rcfile.loadData(RcFile::ShowCrosshairBtn, tb);
  crosshairBtnCheck->setChecked(tb);
  connect(crosshairBtnCheck, SIGNAL(stateChanged(int)), this, SLOT(slotModified()));
  grid->addWidget(crosshairBtnCheck, i++, j + 1);

  // now fill a second col
  i = 0;
  j = 3;

  label = new QLabel(tr("PaperTrade"), w);
  grid->addWidget(label, i, j);
  paperTradeBtnCheck = new QCheckBox(w);
  rcfile.loadData(RcFile::ShowPaperTradeBtn, tb);
  paperTradeBtnCheck->setChecked(tb);
  connect(paperTradeBtnCheck, SIGNAL(stateChanged(int)), this, SLOT(slotModified()));
  grid->addWidget(paperTradeBtnCheck, i++, j + 1);

  label = new QLabel(tr("DrawMode"), w);
  grid->addWidget(label, i, j);
  drawModeBtnCheck= new QCheckBox(w);
  rcfile.loadData(RcFile::ShowDrawModeBtn, tb);
  drawModeBtnCheck->setChecked(tb);
  connect(drawModeBtnCheck, SIGNAL(stateChanged(int)), this, SLOT(slotModified()));
  grid->addWidget(drawModeBtnCheck, i++, j + 1);

  label = new QLabel(tr("NewIndicator"), w);
  grid->addWidget(label, i, j);
  newIndicatorBtnCheck = new QCheckBox(w);
  rcfile.loadData(RcFile::ShowNewIndicatorBtn, tb);
  newIndicatorBtnCheck->setChecked(tb);
  connect(newIndicatorBtnCheck, SIGNAL(stateChanged(int)), this, SLOT(slotModified()));
  grid->addWidget(newIndicatorBtnCheck, i++, j + 1);

  label = new QLabel(tr("DataWindow"), w);
  grid->addWidget(label, i, j);
  dataWindowBtnCheck = new QCheckBox(w);
  rcfile.loadData(RcFile::ShowDataWindowBtn, tb);
//.........这里部分代码省略.........
开发者ID:DigitalPig,项目名称:qtstalker-qt4,代码行数:101,代码来源:Preferences.cpp

示例14: QLabel

ChangeBillingCycle::ChangeBillingCycle(QWidget* parent, const char* name, long CustID) :
	TAAWidget(parent)
{
	setCaption( "Edit Customer Billing Cycle" );

	if (!CustID) return;
	myCustID    = CustID;

    // Create the widgets
    QLabel *customerLabel = new QLabel("Customer:", this, "customerLabel");
    customerLabel->setAlignment(AlignRight|AlignVCenter);

    customer = new QLabel(this, "customer");
    customer->setAlignment(AlignLeft|AlignVCenter);

    QLabel *cycleListLabel = new QLabel("New Billing Cycle:", this, "cycleListLabel");
    cycleListLabel->setAlignment(AlignRight|AlignVCenter);

    cycleList = new QComboBox(false, this, "cycleList");

    QLabel *effectiveDateLabel = new QLabel("Effective Date:", this, "effectiveDateLabel");
    effectiveDateLabel->setAlignment(AlignRight|AlignVCenter);

    effectiveDate = new Q3DateEdit(QDate::currentDate(), this, "effectiveDate");

    QPushButton *saveButton = new QPushButton("&Save", this, "saveButton");
    connect(saveButton, SIGNAL(clicked()), this, SLOT(saveBillingCycleChange()));

    QPushButton *cancelButton = new QPushButton("&Save", this, "cancelButton");
    connect(cancelButton, SIGNAL(clicked()), this, SLOT(cancelBillingCycleChange()));

    // Our layout.
    Q3BoxLayout  *ml = new Q3BoxLayout(this, Q3BoxLayout::TopToBottom, 3);

    Q3GridLayout *gl = new Q3GridLayout(2, 3);
    int curRow = 0;
    gl->addWidget(customerLabel,        curRow, 0);
    gl->addWidget(customer,             curRow, 1);
    gl->setRowStretch(curRow, 0);

    curRow++;
    gl->addWidget(cycleListLabel,       curRow, 0);
    gl->addWidget(cycleList,            curRow, 1);
    gl->setRowStretch(curRow, 0);

    curRow++;
    gl->addWidget(effectiveDateLabel,   curRow, 0);
    gl->addWidget(effectiveDate,        curRow, 1);
    gl->setRowStretch(curRow, 0);

    gl->setColStretch(0, 0);
    gl->setColStretch(1, 1);

    ml->addLayout(gl, 0);
    ml->addStretch(1);

    Q3BoxLayout *bl = new Q3BoxLayout(Q3BoxLayout::LeftToRight, 3);
    bl->addStretch(1);
    bl->addWidget(saveButton, 0);
    bl->addWidget(cancelButton, 0);

    ml->addLayout(bl, 0);

	
	// Load the list of rate plans.
	ADB         DB;
	CustomersDB CDB;
	char        tmpStr[1024];
	
	CDB.get(CustID);
	
	sprintf(tmpStr, "%s (%ld)", (const char *) CDB.getStr("FullName"), myCustID);
	customer->setText(tmpStr);
	
	DB.query("select CycleID,InternalID from BillingCycles order by CycleID");
	while (DB.getrow()) {
	    cycleList->insertItem(DB.curRow["CycleID"]);
	    if (atol(DB.curRow["InternalID"]) == CDB.getLong("BillingCycle")) {
	        cycleList->setCurrentItem(cycleList->count()-1);
	    }
	}
	

}
开发者ID:gottafixthat,项目名称:tacc,代码行数:84,代码来源:ChangeBillingCycle.cpp

示例15: TAAWidget

DomainAliases::DomainAliases(QWidget *parent, const char *name)
   : TAAWidget(parent)
{
    setCaption("Email Alias List");
    // Create the widgets we'll need
    aliasList = new Q3ListView(this, "Alias List");
    aliasList->addColumn("Address");
    aliasList->addColumn("Domain");
    aliasList->addColumn("Mailbox");
    aliasList->addColumn("Time Stamp");
    aliasList->addColumn("Added By");
    aliasList->setAllColumnsShowFocus(true);
    virtIDCol = 5;

    address = new QLineEdit(this, "Address Input");
    address->setMaxLength(63);

    QLabel  *atLabel = new QLabel(this, "At label");
    atLabel->setText("@");

    QLabel  *mapsToLabel = new QLabel(this, "Maps To label");
    mapsToLabel->setText("maps to");

    domainList = new QComboBox(this, false);
    loginList = new QComboBox(this, false);


    addButton = new QPushButton(this, "Add Button");
    addButton->setText("&Add");
    connect(addButton, SIGNAL(clicked()), this, SLOT(addAlias()));

    refreshButton = new QPushButton(this, "Refresh Button");
    refreshButton->setText("&Refresh");
    connect(refreshButton, SIGNAL(clicked()), this, SLOT(refreshAlias()));

    autoButton = new QPushButton(this, "Auto Button");
    autoButton->setText("A&uto");
    connect(autoButton, SIGNAL(clicked()), this, SLOT(autoAlias()));

    delButton = new QPushButton(this, "Delete Button");
    delButton->setText("&Delete");
    connect(delButton, SIGNAL(clicked()), this, SLOT(delAlias()));
    
    closeButton = new QPushButton(this, "Close Button");
    closeButton->setText("&Close");
    connect(closeButton, SIGNAL(clicked()), this, SLOT(close()));

    HorizLine *hline1 = new HorizLine(this);

    // Our layout now.  Very simple top down box.
    Q3BoxLayout *ml = new Q3BoxLayout(this, Q3BoxLayout::TopToBottom, 3, 3);
    ml->addWidget(aliasList, 1);

    // Add in our "add" line.
    Q3BoxLayout *addl = new Q3BoxLayout(Q3BoxLayout::LeftToRight, 3);
    addl->addWidget(address, 1);
    addl->addWidget(atLabel, 0);
    addl->addWidget(domainList, 0);
    addl->addWidget(mapsToLabel, 0);
    addl->addWidget(loginList, 0);
    addl->addWidget(addButton, 0);

    ml->addLayout(addl, 0);
    ml->addWidget(hline1, 0);

    Q3GridLayout *bl = new Q3GridLayout(1, 4);
    int curCol = 0;
    bl->addWidget(refreshButton,    0, curCol++);
    bl->addWidget(autoButton,       0, curCol++);
    bl->addWidget(delButton,        0, curCol++);
    bl->addWidget(closeButton,      0, curCol++);
    for (int i = 0; i < curCol; i++) bl->setColStretch(i, 1);
    bl->setRowStretch(0, 0);

    // Now, the "button bar layout" to keep things spaced nicely.
    Q3BoxLayout  *bbl = new Q3BoxLayout(Q3BoxLayout::LeftToRight, 0);
    bbl->addStretch(1);
    bbl->addLayout(bl, 0);
    ml->addLayout(bbl);
} 
开发者ID:gottafixthat,项目名称:tacc,代码行数:80,代码来源:DomainAliases.cpp


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