本文整理汇总了C++中Q3BoxLayout::addStretch方法的典型用法代码示例。如果您正苦于以下问题:C++ Q3BoxLayout::addStretch方法的具体用法?C++ Q3BoxLayout::addStretch怎么用?C++ Q3BoxLayout::addStretch使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Q3BoxLayout
的用法示例。
在下文中一共展示了Q3BoxLayout::addStretch方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ViewWidget
HCircleView::HCircleView( int viewID_, QWidget *parent )
: ViewWidget( viewID_, parent)
{
setCaption("Harmonic Circle");
Q3BoxLayout *mainLayout = new Q3HBoxLayout(this);
Q3BoxLayout *leftLayout = new Q3VBoxLayout(mainLayout);
Q3BoxLayout *rightLayout = new Q3VBoxLayout(mainLayout);
Q3Grid *waveFrame = new Q3Grid(1, this);
waveFrame->setFrameStyle(Q3Frame::WinPanel | Q3Frame::Sunken);
leftLayout->addWidget(waveFrame);
hCircleWidget = new HCircleWidget(waveFrame);
Q3BoxLayout *bottomLayout = new Q3HBoxLayout(leftLayout);
QwtWheel* ZoomWheel = new QwtWheel(this);
ZoomWheel->setOrientation(Qt::Vertical);
ZoomWheel->setWheelWidth(14);
ZoomWheel->setRange(0.001, 0.1, 0.001, 1);
ZoomWheel->setValue(0.007);
hCircleWidget->setZoom(0.007);
QToolTip::add(ZoomWheel, "Zoom in or out");
rightLayout->addWidget(ZoomWheel);
QwtWheel* lowestValueWheel = new QwtWheel(this);
lowestValueWheel->setOrientation(Qt::Vertical);
lowestValueWheel->setWheelWidth(14);
lowestValueWheel->setRange(-160, 10, 0.01, 1);
lowestValueWheel->setValue(-100);
hCircleWidget->setLowestValue(-100);
QToolTip::add(lowestValueWheel, "Change the lowest value");
rightLayout->addWidget(lowestValueWheel);
rightLayout->addStretch(2);
QwtWheel* thresholdWheel = new QwtWheel(this);
thresholdWheel->setOrientation(Qt::Horizontal);
thresholdWheel->setWheelWidth(14);
thresholdWheel->setRange(-160, 10, 0.01, 1);
thresholdWheel->setValue(-100);
hCircleWidget->setThreshold(-100);
QToolTip::add(thresholdWheel, "Change the harmonic threshold");
bottomLayout->addWidget(thresholdWheel);
bottomLayout->addStretch(2);
connect(ZoomWheel, SIGNAL(valueChanged(double)), hCircleWidget, SLOT(setZoom(double)));
connect(ZoomWheel, SIGNAL(valueChanged(double)), hCircleWidget, SLOT(update()));
connect(lowestValueWheel, SIGNAL(valueChanged(double)), hCircleWidget, SLOT(setLowestValue(double)));
connect(lowestValueWheel, SIGNAL(valueChanged(double)), hCircleWidget, SLOT(update()));
connect(thresholdWheel, SIGNAL(valueChanged(double)), hCircleWidget, SLOT(setThreshold(double)));
connect(thresholdWheel, SIGNAL(valueChanged(double)), hCircleWidget, SLOT(update()));
}
示例2: TAAWidget
RateCenterManager::RateCenterManager
(
QWidget* parent,
const char* name
) : TAAWidget(parent)
{
setCaption( "Rate Center Manager" );
rcList = new Q3ListView(this, "Rate Center Manager");
rcList->setAllColumnsShowFocus(true);
rcList->setRootIsDecorated(true);
rcList->addColumn("Country/State/City");
rcList->addColumn("Active");
rcList->addColumn("Avail");
rcList->addColumn("Total");
connect(rcList, SIGNAL(doubleClicked(Q3ListViewItem *)), this, SLOT(itemDoubleClicked(Q3ListViewItem *)));
activeColumn = 1;
availColumn = 2;
totalColumn = 3;
idColumn = 4;
rcList->setColumnAlignment(activeColumn, Qt::AlignRight);
rcList->setColumnAlignment(availColumn, Qt::AlignRight);
rcList->setColumnAlignment(totalColumn, Qt::AlignRight);
addButton = new QPushButton(this, "Add Button");
addButton->setText("&Add");
connect(addButton, SIGNAL(clicked()), this, SLOT(addClicked()));
editButton = new QPushButton(this, "Edit Button");
editButton->setText("&Edit");
connect(editButton, SIGNAL(clicked()), this, SLOT(editClicked()));
deleteButton = new QPushButton(this, "Delete Button");
deleteButton->setText("&Delete");
connect(deleteButton, SIGNAL(clicked()), this, SLOT(deleteClicked()));
deleteButton->setEnabled(false);
closeButton = new QPushButton(this, "Close Button");
closeButton->setText("&Close");
connect(closeButton, SIGNAL(clicked()), this, SLOT(closeClicked()));
Q3BoxLayout *ml = new Q3BoxLayout(this, Q3BoxLayout::TopToBottom, 3, 3);
ml->addWidget(rcList, 1);
Q3BoxLayout *bl = new Q3BoxLayout(Q3BoxLayout::LeftToRight, 1);
bl->addStretch(1);
bl->addWidget(addButton, 0);
bl->addWidget(editButton, 0);
bl->addWidget(deleteButton, 0);
bl->addWidget(closeButton, 0);
ml->addLayout(bl, 0);
refreshRateCenters();
}
示例3: QTabBar
TE_Main::TE_Main(QWidget* parent, const char* name) :
TAAWidget(parent)
{
setCaption( "Targeted Email" );
// Create our widgets.
theTabBar = new QTabBar(this);
// Create the tabs for the tab bar.
theTabBar->addTab("Message");
theTabBar->addTab("Login Types");
theTabBar->addTab("Cities");
qws = new Q3WidgetStack(this, "widgetStack");
// Create the actual tabs now, using the widget stack as the parent.
tmessage = new TE_Message(qws);
qws->addWidget(tmessage, 0);
tlogins = new TE_LoginTypes(qws);
qws->addWidget(tlogins, 1);
tcities = new TE_Cities(qws);
qws->addWidget(tcities, 2);
// Buttons now.
QPushButton *sendButton = new QPushButton(this, "sendButton");
sendButton->setText("&Send");
connect(sendButton, SIGNAL(clicked()), this, SLOT(sendMessage()));
QPushButton *cancelButton = new QPushButton(this, "cancelButton");
cancelButton->setText("&Cancel");
connect(cancelButton, SIGNAL(clicked()), this, SLOT(cancelClicked()));
// Create our layout.
Q3BoxLayout *ml = new Q3BoxLayout(this, Q3BoxLayout::TopToBottom, 3);
ml->addWidget(theTabBar, 0);
ml->addWidget(qws, 1);
Q3BoxLayout *bl = new Q3BoxLayout(Q3BoxLayout::LeftToRight, 3);
bl->addStretch(1);
bl->addWidget(sendButton, 0);
bl->addWidget(cancelButton, 0);
ml->addLayout(bl, 0);
connect(theTabBar, SIGNAL(selected(int)), qws, SLOT(raiseWidget(int)));
// Create our Ctrl-1 through Ctrl-3 hotkeys
Q3Accel *ac = new Q3Accel(this);
ac->insertItem(Qt::CTRL+Qt::Key_1, 0);
ac->insertItem(Qt::CTRL+Qt::Key_2, 1);
ac->insertItem(Qt::CTRL+Qt::Key_3, 2);
connect(ac, SIGNAL(activated(int)), this, SLOT(raiseTab(int)));
}
示例4: TAAWidget
BillingCycles::BillingCycles
(
QWidget* parent,
const char* name
) : TAAWidget(parent)
{
// Create our widgets.
list = new Q3ListView(this, "Cycle List");
list->addColumn("Cycle ID");
list->addColumn("Type");
list->addColumn("Description");
list->setAllColumnsShowFocus(true);
// Create our buttons.
QPushButton *newButton = new QPushButton(this, "New");
newButton->setText("&New");
connect(newButton, SIGNAL(clicked()), this, SLOT(newCycle()));
QPushButton *editButton = new QPushButton(this, "Edit");
editButton->setText("&Edit");
connect(editButton, SIGNAL(clicked()), this, SLOT(editCycle()));
QPushButton *deleteButton = new QPushButton(this, "Delete");
deleteButton->setText("&Delete");
connect(deleteButton, SIGNAL(clicked()), this, SLOT(deleteCycle()));
QPushButton *closeButton = new QPushButton(this, "Close");
closeButton->setText("&Close");
connect(closeButton, SIGNAL(clicked()), this, SLOT(closeClicked()));
// Our layout. Very simple.
Q3BoxLayout *ml = new Q3BoxLayout(this, Q3BoxLayout::TopToBottom, 3, 3);
ml->addWidget(list, 1);
// Buttons.
Q3BoxLayout *bl = new Q3BoxLayout(Q3BoxLayout::LeftToRight, 1);
bl->addStretch(1);
bl->addWidget(newButton, 0);
bl->addWidget(editButton, 0);
bl->addWidget(deleteButton, 0);
bl->addWidget(closeButton, 0);
ml->addLayout(bl, 0);
// Create our layout.
setCaption( "Billing Cycles" );
}
示例5: QWidget
KexiCSVDelimiterWidget::KexiCSVDelimiterWidget(bool lineEditOnBottom, QWidget * parent)
: QWidget(parent)
, d(new Private())
{
Q3BoxLayout *lyr =
lineEditOnBottom ?
(Q3BoxLayout *)new Q3VBoxLayout(this, 0, KDialog::spacingHint())
: (Q3BoxLayout *)new Q3HBoxLayout(this, 0, KDialog::spacingHint());
d->combo = new KComboBox(this);
d->combo->setObjectName("KexiCSVDelimiterComboBox");
d->combo->addItem(i18n("Comma \",\"")); //<-- KEXICSV_DEFAULT_FILE_DELIMITER
d->combo->addItem(i18n("Semicolon \";\""));
d->combo->addItem(i18n("Tabulator"));
d->combo->addItem(i18n("Space \" \""));
d->combo->addItem(i18n("Other"));
lyr->addWidget(d->combo);
setFocusProxy(d->combo);
d->delimiterEdit = new KLineEdit(this);
d->delimiterEdit->setObjectName("d->delimiterEdit");
// d->delimiterEdit->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, d->delimiterEdit->sizePolicy().hasHeightForWidth() ) );
d->delimiterEdit->setMaximumSize(QSize(30, 32767));
d->delimiterEdit->setMaxLength(1);
lyr->addWidget(d->delimiterEdit);
if (!lineEditOnBottom)
lyr->addStretch(2);
slotDelimiterChangedInternal(KEXICSV_DEFAULT_FILE_DELIMITER_INDEX); //this will init d->delimiter
connect(d->combo, SIGNAL(activated(int)),
this, SLOT(slotDelimiterChanged(int)));
connect(d->delimiterEdit, SIGNAL(returnPressed()),
this, SLOT(slotDelimiterLineEditReturnPressed()));
connect(d->delimiterEdit, SIGNAL(textChanged(const QString &)),
this, SLOT(slotDelimiterLineEditTextChanged(const QString &)));
}
示例6: TAAWidget
/**
* CustomLoginFlagEditor::CustomLoginFlagEditor()
*
* Constructor for the Custom Login Flag Editor.
*/
CustomLoginFlagEditor::CustomLoginFlagEditor
(
QWidget* parent,
const char* name,
long CustID,
const char *loginID
) : TAAWidget(parent)
{
setCaption( "Login Flags" );
myCustID = CustID;
strcpy(myLoginID, loginID);
// Create labels to let the user know who we're editing
QLabel *custIDLabel = new QLabel(this, "custIDLabel");
char tmpStr[1024];
sprintf(tmpStr, "%ld", myCustID);
custIDLabel->setAlignment(AlignRight);
custIDLabel->setText("Customer ID:");
QLabel *custIDValue = new QLabel(this, "custIDValue");
custIDValue->setAlignment(AlignLeft);
custIDValue->setText(tmpStr);
QLabel *loginIDLabel = new QLabel(this, "loginIDLabel");
loginIDLabel->setAlignment(AlignRight);
loginIDLabel->setText("Login ID:");
QLabel *loginIDValue = new QLabel(this, "loginIDValue");
loginIDValue->setAlignment(AlignLeft);
loginIDValue->setText(myLoginID);
QStringList colHeaders;
colHeaders += "Flag";
colHeaders += "Value";
// Create all of our widgets.
flagTable = new Q3Table(0, 2, this, "flagTable");
flagTable->setColumnLabels(colHeaders);
QPushButton *saveButton = new QPushButton(this, "saveButton");
saveButton->setText("&Save");
QPushButton *cancelButton = new QPushButton(this, "cancelButton");
cancelButton->setText("&Cancel");
// Label layout
Q3GridLayout *gl = new Q3GridLayout(2, 2);
int curRow = 0;
gl->addWidget(custIDLabel, curRow, 0);
gl->addWidget(custIDValue, curRow, 1);
curRow++;
gl->addWidget(loginIDLabel, curRow, 0);
gl->addWidget(loginIDValue, curRow, 1);
curRow++;
gl->setColStretch(0, 0);
gl->setColStretch(1, 1);
// Create the layout
Q3BoxLayout *ml = new Q3BoxLayout(this, Q3BoxLayout::TopToBottom, 3, 3);
ml->addLayout(gl, 0);
ml->addWidget(flagTable, 1);
Q3BoxLayout *bl = new Q3BoxLayout(Q3BoxLayout::LeftToRight, 1);
bl->addStretch(1);
bl->addWidget(saveButton, 0);
bl->addWidget(cancelButton, 0);
ml->addLayout(bl, 0);
fillTable();
// Connect our buttons
connect(cancelButton, SIGNAL(clicked()), this, SLOT(cancelClicked()));
connect(saveButton, SIGNAL(clicked()), this, SLOT(saveClicked()));
}
示例7: QLabel
//.........这里部分代码省略.........
curRow++;
igrid->addWidget(customerNameLabel, curRow, 0);
igrid->addMultiCellWidget(customerName, curRow, curRow, 1, 3);
igrid->setRowStretch(curRow, 0);
curRow++;
igrid->addWidget(domainNameLabel, curRow, 0);
igrid->addMultiCellWidget(domainName, curRow, curRow, 1, 3);
igrid->setRowStretch(curRow, 0);
igrid->setColStretch(0, 0);
igrid->setColStretch(1, 1);
igrid->setColStretch(2, 0);
igrid->setColStretch(3, 0);
ml->addLayout(igrid, 0);
ml->addWidget(new HorizLine(this), 0);
Q3GridLayout *gl = new Q3GridLayout(12, 3, 3);
curRow = 0;
gl->addMultiCellWidget(hostmasterSubmit, curRow, curRow, 0, 1);
gl->addWidget(hostmastDate, curRow, 2);
gl->setRowStretch(curRow, 0);
curRow++;
gl->addMultiCellWidget(internicSubmit, curRow, curRow, 0, 1);
gl->addWidget(nicReqDate, curRow, 2);
gl->setRowStretch(curRow, 0);
curRow++;
gl->addMultiCellWidget(dnsDone, curRow, curRow, 0, 1);
gl->addWidget(dnsDate, curRow, 2);
gl->setRowStretch(curRow, 0);
curRow++;
gl->addMultiCellWidget(mailDone, curRow, curRow, 0, 1);
gl->addWidget(mailDate, curRow, 2);
gl->setRowStretch(curRow, 0);
curRow++;
gl->addMultiCellWidget(vserverDone, curRow, curRow, 0, 1);
gl->addWidget(vserverDate, curRow, 2);
gl->setRowStretch(curRow, 0);
curRow++;
gl->addWidget(serverListLabel, curRow, 0);
gl->addMultiCellWidget(serverList, curRow, curRow, 1, 2);
gl->setRowStretch(curRow, 0);
curRow++;
gl->addWidget(processListLabel, curRow, 0);
gl->addMultiCellWidget(processList, curRow, curRow, 1, 2);
gl->setRowStretch(curRow, 0);
curRow++;
gl->addWidget(ipAddressLabel, curRow, 0);
gl->addMultiCellWidget(ipAddress, curRow, curRow, 1, 2);
gl->setRowStretch(curRow, 0);
curRow++;
gl->addMultiCellWidget(internicDone, curRow, curRow, 0, 1);
gl->addWidget(nicDoneDate, curRow, 2);
gl->setRowStretch(curRow, 0);
curRow++;
gl->addWidget(nicAdminIDLabel, curRow, 0);
gl->addMultiCellWidget(nicAdminID, curRow, curRow, 1, 2);
gl->setRowStretch(curRow, 0);
curRow++;
gl->addWidget(nicBillIDLabel, curRow, 0);
gl->addMultiCellWidget(nicBillID, curRow, curRow, 1, 2);
gl->setRowStretch(curRow, 0);
curRow++;
gl->addMultiCellWidget(domainDone, curRow, curRow, 0, 1);
gl->addWidget(doneDate, curRow, 2);
gl->setRowStretch(curRow, 0);
gl->setColStretch(0, 0);
gl->setColStretch(1, 1);
gl->setColStretch(2, 0);
ml->addLayout(gl, 0);
ml->addStretch(1);
ml->addWidget(new HorizLine(this), 0);
Q3BoxLayout *bl = new Q3BoxLayout(Q3BoxLayout::LeftToRight, 3);
bl->addStretch(1);
bl->addWidget(updateButton, 0);
bl->addWidget(saveButton, 0);
bl->addWidget(cancelButton, 0);
ml->addLayout(bl, 0);
refreshCheckList();
}
示例8: 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);
}
}
}
示例9: ViewWidget
ScoreView::ScoreView( int viewID_, QWidget *parent )
: ViewWidget( viewID_, parent)
{
//QPalette p = palette();
//p.setBrush(QPalette::Window, QBrush(QPixmap(background_xpm)));
//setPalette(p);
//setAutoFillBackground(true);
Q3BoxLayout *mainLayout = new Q3HBoxLayout(this);
Q3BoxLayout *leftLayout = new Q3VBoxLayout(mainLayout);
Q3BoxLayout *rightLayout = new Q3VBoxLayout(mainLayout);
//create a drawing object
scoreWidget = new ScoreWidget(this);
leftLayout->addWidget(scoreWidget);
//scoreWidget->show();
Q3BoxLayout *bottomLayout = new Q3HBoxLayout(leftLayout);
//vertical scroll wheel
QwtWheel *scaleWheelY = new QwtWheel(this);
scaleWheelY->setOrientation(Qt::Vertical);
scaleWheelY->setWheelWidth(14);
scaleWheelY->setRange(1.0, 30.0, 0.1, 1);
scaleWheelY->setValue(scoreWidget->scaleY());
QToolTip::add(scaleWheelY, tr("Zoom vertically"));
rightLayout->addWidget(scaleWheelY, 1);
rightLayout->addStretch(4);
connect(scaleWheelY, SIGNAL(sliderMoved(double)), scoreWidget, SLOT(setScaleY(double)));
connect(scaleWheelY, SIGNAL(sliderMoved(double)), scoreWidget, SLOT(update()));
//horizontal scroll wheel
QwtWheel* scaleWheelX = new QwtWheel(this);
scaleWheelX->setOrientation(Qt::Horizontal);
scaleWheelX->setWheelWidth(16);
scaleWheelX->setRange(1.0, 100.0, 1.1, 1);
scaleWheelX->setValue(scoreWidget->scaleX());
QToolTip::add(scaleWheelX, tr("Zoom horizontally"));
connect(scaleWheelX, SIGNAL(sliderMoved(double)), scoreWidget, SLOT(setScaleX(double)));
connect(scaleWheelX, SIGNAL(sliderMoved(double)), scoreWidget, SLOT(update()));
QComboBox *sharpsModeComboBox = new QComboBox(this, tr("sharpsModeComboBox"));
QStringList s;
s << tr("Sharps") << tr("Flats");
sharpsModeComboBox->addItems(s);
connect(sharpsModeComboBox, SIGNAL(activated(int)), scoreWidget, SLOT(setSharpsMode(int)));
connect(sharpsModeComboBox, SIGNAL(activated(int)), scoreWidget, SLOT(update()));
QComboBox *notesModeComboBox = new QComboBox(this, tr("notesModeComboBox"));
s.clear();
s << tr("Notes") << tr("MIDI blocks");
notesModeComboBox->addItems(s);
connect(notesModeComboBox, SIGNAL(activated(int)), scoreWidget, SLOT(setNotesMode(int)));
connect(notesModeComboBox, SIGNAL(activated(int)), scoreWidget, SLOT(update()));
QComboBox *clefModeComboBox = new QComboBox(this, tr("clefModeComboBox"));
s.clear();
s << tr("Both clefs") << tr("Treble clef");
clefModeComboBox->addItems(s);
connect(clefModeComboBox, SIGNAL(activated(int)), scoreWidget, SLOT(setClefMode(int)));
connect(clefModeComboBox, SIGNAL(activated(int)), scoreWidget, SLOT(update()));
QComboBox *opaqueModeComboBox = new QComboBox(this, tr("opaqueModeComboBox"));
s.clear();
s << tr("See-through notes") << tr("Opaque notes");
opaqueModeComboBox->addItems(s);
connect(opaqueModeComboBox, SIGNAL(activated(int)), scoreWidget, SLOT(setOpaqueMode(int)));
connect(opaqueModeComboBox, SIGNAL(activated(int)), scoreWidget, SLOT(update()));
QComboBox *transposeComboBox = new QComboBox(this, tr("transposeComboBox"));
s.clear();
s << tr("Up 2 octaves") << tr("Up 1 octave") << tr("As played") << tr("Down 1 octave") << tr("Down 2 octaves");
transposeComboBox->addItems(s);
transposeComboBox->setCurrentIndex(2);
connect(transposeComboBox, SIGNAL(activated(int)), scoreWidget, SLOT(setTransposeLevel(int)));
connect(transposeComboBox, SIGNAL(activated(int)), scoreWidget, SLOT(update()));
QComboBox *showAllModeComboBox = new QComboBox(this, "showAllModeComboBox");
s.clear();
s << tr("Hide extream notes") << tr("Show all notes");
showAllModeComboBox->addItems(s);
connect(showAllModeComboBox, SIGNAL(activated(int)), scoreWidget, SLOT(setShowAllMode(int)));
connect(showAllModeComboBox, SIGNAL(activated(int)), scoreWidget, SLOT(update()));
bottomLayout->addWidget(scaleWheelX, 0);
bottomLayout->addStretch(1);
bottomLayout->addWidget(sharpsModeComboBox, 0);
bottomLayout->addStretch(1);
bottomLayout->addWidget(notesModeComboBox, 0);
bottomLayout->addStretch(1);
bottomLayout->addWidget(clefModeComboBox, 0);
bottomLayout->addStretch(1);
bottomLayout->addWidget(opaqueModeComboBox, 0);
bottomLayout->addStretch(1);
bottomLayout->addWidget(transposeComboBox, 0);
bottomLayout->addStretch(1);
bottomLayout->addWidget(showAllModeComboBox, 0);
bottomLayout->addStretch(4);
//make any connections
//.........这里部分代码省略.........
示例10: 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);
}
示例11: ViewWidget
//.........这里部分代码省略.........
connect(gdata, SIGNAL(activeIntThresholdChanged(int)), thresholdSpinBox, SLOT(setValue(int)));
*/
QComboBox *amplitudeModeComboBox = new QComboBox(bottomWidget, "amplitudeTypeModeBox");
//static const char* amplitudeModeItems[] = { "RMS (Log)", "Peak Amplitude (Log)", "Peak Correlation", "Purity", "Changeness", 0 };
//amplitudeModeComboBox->insertStrList(amplitudeModeItems);
//amplitudeModeComboBox->insertStrList(amp_mode_names, NUM_AMP_MODES);
amplitudeModeComboBox->setWhatsThis("Select different algorithm parameters to view in the bottom pannel");
int j;
QStringList s;
for(j=0; j<NUM_AMP_MODES; j++) s << amp_mode_names[j];
amplitudeModeComboBox->addItems(s);
connect(amplitudeModeComboBox, SIGNAL(activated(int)), gdata, SLOT(setAmplitudeMode(int)));
connect(amplitudeModeComboBox, SIGNAL(activated(int)), amplitudeWidget, SLOT(update()));
QComboBox *pitchContourModeComboBox = new QComboBox(bottomWidget, "pitchContourModeComboBox");
pitchContourModeComboBox->setWhatsThis("Select whether the Pitch Contour line fades in/out with clarity/loudness of the sound or is a solid dark line");
//static const char* pitchContourModeItems[] = { "Clarity fading", "Note grouping", 0 };
//pitchContourModeComboBox->insertStrList(pitchContourModeItems);
s.clear();
s << "Clarity fading" << "Note grouping";
pitchContourModeComboBox->addItems(s);
connect(pitchContourModeComboBox, SIGNAL(activated(int)), gdata, SLOT(setPitchContourMode(int)));
//connect(pitchContourModeComboBox, SIGNAL(activated(int)), freqDrawWidget, SLOT(update()));
connect(pitchContourModeComboBox, SIGNAL(activated(int)), freqWidgetGL, SLOT(update()));
freqWheelX = new QwtWheel(bottomWidget);
freqWheelX->setOrientation(Qt::Horizontal);
freqWheelX->setWheelWidth(16);
freqWheelX->setRange(0.5, 9.0, 0.001, 1);
freqWheelX->setValue(2.0);
QToolTip::add(freqWheelX, "Zoom horizontally");
bottomBottomLayout->addStretch(2);
//bottomBottomLayout->addWidget(thresholdSpinBox, 0);
//bottomBottomLayout->addStretch(2);
bottomBottomLayout->addWidget(amplitudeModeComboBox, 0);
bottomBottomLayout->addStretch(2);
bottomBottomLayout->addWidget(pitchContourModeComboBox, 0);
bottomBottomLayout->addStretch(2);
bottomBottomLayout->addWidget(freqWheelX, 1);
bottomBottomLayout->addSpacing(16);
//Create the horizontal scrollbar and +/- buttons
//hScrollBar = new MyScrollBar(gdata->leftTime(), gdata->rightTime(), 0.1, view->viewWidth(), view->currentTime(), 10000, Qt::Horizontal, this);
/*
QPushButton *buttonPlusX = new QPushButton("+", this);
buttonPlusX->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed));
buttonPlusX->setFixedSize(15, 15);
QToolTip::add(buttonPlusX, "Zoom in horizontal");
QPushButton *buttonMinusX = new QPushButton("-", this);
buttonMinusX->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed));
buttonMinusX->setFixedSize(15, 15);
QToolTip::add(buttonMinusX, "Zoom out horizontal");
*/
//Create the resize grip. The thing in the bottom right hand corner
QSizeGrip *sizeGrip = new QSizeGrip(bottomWidget);
sizeGrip->setFixedSize(15, 15);
//sizeGrip->setSizePolicy(QSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum, false));
sizeGrip->setSizePolicy(QSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred, false));
bottomBottomLayout->addWidget(sizeGrip);
//Actually add all the widgets into the widget layout
示例12: 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);
}
示例13: ViewWidget
HTrackView::HTrackView( int viewID_, QWidget *parent )
: ViewWidget( viewID_, parent)
{
//setCaption("HTrack view");
Q3GridLayout *mainLayout = new Q3GridLayout(this, 2, 2);
mainLayout->setResizeMode(QLayout::SetNoConstraint);
//QBoxLayout *topLayout = new QVBoxLayout(mainLayout);
//QBoxLayout *rightLayout = new QVBoxLayout(mainLayout);
Q3BoxLayout *rightLayout = new Q3VBoxLayout();
Q3BoxLayout *bottomLayout = new Q3HBoxLayout();
Q3Grid *frame = new Q3Grid(1, this);
frame->setFrameStyle(Q3Frame::WinPanel | Q3Frame::Sunken);
//frame->setLineWidth(2);
//frame->setMidLineWidth(2);
QWidget *aWidget = new QWidget(frame);
hTrackWidget = new HTrackWidget(aWidget);
hTrackWidget->setWhatsThis("Shows a 3D keyboard with the current note coloured. "
"Vertical columns (or tracks), each representing a harmonic (or component frequency), protrude from the back, and move further away over time. "
"The height of each track is related to how much energy is at that frequency. "
"Tracks alternate in colour for better visibility. It can be seen how the hamonics in a note fit into the musical scale.");
//hTrackWidget->show();
peakThresholdSlider = new QSlider(0, 100, 10, 5, Qt::Vertical, this);
QToolTip::add(peakThresholdSlider, "Thresholding of harmonics");
rotateXWheel = new QwtWheel(this);
rotateXWheel->setWheelWidth(20);
rotateXWheel->setRange(-180, 180, 0.1, 1);
QToolTip::add(rotateXWheel, "Rotate piano horizonally");
rotateYWheel = new QwtWheel(this);
rotateYWheel->setOrientation(Qt::Vertical);
rotateYWheel->setWheelWidth(20);
rotateYWheel->setRange(-90, 0, 0.1, 1);
QToolTip::add(rotateYWheel, "Rotate piano vertically");
distanceWheel = new QwtWheel(this);
distanceWheel->setOrientation(Qt::Vertical);
//distanceWheel->setWheelWidth(20);
distanceWheel->setRange(100, 5000, 10, 20);
distanceWheel->setTotalAngle(20*360);
QToolTip::add(distanceWheel, "Move towards/away from piano");
QPushButton *homeButton = new QPushButton("Reset", this, "homebutton");
QToolTip::add(homeButton, "Return to the original view");
QSizeGrip *sizeGrip = new QSizeGrip(this);
//sizeGrip->setFixedSize(15, 15);
mainLayout->addWidget(frame, 0, 0);
mainLayout->addLayout(bottomLayout, 1, 0);
mainLayout->addLayout(rightLayout, 0, 1);
rightLayout->addStretch(2);
rightLayout->addWidget(peakThresholdSlider);
rightLayout->addStretch(4);
rightLayout->addWidget(rotateYWheel);
rightLayout->addSpacing(14);
rightLayout->addWidget(distanceWheel);
bottomLayout->addStretch(0);
bottomLayout->addWidget(homeButton);
bottomLayout->addSpacing(14);
bottomLayout->addWidget(rotateXWheel);
//bottomLayout->addSpacing(20);
mainLayout->addWidget(sizeGrip, 1, 1);
//make the widget get updated when the view changes
connect(gdata->view, SIGNAL(onSlowUpdate(double)), hTrackWidget, SLOT(update()));
connect(peakThresholdSlider, SIGNAL(valueChanged(int)), this, SLOT(setPeakThreshold(int)));
connect(rotateYWheel, SIGNAL(valueChanged(double)), hTrackWidget, SLOT(setViewAngleVertical(double)));
connect(rotateYWheel, SIGNAL(valueChanged(double)), hTrackWidget, SLOT(update()));
connect(hTrackWidget, SIGNAL(viewAngleVerticalChanged(double)), rotateYWheel, SLOT(setValue(double)));
connect(distanceWheel, SIGNAL(valueChanged(double)), hTrackWidget, SLOT(setDistanceAway(double)));
connect(distanceWheel, SIGNAL(valueChanged(double)), hTrackWidget, SLOT(update()));
connect(hTrackWidget, SIGNAL(distanceAwayChanged(double)), distanceWheel, SLOT(setValue(double)));
connect(rotateXWheel, SIGNAL(valueChanged(double)), hTrackWidget, SLOT(setViewAngleHorizontal(double)));
connect(rotateXWheel, SIGNAL(valueChanged(double)), hTrackWidget, SLOT(update()));
connect(hTrackWidget, SIGNAL(viewAngleHorizontalChanged(double)), rotateXWheel, SLOT(setValue(double)));
connect(homeButton, SIGNAL(clicked()), hTrackWidget, SLOT(home()));
}
示例14: TAAWidget
CallWizard::CallWizard
(
QWidget* parent,
const char* name
) : TAAWidget(parent)
{
setCaption("Call Logger");
titleBar = new QStatusBar(this);
titleBar->setSizeGripEnabled(false);
titleBar->message("Call Logger");
QLabel *hline1 = new QLabel(this);
hline1->setFrameStyle(Q3Frame::HLine|Q3Frame::Sunken);
hline1->setMaximumHeight(3);
hangupButton = new QPushButton(this, "Hangup Button");
hangupButton->setText("Han&g Up");
connect(hangupButton, SIGNAL(clicked()), this, SLOT(stopTimer()));
transferButton = new QPushButton(this, "Transfer Button");
transferButton->setText("&Transfer");
transferButton->hide();
proceedButton = new QPushButton(this, "Proceed Button");
proceedButton->setText("&Proceed");
QLabel *hline2 = new QLabel(this);
hline2->setFrameStyle(Q3Frame::HLine|Q3Frame::Sunken);
hline2->setMaximumHeight(3);
status = new QStatusBar(this);
status->message("Status bar here.");
mainArea = new Q3WidgetStack(this);
typeSel = new CallTypeSelector(mainArea, "CallTypeSelector");
mainArea->addWidget(typeSel, 0);
mainArea->raiseWidget(0);
// Now, do the layout for the widget.
Q3BoxLayout *ml = new Q3BoxLayout(this, Q3BoxLayout::TopToBottom, 0, 3);
ml->addWidget(titleBar, 0);
ml->addWidget(hline1, 0);
ml->addWidget(mainArea, 1);
Q3BoxLayout *butlay = new Q3BoxLayout(Q3BoxLayout::LeftToRight, 3);
butlay->addStretch(1);
butlay->addWidget(hangupButton, 0);
butlay->addWidget(transferButton, 0);
butlay->addWidget(proceedButton, 0);
butlay->addSpacing(3);
ml->addLayout(butlay, 0);
ml->addWidget(hline2, 0);
ml->addWidget(status, 0);
callStart = QDateTime::currentDateTime();
callEnd = QDateTime::currentDateTime();
clockLCD = new QLCDNumber(status, "Clock Timer");
clockLCD->setMode(QLCDNumber::DEC);
clockLCD->setSegmentStyle(QLCDNumber::Flat);
clockLCD->setNumDigits(7);
clockLCD->display("0:00:00");
status->addWidget(clockLCD, 0, true);
clockTimer = new QTimer(this);
connect(clockTimer, SIGNAL(timeout()), this, SLOT(updateClock()));
clockTimer->start(1000);
timerRunning = 1;
// Make it the same width as an 80 column wide RXVT terminal window.
resize(499, 385);
}
示例15: TAAWidget
//.........这里部分代码省略.........
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);
asl->addWidget(targetAccountLabel, curRow, 0);
asl->addWidget(targetAccountList, curRow, 1);
asl->setRowStretch(curRow++, 0);
asl->addWidget(transDateLabel, curRow, 0);
asl->addWidget(transDate, curRow, 1);
asl->setRowStretch(curRow++, 0);
// Now our button layout
Q3BoxLayout *bl = new Q3BoxLayout(Q3BoxLayout::LeftToRight, 3);
bl->addStretch(1);
bl->addWidget(printButton, 0);
bl->addWidget(selectAllButton, 0);
bl->addWidget(selectNoneButton, 0);
bl->addWidget(continueButton, 0);
bl->addWidget(cancelButton, 0);
// Add the buttons to our other widget layout
//owl->addLayout(bl, 0);
// Add the other widget layout to our main layout.
ml->addLayout(asl, 0);
ml->addWidget(new HorizLine(this), 0);
ml->addLayout(bl, 0);
// Done with the layout.
// Fill our account list.
ADB DB;
int tmpPos = 0;
DB.query("select IntAccountNo, AccountNo, AcctName from Accounts order by AccountNo");
accountIDX = new long[DB.rowCount+2];
accountIDX[0] = 0;
QString tmpStr;
if (DB.rowCount) while (DB.getrow()) {
accountIDX[tmpPos++] = atol(DB.curRow["IntAccountNo"]);
tmpStr = DB.curRow["AccountNo"];
tmpStr += " ";
tmpStr += DB.curRow["AcctName"];
targetAccountList->insertItem(tmpStr);
}
selTotal = 0.00;
fillDepositList();
}