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


C++ KVBox类代码示例

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


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

示例1: BatchTool

ChannelMixer::ChannelMixer(QObject* parent)
    : BatchTool("ChannelMixer", ColorTool, parent)
{
    setToolTitle(i18n("Channel Mixer"));
    setToolDescription(i18n("A tool to mix color channel."));
    setToolIcon(KIcon(SmallIcon("channelmixer")));

    KVBox* vbox          = new KVBox;
    KHBox* hbox          = new KHBox(vbox);
    QLabel* channelLabel = new QLabel(hbox);
    channelLabel->setText(i18n("Channel:"));
    m_channelCB          = new KComboBox(hbox);
    m_channelCB->addItem(i18n("Red"),   QVariant(RedChannel));
    m_channelCB->addItem(i18n("Green"), QVariant(GreenChannel));
    m_channelCB->addItem(i18n("Blue"),  QVariant(BlueChannel));

    m_settingsView = new MixerSettings(vbox);
    QLabel* space  = new QLabel(vbox);
    vbox->setStretchFactor(space, 10);

    setSettingsWidget(vbox);

    connect(m_settingsView, SIGNAL(signalSettingsChanged()),
            this, SLOT(slotSettingsChanged()));

    connect(m_channelCB, SIGNAL(activated(int)),
            this, SLOT(slotChannelChanged()));

    connect(m_settingsView, SIGNAL(signalMonochromeActived(bool)),
            this, SLOT(slotMonochromeActived(bool)));
}
开发者ID:UIKit0,项目名称:digikam,代码行数:31,代码来源:channelmixer.cpp

示例2: KPWizardPage

PreProcessingPage::PreProcessingPage(Manager* const mngr, KAssistantDialog* const dlg)
    : KPWizardPage(dlg, i18n("<b>Pre-Processing Images</b>")),
      d(new PreProcessingPagePriv)
{
    d->mngr             = mngr;
    d->progressTimer    = new QTimer(this);
    KVBox* vbox         = new KVBox(this);
    d->title            = new QLabel(vbox);
    d->title->setWordWrap(true);
    d->title->setOpenExternalLinks(true);

    KConfig config("kipirc");
    KConfigGroup group  = config.group(QString("Panorama Settings"));

    d->celesteCheckBox  = new QCheckBox(i18n("Detect moving skies"), vbox);
    d->celesteCheckBox->setChecked(group.readEntry("Celeste", false));
    d->celesteCheckBox->setToolTip(i18n("Automatic detection of clouds to prevent wrong keypoints matching "
                                        "between images due to moving clouds."));
    d->celesteCheckBox->setWhatsThis(i18n("<b>Detect moving skies</b>: During the control points selection and matching, "
                                          "this option discards any points that are associated to a possible cloud. This "
                                          "is useful to prevent moving clouds from altering the control points matching "
                                          "process."));

    QLabel* space1   = new QLabel(vbox);
    KHBox* hbox      = new KHBox(vbox);
    d->detailsBtn    = new QPushButton(hbox);
    d->detailsBtn->setText(i18n("Details..."));
    d->detailsBtn->hide();
    QLabel* space2   = new QLabel(hbox);
    hbox->setStretchFactor(space2, 10);

    QLabel* space3   = new QLabel(vbox);
    d->progressLabel = new QLabel(vbox);
    d->progressLabel->setAlignment(Qt::AlignCenter);
    QLabel* space4   = new QLabel(vbox);

    vbox->setStretchFactor(space1, 2);
    vbox->setStretchFactor(space3, 2);
    vbox->setStretchFactor(space4, 10);
    vbox->setSpacing(KDialog::spacingHint());
    vbox->setMargin(KDialog::spacingHint());

    setPageWidget(vbox);

    resetTitle();

    QPixmap leftPix = KStandardDirs::locate("data", "kipiplugin_panorama/pics/assistant-preprocessing.png");
    setLeftBottomPix(leftPix.scaledToWidth(128, Qt::SmoothTransformation));

//     connect(d->mngr->thread(), SIGNAL(starting(KIPIPanoramaPlugin::ActionData)),
//             this, SLOT(slotAction(KIPIPanoramaPlugin::ActionData)));

    connect(d->progressTimer, SIGNAL(timeout()),
            this, SLOT(slotProgressTimerDone()));

    connect(d->detailsBtn, SIGNAL(clicked()),
            this, SLOT(slotShowDetails()));
}
开发者ID:UIKit0,项目名称:digikam-2012-kipi-plugins,代码行数:58,代码来源:preprocessingpage.cpp

示例3: KDialog

