本文整理汇总了C++中QSizePolicy函数的典型用法代码示例。如果您正苦于以下问题:C++ QSizePolicy函数的具体用法?C++ QSizePolicy怎么用?C++ QSizePolicy使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了QSizePolicy函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: QScrollArea
void toResultDataSingle::changeSource(toResultModelEdit *model, int _row)
{
delete Container;
Container = new QScrollArea(this);
layout()->addWidget(Container);
Model = model;
ProgressBar->setMaximum(Model->rowCount());
ProgressBar->setValue(_row);
QWidget *ext = new QWidget(Container);
Container->setWidget(ext);
Container->setWidgetResizable(true);
QGridLayout *grid = new QGridLayout;
ext->setLayout(grid);
Value.clear();
Null.clear();
const toResultModel::HeaderList Headers = Model->headers();
int row = 1 + Model->getPriKeys().size();
int col = 0;
for (; row < Headers.size(); row++, col = 0)
{
QLabel *name = new QLabel(Headers[row].name, this);
grid->addWidget(name, row, col++);
QLineEdit *edit = new QLineEdit(this);
edit->setObjectName(QString::number(row));
edit->setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding,
QSizePolicy::Minimum));
grid->addWidget(edit, row, col);
// edit widget should get the most space
grid->setColumnStretch(col++, 1);
QCheckBox *box = new QCheckBox(("NULL"), this);
connect(box, SIGNAL(toggled(bool)), edit, SLOT(setDisabled(bool)));
grid->addWidget(box, row, col++);
toParamGetButton *btn = new toParamGetButton(row, this);
btn->setText(tr("Edit"));
btn->setSizePolicy(QSizePolicy(QSizePolicy::Maximum, QSizePolicy::Fixed));
connect(btn, SIGNAL(clicked(int)), this, SLOT(showMemo(int)));
connect(box, SIGNAL(toggled(bool)), btn, SLOT(setDisabled(bool)));
connect(box, SIGNAL(toggled(bool)), this, SLOT(saveRow()));
connect(edit, SIGNAL(editingFinished()), this, SLOT(saveRow()));
grid->addWidget(btn, row, col++);
Value.append(edit);
Null.append(box);
}
// add widget at bottom of grid so it can resize
grid->addWidget(new QLabel(this), row, 0);
grid->setRowStretch(row, 1);
changeRow(Row);
connect(Model,
SIGNAL(dataChanged(const QModelIndex &, const QModelIndex &)),
this,
SLOT(dataChanged(const QModelIndex &, const QModelIndex &)));
}
开发者ID:dieface,项目名称:tora,代码行数:66,代码来源:toresultdatasingle.cpp
示例2: QWidget
//.........这里部分代码省略.........
layout9_2->addWidget( m_hardwareCb, 0, 2 );
m_softwareCb = new QCheckBox( this, "m_softwareCb" );
layout9_2->addWidget( m_softwareCb, 0, 1 );
m_writeCb = new QCheckBox( this, "m_writeCb" );
layout9_2->addWidget( m_writeCb, 1, 2 );
m_readCb = new QCheckBox( this, "m_readCb" );
layout9_2->addWidget( m_readCb, 1, 1 );
textLabel1_3 = new QLabel( this, "textLabel1_3" );
layout9_2->addWidget( textLabel1_3, 1, 0 );
textLabel2_2 = new QLabel( this, "textLabel2_2" );
layout9_2->addWidget( textLabel2_2, 0, 0 );
layout10->addLayout( layout9_2 );
m_applyCb = new QCheckBox( this, "m_applyCb" );
layout10->addWidget( m_applyCb );
layout11->addMultiCellLayout( layout10, 0, 3, 3, 3 );
CuteCommDlgLayout->addLayout( layout11 );
splitter2 = new QSplitter( this, "splitter2" );
splitter2->setOrientation( QSplitter::Vertical );
frame3 = new QFrame( splitter2, "frame3" );
frame3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)5, 0, 2, frame3->sizePolicy().hasHeightForWidth() ) );
frame3->setFrameShape( QFrame::StyledPanel );
frame3->setFrameShadow( QFrame::Raised );
frame3Layout = new QVBoxLayout( frame3, 11, 6, "frame3Layout");
m_outputView = new QTextBrowser( frame3, "m_outputView" );
QFont m_outputView_font( m_outputView->font() );
m_outputView_font.setFamily( "Courier" );
m_outputView->setFont( m_outputView_font );
m_outputView->setTextFormat( QTextBrowser::PlainText );
m_outputView->setWrapPolicy( QTextBrowser::Anywhere );
frame3Layout->addWidget( m_outputView );
layout10_2 = new QHBoxLayout( 0, 0, 6, "layout10_2");
m_clearOutputPb = new QPushButton( frame3, "m_clearOutputPb" );
layout10_2->addWidget( m_clearOutputPb );
m_hexOutputCb = new QCheckBox( frame3, "m_hexOutputCb" );
m_hexOutputCb->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)0, 1, 0, m_hexOutputCb->sizePolicy().hasHeightForWidth() ) );
layout10_2->addWidget( m_hexOutputCb );
m_enableLoggingCb = new QCheckBox( frame3, "m_enableLoggingCb" );
layout10_2->addWidget( m_enableLoggingCb );
m_logAppendCb = new QComboBox( FALSE, frame3, "m_logAppendCb" );
layout10_2->addWidget( m_logAppendCb );
m_logFileLe = new QLineEdit( frame3, "m_logFileLe" );
m_logFileLe->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 2, 0, m_logFileLe->sizePolicy().hasHeightForWidth() ) );
layout10_2->addWidget( m_logFileLe );
m_logFileFileDialog = new QPushButton( frame3, "m_logFileFileDialog" );
开发者ID:GSI-CS-CO,项目名称:kernel_modules,代码行数:67,代码来源:cutecommdlg.cpp
示例3: WidgetItem
void QtGroupBoxPropertyBrowserPrivate::propertyInserted(QtBrowserItem *index, QtBrowserItem *afterIndex)
{
WidgetItem *afterItem = m_indexToItem.value(afterIndex);
WidgetItem *parentItem = m_indexToItem.value(index->parent());
WidgetItem *newItem = new WidgetItem();
newItem->parent = parentItem;
QGridLayout *layout = 0;
QWidget *parentWidget = 0;
int row = -1;
if (!afterItem) {
row = 0;
if (parentItem)
parentItem->children.insert(0, newItem);
else
m_children.insert(0, newItem);
} else {
if (parentItem) {
row = parentItem->children.indexOf(afterItem) + 1;
parentItem->children.insert(row, newItem);
} else {
row = m_children.indexOf(afterItem) + 1;
m_children.insert(row, newItem);
}
}
if (parentItem && hasHeader(parentItem))
row += 2;
if (!parentItem) {
layout = m_mainLayout;
parentWidget = q_ptr;;
} else {
if (!parentItem->groupBox) {
m_recreateQueue.removeAll(parentItem);
WidgetItem *par = parentItem->parent;
QWidget *w = 0;
QGridLayout *l = 0;
int oldRow = -1;
if (!par) {
w = q_ptr;
l = m_mainLayout;
oldRow = m_children.indexOf(parentItem);
} else {
w = par->groupBox;
l = par->layout;
oldRow = par->children.indexOf(parentItem);
if (hasHeader(par))
oldRow += 2;
}
parentItem->groupBox = new QGroupBox(w);
parentItem->layout = new QGridLayout();
parentItem->groupBox->setLayout(parentItem->layout);
if (parentItem->label) {
l->removeWidget(parentItem->label);
delete parentItem->label;
parentItem->label = 0;
}
if (parentItem->widget) {
l->removeWidget(parentItem->widget);
parentItem->widget->setParent(parentItem->groupBox);
parentItem->layout->addWidget(parentItem->widget, 0, 0, 1, 2);
parentItem->line = new QFrame(parentItem->groupBox);
} else if (parentItem->widgetLabel) {
l->removeWidget(parentItem->widgetLabel);
delete parentItem->widgetLabel;
parentItem->widgetLabel = 0;
}
if (parentItem->line) {
parentItem->line->setFrameShape(QFrame::HLine);
parentItem->line->setFrameShadow(QFrame::Sunken);
parentItem->layout->addWidget(parentItem->line, 1, 0, 1, 2);
}
l->addWidget(parentItem->groupBox, oldRow, 0, 1, 2);
updateItem(parentItem);
}
layout = parentItem->layout;
parentWidget = parentItem->groupBox;
}
newItem->label = new QLabel(parentWidget);
newItem->label->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed));
newItem->widget = createEditor(index->property(), parentWidget);
if (!newItem->widget) {
newItem->widgetLabel = new QLabel(parentWidget);
newItem->widgetLabel->setSizePolicy(QSizePolicy(QSizePolicy::Ignored, QSizePolicy::Fixed));
newItem->widgetLabel->setTextFormat(Qt::PlainText);
} else {
QObject::connect(newItem->widget, SIGNAL(destroyed()), q_ptr, SLOT(slotEditorDestroyed()));
m_widgetToItem[newItem->widget] = newItem;
}
insertRow(layout, row);
int span = 1;
if (newItem->widget)
layout->addWidget(newItem->widget, row, 1);
else if (newItem->widgetLabel)
layout->addWidget(newItem->widgetLabel, row, 1);
else
span = 2;
//.........这里部分代码省略.........
开发者ID:samuel79,项目名称:qt-solutions,代码行数:101,代码来源:qtgroupboxpropertybrowser.cpp
示例4: QSizePolicy
QSizePolicy EditSvcPerms::sizePolicy() const
{
return QSizePolicy(QSizePolicy::Fixed,QSizePolicy::Fixed);
}
开发者ID:stgabmp,项目名称:Rivendell,代码行数:4,代码来源:edit_svc_perms.cpp
示例5: IconButton
IconButton(const QString& path, QWidget*parent = 0) : QPushButton(QIcon(path), "", parent) {
setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed));
setParent(parent);
setFixedSize(QSize(24, 24));
}
开发者ID:jameseriot,项目名称:realopinsight-workstation,代码行数:5,代码来源:ServiceEditor.hpp
示例6: QSizePolicy
QSizePolicy RDAudioSettingsDialog::sizePolicy() const
{
return QSizePolicy(QSizePolicy::Fixed,QSizePolicy::Fixed);
}
开发者ID:ElvishArtisan,项目名称:rivendell,代码行数:4,代码来源:rdaudiosettings_dialog.cpp
示例7: invalidateFixedSizes
//.........这里部分代码省略.........
#endif
} else if ( dockLine == 0 && insertLine ) { // insert before first line
dockWindows->insert( 0, dockWindow );
dockWindows->at( 1 )->setNewLine( TRUE );
#if defined(QDOCKAREA_DEBUG)
qDebug( "insert at the begin" );
#endif
} else { // insert somewhere in between
// make sure each line start has a new line
for ( dw = lineStarts.first(); dw; dw = lineStarts.next() )
dw->setNewLine( TRUE );
// find the index of the first widget in the search line
int searchLine = dockLine;
#if defined(QDOCKAREA_DEBUG)
qDebug( "search line start of %d", searchLine );
#endif
QDockWindow *lsw = lineStarts.at( searchLine );
int index = dockWindows->find( lsw );
if ( index == -1 ) { // the linestart widget hasn't been found, try to find it harder
if ( lsw == w && dockWindowIndex <= (int)dockWindows->count())
index = dockWindowIndex;
else
index = 0;
if ( index < (int)dockWindows->count() )
(void)dockWindows->at( index ); // move current to index
}
#if defined(QDOCKAREA_DEBUG)
qDebug( " which starts at %d", index );
#endif
if ( !insertLine ) { // if we insert the docking widget in the existing line
// find the index for the widget
bool inc = TRUE;
bool firstTime = TRUE;
for ( dw = dockWindows->current(); dw; dw = dockWindows->next() ) {
if ( orientation() == Horizontal )
dw->setFixedExtentWidth( -1 );
else
dw->setFixedExtentHeight( -1 );
if ( !firstTime && lineStarts.find( dw ) != -1 ) // we are in the next line, so break
break;
if ( point_pos( pos, orientation() ) <
point_pos( fix_pos( dw ), orientation() ) + size_extent( dw->size(), orientation() ) / 2 ) {
inc = FALSE;
}
if ( inc )
index++;
firstTime = FALSE;
}
#if defined(QDOCKAREA_DEBUG)
qDebug( "insert at index: %d", index );
#endif
// if we insert it just before a widget which has a new line, transfer the newline to the docking widget
// but not if we didn't only mave a widget in its line which was alone in the line before
if ( !( wasAloneInLine && lr.contains( pos ) )
&& index >= 0 && index < (int)dockWindows->count() &&
dockWindows->at( index )->newLine() && lineOf( index ) == dockLine ) {
#if defined(QDOCKAREA_DEBUG)
qDebug( "get rid of the old newline and get me one" );
#endif
dockWindows->at( index )->setNewLine( FALSE );
dockWindow->setNewLine( TRUE );
} else if ( wasAloneInLine && lr.contains( pos ) ) {
dockWindow->setNewLine( TRUE );
} else { // if we are somewhere in a line, get rid of the newline
dockWindow->setNewLine( FALSE );
}
} else { // insert in a new line, so make sure the dock widget and the widget which will be after it have a newline
#if defined(QDOCKAREA_DEBUG)
qDebug( "insert a new line" );
#endif
if ( index < (int)dockWindows->count() ) {
#if defined(QDOCKAREA_DEBUG)
qDebug( "give the widget at %d a newline", index );
#endif
QDockWindow* nldw = dockWindows->at( index );
if ( nldw )
nldw->setNewLine( TRUE );
}
#if defined(QDOCKAREA_DEBUG)
qDebug( "give me a newline" );
#endif
dockWindow->setNewLine( TRUE );
}
// finally insert the widget
dockWindows->insert( index, dockWindow );
}
}
if ( mse != -10 && w->isResizeEnabled() ) {
if ( orientation() != Qt::Horizontal )
w->setFixedExtentWidth( QMIN( QMAX( w->minimumWidth(), mse ), w->sizeHint().width() ) );
else
w->setFixedExtentHeight( QMIN( QMAX( w->minimumHeight(), mse ), w->sizeHint().height() ) );
}
updateLayout();
setSizePolicy( QSizePolicy( orientation() == Horizontal ? QSizePolicy::Expanding : QSizePolicy::Minimum,
orientation() == Vertical ? QSizePolicy::Expanding : QSizePolicy::Minimum ) );
}
开发者ID:AliYousuf,项目名称:univ-aca-mips,代码行数:101,代码来源:qdockarea.cpp
示例8: QSizePolicy
QSizePolicy ImportTrack::sizePolicy() const
{
return QSizePolicy(QSizePolicy::Fixed,QSizePolicy::Fixed);
}
开发者ID:WMFO,项目名称:rivendell,代码行数:4,代码来源:import_track.cpp
示例9: QDialog
RoutingDialog::RoutingDialog(QWidget* parentWindow,
DBThread* dbThread,
const SettingsRef& settings)
: QDialog(parentWindow),
settings(settings),
dbThread(dbThread),
from(new QLineEdit()),
hasStart(false),
to(new QLineEdit()),
hasEnd(false),
routeView(new QTableView()),
routeModel(new RouteModel())
{
QVBoxLayout *mainLayout=new QVBoxLayout();
QFormLayout *formLayout=new QFormLayout();
QHBoxLayout *fromBoxLayout=new QHBoxLayout();
QHBoxLayout *toBoxLayout=new QHBoxLayout();
QHBoxLayout *asBoxLayout=new QHBoxLayout();
QPushButton *selectFromButton=new QPushButton("...");
QPushButton *selectToButton=new QPushButton("...");
QButtonGroup *routeTypes = new QButtonGroup();
QPushButton *routeTypeFoot = new QPushButton("Foot");
QPushButton *routeTypeBicycle = new QPushButton("Bicycle");
QPushButton *routeTypeCar = new QPushButton("Car");
from->setReadOnly(true);
from->setEnabled(false);
from->setMinimumWidth(QApplication::fontMetrics().width("mlxi")/4*70);
//from->setPlaceholderText("Starting location");
to->setReadOnly(true);
to->setEnabled(false);
to->setMinimumWidth(QApplication::fontMetrics().width("mlxi")/4*70);
//to->setPlaceholderText("Destination location");
selectFromButton->setSizePolicy(QSizePolicy(QSizePolicy::Minimum,QSizePolicy::Fixed));
selectToButton->setSizePolicy(QSizePolicy(QSizePolicy::Minimum,QSizePolicy::Fixed));
fromBoxLayout->addWidget(from);
fromBoxLayout->addWidget(selectFromButton);
formLayout->addRow("From:",fromBoxLayout);
toBoxLayout->addWidget(to);
toBoxLayout->addWidget(selectToButton);
formLayout->addRow("To:",toBoxLayout);
osmscout::Vehicle vehicle=settings->GetRoutingVehicle();
routeTypeFoot->setCheckable(true);
routeTypeFoot->setChecked(vehicle==osmscout::vehicleFoot);
routeTypeBicycle->setCheckable(true);
routeTypeBicycle->setChecked(vehicle==osmscout::vehicleBicycle);
routeTypeCar->setCheckable(true);
routeTypeCar->setChecked(vehicle==osmscout::vehicleCar);
routeTypes->addButton(routeTypeFoot,
osmscout::vehicleFoot);
routeTypes->addButton(routeTypeBicycle,
osmscout::vehicleBicycle);
routeTypes->addButton(routeTypeCar,
osmscout::vehicleCar);
asBoxLayout->addWidget(routeTypeFoot);
asBoxLayout->addWidget(routeTypeBicycle);
asBoxLayout->addWidget(routeTypeCar);
formLayout->addRow("As: ",asBoxLayout);
mainLayout->addLayout(formLayout);
routeView->setModel(routeModel);
routeView->setEditTriggers(QAbstractItemView::NoEditTriggers);
routeView->setSelectionMode(QAbstractItemView::SingleSelection);
routeView->setSelectionBehavior(QAbstractItemView::SelectRows);
routeView->setShowGrid(false);
routeView->setMinimumWidth(QApplication::fontMetrics().width("mlxi")/4*70);
routeView->horizontalHeader()->setStretchLastSection(true);
routeView->horizontalHeader()->setHighlightSections (false);
routeView->verticalHeader()->hide();
routeView->setColumnWidth(0,QApplication::fontMetrics().width("mlxi")/4*12);
routeView->setColumnWidth(1,QApplication::fontMetrics().width("mlxi")/4*12);
routeView->setColumnWidth(2,QApplication::fontMetrics().width("mlxi")/4*10);
routeView->setColumnWidth(3,QApplication::fontMetrics().width("mlxi")/4*10);
mainLayout->addWidget(routeView);
QDialogButtonBox *buttonBox=new QDialogButtonBox();
routeButton=buttonBox->addButton("&Route",QDialogButtonBox::ApplyRole);
buttonBox->addButton(QDialogButtonBox::Close);
routeButton->setEnabled(false);
mainLayout->addWidget(buttonBox);
setLayout(mainLayout);
//.........这里部分代码省略.........
开发者ID:bolidehi,项目名称:libosmscout,代码行数:101,代码来源:RoutingDialog.cpp
示例10: QSizePolicy
QSizePolicy SEQListView::sizePolicy() const
{
return QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
}
开发者ID:xbackupx,项目名称:showeqx,代码行数:4,代码来源:seqlistview.cpp
示例11: QSizePolicy
QSizePolicy RDSchedCodesDialog::sizePolicy() const
{
return QSizePolicy(QSizePolicy::Fixed,QSizePolicy::Fixed);
}
开发者ID:WMTH,项目名称:rivendell,代码行数:4,代码来源:rdschedcodes_dialog.cpp
示例12: QWidget
QIStatusBarIndicator::QIStatusBarIndicator(QWidget *pParent /* = 0 */)
: QWidget(pParent)
{
/* Configure size-policy: */
setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed));
}
开发者ID:mcenirm,项目名称:vbox,代码行数:6,代码来源:QIStatusBarIndicator.cpp
示例13: QWidget
/*
* Constructs a Options2 as a child of 'parent', with the
* name 'name' and widget flags set to 'f'.
*/
Options2::Options2( QWidget* parent, const char* name, WFlags fl )
: QWidget( parent, name, fl )
{
if ( !name )
setName( "Options2" );
setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)3, 0, 0, sizePolicy().hasHeightForWidth() ) );
Options2Layout = new QVBoxLayout( this, 0, 6, "Options2Layout");
groupBox6 = new QGroupBox( this, "groupBox6" );
groupBox6->setColumnLayout(0, Qt::Vertical );
groupBox6->layout()->setSpacing( 6 );
groupBox6->layout()->setMargin( 11 );
groupBox6Layout = new QVBoxLayout( groupBox6->layout() );
groupBox6Layout->setAlignment( Qt::AlignTop );
kcfg_UseCustomIconTheme = new QCheckBox( groupBox6, "kcfg_UseCustomIconTheme" );
groupBox6Layout->addWidget( kcfg_UseCustomIconTheme );
Options2Layout->addWidget( groupBox6 );
groupBox4 = new QGroupBox( this, "groupBox4" );
groupBox4->setColumnLayout(0, Qt::Vertical );
groupBox4->layout()->setSpacing( 0 );
groupBox4->layout()->setMargin( 11 );
groupBox4Layout = new QVBoxLayout( groupBox4->layout() );
groupBox4Layout->setAlignment( Qt::AlignTop );
kcfg_UseCustomFonts = new QCheckBox( groupBox4, "kcfg_UseCustomFonts" );
kcfg_UseCustomFonts->setChecked( FALSE );
groupBox4Layout->addWidget( kcfg_UseCustomFonts );
fontGroupBox = new QGroupBox( groupBox4, "fontGroupBox" );
fontGroupBox->setEnabled( FALSE );
fontGroupBox->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)5, 0, 0, fontGroupBox->sizePolicy().hasHeightForWidth() ) );
fontGroupBox->setFrameShape( QGroupBox::NoFrame );
fontGroupBox->setLineWidth( 0 );
fontGroupBox->setFlat( TRUE );
fontGroupBox->setColumnLayout(0, Qt::Vertical );
fontGroupBox->layout()->setSpacing( 6 );
fontGroupBox->layout()->setMargin( 11 );
fontGroupBoxLayout = new QVBoxLayout( fontGroupBox->layout() );
fontGroupBoxLayout->setAlignment( Qt::AlignTop );
layout5 = new QHBoxLayout( 0, 0, 6, "layout5");
textLabel3 = new QLabel( fontGroupBox, "textLabel3" );
textLabel3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)5, 0, 0, textLabel3->sizePolicy().hasHeightForWidth() ) );
textLabel3->setMinimumSize( QSize( 90, 0 ) );
layout5->addWidget( textLabel3 );
kcfg_PlaylistWindowFont = new KFontRequester( fontGroupBox, "kcfg_PlaylistWindowFont" );
kcfg_PlaylistWindowFont->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)5, 0, 0, kcfg_PlaylistWindowFont->sizePolicy().hasHeightForWidth() ) );
layout5->addWidget( kcfg_PlaylistWindowFont );
fontGroupBoxLayout->addLayout( layout5 );
layout4 = new QHBoxLayout( 0, 0, 6, "layout4");
textLabel1 = new QLabel( fontGroupBox, "textLabel1" );
textLabel1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)5, 0, 0, textLabel1->sizePolicy().hasHeightForWidth() ) );
textLabel1->setMinimumSize( QSize( 90, 0 ) );
textLabel1->setAlignment( int( QLabel::AlignVCenter ) );
layout4->addWidget( textLabel1 );
kcfg_PlayerWidgetFont = new KFontRequester( fontGroupBox, "kcfg_PlayerWidgetFont" );
kcfg_PlayerWidgetFont->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)5, 0, 0, kcfg_PlayerWidgetFont->sizePolicy().hasHeightForWidth() ) );
layout4->addWidget( kcfg_PlayerWidgetFont );
fontGroupBoxLayout->addLayout( layout4 );
layout6 = new QHBoxLayout( 0, 0, 6, "layout6");
textLabel3_2 = new QLabel( fontGroupBox, "textLabel3_2" );
textLabel3_2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)5, 0, 0, textLabel3_2->sizePolicy().hasHeightForWidth() ) );
textLabel3_2->setMinimumSize( QSize( 90, 0 ) );
layout6->addWidget( textLabel3_2 );
kcfg_ContextBrowserFont = new KFontRequester( fontGroupBox, "kcfg_ContextBrowserFont" );
kcfg_ContextBrowserFont->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)5, 0, 0, kcfg_ContextBrowserFont->sizePolicy().hasHeightForWidth() ) );
layout6->addWidget( kcfg_ContextBrowserFont );
fontGroupBoxLayout->addLayout( layout6 );
groupBox4Layout->addWidget( fontGroupBox );
Options2Layout->addWidget( groupBox4 );
groupBox3 = new QGroupBox( this, "groupBox3" );
groupBox3->setColumnLayout(0, Qt::Vertical );
groupBox3->layout()->setSpacing( 6 );
groupBox3->layout()->setMargin( 11 );
groupBox3Layout = new QGridLayout( groupBox3->layout() );
groupBox3Layout->setAlignment( Qt::AlignTop );
radioGroup = new QButtonGroup( groupBox3, "radioGroup" );
radioGroup->setFrameShape( QButtonGroup::NoFrame );
radioGroup->setColumnLayout(0, Qt::Vertical );
radioGroup->layout()->setSpacing( 6 );
radioGroup->layout()->setMargin( 0 );
radioGroupLayout = new QGridLayout( radioGroup->layout() );
radioGroupLayout->setAlignment( Qt::AlignTop );
//.........这里部分代码省略.........
开发者ID:tmarques,项目名称:waheela,代码行数:101,代码来源:Options2.cpp
示例14: QDialog
/*
* Constructs a RichTextFontDialog as a child of 'parent', with the
* name 'name' and widget flags set to 'f'.
*
* The dialog will by default be modeless, unless you set 'modal' to
* TRUE to construct a modal dialog.
*/
RichTextFontDialog::RichTextFontDialog( QWidget* parent, const char* name, bool modal, WFlags fl )
: QDialog( parent, name, modal, fl )
{
if ( !name )
setName( "RichTextFontDialog" );
setSizeGripEnabled( TRUE );
RichTextFontDialogLayout = new QGridLayout( this, 1, 1, 11, 6, "RichTextFontDialogLayout");
Layout6 = new QGridLayout( 0, 1, 1, 0, 6, "Layout6");
fontCombo = new QComboBox( FALSE, this, "fontCombo" );
Layout6->addMultiCellWidget( fontCombo, 0, 0, 1, 2 );
TextLabel1_2 = new QLabel( this, "TextLabel1_2" );
Layout6->addWidget( TextLabel1_2, 0, 0 );
TextLabel2 = new QLabel( this, "TextLabel2" );
Layout6->addWidget( TextLabel2, 1, 0 );
Spacer13 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
Layout6->addItem( Spacer13, 2, 2 );
TextLabel1 = new QLabel( this, "TextLabel1" );
Layout6->addWidget( TextLabel1, 2, 0 );
fontSizeCombo = new QComboBox( FALSE, this, "fontSizeCombo" );
fontSizeCombo->setEditable( TRUE );
fontSizeCombo->setInsertionPolicy( QComboBox::AtTop );
Layout6->addMultiCellWidget( fontSizeCombo, 1, 1, 1, 2 );
colorButton = new QToolButton( this, "colorButton" );
colorButton->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, colorButton->sizePolicy().hasHeightForWidth() ) );
colorButton->setMinimumSize( QSize( 40, 20 ) );
colorButton->setPaletteBackgroundColor( QColor( 0, 0, 0 ) );
colorButton->setFocusPolicy( QToolButton::TabFocus );
Layout6->addWidget( colorButton, 2, 1 );
RichTextFontDialogLayout->addLayout( Layout6, 0, 0 );
Spacer14 = new QSpacerItem( 20, 16, QSizePolicy::Minimum, QSizePolicy::Expanding );
RichTextFontDialogLayout->addItem( Spacer14, 1, 0 );
Line1 = new QFrame( this, "Line1" );
Line1->setFrameShape( QFrame::HLine );
Line1->setFrameShadow( QFrame::Sunken );
Line1->setFrameShape( QFrame::HLine );
RichTextFontDialogLayout->addWidget( Line1, 2, 0 );
Layout15 = new QHBoxLayout( 0, 0, 6, "Layout15");
Spacer12 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
Layout15->addItem( Spacer12 );
okButton = new QPushButton( this, "okButton" );
Layout15->addWidget( okButton );
cancelButton = new QPushButton( this, "cancelButton" );
Layout15->addWidget( cancelButton );
RichTextFontDialogLayout->addLayout( Layout15, 3, 0 );
languageChange();
resize( QSize(255, 158).expandedTo(minimumSizeHint()) );
clearWState( WState_Polished );
// signals and slots connections
connect( colorButton, SIGNAL( clicked() ), this, SLOT( selectColor() ) );
connect( okButton, SIGNAL( clicked() ), this, SLOT( accept() ) );
connect( cancelButton, SIGNAL( clicked() ), this, SLOT( reject() ) );
// tab order
setTabOrder( fontCombo, fontSizeCombo );
setTabOrder( fontSizeCombo, colorButton );
setTabOrder( colorButton, okButton );
setTabOrder( okButton, cancelButton );
// buddies
TextLabel1_2->setBuddy( fontCombo );
TextLabel2->setBuddy( fontSizeCombo );
TextLabel1->setBuddy( colorButton );
init();
}
开发者ID:AliYousuf,项目名称:univ-aca-mips,代码行数:92,代码来源:richtextfontdialog.cpp
示例15: m_r
MeshifyPopup::MeshifyPopup()
: DVGui::Dialog(TApp::instance()->getMainWindow(), true, false,
"MeshifyPopup")
, m_r(-1)
, m_c(-1) {
setWindowTitle(tr("Create Mesh"));
setLabelWidth(0);
setModal(false);
setTopMargin(0);
setTopSpacing(0);
beginVLayout();
QSplitter *splitter = new QSplitter(Qt::Vertical);
splitter->setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding,
QSizePolicy::MinimumExpanding));
addWidget(splitter);
endVLayout();
//------------------------- Top Layout --------------------------
QScrollArea *scrollArea = new QScrollArea(splitter);
scrollArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
scrollArea->setWidgetResizable(true);
scrollArea->setMinimumWidth(450);
splitter->addWidget(scrollArea);
splitter->setStretchFactor(0, 1);
QFrame *topWidget = new QFrame(scrollArea);
scrollArea->setWidget(topWidget);
QGridLayout *topLayout =
new QGridLayout(topWidget); // Needed to justify at top
topWidget->setLayout(topLayout);
//------------------------- Parameters --------------------------
int row = 0;
QLabel *edgesLengthLabel = new QLabel(tr("Mesh Edges Length:"));
topLayout->addWidget(edgesLengthLabel, row, 0,
Qt::AlignRight | Qt::AlignVCenter);
m_edgesLength = new DVGui::MeasuredDoubleField;
m_edgesLength->setMeasure("length.x");
m_edgesLength->setRange(0.0, 1.0); // In inches (standard unit)
m_edgesLength->setValue(0.2);
topLayout->addWidget(m_edgesLength, row++, 1);
QLabel *rasterizationDpiLabel = new QLabel(tr("Rasterization DPI:"));
topLayout->addWidget(rasterizationDpiLabel, row, 0,
Qt::AlignRight | Qt::AlignVCenter);
m_rasterizationDpi = new DVGui::DoubleLineEdit;
m_rasterizationDpi->setRange(1.0, (std::numeric_limits<double>::max)());
m_rasterizationDpi->setValue(300.0);
topLayout->addWidget(m_rasterizationDpi, row++, 1);
QLabel *shapeMarginLabel = new QLabel(tr("Mesh Margin (pixels):"));
topLayout->addWidget(shapeMarginLabel, row, 0,
Qt::AlignRight | Qt::AlignVCenter);
m_margin = new DVGui::IntLineEdit;
m_margin->setRange(2, (std::numeric_limits<int>::max)());
m_margin->setValue(5);
topLayout->addWidget(m_margin, row++, 1);
connect(m_edgesLength, SIGNAL(valueChanged(bool)), this,
SLOT(onParamsChanged(bool)));
connect(m_rasterizationDpi, SIGNAL(editingFinished()), this,
SLOT(onParamsChanged()));
connect(m_margin, SIGNAL(editingFinished()), this, SLOT(onParamsChanged()));
topLayout->setRowStretch(row, 1);
//------------------------- View Widget -------------------------
// NOTE: It's IMPORTANT that parent widget is supplied. It's somewhat
// used by QSplitter to decide the initial widget sizes...
m_viewer = new Swatch(splitter);
m_viewer->setMinimumHeight(150);
m_viewer->setFocusPolicy(Qt::WheelFocus);
splitter->addWidget(m_viewer);
//--------------------------- Buttons ---------------------------
m_okBtn = new QPushButton(tr("Apply"));
addButtonBarWidget(m_okBtn);
connect(m_okBtn, SIGNAL(clicked()), this, SLOT(apply()));
// Finally, acquire current selection
onCellSwitched();
//.........这里部分代码省略.........
开发者ID:walkerka,项目名称:opentoonz,代码行数:101,代码来源:meshifypopup.cpp
示例16: QSizePolicy
QSizePolicy TestImport::sizePolicy() const
{
return QSizePolicy(QSizePolicy::Fixed,QSizePolicy::Fixed);
}
开发者ID:elmuz,项目名称:rivendell,代码行数:4,代码来源:test_import.cpp
示例17: Dialog
BrightnessAndContrastPopup::BrightnessAndContrastPopup()
: Dialog(TApp::instance()->getMainWindow(), true, false, "BrightnessAndContrast"), m_startRas(0)
{
setWindowTitle(tr("Brightness and Contrast"));
setLabelWidth(0);
setModal(false);
setTopMargin(0);
setTopSpacing(0);
beginVLayout();
QSplitter *splitter = new QSplitter(Qt::Vertical);
splitter->setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding));
addWidget(splitter);
endVLayout();
//------------------------- Top Layout --------------------------
QScrollArea *scrollArea = new QScrollArea(splitter);
scrollArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
scrollArea->setWidgetResizable(true);
splitter->addWidget(scrollArea);
splitter->setStretchFactor(0, 1);
QFrame *topWidget = new QFrame(scrollArea);
topWidget->setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding));
scrollArea->setWidget(topWidget);
QGridLayout *topLayout = new QGridLayout(this);
topWidget->setLayout(topLayout);
//------------------------- Parameters --------------------------
//Brightness
QLabel *brightnessLabel = new QLabel(tr("Brightness:"));
topLayout->addWidget(brightnessLabel, 0, 0, Qt::AlignRight | Qt::AlignVCenter);
m_brightnessField = new DVGui::IntField(topWidget);
m_brightnessField->setRange(-127, 127);
m_brightnessField->setValue(0);
topLayout->addWidget(m_brightnessField, 0, 1);
//Contrast
QLabel *contrastLabel = new QLabel(tr("Contrast:"));
topLayout->addWidget(contrastLabel, 1, 0, Qt::AlignRight | Qt::AlignVCenter);
m_contrastField = new DVGui::IntField(topWidget);
m_contrastField->setRange(-127, 127);
m_contrastField->setValue(0);
topLayout->addWidget(m_contrastField, 1, 1);
topLayout->setRowStretch(2, 1);
//--------------------------- Swatch ----------------------------
m_viewer = new Swatch(splitter);
m_viewer->setMinimumHeight(150);
m_viewer->setFocusPolicy(Qt::WheelFocus);
splitter->addWidget(m_viewer);
//--------------------------- Button ----------------------------
m_okBtn = new QPushButton(QString("Apply"), this);
connect(m_okBtn, SIGNAL(clicked()), this, SLOT(apply()));
addButtonBarWidget(m_okBtn);
//------------------------ Connections --------------------------
TApp *app = TApp::instance();
bool ret = true;
ret = ret && connect(m_brightnessField, SIGNAL(valueChanged(bool)), this, SLOT(onValuesChanged(bool)));
ret = ret && connect(m_contrastField, SIGNAL(valueChanged(bool)), this, SLOT(onValuesChanged(bool)));
assert(ret);
m_viewer->resize(0, 350);
resize(600, 500);
}
开发者ID:ArseniyShestakov,项目名称:opentoonz,代码行数:83,代码来源:brightnessandcontrastpopup.cpp
示例18: QSizePolicy
QSizePolicy EditGpi::sizePolicy() const
{
return QSizePolicy(QSizePolicy::Fixed,QSizePolicy::Fixed);
}
开发者ID:WMFO,项目名称:rivendell,代码行数:4,代码来源:edit_gpi.cpp
示例19: QSizePolicy
QSizePolicy MainWidget::sizePolicy() const
{
return QSizePolicy(QSizePolicy::Fixed,QSizePolicy::Fixed);
}
开发者ID:stgabmp,项目名称:Rivendell,代码行数:4,代码来源:rdlogin.cpp
示例20: name
ScoreInfoDialog::ScoreInfoDialog(NMainFrameWidget *parent) :
KDialogBase
(Tabbed, // dialogFace
kapp->makeStdCaption(i18n("Score information")),
Help | User1 | User2 | Ok | Apply | Cancel,
Ok, // defaultButton
parent, // parent
"ScoreInfoDialog", // name (for internal use only)
true, // modal
true, // separator
i18n("&Revert"), // User1
i18n("Cl&ear all") // User1
),
mainWidget(parent) {
kapp->config()->setGroup("ScoreInfo");
// GENERAL
QFrame *pageGeneral = addPage(i18n("&General"));
QGridLayout *layoutGeneral = new QGridLayout(pageGeneral, 5, 2);
layoutGeneral->setSpacing(KDialog::spacingHint());
layoutGeneral->setColStretch(1 /* the right column */, 1 /*factor*/);
// Title
title = new KHistoryCombo(pageGeneral);
title->setHistoryItems(kapp->config()->readListEntry("TitleHistory"), true);
title->setEditText(mainWidget->scTitle_);
layoutGeneral->addWidget(title, 0, 1);
QLabel *titleLabel = new QLabel(title, i18n("&Title:"), pageGeneral);
layoutGeneral->addWidget(titleLabel, 0, 0);
// Subject
subject = new KHistoryCombo(pageGeneral);
subject->setHistoryItems
(kapp->config()->readListEntry("SubjectHistory"), true);
subject->setEditText(mainWidget->scSubtitle_);
layoutGeneral->addWidget(subject, 1, 1);
QLabel *subjectLabel = new QLabel(subject, i18n("&Subject:"), pageGeneral);
layoutGeneral->addWidget(subjectLabel, 1, 0);
// Author
author = new KHistoryCombo(pageGeneral);
author->setHistoryItems
(kapp->config()->readListEntry("AuthorHistory"), true);
author->setEditText(mainWidget->scAuthor_);
layoutGeneral->addWidget(author, 2, 1);
QLabel *authorLabel = new QLabel(author, i18n("A&uthor:"), pageGeneral);
layoutGeneral->addWidget(authorLabel, 2, 0);
// Last author
lastAuthor = new KHistoryCombo(pageGeneral);
lastAuthor->setHistoryItems
(kapp->config()->readListEntry("LastAuthorHistory"), true);
lastAuthor->setEditText(mainWidget->scLastAuthor_);
layoutGeneral->addWidget(lastAuthor, 3, 1);
QLabel *lastAuthorLabel = new QLabel
(lastAuthor, i18n("&Last author:"), pageGeneral);
layoutGeneral->addWidget(lastAu
|
请发表评论