本文整理汇总了C++中KDialog::result方法的典型用法代码示例。如果您正苦于以下问题:C++ KDialog::result方法的具体用法?C++ KDialog::result怎么用?C++ KDialog::result使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KDialog
的用法示例。
在下文中一共展示了KDialog::result方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: QLabel
void RKCaughtX11Window::copyDeviceToRObject () {
RK_TRACE (MISC);
// TODO: not very pretty, yet
KDialog *dialog = new KDialog (this);
dialog->setButtons (KDialog::Ok|KDialog::Cancel);
dialog->setCaption (i18n ("Specify R object"));
dialog->setModal (true);
KVBox *page = new KVBox (dialog);
dialog->setMainWidget (page);
new QLabel (i18n ("Specify the R object name, you want to save the graph to"), page);
RKSaveObjectChooser *chooser = new RKSaveObjectChooser (page, "my.plot");
connect (chooser, SIGNAL (changed(bool)), dialog, SLOT (enableButtonOk(bool)));
if (!chooser->isOk ()) dialog->enableButtonOk (false);
dialog->exec ();
if (dialog->result () == QDialog::Accepted) {
RK_ASSERT (chooser->isOk ());
QString name = chooser->currentFullName ();
RKGlobals::rInterface ()->issueCommand ("dev.set (" + QString::number (device_number) + ")\n" + name + " <- recordPlot ()", RCommand::App | RCommand::ObjectListUpdate, i18n ("Save contents of graphics device number %1 to object '%2'", device_number, name), error_dialog);
}
delete dialog;
}
示例2: showSourceDialog
void MagnatuneCollectionLocation::showSourceDialog( const Meta::TrackList &tracks, bool removeSources )
{
KDialog dialog;
dialog.setCaption( i18n( "Preview Tracks" ) );
dialog.setButtons( KDialog::Ok | KDialog::Cancel );
QLabel *label = new QLabel( i18n( "The tracks you are about to copy are Magnatune.com preview streams. For better quality and advert free streams, consider buying an album download. Remember that when buying from Magnatune the artist gets 50%. Also if you buy using Amarok, you support the Amarok project with 10%." ) );
label->setWordWrap ( true );
label->setMaximumWidth( 400 );
dialog.setMainWidget( label );
dialog.exec();
if ( dialog.result() == QDialog::Rejected )
abort();
CollectionLocation::showSourceDialog( tracks, removeSources ); // to get transcoding dialog
}