RKProgressControlDialog::RKProgressControlDialog (const QString &text, const QString &caption, int mode_flags, bool modal) : KDialog (0) {
	RK_TRACE (MISC);

	setAttribute (Qt::WA_DeleteOnClose, true);
	setModal (modal);
	setCaption (caption);

	KVBox *vbox = new KVBox (this);
	vbox->setSizePolicy (QSizePolicy::Fixed, QSizePolicy::Fixed);
	setMainWidget (vbox);

	QLabel *label = new QLabel (text, vbox);
	label->setWordWrap (true);

	error_indicator = new QLabel (i18n ("<b>There have been errors and / or warnings! See below for a transcript</b>"), vbox);
	QPalette palette = error_indicator->palette ();
	palette.setColor (error_indicator->foregroundRole (), QColor (255, 0, 0));
	error_indicator->setPalette (palette);
	error_indicator->hide ();

	KVBox* output_box = new KVBox ();
	if (mode_flags & (RKProgressControl::IncludeErrorOutput | RKProgressControl::IncludeRegularOutput)) {
		QString ocaption;
		if (mode_flags & RKProgressControl::IncludeRegularOutput) {
			output_button_text = i18n ("Output");
			ocaption = i18n ("Output:");
		} else {
			output_button_text = i18n ("Errors / Warnings");
			ocaption = i18n ("Errors / Warnings:");
		}
		new QLabel (ocaption, output_box);

		output_text = new QTextEdit (output_box);
		output_text->setReadOnly (true);
		output_text->setPlainText (QString ());
		output_text->setUndoRedoEnabled (false);
		output_text->setLineWrapMode (QTextEdit::NoWrap);
		output_text->setMinimumWidth (QFontMetrics (output_text->font ()).averageCharWidth () * RKSettingsModuleR::getDefaultWidth ());
		output_box->setStretchFactor (output_text, 10);
	}
	setDetailsWidget (output_box);
	// it's important to use a queued connection, here. Otherwise, if the details widget gets shown due to error output, scrollDown() would only scroll to the position directly *above* the new output.
	connect (this, SIGNAL(aboutToShowDetails()), this, SLOT(scrollDown()), Qt::QueuedConnection);

	KDialog::ButtonCodes button_codes = KDialog::Cancel;
	if (mode_flags & RKProgressControl::OutputSwitchable) button_codes |= KDialog::Details;
	setButtons (button_codes);
	if (button_codes & KDialog::Details) setButtonText (KDialog::Details, output_button_text);
	if (mode_flags & RKProgressControl::AllowCancel) setButtonText (KDialog::Cancel, i18n ("Cancel"));
	else (setCloseTextToClose ());

	if (mode_flags & RKProgressControl::OutputShownByDefault) setDetailsWidgetVisible (true);

	prevent_close = (mode_flags & RKProgressControl::PreventClose);

	last_output_type = ROutput::Output;
	is_done = false;
}
开发者ID:svn2github,项目名称:rkward-svn-mirror,代码行数:58,代码来源:rkprogresscontrol.cpp

示例4: QToolButton

VolumePopupButton::VolumePopupButton( QWidget * parent, PlayerManager *mgr ) :
    QToolButton( parent ),
    m_prevVolume(0.0),
    m_curVolume(0.0),
    player(mgr)
{
    //create the volume popup
    m_volumeMenu = new QMenu( this );

    KVBox *mainBox = new KVBox( this );

    m_volumeLabel= new QLabel( mainBox );
    m_volumeLabel->setAlignment( Qt::AlignHCenter );

    KHBox *sliderBox = new KHBox( mainBox );
    m_volumeSlider = new VolumeSlider( 100, sliderBox, false );
    m_volumeSlider->setFixedHeight( 170 );
    mainBox->setMargin( 0 );
    mainBox->setSpacing( 0 );
    sliderBox->setSpacing( 0 );
    sliderBox->setMargin( 0 );
    mainBox->setSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::Fixed );
    sliderBox->setSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::Fixed );

    QWidgetAction *sliderActionWidget = new QWidgetAction( this );
    sliderActionWidget->setDefaultWidget( mainBox );

    // volumeChanged is a customSignal, is not emited by setValue()
    connect( m_volumeSlider, SIGNAL(volumeChanged(float)), player, SLOT(setVolume(float)) );

    QToolBar *muteBar = new QToolBar( QString(), mainBox );
    muteBar->setContentsMargins( 0, 0, 0, 0 );
    muteBar->setIconSize( QSize( 16, 16 ) );

    // our popup's mute-toggle  button
    m_muteAction = new QAction( KIcon( "audio-volume-muted" ), QString(), muteBar );
    m_muteAction->setToolTip( i18n( "Mute/Unmute" ) );

    connect( m_muteAction, SIGNAL(triggered(bool)), this, SLOT(slotToggleMute(bool)) );
    connect( player, SIGNAL(mutedChanged(bool)), this, SLOT(slotMuteStateChanged(bool)) );

    m_volumeMenu->addAction( sliderActionWidget );
    muteBar->addAction( m_muteAction );

    /* set icon and label to match create state of AudioOutput, as the
     * desired volume value is not available yet (because the player
     * object is not set up yet.) Someone must call PlayerManager::setVolume()
     * later.
     */
    slotVolumeChanged( 1.0 );

    // let player notify us when volume changes
    connect( player, SIGNAL(volumeChanged(float)), this, SLOT(slotVolumeChanged(float)) );
}
开发者ID:mjs973b,项目名称:jukebox,代码行数:54,代码来源:volumepopupbutton.cpp

