本文整理汇总了C++中setModal函数的典型用法代码示例。如果您正苦于以下问题:C++ setModal函数的具体用法?C++ setModal怎么用?C++ setModal使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setModal函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: setFullscreen
void PlayerEditNameState::init()
{
State::init();
setFullscreen(false);
setModal(true);
auto bgX = (Game::getInstance()->renderer()->width() - 640)*0.5;
auto bgY = (Game::getInstance()->renderer()->height() - 480)*0.5;
_keyCodes.insert(std::make_pair(SDLK_a, 'a'));
_keyCodes.insert(std::make_pair(SDLK_b, 'b'));
_keyCodes.insert(std::make_pair(SDLK_c, 'c'));
_keyCodes.insert(std::make_pair(SDLK_d, 'd'));
_keyCodes.insert(std::make_pair(SDLK_e, 'e'));
_keyCodes.insert(std::make_pair(SDLK_f, 'f'));
_keyCodes.insert(std::make_pair(SDLK_g, 'g'));
_keyCodes.insert(std::make_pair(SDLK_h, 'h'));
_keyCodes.insert(std::make_pair(SDLK_i, 'i'));
_keyCodes.insert(std::make_pair(SDLK_j, 'j'));
_keyCodes.insert(std::make_pair(SDLK_k, 'k'));
_keyCodes.insert(std::make_pair(SDLK_l, 'l'));
_keyCodes.insert(std::make_pair(SDLK_m, 'm'));
_keyCodes.insert(std::make_pair(SDLK_n, 'n'));
_keyCodes.insert(std::make_pair(SDLK_o, 'o'));
_keyCodes.insert(std::make_pair(SDLK_p, 'p'));
_keyCodes.insert(std::make_pair(SDLK_q, 'q'));
_keyCodes.insert(std::make_pair(SDLK_r, 'r'));
_keyCodes.insert(std::make_pair(SDLK_s, 's'));
_keyCodes.insert(std::make_pair(SDLK_t, 't'));
_keyCodes.insert(std::make_pair(SDLK_u, 'u'));
_keyCodes.insert(std::make_pair(SDLK_v, 'v'));
_keyCodes.insert(std::make_pair(SDLK_w, 'w'));
_keyCodes.insert(std::make_pair(SDLK_x, 'x'));
_keyCodes.insert(std::make_pair(SDLK_y, 'y'));
_keyCodes.insert(std::make_pair(SDLK_z, 'z'));
_keyCodes.insert(std::make_pair(SDLK_1, '1'));
_keyCodes.insert(std::make_pair(SDLK_2, '2'));
_keyCodes.insert(std::make_pair(SDLK_3, '3'));
_keyCodes.insert(std::make_pair(SDLK_4, '4'));
_keyCodes.insert(std::make_pair(SDLK_5, '5'));
_keyCodes.insert(std::make_pair(SDLK_6, '6'));
_keyCodes.insert(std::make_pair(SDLK_7, '7'));
_keyCodes.insert(std::make_pair(SDLK_8, '8'));
_keyCodes.insert(std::make_pair(SDLK_9, '9'));
_keyCodes.insert(std::make_pair(SDLK_0, '0'));
_timer = SDL_GetTicks();
auto bg = new Image("art/intrface/charwin.frm");
bg->setX(bgX+22);
bg->setY(bgY+0);
auto nameBox = new Image("art/intrface/namebox.frm");
nameBox->setX(bgX+35);
nameBox->setY(bgY+10);
auto doneBox = new Image("art/intrface/donebox.frm");
doneBox->setX(bgX+35);
doneBox->setY(bgY+40);
auto msg = ResourceManager::msgFileType("text/english/game/editor.msg");
auto doneLabel = new TextArea(msg->message(100), bgX+65, bgY+43);
auto font3_b89c28ff = ResourceManager::font("font3.aaf", 0xb89c28ff);
doneLabel->setFont(font3_b89c28ff);
auto doneButton = new ImageButton(ImageButton::TYPE_SMALL_RED_CIRCLE, bgX+45, bgY+43);
doneButton->addEventHandler("mouseleftclick", this, (EventRecieverMethod) &PlayerEditNameState::onDoneButtonClick);
_name = new TextArea(Game::getInstance()->player()->name(), bgX+43, bgY+15);
_name->addEventHandler("keyup", this, (EventRecieverMethod) &PlayerEditNameState::onKeyboardPress);
_cursor = new Image(5, 8);
_cursor->setX(bgX+83);
_cursor->setY(bgY+15);
_cursor->texture()->fill(0x3FF800FF);
addUI(bg);
addUI(nameBox);
addUI(doneBox);
addUI(doneLabel);
addUI(doneButton);
addUI(_name);
addUI(_cursor);
}
开发者ID:Legun,项目名称:falltergeist,代码行数:84,代码来源:PlayerEditNameState.cpp
示例2: m_frequency
//***************************************************************************
Kwave::NotchFilterDialog::NotchFilterDialog(QWidget *parent, double sample_rate)
:QDialog(parent), Kwave::PluginSetupDialog(),
Ui::NotchFilterDlg(),
m_frequency(3500),m_bw(100),
m_sample_rate(sample_rate), m_filter(0)
{
setupUi(this);
setModal(true);
// set maximum frequency to sample rate / 2
double f_max = sample_rate / 2.0;
slider->setMaximum(Kwave::toInt(f_max));
spinbox->setMaximum(Kwave::toInt(f_max));
slider_2->setMaximum(Kwave::toInt(f_max));
spinbox_2->setMaximum(Kwave::toInt(f_max));
// initialize the frequency scale widget
scale_freq->setMinMax(0, Kwave::toInt(f_max));
scale_freq->setLogMode(false);
scale_freq->setUnit(i18n("Hz"));
// initialize the attenuation scale widget
scale_db->setMinMax(-24, +6);
scale_db->setLogMode(false);
scale_db->setUnit(i18n("dB"));
// initialize the frequency response widget
freq_response->init(f_max, -24, +6);
// set up the low pass filter dunction
m_filter = new NotchFilter();
freq_response->setFilter(m_filter);
// initialize the controls and the curve display
slider->setValue(Kwave::toInt(m_frequency));
spinbox->setValue(Kwave::toInt(m_frequency));
slider_2->setValue(Kwave::toInt(m_bw));
spinbox_2->setValue(Kwave::toInt(m_bw));
updateDisplay();
// changes in the slider or spinbox
connect(spinbox, SIGNAL(valueChanged(int)),
this, SLOT(freqValueChanged(int)));
connect(spinbox_2, SIGNAL(valueChanged(int)),
this, SLOT(bwValueChanged(int)));
// click to the "Listen" button
connect(btListen, SIGNAL(toggled(bool)),
this, SLOT(listenToggled(bool)));
// expand the "Listen" button to it's maximum width
listenToggled(true);
if (btListen->width() > btListen->minimumWidth())
btListen->setMinimumWidth(btListen->width());
listenToggled(false);
if (btListen->width() > btListen->minimumWidth())
btListen->setMinimumWidth(btListen->width());
// set the initial size of the dialog
int h = (width() * 3) / 5;
if (height() < h) resize(width(), h);
int w = (height() * 5) / 3;
if (width() < w) resize(w, height());
connect(buttonHelp->button(QDialogButtonBox::Help), SIGNAL(clicked()),
this, SLOT(invokeHelp()));
// set the focus onto the "OK" button
buttonBox->button(QDialogButtonBox::Ok)->setFocus();
}
开发者ID:KDE,项目名称:kwave,代码行数:72,代码来源:NotchFilterDialog.cpp
示例3: setModal
void GameMenu::init()
{
if (_initialized) return;
State::init();
setModal(true);
setFullscreen(false);
auto background = new UI::Image("art/intrface/opbase.frm");
auto panelHeight = Game::getInstance()->locationState()->playerPanelState()->height();
auto backgroundPos = (Game::getInstance()->renderer()->size() - background->size() - Point(0, panelHeight)) / 2;
int backgroundX = backgroundPos.x();
int backgroundY = backgroundPos.y();
auto saveGameButton = new UI::ImageButton(UI::ImageButton::Type::OPTIONS_BUTTON, backgroundX+14, backgroundY+18);
auto loadGameButton = new UI::ImageButton(UI::ImageButton::Type::OPTIONS_BUTTON, backgroundX+14, backgroundY+18+37);
auto preferencesButton = new UI::ImageButton(UI::ImageButton::Type::OPTIONS_BUTTON, backgroundX+14, backgroundY+18+37*2);
auto exitGameButton = new UI::ImageButton(UI::ImageButton::Type::OPTIONS_BUTTON, backgroundX+14, backgroundY+18+37*3);
auto doneButton = new UI::ImageButton(UI::ImageButton::Type::OPTIONS_BUTTON, backgroundX+14, backgroundY+18+37*4);
preferencesButton->addEventHandler("mouseleftclick", [this](Event::Event* event){ this->doPreferences(); });
exitGameButton->addEventHandler("mouseleftclick", [this](Event::Event* event){ this->doExit(); });
doneButton->addEventHandler("mouseleftclick", [this](Event::Event* event){ this->closeMenu(); });
auto font = ResourceManager::getInstance()->font("font3.aaf", 0xb89c28ff);
// label: save game
auto saveGameButtonLabel = new UI::TextArea(_t(MSG_OPTIONS, 0), backgroundX+8, backgroundY+26);
saveGameButtonLabel->setFont(font);
saveGameButtonLabel->setSize({150, 0});
saveGameButtonLabel->setHorizontalAlign(UI::TextArea::HorizontalAlign::CENTER);
saveGameButton->addEventHandler("mouseleftclick", [this](Event::Event* event){ this->doSaveGame(); });
// label: load game
auto loadGameButtonLabel = new UI::TextArea(_t(MSG_OPTIONS, 1), backgroundX+8, backgroundY+26+37);
loadGameButtonLabel->setFont(font);
loadGameButtonLabel->setSize({150, 0});
loadGameButtonLabel->setHorizontalAlign(UI::TextArea::HorizontalAlign::CENTER);
loadGameButton->addEventHandler("mouseleftclick", [this](Event::Event* event){ this->doLoadGame(); });
// label: preferences
auto preferencesButtonLabel = new UI::TextArea(_t(MSG_OPTIONS, 2), backgroundX+8, backgroundY+26+37*2);
preferencesButtonLabel->setFont(font);
preferencesButtonLabel->setSize({150, 0});
preferencesButtonLabel->setHorizontalAlign(UI::TextArea::HorizontalAlign::CENTER);
// label: exit game
auto exitGameButtonLabel = new UI::TextArea(_t(MSG_OPTIONS, 3), backgroundX+8, backgroundY+26+37*3);
exitGameButtonLabel->setFont(font);
exitGameButtonLabel->setSize({150, 0});
exitGameButtonLabel->setHorizontalAlign(UI::TextArea::HorizontalAlign::CENTER);
// label: done
auto doneButtonLabel = new UI::TextArea(_t(MSG_OPTIONS, 4), backgroundX+8, backgroundY+26+37*4);
doneButtonLabel->setFont(font);
doneButtonLabel->setSize({150, 0});
doneButtonLabel->setHorizontalAlign(UI::TextArea::HorizontalAlign::CENTER);
background->setPosition(backgroundPos);
addUI(background);
addUI(saveGameButton);
addUI(loadGameButton);
addUI(preferencesButton);
addUI(exitGameButton);
addUI(doneButton);
addUI(saveGameButtonLabel);
addUI(loadGameButtonLabel);
addUI(preferencesButtonLabel);
addUI(exitGameButtonLabel);
addUI(doneButtonLabel);
}
开发者ID:nishazzar,项目名称:falltergeist,代码行数:73,代码来源:GameMenu.cpp
示例4: KDialog
//BEGIN class LinkerOptionsDlg
LinkerOptionsDlg::LinkerOptionsDlg( LinkerOptions * linkingOptions, QWidget *parent )
: // KDialog( parent, "Linker Options Dialog", true, "Linker Options", KDialog::Ok|KDialog::Cancel, KDialog::Ok, true )
KDialog( parent) //, "Linker Options Dialog", true, "Linker Options", KDialog::Ok|KDialog::Cancel, KDialog::Ok, true )
{
setObjectName("Linker Options Dialog");
setModal(true);
setCaption(i18n("Linker Options"));
setButtons(KDialog::Ok|KDialog::Cancel);
setDefaultButton(KDialog::Ok);
showButtonSeparator(true);
m_pLinkerOptions = linkingOptions;
m_pWidget = new LinkerOptionsWidget(this);
ProjectInfo * pi = ProjectManager::self()->currentProject();
assert(pi);
//BEGIN Update gplink options
m_pWidget->m_pHexFormat->setCurrentIndex( m_pLinkerOptions->hexFormat() );
m_pWidget->m_pOutputMap->setChecked( m_pLinkerOptions->outputMapFile() );
m_pWidget->m_pLibraryDir->setText( m_pLinkerOptions->libraryDir() );
m_pWidget->m_pLinkerScript->setText( m_pLinkerOptions->linkerScript() );
m_pWidget->m_pOther->setText( m_pLinkerOptions->linkerOther() );
//END Update gplink options
//BEGIN Update library widgets
const KUrl::List availableInternal = pi->childOutputURLs( ProjectItem::LibraryType );
const QStringList linkedInternal = m_pLinkerOptions->linkedInternal();
KUrl::List::const_iterator end = availableInternal.end();
for ( KUrl::List::const_iterator it = availableInternal.begin(); it != end; ++it )
{
QString relativeURL = KUrl::relativeUrl( pi->url(), *it );
// 2017.12.1 - convert to QListWidgetItem
//Q3CheckListItem * item = new Q3CheckListItem( m_pWidget->m_pInternalLibraries, relativeURL, Q3CheckListItem::CheckBox );
QListWidgetItem * item = new QListWidgetItem( relativeURL, m_pWidget->m_pInternalLibraries );
item->setCheckState( (linkedInternal.contains(relativeURL)) ? Qt::Checked : Qt::Unchecked );
//item->setOn( linkedInternal.contains(relativeURL) ); // 2017.12.1 - convert to QListWidgetItem
}
m_pExternalLibraryRequester = new KUrlRequester( 0l );
m_pExternalLibraryRequester->fileDialog()->setUrl( KUrl( "/usr/share/sdcc/lib" ) );
delete m_pWidget->m_pExternalLibraries;
m_pWidget->m_pExternalLibraries = new KEditListBox( i18n("Link libraries outside project"), m_pExternalLibraryRequester->customEditor(), m_pWidget );
m_pWidget->m_pExternalLibraries->layout()->setMargin(11);
{
QGridLayout* grLayout = (dynamic_cast<QGridLayout*>(m_pWidget->layout()));
//grLayout->addMultiCellWidget( m_pWidget->m_pExternalLibraries, 7, 7, 0, 1 ); // 2018.12.02
grLayout->addWidget( m_pWidget->m_pExternalLibraries, 7, 0, 1, 2);
}
m_pWidget->m_pExternalLibraries->setButtons( KEditListBox::Add | KEditListBox::Remove );
m_pWidget->m_pExternalLibraries->insertStringList( m_pLinkerOptions->linkedExternal() );
//END Update library widgets
setMainWidget( m_pWidget );
setInitialSize( m_pWidget->rect().size() );
}
开发者ID:ktechlab,项目名称:ktechlab,代码行数:65,代码来源:projectdlgs.cpp
示例5: QDialog
/*
* Constructs a ResampleForm 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.
*/
ResampleForm::ResampleForm( RasterInfo input, RasterInfo output, QWidget* parent, bool modal, Qt::WFlags fl )
: QDialog( parent, fl )
{
setModal( modal );
//Keeps it from overly expanding since over riding sizeHint didn't work
setMaximumSize( 152, 150 );
if ( objectName().isEmpty() )
setObjectName( "ResampleForm" );
setPalette( RESAMPLEFORM_COLOR );
bytesPerRow = (input.cols() * (input.bitCount() / 8));
ResampleFormLayout = new QVBoxLayout( this );
ResampleFormLayout->setSpacing( 6 );
inputLayout = new QVBoxLayout( 0 );
inputLayout->setSpacing( 6 );
resampleBox = new QGroupBox( this );
resampleBoxLayout = new QVBoxLayout( resampleBox );
resampleBoxLayout->setSpacing( 6 );
resampleBoxLayout->setMargin( 11 );
resampleBoxLayout->setAlignment( Qt::AlignTop );
resampleCombo = new QComboBox( resampleBox );
resampleCombo->setMinimumSize( QSize( 125, 0 ) );
resampleCombo->installEventFilter( this );
resampleBoxLayout->addWidget( resampleCombo );
categoricalLayout = new QHBoxLayout( 0 );
categoricalLayout->setParent( resampleBoxLayout );
resampleBoxLayout->addLayout( categoricalLayout );
catconLabel = new QLabel( "", resampleBox );
conRadio = new QRadioButton( "Continuous Data", resampleBox );
catRadio = new QRadioButton( "Categorical Data", resampleBox );
catconButtonGroup = new QGroupBox( resampleBox );
catconButtonGroup->hide();
QHBoxLayout *catconLayout = new QHBoxLayout( catconButtonGroup );
catconLayout->addWidget( catRadio );
catconLayout->addWidget( conRadio );
categoricalLayout->addWidget( catconLabel );
categoricalLayout->addWidget( conRadio );
categoricalLayout->addWidget( catRadio );
inputLayout->addWidget( resampleBox );
ignoreBox = new QGroupBox( this );
ignoreBoxLayout = new QHBoxLayout( ignoreBox );
ignoreBoxLayout->setSpacing( 6 );
ignoreBoxLayout->setMargin( 11 );
ignoreBoxLayout->setAlignment( Qt::AlignTop );
ignoreLayout = new QVBoxLayout( 0 );
ignoreLayout->setSpacing( 6 );
ignoreLabel = new QLabel( "Ignore values cannot be used if an output \"No Data \nValue\" is not provided.", ignoreBox );
ignoreLabel->hide();
ignoreBoxLayout->addWidget( ignoreLabel );
ignoreEdit = new QLineEdit( ignoreBox );
ignoreEdit->setMinimumSize( QSize( 125, 0 ) );
ignoreEdit->setValidator( new MapimgValidator( output.fullDataType(), ignoreEdit ) );
ignoreLayout->addWidget( ignoreEdit );
newButton = new QPushButton( ignoreBox );
newButton->setAutoDefault( false );
ignoreLayout->addWidget( newButton );
delButton = new QPushButton( ignoreBox );
delButton->setEnabled( false );
delButton->setAutoDefault( false );
ignoreLayout->addWidget( delButton );
ingoreSpacer = new QSpacerItem( 31, 91, QSizePolicy::Minimum, QSizePolicy::Expanding );
ignoreLayout->addItem( ingoreSpacer );
ignoreBoxLayout->addLayout( ignoreLayout );
ignoreListBox = new QListWidget( ignoreBox );
ignoreListBox->setMinimumSize( QSize( 125, 0 ) );
ignoreListBox->installEventFilter( this );
ignoreBoxLayout->addWidget( ignoreListBox );
inputLayout->addWidget( ignoreBox );
if( !output.hasNoDataValue() )
{
ignoreLabel->show();
ignoreEdit->hide();
newButton->hide();
delButton->hide();
ignoreListBox->hide();
}
//.........这里部分代码省略.........
开发者ID:dmm,项目名称:cegis,代码行数:101,代码来源:resampleform.cpp
示例6: setModal
/**
* @brief PartSetter::showDialogModal
*
* Affiche le dialogue
*/
void PartSetter::showDialogModal()
{
// on affiche la boite de dialogue de facon modale
setModal(true);
show();
}
开发者ID:jcelerier,项目名称:pfa_guitar_tutor,代码行数:11,代码来源:PartSetter.cpp
示例7: KDialog
RecompressOptionsDialog::RecompressOptionsDialog(QWidget *parent)
: KDialog( parent)
{
setCaption(i18n("Recompression Options"));
setModal(true);
setButtons(Ok | Cancel);
setDefaultButton(Ok);
QWidget* box = new QWidget( this );
setMainWidget(box);
Q3VBoxLayout *dvlay = new Q3VBoxLayout( box, 10, spacingHint() );
QString whatsThis;
// JPEG file format.
Q3GroupBox * groupBox1 = new Q3GroupBox( 2, Qt::Horizontal, i18n("JPEG File Format"), box );
m_label_JPEGimageCompression = new QLabel (i18n("Image compression level:"), groupBox1);
m_JPEGCompression = new KIntNumInput(75, groupBox1);
m_JPEGCompression->setRange(1, 100);
m_JPEGCompression->setSliderEnabled(true);
whatsThis = i18n("<p>The compression value for JPEG target images:<p>");
whatsThis = whatsThis + i18n("<b>1</b>: very high compression<p>"
"<b>25</b>: high compression<p>"
"<b>50</b>: medium compression<p>"
"<b>75</b>: low compression (default value)<p>"
"<b>100</b>: no compression");
m_JPEGCompression->setWhatsThis(whatsThis);
m_label_JPEGimageCompression->setBuddy( m_JPEGCompression );
m_compressLossLess = new QCheckBox( i18n("Use lossless compression"), groupBox1);
m_compressLossLess->setWhatsThis(i18n("<p>If this option is enabled, "
"all JPEG operations will use lossless compression."));
connect(m_compressLossLess, SIGNAL( toggled(bool) ),
this, SLOT( slotCompressLossLessEnabled(bool) ) );
dvlay->addWidget( groupBox1 );
// PNG File format.
Q3GroupBox * groupBox2 = new Q3GroupBox( 2, Qt::Horizontal, i18n("PNG File Format"), box );
m_label_PNGimageCompression = new QLabel (i18n("Image compression level:"), groupBox2);
m_PNGCompression = new KIntNumInput(75, groupBox2);
m_PNGCompression->setRange(1, 100);
m_PNGCompression->setSliderEnabled(true);
whatsThis = i18n("<p>The compression value for PNG target images:<p>");
whatsThis = whatsThis + i18n("<b>1</b>: very high compression<p>"
"<b>25</b>: high compression<p>"
"<b>50</b>: medium compression<p>"
"<b>75</b>: low compression (default value)<p>"
"<b>100</b>: no compression");
m_PNGCompression->setWhatsThis(whatsThis);
m_label_PNGimageCompression->setBuddy( m_PNGCompression );
dvlay->addWidget( groupBox2 );
// TIFF File format.
Q3GroupBox * groupBox3 = new Q3GroupBox( 2, Qt::Horizontal, i18n("TIFF File Format"), box );
m_label_TIFFimageCompression = new QLabel (i18n("Image compression algorithm:"), groupBox3);
m_TIFFCompressionAlgo = new QComboBox( false, groupBox3 );
m_TIFFCompressionAlgo->insertItem("LZW");
m_TIFFCompressionAlgo->insertItem("JPEG");
m_TIFFCompressionAlgo->insertItem(i18n("None"));
m_TIFFCompressionAlgo->setWhatsThis(i18n("<p>Select here the TIFF compression algorithm.") );
m_label_TIFFimageCompression->setBuddy( m_TIFFCompressionAlgo );
dvlay->addWidget( groupBox3 );
// TGA File format.
Q3GroupBox * groupBox4 = new Q3GroupBox( 2, Qt::Horizontal, i18n("TGA File Format"), box );
m_label_TGAimageCompression = new QLabel (i18n("Image compression algorithm:"), groupBox4);
m_TGACompressionAlgo = new QComboBox( false, groupBox4 );
m_TGACompressionAlgo->insertItem("RLE");
m_TGACompressionAlgo->insertItem(i18n("None"));
m_TGACompressionAlgo->setWhatsThis(i18n("<p>Select here the TGA compression algorithm.") );
m_label_TGAimageCompression->setBuddy( m_TGACompressionAlgo );
dvlay->addWidget( groupBox4 );
}
开发者ID:ruphy,项目名称:kipi-plugins,代码行数:86,代码来源:recompressoptionsdialog.cpp
示例8: QDialog
SearchReplace::SearchReplace( QWidget* parent, ScribusDoc *doc, PageItem* ite, bool mode )
: QDialog( parent ),
matchesFound(0)
{
m_item = ite;
m_doc = doc;
m_notFound = false;
m_itemMode = mode;
m_firstMatchPosition = -1;
setModal(true);
setWindowTitle( tr( "Search/Replace" ) );
setWindowIcon(IconManager::instance()->loadIcon("AppIcon.png"));
SearchReplaceLayout = new QVBoxLayout( this );
SearchReplaceLayout->setMargin(10);
SearchReplaceLayout->setSpacing(5);
SelLayout = new QHBoxLayout;
SelLayout->setMargin(0);
SelLayout->setSpacing(5);
Search = new QGroupBox( this );
Search->setTitle( tr( "Search for:" ) );
SearchLayout = new QGridLayout( Search );
SearchLayout->setMargin(5);
SearchLayout->setSpacing(2);
SearchLayout->setAlignment( Qt::AlignTop );
SText = new QCheckBox( Search );
SText->setText( tr( "Text" ) );
SearchLayout->addWidget( SText, 0, 0 );
SStyle = new QCheckBox( Search );
SStyle->setText( tr( "Style" ) );
SearchLayout->addWidget( SStyle, 1, 0 );
SAlign = new QCheckBox( Search );
SAlign->setText( tr( "Alignment" ) );
SearchLayout->addWidget( SAlign, 2, 0 );
SFont = new QCheckBox( Search );
SFont->setText( tr( "Font" ) );
SearchLayout->addWidget( SFont, 3, 0 );
SSize = new QCheckBox( Search );
SSize->setText( tr( "Font Size" ) );
SearchLayout->addWidget( SSize, 4, 0 );
SEffect = new QCheckBox( Search );
SEffect->setText( tr( "Font Effects" ) );
SearchLayout->addWidget( SEffect, 5, 0 );
SFill = new QCheckBox( Search);
SFill->setText( tr( "Fill Color" ) );
SearchLayout->addWidget( SFill, 6, 0 );
SFillS = new QCheckBox( Search );
SFillS->setText( tr( "Fill Shade" ) );
SearchLayout->addWidget( SFillS, 7, 0 );
SStroke = new QCheckBox( Search );
SStroke->setText( tr( "Stroke Color" ) );
SearchLayout->addWidget( SStroke, 8, 0 );
SStrokeS = new QCheckBox( Search );
SStrokeS->setText( tr( "Stroke Shade" ) );
SearchLayout->addWidget( SStrokeS, 9, 0 );
STextVal = new QLineEdit( Search );
STextVal->setEnabled(false);
SearchLayout->addWidget( STextVal, 0, 1 );
SStyleVal = new QComboBox( Search );
SStyleVal->setEditable(false);
for (int x = 0; x < doc->paragraphStyles().count(); ++x)
SStyleVal->addItem(doc->paragraphStyles()[x].name());
QListView *tmpView = dynamic_cast<QListView*>(SStyleVal->view()); Q_ASSERT(tmpView);
int tmpWidth = tmpView->sizeHintForColumn(0);
if (tmpWidth > 0)
tmpView->setMinimumWidth(tmpWidth + 24);
SStyleVal->setCurrentIndex(findParagraphStyle(doc, doc->currentStyle));
SStyleVal->setEnabled(false);
SearchLayout->addWidget( SStyleVal, 1, 1 );
SAlignVal = new QComboBox( Search );
SAlignVal->setEditable(false);
QString tmp_sty[] = { tr("Left"), tr("Center"), tr("Right"), tr("Block"), tr("Forced")};
size_t ar_sty = sizeof(tmp_sty) / sizeof(*tmp_sty);
for (uint a = 0; a < ar_sty; ++a)
SAlignVal->addItem( tmp_sty[a] );
tmpView = dynamic_cast<QListView*>(SAlignVal->view()); Q_ASSERT(tmpView);
tmpWidth = tmpView->sizeHintForColumn(0);
if (tmpWidth > 0)
tmpView->setMinimumWidth(tmpWidth + 24);
SAlignVal->setEnabled(false);
SearchLayout->addWidget( SAlignVal, 2, 1 );
SFontVal = new FontCombo(Search);
SFontVal->setMaximumSize(190, 30);
setCurrentComboItem(SFontVal, doc->currentStyle.charStyle().font().scName());
SFontVal->setEnabled(false);
SearchLayout->addWidget( SFontVal, 3, 1 );
SSizeVal = new ScrSpinBox( 0.5, 2048, Search, 0 );
SSizeVal->setValue( doc->currentStyle.charStyle().fontSize() / 10.0 );
SSizeVal->setEnabled(false);
SearchLayout->addWidget( SSizeVal, 4, 1 );
SEffVal = new StyleSelect( Search );
SEffVal->setStyle(0);
SEffVal->setEnabled(false);
SearchLayout->addWidget( SEffVal, 5, 1, Qt::AlignLeft );
SFillVal = new ColorCombo( Search );
SFillVal->setEditable(false);
SFillVal->setPixmapType(ColorCombo::fancyPixmaps);
SFillVal->setColors(doc->PageColors, true);
SFillVal->setMinimumWidth(SFillVal->view()->maximumViewportSize().width() + 24);
//.........这里部分代码省略.........
开发者ID:HOST-Oman,项目名称:scribus,代码行数:101,代码来源:search.cpp
示例9: QDialog
EditGpi::EditGpi(int gpi,int *oncart,QString *ondesc,
int *offcart,QString *offdesc,QWidget *parent)
: QDialog(parent)
{
setModal(true);
edit_gpi=gpi;
edit_oncart=oncart;
edit_offcart=offcart;
edit_ondescription=ondesc;
edit_offdescription=offdesc;
setWindowTitle("RDAdmin - "+tr("Edit GPI")+QString().sprintf(" %d",gpi));
//
// Fix the Window Size
//
setMinimumWidth(sizeHint().width());
setMaximumWidth(sizeHint().width());
setMinimumHeight(sizeHint().height());
setMaximumHeight(sizeHint().height());
//
// Create Fonts
//
QFont label_font=QFont("Helvetica",14,QFont::Bold);
label_font.setPixelSize(14);
QFont bold_font=QFont("Helvetica",12,QFont::Bold);
bold_font.setPixelSize(12);
QFont font=QFont("Helvetica",12,QFont::Normal);
font.setPixelSize(12);
//
// Text Validator
//
RDTextValidator *validator=new RDTextValidator(this);
//
// On Section Label
//
QLabel *label=new QLabel("ON Transition",this);
label->setGeometry(30,10,120,20);
label->setFont(label_font);
label->setAlignment(Qt::AlignCenter);
//
// On Cart Macro Cart
//
edit_onmacro_edit=new QLineEdit(this);
edit_onmacro_edit->setGeometry(120,30,60,20);
edit_onmacro_edit->setFont(font);
edit_onmacro_edit->setValidator(validator);
label=new QLabel(tr("Cart Number: "),this);
label->setGeometry(15,30,100,20);
label->setFont(bold_font);
label->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
//
// On Select Button
//
QPushButton *button=new QPushButton(this);
button->setGeometry(190,30,60,20);
button->setFont(font);
button->setText(tr("&Select"));
connect(button,SIGNAL(clicked()),this,SLOT(selectOnData()));
//
// On Clear Button
//
button=new QPushButton(this);
button->setGeometry(270,30,60,20);
button->setFont(font);
button->setText(tr("C&lear"));
connect(button,SIGNAL(clicked()),this,SLOT(clearOnData()));
//
// On Cart Description
//
edit_ondescription_edit=new QLineEdit(this);
edit_ondescription_edit->setGeometry(120,52,sizeHint().width()-140,20);
edit_ondescription_edit->setFont(font);
edit_ondescription_edit->setReadOnly(true);
label=new QLabel(tr("Description: "),this);
label->setGeometry(15,52,100,20);
label->setFont(bold_font);
label->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
//
// Off Section Label
//
label=new QLabel("OFF Transition",this);
label->setGeometry(30,90,120,20);
label->setFont(label_font);
label->setAlignment(Qt::AlignCenter);
//
// Off Cart Macro Cart
//
edit_offmacro_edit=new QLineEdit(this);
edit_offmacro_edit->setGeometry(120,110,60,20);
edit_offmacro_edit->setFont(font);
//.........这里部分代码省略.........
开发者ID:ElvishArtisan,项目名称:rivendell,代码行数:101,代码来源:edit_gpi.cpp
示例10: QDialog
HatPrompt::HatPrompt(int currentIndex, QWidget* parent) : QDialog(parent)
{
setModal(true);
setWindowFlags(Qt::Sheet);
setWindowModality(Qt::WindowModal);
setMinimumSize(550, 430);
resize(550, 430);
setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
setStyleSheet("QPushButton { padding: 5px; margin-top: 10px; }");
// Hat model, and a model for setting a filter
HatModel * hatModel = DataManager::instance().hatModel();
filterModel = new QSortFilterProxyModel();
filterModel->setSourceModel(hatModel);
filterModel->setFilterCaseSensitivity(Qt::CaseInsensitive);
// Grid
QGridLayout * dialogLayout = new QGridLayout(this);
dialogLayout->setSpacing(0);
dialogLayout->setColumnStretch(1, 1);
QHBoxLayout * topLayout = new QHBoxLayout();
// Help/prompt message at top
QLabel * lblDesc = new QLabel(tr("Search for a hat:"));
lblDesc->setObjectName("lblDesc");
lblDesc->setStyleSheet("#lblDesc { color: #130F2A; background: #F6CB1C; border: solid 4px #F6CB1C; border-top-left-radius: 10px; padding: 4px 10px;}");
lblDesc->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
lblDesc->setFixedHeight(24);
lblDesc->setMinimumWidth(0);
// Filter text box
QWidget * filterContainer = new QWidget();
filterContainer->setFixedHeight(24);
filterContainer->setObjectName("filterContainer");
filterContainer->setStyleSheet("#filterContainer { background: #F6CB1C; border-top-right-radius: 10px; padding: 3px; }");
filterContainer->setFixedWidth(150);
txtFilter = new LineEditCursor(filterContainer);
txtFilter->setFixedWidth(150);
txtFilter->setFocus();
txtFilter->setFixedHeight(22);
txtFilter->setStyleSheet("LineEditCursor { border-width: 0px; border-radius: 6px; margin-top: 3px; margin-right: 3px; padding-left: 4px; padding-bottom: 2px; background-color: rgb(23, 11, 54); } LineEditCursor:hover, LineEditCursor:focus { background-color: rgb(13, 5, 68); }");
connect(txtFilter, SIGNAL(textChanged(const QString &)), this, SLOT(filterChanged(const QString &)));
connect(txtFilter, SIGNAL(moveUp()), this, SLOT(moveUp()));
connect(txtFilter, SIGNAL(moveDown()), this, SLOT(moveDown()));
connect(txtFilter, SIGNAL(moveLeft()), this, SLOT(moveLeft()));
connect(txtFilter, SIGNAL(moveRight()), this, SLOT(moveRight()));
// Corner widget
QLabel * corner = new QLabel();
corner->setPixmap(QPixmap(QString::fromUtf8(":/res/inverse-corner-bl.png")));
corner->setFixedSize(10, 10);
// Add widgets to top layout
topLayout->addWidget(lblDesc);
topLayout->addWidget(filterContainer);
topLayout->addWidget(corner, 0, Qt::AlignBottom);
topLayout->addStretch(1);
// Cancel button (closes dialog)
QPushButton * btnCancel = new QPushButton(tr("Cancel"));
connect(btnCancel, SIGNAL(clicked()), this, SLOT(reject()));
// Select button
QPushButton * btnSelect = new QPushButton(tr("Use selected hat"));
btnSelect->setDefault(true);
connect(btnSelect, SIGNAL(clicked()), this, SLOT(onAccepted()));
// Add hats
list = new HatListView();
list->setModel(filterModel);
list->setViewMode(QListView::IconMode);
list->setResizeMode(QListView::Adjust);
list->setMovement(QListView::Static);
list->setEditTriggers(QAbstractItemView::NoEditTriggers);
list->setSpacing(8);
list->setWordWrap(true);
list->setSelectionMode(QAbstractItemView::SingleSelection);
list->setObjectName("hatList");
list->setCurrentIndex(filterModel->index(currentIndex, 0));
connect(list, SIGNAL(activated(const QModelIndex &)), this, SLOT(hatChosen(const QModelIndex &)));
connect(list, SIGNAL(clicked(const QModelIndex &)), this, SLOT(hatChosen(const QModelIndex &)));
// Add elements to layouts
dialogLayout->addLayout(topLayout, 0, 0, 1, 3);
dialogLayout->addWidget(list, 1, 0, 1, 3);
dialogLayout->addWidget(btnCancel, 2, 0, 1, 1, Qt::AlignLeft);
dialogLayout->addWidget(btnSelect, 2, 2, 1, 1, Qt::AlignRight);
}
开发者ID:RobWatlingSF,项目名称:hedgewars,代码行数:90,代码来源:hatprompt.cpp
示例11: QDialog
purchaseOrderList::purchaseOrderList(QWidget* parent, const char* name, bool modal, Qt::WindowFlags fl) :
QDialog(parent, fl)
{
setObjectName(name ? name : "purchaseOrderList");
setModal(modal);
_poheadid = -1;
_type = (cPOUnposted | cPOOpen | cPOClosed);
setWindowTitle(tr("Purchase Orders"));
QHBoxLayout *purchaseOrderListLayout = new QHBoxLayout(this);
QVBoxLayout *tableLayout = new QVBoxLayout();
QVBoxLayout *buttonLayout = new QVBoxLayout();
purchaseOrderListLayout->addLayout(tableLayout);
purchaseOrderListLayout->addLayout(buttonLayout);
QHBoxLayout *vendLayout = new QHBoxLayout();
_vend = new VendorCluster(this, "_vend");
vendLayout->addWidget(_vend);
vendLayout->addItem(new QSpacerItem(20, 20, QSizePolicy::Expanding,
QSizePolicy::Minimum));
tableLayout->addLayout(vendLayout);
QLabel *_poheadLit = new QLabel(tr("&Purchase Orders:"), this);
_poheadLit->setObjectName("_poheadLit");
tableLayout->addWidget( _poheadLit );
_pohead = new XTreeWidget(this);
_pohead->setObjectName("_pohead");
_poheadLit->setBuddy(_pohead);
tableLayout->addWidget(_pohead);
_close = new QPushButton(tr("&Cancel"), this);
_close->setObjectName("_close");
buttonLayout->addWidget( _close );
_select = new QPushButton(tr("&Select"), this);
_select->setObjectName("_select");
_select->setEnabled( false );
_select->setDefault( true );
buttonLayout->addWidget( _select );
QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding );
buttonLayout->addItem( spacer );
resize( QSize(550, 350).expandedTo(minimumSizeHint()) );
//clearWState( WState_Polished );
// signals and slots connections
connect(_close, SIGNAL(clicked()), this, SLOT(sClose() ));
connect(_pohead, SIGNAL(itemSelected(int)), _select, SLOT(animateClick() ));
connect(_pohead, SIGNAL(valid(bool)), _select, SLOT(setEnabled(bool)));
connect(_select, SIGNAL(clicked()), this, SLOT(sSelect() ));
connect(_vend, SIGNAL(newId(int)), this, SLOT(sFillList() ));
_type = 0;
_pohead->addColumn(tr("Number"), _orderColumn, Qt::AlignRight, true, "pohead_number");
_pohead->addColumn(tr("Vendor"), -1, Qt::AlignLeft, true, "vend_name");
_pohead->addColumn(tr("Agent"), _itemColumn, Qt::AlignCenter,true, "pohead_agent_username");
_pohead->addColumn(tr("Order Date"),_dateColumn, Qt::AlignLeft, true, "pohead_orderdate");
_pohead->addColumn(tr("First Item"),_itemColumn, Qt::AlignLeft, true, "item_number");
_pohead->setFocus();
}
开发者ID:ChristopherCotnoir,项目名称:qt-client,代码行数:66,代码来源:purchaseOrderList.cpp
示例12: QDialog
RocketStorageSceneImporter::RocketStorageSceneImporter(QWidget *parent, RocketPlugin *plugin, const QString &destinationPrefix,
const SceneDesc &sceneDesc_, const ImportEntityItemList &entities_,
const ImportAssetItemList &assets_) :
QDialog(parent, Qt::SplashScreen),
plugin_(plugin),
destinationPrefix_(destinationPrefix),
menu_(0),
sceneDesc(sceneDesc_),
entities(entities_),
assets(assets_)
{
setAttribute(Qt::WA_DeleteOnClose, true);
setWindowModality(Qt::ApplicationModal);
setModal(true);
ui.setupUi(this);
hide();
#ifdef Q_WS_WIN
// @bug Scrolling is broken on Mac if you have custom stylesheet to QTableWidgets;
QString style("QTableView { border: 1px solid grey; font: 10px \"Arial\"; }");
ui.assets->setStyleSheet(style);
ui.entities->setStyleSheet(style);
#endif
ui.assets->setSortingEnabled(false);
ui.entities->setSortingEnabled(false);
ui.assets->setVisible(false);
ui.entities->setVisible(false);
// Rewrite all asset refs to be relative "file.extension" from "local://file.extension" etc.
QMutableListIterator<EntityDesc> edIt(sceneDesc.entities);
while(edIt.hasNext())
{
QMutableListIterator<ComponentDesc> cdIt(edIt.next().components);
while(cdIt.hasNext())
{
QMutableListIterator<AttributeDesc> adIt(cdIt.next().attributes);
while(adIt.hasNext())
{
adIt.next();
if ((adIt.value().typeName.compare(cAttributeAssetReferenceTypeName, Qt::CaseInsensitive) == 0) ||
(adIt.value().typeName.compare(cAttributeAssetReferenceListTypeName, Qt::CaseInsensitive) == 0))
{
QString trimmed = adIt.value().value.trimmed();
if (trimmed.isEmpty() || trimmed == "RexSkyBox")
continue;
QStringList newValues;
QStringList valueParts = adIt.value().value.split(";", QString::KeepEmptyParts);
for(int i=0; i<valueParts.size(); ++i)
{
QString &value = valueParts[i];
if (value.trimmed().isEmpty())
newValues << "";
else
{
// Leave http refs alone
if (!value.startsWith("http://") && !value.startsWith("https://"))
{
QString filename, subasset;
AssetAPI::ParseAssetRef(value, 0, 0, 0, 0, 0, 0, &filename, &subasset);
newValues << destinationPrefix_ + filename + (!subasset.isEmpty() ? "#" + subasset : "");
}
else
{
LogDebug("Found web ref, leaving alone: " + value);
newValues << value;
}
}
}
if (!newValues.isEmpty())
{
QString newValue = newValues.join(";");
if (adIt.value().value != newValue)
{
foreach(const RocketStorageImportAssetItem &item, assets)
{
if (newValue == item.pathRelative)
{
newValue = item.desc.destinationName;
break;
}
}
//LogInfo("[RocketSceneImporter]: Rewriting asset reference from " + adIt.value().value + " to " + newValue);
adIt.value().value = newValue;
}
}
}
}
开发者ID:Adminotech,项目名称:meshmoon-plugins,代码行数:93,代码来源:RocketStorageSceneImporter.cpp
示例13: QDialog
CustomFDialog::CustomFDialog(QWidget *parent, QString wDir, QString caption, QString filter, int flags)
: QDialog(parent), optionFlags(flags)
{
setModal(true);
setWindowTitle(caption);
setWindowIcon(QIcon(loadIcon("AppIcon.png")));
vboxLayout = new QVBoxLayout(this);
vboxLayout->setSpacing(5);
vboxLayout->setMargin(10);
hboxLayout = new QHBoxLayout;
hboxLayout->setSpacing(5);
hboxLayout->setMargin(0);
fileDialog = new ScFileWidget(this);
hboxLayout->addWidget(fileDialog);
fileDialog->setIconProvider(new ImIconProvider());
fileDialog->setFilter(filter);
fileDialog->selectFilter(filter);
fileDialog->setDirectory(wDir);
vboxLayout1 = new QVBoxLayout;
vboxLayout1->setSpacing(0);
vboxLayout1->setMargin(0);
vboxLayout1->setContentsMargins(0, 37, 0, 0);
vboxLayout1->setAlignment( Qt::AlignTop );
pw = new FDialogPreview( this );
pw->setMinimumSize(QSize(200, 200));
pw->setMaximumSize(QSize(200, 200));
vboxLayout1->addWidget(pw);
hboxLayout->addLayout(vboxLayout1);
vboxLayout->addLayout(hboxLayout);
QHBoxLayout *hboxLayout1 = new QHBoxLayout;
hboxLayout1->setSpacing(5);
hboxLayout1->setContentsMargins(9, 0, 0, 0);
showPreview = new QCheckBox(this);
showPreview->setText( tr("Show Preview"));
showPreview->setToolTip( tr("Show a preview and information for the selected file"));
showPreview->setChecked(true);
previewIsShown = true;
hboxLayout1->addWidget(showPreview);
QSpacerItem *spacerItem = new QSpacerItem(2, 2, QSizePolicy::Expanding, QSizePolicy::Minimum);
hboxLayout1->addItem(spacerItem);
OKButton = new QPushButton( CommonStrings::tr_OK, this);
OKButton->setDefault( true );
hboxLayout1->addWidget( OKButton );
CancelB = new QPushButton( CommonStrings::tr_Cancel, this);
CancelB->setAutoDefault( false );
hboxLayout1->addWidget( CancelB );
vboxLayout->addLayout(hboxLayout1);
SaveZip=NULL;
WithFonts=NULL;
WithProfiles=NULL;
if (flags & fdDirectoriesOnly)
{
Layout = new QFrame(this);
Layout1 = new QHBoxLayout(Layout);
Layout1->setSpacing( 0 );
Layout1->setContentsMargins(9, 0, 0, 0);
SaveZip = new QCheckBox( tr( "&Compress File" ), Layout);
Layout1->addWidget(SaveZip, Qt::AlignLeft);
QSpacerItem* spacer = new QSpacerItem( 2, 2, QSizePolicy::Expanding, QSizePolicy::Minimum );
Layout1->addItem( spacer );
vboxLayout->addWidget(Layout);
LayoutC = new QFrame(this);
Layout1C = new QHBoxLayout(LayoutC);
Layout1C->setSpacing( 0 );
Layout1C->setContentsMargins(9, 0, 0, 0);
WithFonts = new QCheckBox( tr( "&Include Fonts" ), LayoutC);
Layout1C->addWidget(WithFonts, Qt::AlignLeft);
WithProfiles = new QCheckBox( tr( "&Include Color Profiles" ), LayoutC);
Layout1C->addWidget(WithProfiles, Qt::AlignLeft);
QSpacerItem* spacer2 = new QSpacerItem( 2, 2, QSizePolicy::Expanding, QSizePolicy::Minimum );
Layout1C->addItem( spacer2 );
vboxLayout->addWidget(LayoutC);
fileDialog->setFileMode(QFileDialog::DirectoryOnly);
pw->hide();
showPreview->setVisible(false);
showPreview->setChecked(false);
previewIsShown = false;
}
else
{
if (flags & fdCompressFile)
{
Layout = new QFrame(this);
Layout1 = new QHBoxLayout(Layout);
Layout1->setSpacing( 5 );
Layout1->setContentsMargins(9, 0, 0, 0);
SaveZip = new QCheckBox( tr( "&Compress File" ), Layout);
Layout1->addWidget(SaveZip);
QSpacerItem* spacer = new QSpacerItem( 2, 2, QSizePolicy::Expanding, QSizePolicy::Minimum );
Layout1->addItem( spacer );
}
if (flags & fdExistingFiles)
fileDialog->setFileMode(QFileDialog::ExistingFile);
else
{
fileDialog->setFileMode(QFileDialog::AnyFile);
if (flags & fdCompressFile)
vboxLayout->addWidget(Layout);
}
//.........这里部分代码省略.........
开发者ID:moceap,项目名称:scribus,代码行数:101,代码来源:customfdialog.cpp
示例14: QDialog
SelectFields::SelectFields(QWidget* parent, QString Felder, QString Own, ScribusDoc *Doc, int Art) : QDialog(parent)
{
setModal(true);
setWindowTitle( tr( "Select Fields" ) );
setWindowIcon(QIcon(loadIcon ( "AppIcon.png" )));
FTyp = Art;
SelectFieldsLayout = new QVBoxLayout( this );
SelectFieldsLayout->setMargin(10);
SelectFieldsLayout->setSpacing(5);
Layout5 = new QHBoxLayout;
Layout5->setMargin(0);
Layout5->setSpacing(5);
Layout1 = new QVBoxLayout;
Layout1->setMargin(0);
Layout1->setSpacing(5);
Text1 = new QLabel(
|
请发表评论