示例5: FolderDialogTab

KMail::FolderDialogACLTab::FolderDialogACLTab( KMFolderDialog* dlg, QWidget* parent )
  : FolderDialogTab( dlg, parent ),
    mImapAccount( 0 ),
    mUserRights( 0 ),
    mChanged( false ), mAccepting( false ), mSaving( false )
{
  QVBoxLayout* topLayout = new QVBoxLayout( this );
  // We need a widget stack to show either a label ("no acl support", "please wait"...)
  // or a listview.
  mStack = new QStackedWidget( this );
  topLayout->addWidget( mStack );

  mLabel = new QLabel( mStack );
  mLabel->setAlignment( Qt::AlignHCenter | Qt::AlignVCenter );
  mLabel->setWordWrap( true );
  mStack->addWidget( mLabel );

  mACLWidget = new KHBox( mStack );
  mACLWidget->setSpacing( KDialog::spacingHint() );

  mListView = new QTreeWidget( mACLWidget );
  QStringList headerNames;
  headerNames << i18n("User Id") << i18n("Permissions");
  mListView->setHeaderItem( new QTreeWidgetItem( headerNames ) );
  mListView->setAllColumnsShowFocus( true );
  mListView->setAlternatingRowColors( true );
  mListView->setSortingEnabled( false );
  mListView->setRootIsDecorated( false );

  mStack->addWidget( mACLWidget );

  connect( mListView, SIGNAL( itemActivated( QTreeWidgetItem*, int ) ),
       SLOT( slotEditACL( QTreeWidgetItem* ) ) );
  connect( mListView, SIGNAL( itemSelectionChanged() ),
       SLOT( slotSelectionChanged() ) );

  KVBox* buttonBox = new KVBox( mACLWidget );
  buttonBox->setSpacing( KDialog::spacingHint() );
  mAddACL = new KPushButton( i18n( "Add Entry..." ), buttonBox );
  mEditACL = new KPushButton( i18n( "Modify Entry..." ), buttonBox );
  mRemoveACL = new KPushButton( i18n( "Remove Entry" ), buttonBox );
  QWidget *spacer = new QWidget( buttonBox );
  spacer->setSizePolicy( QSizePolicy::Minimum, QSizePolicy::Expanding );

  connect( mAddACL, SIGNAL( clicked() ), SLOT( slotAddACL() ) );
  connect( mEditACL, SIGNAL( clicked() ), SLOT( slotEditACL() ) );
  connect( mRemoveACL, SIGNAL( clicked() ), SLOT( slotRemoveACL() ) );
  mEditACL->setEnabled( false );
  mRemoveACL->setEnabled( false );

  connect( this, SIGNAL( changed(bool) ), SLOT( slotChanged(bool) ) );
}
开发者ID:akhuettel,项目名称:kdepim-noakonadi,代码行数:52,代码来源:folderdialogacltab.cpp

示例6: m_image

KHTMLImage::KHTMLImage( QWidget *parentWidget,
                        QObject *parent, KHTMLPart::GUIProfile prof )
    : KParts::ReadOnlyPart( parent ), m_image( 0 )
{
    KHTMLPart* parentPart = qobject_cast<KHTMLPart*>( parent );
    setComponentData( KHTMLImageFactory::componentData(), prof == KHTMLPart::BrowserViewGUI && !parentPart );

    KVBox *box = new KVBox( parentWidget );
    box->setAcceptDrops( true );

    m_khtml = new KHTMLPart( box, this, prof );
    m_khtml->setAutoloadImages( true );

    // We do not want our subpart to be destroyed when its widget is,
    // since that may cause all KHTMLParts to die when we're dealing
    // with
    m_khtml->setAutoDeletePart( false );

    connect( m_khtml->view(), SIGNAL(finishedLayout()), this, SLOT(restoreScrollPosition()) );

    setWidget( box );

    // VBox can't take focus, so pass it on to sub-widget
    box->setFocusProxy( m_khtml->widget() );

    m_ext = new KHTMLImageBrowserExtension( this );
    m_ext->setObjectName( "be" );

    m_sbExt = new KParts::StatusBarExtension( this );
    m_sbExt->setObjectName( "sbe" );

    // Remove unnecessary actions.
    delete actionCollection()->action( "setEncoding" );
    delete actionCollection()->action( "viewDocumentSource" );
    delete actionCollection()->action( "selectAll" );

    // forward important signals from the khtml part

    // forward opening requests to parent frame (if existing)
    KHTMLPart *p = qobject_cast<KHTMLPart*>(parent);
    KParts::BrowserExtension *be = p ? p->browserExtension() : m_ext;
    connect(m_khtml->browserExtension(), SIGNAL(openUrlRequestDelayed(KUrl,KParts::OpenUrlArguments,KParts::BrowserArguments)),
               be, SIGNAL(openUrlRequestDelayed(KUrl,KParts::OpenUrlArguments,KParts::BrowserArguments)));

    connect(m_khtml->browserExtension(), SIGNAL(popupMenu(QPoint,KUrl,mode_t,KParts::OpenUrlArguments,KParts::BrowserArguments,KParts::BrowserExtension::PopupFlags,KParts::BrowserExtension::ActionGroupMap)),
            this, SLOT(slotPopupMenu(QPoint,KUrl,mode_t,KParts::OpenUrlArguments,KParts::BrowserArguments,KParts::BrowserExtension::PopupFlags,KParts::BrowserExtension::ActionGroupMap)));

    connect( m_khtml->browserExtension(), SIGNAL(enableAction(const char*,bool)),
             m_ext, SIGNAL(enableAction(const char*,bool)) );

    m_ext->setURLDropHandlingEnabled( true );
}
开发者ID:,项目名称:,代码行数:52,代码来源:

示例7: KPWizardPage

PreProcessingPage::PreProcessingPage(Manager* const mngr, KAssistantDialog* const dlg)
    : KPWizardPage(dlg, i18n("<b>Pre-Processing Bracketed Images</b>")),
      d(new PreProcessingPagePriv)
{
    d->mngr          = mngr;
    d->progressTimer = new QTimer(this);
    KVBox *vbox      = new KVBox(this);
    d->title         = new QLabel(vbox);
    d->title->setWordWrap(true);
    d->title->setOpenExternalLinks(true);
    d->alignCheckBox = new QCheckBox(i18n("Align bracketed images"), vbox);
    KConfig config("kipirc");
    KConfigGroup group = config.group(QString("ExpoBlending Settings"));
    d->alignCheckBox->setChecked(group.readEntry("Auto Alignment", true));

    QLabel* space1   = new QLabel(vbox);
    KHBox* hbox      = new KHBox(vbox);
    d->detailsBtn    = new QPushButton(hbox);
    d->detailsBtn->setText(i18n("Details..."));
    d->detailsBtn->hide();
    QLabel* space2   = new QLabel(hbox);
    hbox->setStretchFactor(space2, 10);

    QLabel* space3   = new QLabel(vbox);
    d->progressLabel = new QLabel(vbox);
    d->progressLabel->setAlignment(Qt::AlignCenter);
    QLabel* space4   = new QLabel(vbox);

    vbox->setStretchFactor(space1, 2);
    vbox->setStretchFactor(space3, 2);
    vbox->setStretchFactor(space4, 10);
    vbox->setSpacing(KDialog::spacingHint());
    vbox->setMargin(KDialog::spacingHint());

    setPageWidget(vbox);

    resetTitle();

    QPixmap leftPix = KStandardDirs::locate("data", "kipiplugin_expoblending/pics/assistant-preprocessing.png");
    setLeftBottomPix(leftPix.scaledToWidth(128, Qt::SmoothTransformation));

    connect(d->mngr->thread(), SIGNAL(starting(KIPIExpoBlendingPlugin::ActionData)),
            this, SLOT(slotAction(KIPIExpoBlendingPlugin::ActionData)));

    connect(d->progressTimer, SIGNAL(timeout()),
            this, SLOT(slotProgressTimerDone()));

    connect(d->detailsBtn, SIGNAL(clicked()),
            this, SLOT(slotShowDetails()));
}
开发者ID:NathanDM,项目名称:kipi-plugins,代码行数:50,代码来源:preprocessingpage.cpp

示例8: SettingsPageBase

NavigationSettingsPage::NavigationSettingsPage(QWidget* parent) :
    SettingsPageBase(parent),
    m_openArchivesAsFolder(0),
    m_autoExpandFolders(0)
{
    const int spacing = KDialog::spacingHint();

    QVBoxLayout* topLayout = new QVBoxLayout(this);
    KVBox* vBox = new KVBox(this);
    vBox->setSpacing(spacing);

    // create 'Mouse' group
    QGroupBox* mouseBox = new QGroupBox(i18nc("@title:group", "Mouse"), vBox);
    mouseBox->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Maximum);
    m_singleClick = new QRadioButton(i18nc("@option:check Mouse Settings",
                                           "Single-click to open files and folders"), mouseBox);
    m_doubleClick = new QRadioButton(i18nc("@option:check Mouse Settings",
                                           "Double-click to open files and folders"), mouseBox);

    QVBoxLayout* mouseBoxLayout = new QVBoxLayout(mouseBox);
    mouseBoxLayout->addWidget(m_singleClick);
    mouseBoxLayout->addWidget(m_doubleClick);

    m_openArchivesAsFolder = new QCheckBox(i18nc("@option:check", "Open archives as folder"), vBox);

    m_autoExpandFolders = new QCheckBox(i18nc("option:check", "Open folders during drag operations"), vBox);

    // Add a dummy widget with no restriction regarding
    // a vertical resizing. This assures that the dialog layout
    // is not stretched vertically.
    new QWidget(vBox);

    topLayout->addWidget(vBox);

    loadSettings();

    connect(m_singleClick, SIGNAL(toggled(bool)), this, SIGNAL(changed()));
    connect(m_doubleClick, SIGNAL(toggled(bool)), this, SIGNAL(changed()));
    connect(m_openArchivesAsFolder, SIGNAL(toggled(bool)), this, SIGNAL(changed()));
    connect(m_autoExpandFolders, SIGNAL(toggled(bool)), this, SIGNAL(changed()));
}
开发者ID:fluxer,项目名称:kde-baseapps,代码行数:41,代码来源:navigationsettingspage.cpp

示例9: main

int main( int argc, char **argv )
{
  KCmdLineArgs::init(argc, argv, "test", 0, ki18n("Test"), "1.0", ki18n("test app"));
  KApplication app;

  KVBox* box = new KVBox();
  KSqueezedTextLabel *l = new KSqueezedTextLabel( "This is a rather long string", box);
  Q_UNUSED(*l);
  l = new KSqueezedTextLabel( "This is another long string, selectable by mouse", box );
  l->setTextElideMode( Qt::ElideRight );
  l->setTextInteractionFlags(Qt::TextSelectableByMouse);
  KSqueezedTextLabel* urlLabel = new KSqueezedTextLabel("http://www.example.com/this/url/is/selectable/by/mouse", box);
  urlLabel->setTextInteractionFlags(Qt::TextSelectableByMouse);

  new QLabel("This is a normal QLabel", box);
  QLabel* selectableLabel = new QLabel("This is a normal QLabel, selectable by mouse", box);
  selectableLabel->setTextInteractionFlags(Qt::TextSelectableByMouse);

  box->show();

  return app.exec();
}
开发者ID:fluxer,项目名称:kdelibs,代码行数:22,代码来源:ksqueezedtextlabeltest.cpp

示例10: BatchTool

AutoCorrection::AutoCorrection(QObject* parent)
    : BatchTool("AutoCorrection", ColorTool, parent)
{
    setToolTitle(i18n("Color Auto-correction"));
    setToolDescription(i18n("A tool to automatically correct image colors."));
    setToolIcon(KIcon(SmallIcon("autocorrection")));

    KVBox* vbox   = new KVBox;
    QLabel* label = new QLabel(vbox);
    m_comboBox    = new KComboBox(vbox);
    m_comboBox->insertItem(AutoLevelsCorrection,      i18n("Auto Levels"));
    m_comboBox->insertItem(NormalizeCorrection,       i18n("Normalize"));
    m_comboBox->insertItem(EqualizeCorrection,        i18n("Equalize"));
    m_comboBox->insertItem(StretchContrastCorrection, i18n("Stretch Contrast"));
    m_comboBox->insertItem(AutoExposureCorrection,    i18n("Auto Exposure"));
    label->setText(i18n("Filter:"));
    QLabel* space = new QLabel(vbox);
    vbox->setStretchFactor(space, 10);

    setSettingsWidget(vbox);

    connect(m_comboBox, SIGNAL(activated(int)),
            this, SLOT(slotSettingsChanged()));
}
开发者ID:UIKit0,项目名称:digikam,代码行数:24,代码来源:autocorrection.cpp

示例11: SettingsPageBase

StartupSettingsPage::StartupSettingsPage(const KUrl& url, QWidget* parent) :
    SettingsPageBase(parent),
    m_url(url),
    m_homeUrl(0),
    m_splitView(0),
    m_editableUrl(0),
    m_showFullPath(0),
    m_filterBar(0)
{
    const int spacing = KDialog::spacingHint();

    QVBoxLayout* topLayout = new QVBoxLayout(this);
    KVBox* vBox = new KVBox(this);
    vBox->setSpacing(spacing);

    // create 'Home URL' editor
    QGroupBox* homeBox = new QGroupBox(i18nc("@title:group", "Home Folder"), vBox);

    KHBox* homeUrlBox = new KHBox(homeBox);
    homeUrlBox->setSpacing(spacing);

    new QLabel(i18nc("@label:textbox", "Location:"), homeUrlBox);
    m_homeUrl = new KLineEdit(homeUrlBox);
    m_homeUrl->setClearButtonShown(true);

    QPushButton* selectHomeUrlButton = new QPushButton(KIcon("folder-open"), QString(), homeUrlBox);

#ifndef QT_NO_ACCESSIBILITY
    selectHomeUrlButton->setAccessibleName(i18nc("@action:button", "Select Home Location"));
#endif

    connect(selectHomeUrlButton, SIGNAL(clicked()),
            this, SLOT(selectHomeUrl()));

    KHBox* buttonBox = new KHBox(homeBox);
    buttonBox->setSpacing(spacing);

    QPushButton* useCurrentButton = new QPushButton(i18nc("@action:button", "Use Current Location"), buttonBox);
    connect(useCurrentButton, SIGNAL(clicked()),
            this, SLOT(useCurrentLocation()));
    QPushButton* useDefaultButton = new QPushButton(i18nc("@action:button", "Use Default Location"), buttonBox);
    connect(useDefaultButton, SIGNAL(clicked()),
            this, SLOT(useDefaultLocation()));

    QVBoxLayout* homeBoxLayout = new QVBoxLayout(homeBox);
    homeBoxLayout->addWidget(homeUrlBox);
    homeBoxLayout->addWidget(buttonBox);

    // create 'Split view', 'Show full path', 'Editable location' and 'Filter bar' checkboxes
    m_splitView = new QCheckBox(i18nc("@option:check Startup Settings", "Split view mode"), vBox);
    m_editableUrl = new QCheckBox(i18nc("@option:check Startup Settings", "Editable location bar"), vBox);
    m_showFullPath = new QCheckBox(i18nc("@option:check Startup Settings", "Show full path inside location bar"), vBox);
    m_filterBar = new QCheckBox(i18nc("@option:check Startup Settings", "Show filter bar"), vBox);

    // Add a dummy widget with no restriction regarding
    // a vertical resizing. This assures that the dialog layout
    // is not stretched vertically.
    new QWidget(vBox);

    topLayout->addWidget(vBox);

    loadSettings();

    connect(m_homeUrl, SIGNAL(textChanged(QString)), this, SLOT(slotSettingsChanged()));
    connect(m_splitView,    SIGNAL(toggled(bool)), this, SLOT(slotSettingsChanged()));
    connect(m_editableUrl,  SIGNAL(toggled(bool)), this, SLOT(slotSettingsChanged()));
    connect(m_showFullPath, SIGNAL(toggled(bool)), this, SLOT(slotSettingsChanged()));
    connect(m_filterBar,    SIGNAL(toggled(bool)), this, SLOT(slotSettingsChanged()));
}
开发者ID:fluxer,项目名称:kde-baseapps,代码行数:69,代码来源:startupsettingspage.cpp

示例12: KDialog

AdvancedSearchDialog::AdvancedSearchDialog(const QString &defaultName,
                                           const PlaylistSearch &defaultSearch,
                                           QWidget *parent,
                                           const char *name) :
    KDialog(parent)
{
    setCaption( i18n("Create Search Playlist") );
    setButtons( Ok|Cancel );
    setDefaultButton( Ok );
    setObjectName( QLatin1String( name ) );
    setModal(true);

    KVBox *mw = new KVBox(this);
    setMainWidget(mw);

    KHBox *box = new KHBox(mw);
    box->setSpacing(5);

    new QLabel(i18n("Playlist name:"), box);
    m_playlistNameLineEdit = new KLineEdit(defaultName, box);

    QGroupBox *criteriaGroupBox = new QGroupBox(i18n("Search Criteria"), mw);
    mw->setStretchFactor(criteriaGroupBox, 1);

    m_criteriaLayout = new QVBoxLayout;

    QGroupBox *group = new QGroupBox();

    m_matchAnyButton = new QRadioButton(i18n("Match any of the following"));
    m_matchAllButton = new QRadioButton(i18n("Match all of the following"));

    QHBoxLayout *hgroupbox = new QHBoxLayout;
    hgroupbox->addWidget(m_matchAnyButton);
    hgroupbox->addWidget(m_matchAllButton);

    group->setLayout(hgroupbox);

    m_criteriaLayout->addWidget(group);

    if(defaultSearch.isNull()) {
        SearchLine *newSearchLine = new SearchLine(this);
        m_searchLines.append(newSearchLine);
        m_criteriaLayout->addWidget(newSearchLine);
        newSearchLine = new SearchLine(this);
        m_searchLines.append(newSearchLine);
        m_criteriaLayout->addWidget(newSearchLine);
        m_matchAnyButton->setChecked(true);
    }
    else {
        PlaylistSearch::ComponentList components = defaultSearch.components();
        for(PlaylistSearch::ComponentList::ConstIterator it = components.constBegin();
            it != components.constEnd();
            ++it)
        {
            SearchLine *s = new SearchLine(this);
            s->setSearchComponent(*it);
            m_searchLines.append(s);
            m_criteriaLayout->addWidget(s);
        }
        if(defaultSearch.searchMode() == PlaylistSearch::MatchAny)
            m_matchAnyButton->setChecked(true);
        else
            m_matchAllButton->setChecked(true);
    }

    QWidget *buttons = new QWidget(mw);
    QHBoxLayout *l = new QHBoxLayout(buttons);
    l->setSpacing(5);
    l->setMargin(0);

    KPushButton *clearButton = new KPushButton(KStandardGuiItem::clear(), buttons);
    connect(clearButton, SIGNAL(clicked()), SLOT(clear()));
    l->addWidget(clearButton);

    l->addStretch(1);

    m_moreButton = new KPushButton(i18nc("additional search options", "More"), buttons);
    connect(m_moreButton, SIGNAL(clicked()), SLOT(more()));
    l->addWidget(m_moreButton);

    m_fewerButton = new KPushButton(i18n("Fewer"), buttons);
    connect(m_fewerButton, SIGNAL(clicked()), SLOT(fewer()));
    l->addWidget(m_fewerButton);

    m_criteriaLayout->addStretch(1);

    criteriaGroupBox->setLayout(m_criteriaLayout);

    m_playlistNameLineEdit->setFocus();
}
开发者ID:kryptBlue,项目名称:juk,代码行数:90,代码来源:advancedsearchdialog.cpp

示例13: KPWizardPage

OptimizePage::OptimizePage(Manager* const mngr, KAssistantDialog* const dlg)
    : KPWizardPage(dlg, i18n("<b>Optimization</b>")),
      d(new OptimizePagePriv)
{
    d->mngr                         = mngr;
    KVBox* vbox                     = new KVBox(this);
    d->progressTimer                = new QTimer(this);
    d->title                        = new QLabel(vbox);
    d->title->setOpenExternalLinks(true);
    d->title->setWordWrap(true);

    KConfig config("kipirc");
    KConfigGroup group              = config.group(QString("Panorama Settings"));

    d->horizonCheckbox              = new QCheckBox(i18n("Level horizon"), vbox);
    d->horizonCheckbox->setChecked(group.readEntry("Horizon", true));
    d->horizonCheckbox->setToolTip(i18n("Detect the horizon and adapt the project to make it horizontal."));
    d->horizonCheckbox->setWhatsThis(i18n("<b>Level horizon</b>: Detect the horizon and adapt the projection so that "
                                          "the detected horizon is an horizontal line in the final panorama"));
    d->projectionAndSizeCheckbox    = new QCheckBox(i18n("Automatic projection and crop"), vbox);
    d->projectionAndSizeCheckbox->setChecked(group.readEntry("Output Projection And Size", true));
    d->projectionAndSizeCheckbox->setToolTip(i18n("Adapt the projection of the panorama and the cropping on the resulting "
                                                  "projection so that every photo fits in the resulting panorama."));
    d->projectionAndSizeCheckbox->setWhatsThis(i18n("<b>Automatic projection and crop</b>: Automatically adapt the projection "
                                                    "and the crop of the panorama to get every photos into the panorama."));

    d->preprocessResults            = new QLabel(vbox);

    QLabel* space1                  = new QLabel(vbox);
    vbox->setStretchFactor(space1, 2);

    KHBox* hbox                     = new KHBox(vbox);
    d->detailsBtn                   = new QPushButton(hbox);
    d->detailsBtn->setText(i18n("Details..."));
    d->detailsBtn->hide();

    QLabel* space2                  = new QLabel(hbox);
    hbox->setStretchFactor(space2, 10);

    QLabel* space3                  = new QLabel(vbox);
    vbox->setStretchFactor(space3, 2);

    d->progressLabel                = new QLabel(vbox);
    d->progressLabel->setAlignment(Qt::AlignCenter);

    QLabel* space4                  = new QLabel(vbox);
    vbox->setStretchFactor(space4, 10);

    vbox->setSpacing(KDialog::spacingHint());
    vbox->setMargin(KDialog::spacingHint());

    setPageWidget(vbox);

    resetTitle();

    QPixmap leftPix = KStandardDirs::locate("data", "kipiplugin_panorama/pics/assistant-hugin.png");
    setLeftBottomPix(leftPix.scaledToWidth(128, Qt::SmoothTransformation));

//     connect(d->mngr->thread(), SIGNAL(starting(KIPIPanoramaPlugin::ActionData)),
//             this, SLOT(slotAction(KIPIPanoramaPlugin::ActionData)));

    connect(d->progressTimer, SIGNAL(timeout()),
            this, SLOT(slotProgressTimerDone()));

    connect(d->detailsBtn, SIGNAL(clicked()),
            this, SLOT(slotShowDetails()));
}
开发者ID:UIKit0,项目名称:digikam-2012-kipi-plugins,代码行数:67,代码来源:optimizepage.cpp

示例14: KDialog

CloseConfirmDialog::CloseConfirmDialog(
    QList<KTextEditor::Document*>& docs
  , KToggleAction* show_confirmation_action
  , QWidget* const parent
  )
  : KDialog(parent)
  , m_docs(docs)
{
    assert("Documents container expected to be non empty" && !docs.isEmpty());

    setCaption(i18n("Close files confirmation"));
    setButtons(Ok | Cancel);
    setModal(true);
    setDefaultButton(KDialog::Ok);

    KVBox* w = new KVBox(this);
    setMainWidget(w);
    w->setSpacing(KDialog::spacingHint());

    KHBox* lo1 = new KHBox(w);

    // dialog text
    QLabel* icon = new QLabel(lo1);
    icon->setPixmap(DesktopIcon("dialog-warning"));

    QLabel* t = new QLabel(
        i18n(
            "<qt>You are about to close the following documents..."
            "<p>It is last chance to uncheck those you don't want to close ;-)</p></qt>"
          )
      , lo1
      );
    lo1->setStretchFactor(t, 1000);

    // document list
    m_docs_tree = new QTreeWidget(w);
    QStringList headers;
    headers << i18n("Document") << i18n("Location");
    m_docs_tree->setHeaderLabels(headers);
    m_docs_tree->setSelectionMode(QAbstractItemView::SingleSelection);
    m_docs_tree->setRootIsDecorated(false);

    for (int i = 0; i < m_docs.size(); i++)
    {
        new KateDocItem(m_docs[i], m_docs_tree);
    }
    m_docs_tree->header()->setStretchLastSection(false);
    m_docs_tree->header()->setResizeMode(0, QHeaderView::ResizeToContents);
    m_docs_tree->header()->setResizeMode(1, QHeaderView::ResizeToContents);

    m_dont_ask_again = new QCheckBox(i18n("Do not ask again"), w);
    // NOTE If we are here, it means that 'Show Confirmation' action is enabled,
    // so not needed to read config...
    assert("Sanity check" && show_confirmation_action->isChecked());
    m_dont_ask_again->setCheckState(Qt::Checked);
    connect(m_dont_ask_again, SIGNAL(toggled(bool)), show_confirmation_action, SLOT(setChecked(bool)));

    // Update documents list according checkboxes
    connect(this, SIGNAL(accepted()), this, SLOT(updateDocsList()));

    KConfigGroup gcg(KGlobal::config(), "CloseConfirmationDialog");
    restoreDialogSize(gcg);                                 // restore dialog geometry from config
}
开发者ID:tazjel,项目名称:kate-close-except-plugin,代码行数:63,代码来源:close_confirm_dialog.cpp

示例15: KDialog

KateMwModOnHdDialog::KateMwModOnHdDialog( DocVector docs, QWidget *parent, const char *name )
    : KDialog( parent ),
      m_proc( 0 ),
      m_diffFile( 0 )
{
  setCaption( i18n("Documents Modified on Disk") );
  setButtons( User1 | User2 | User3 );
  setButtonGuiItem( User1, KGuiItem (i18n("&Ignore"), "window-close") );
  setButtonGuiItem( User2, KStandardGuiItem::overwrite() );
  setButtonGuiItem( User3, KGuiItem (i18n("&Reload"), "view-refresh") );

  setObjectName( name );
  setModal( true );
  setDefaultButton( KDialog::User3 );

  setButtonWhatsThis( User1, i18n(
                        "Removes the modified flag from the selected documents and closes the "
                        "dialog if there are no more unhandled documents.") );
  setButtonWhatsThis( User2, i18n(
                        "Overwrite selected documents, discarding the disk changes and closes the "
                        "dialog if there are no more unhandled documents.") );
  setButtonWhatsThis( User3, i18n(
                        "Reloads the selected documents from disk and closes the dialog if there "
                        "are no more unhandled documents.") );

  KVBox *w = new KVBox( this );
  setMainWidget( w );
  w->setSpacing( KDialog::spacingHint() );

  KHBox *lo1 = new KHBox( w );

  // dialog text
  QLabel *icon = new QLabel( lo1 );
  icon->setPixmap( DesktopIcon("dialog-warning") );

  QLabel *t = new QLabel( i18n(
                            "<qt>The documents listed below have changed on disk.<p>Select one "
                            "or more at once, and press an action button until the list is empty.</p></qt>"), lo1 );
  lo1->setStretchFactor( t, 1000 );

  // document list
  twDocuments = new QTreeWidget( w );
  QStringList header;
  header << i18n("Filename") << i18n("Status on Disk");
  twDocuments->setHeaderLabels(header);
  twDocuments->setSelectionMode( QAbstractItemView::SingleSelection );
  twDocuments->setRootIsDecorated( false );

  
  m_stateTexts << "" << i18n("Modified") << i18n("Created") << i18n("Deleted");
  for ( int i = 0; i < docs.size(); i++ )
  {
    new KateDocItem( docs[i], m_stateTexts[ (uint)KateDocManager::self()->documentInfo( docs[i] )->modifiedOnDiscReason ], twDocuments );
  }
  twDocuments->header()->setStretchLastSection(false);
  twDocuments->header()->setResizeMode(0, QHeaderView::Stretch);
  twDocuments->header()->setResizeMode(1, QHeaderView::ResizeToContents);

  connect( twDocuments, SIGNAL(currentItemChanged(QTreeWidgetItem*,QTreeWidgetItem*)), this, SLOT(slotSelectionChanged(QTreeWidgetItem*,QTreeWidgetItem*)) );

  // diff button
  KHBox *lo2 = new KHBox ( w );
  QWidget *d = new QWidget (lo2);
  lo2->setStretchFactor (d, 2);
  btnDiff = new KPushButton( KGuiItem (i18n("&View Difference"), "document-preview"), lo2 );

  btnDiff->setWhatsThis(i18n(
                          "Calculates the difference between the editor contents and the disk "
                          "file for the selected document, and shows the difference with the "
                          "default application. Requires diff(1).") );
  connect( btnDiff, SIGNAL(clicked()), this, SLOT(slotDiff()) );
  connect( this, SIGNAL(user1Clicked()), this, SLOT(slotUser1()) );
  connect( this, SIGNAL(user2Clicked()), this, SLOT(slotUser2()) );
  connect( this, SIGNAL(user3Clicked()), this, SLOT(slotUser3()) );

  slotSelectionChanged(NULL, NULL);
}
开发者ID:UIKit0,项目名称:kate,代码行数:77,代码来源:katemwmodonhddialog.cpp


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