K3bVideoDVDRippingDialog::K3bVideoDVDRippingDialog( const K3bVideoDVD::VideoDVD& dvd, const QValueList<int>& titles, QWidget* parent, const char* name ) : K3bInteractionDialog( parent, name, i18n("Video DVD Ripping"), QString::null, START_BUTTON|CANCEL_BUTTON, START_BUTTON, "VideoDVD Ripping" ), // config group m_dvd( dvd ) { d = new Private; QWidget* frame = mainWidget(); QHBoxLayout* frameLayout = new QHBoxLayout( frame ); frameLayout->setMargin( 0 ); frameLayout->setAutoAdd( true ); m_w = new K3bVideoDVDRippingWidget( frame ); connect( m_w, SIGNAL(changed()), this, SLOT(slotUpdateFilesizes()) ); connect( m_w, SIGNAL(changed()), this, SLOT(slotUpdateFilenames()) ); connect( m_w, SIGNAL(changed()), this, SLOT(slotUpdateVideoSizes()) ); setTitle( i18n("Video DVD Ripping"), i18n("1 title from %1", "%n titles from %1", titles.count()) .arg( k3bappcore->mediaCache()->medium(m_dvd.device()).beautifiedVolumeId() ) ); // populate list map populateTitleView( titles ); }
KorrentPrefPageTwo::KorrentPrefPageTwo(QWidget *parent) : QFrame(parent) { QHBoxLayout *layout = new QHBoxLayout(this); layout->setAutoAdd(true); new QLabel("Add something here", this); }
/** * Initialize this object. */ PakooView::PakooView( QWidget *parent ) : DCOPObject("pakooIface"), QWidget(parent) { m_backend = new PortageBackend(); // Overall layout QHBoxLayout* topLayout = new QHBoxLayout( this ); topLayout->setAutoAdd( true ); m_hSplitter = new QSplitter( this ); m_hSplitter->setOpaqueResize( true ); QToolBox* toolBox = new QToolBox( m_hSplitter, "toolBox" ); m_vSplitter = new QSplitter( m_hSplitter ); m_vSplitter->setOrientation( QSplitter::Vertical ); m_vSplitter->setOpaqueResize( true ); // Adding the individual widgets m_treeView = new PackageTreeView( this, "treeView", m_backend ); int sectionIndex = toolBox->addItem( m_treeView, TREEVIEWTEXT ); m_sectionIndexes[sectionIndex] = BrowseSection; sectionIndex = toolBox->addItem( new QLabel("Action View", 0, "tempactionlabel"), ACTIONVIEWTEXT ); m_sectionIndexes[sectionIndex] = ActionSection; toolBox->setCurrentIndex( 1 ); sectionIndex = toolBox->addItem( new QLabel("Config View", 0, "tempconfiglabel"), CONFIGVIEWTEXT ); m_sectionIndexes[sectionIndex] = ConfigSection; m_viewAreas = new QWidgetStack( m_vSplitter, "viewArea" ); m_packageView = new PackageView( m_viewAreas, "packageView", m_backend ); m_actionArea = new QWidgetStack( m_viewAreas, "actionArea" ); JobView* jobView = new JobView( new EmergeProcess(), "title", m_actionArea, "jobView" ); jobView->start(); m_configArea = new QWidgetStack( m_viewAreas, "configArea" ); new QLabel( "Config View", m_viewAreas, "configView" ); m_viewAreas->raiseWidget( m_actionArea ); m_packageInfoView = new PackageInfoView( m_vSplitter, "packageInfoView" ); m_hSplitter->setResizeMode( toolBox, QSplitter::KeepSize ); m_vSplitter->setResizeMode( m_packageInfoView->view(), QSplitter::KeepSize ); m_vSplitter->setSizes( PakooConfig::vSplitterSizes() ); m_hSplitter->setSizes( PakooConfig::hSplitterSizes() ); // // Here comes the big connection creator // // Connect the QToolBox signals so the right side follows the left one connect( toolBox, SIGNAL( currentChanged(int) ), this, SLOT( showSection(int) ) ); // Connect the package displaying widgets to work together connect( m_treeView, SIGNAL( packageListChanged(PackageList&) ), m_packageView->listView, SLOT( setPackageList(PackageList&) ) ); connect( m_treeView, SIGNAL( selectionChanged(PackageSelector&) ), m_packageView->listView, SLOT( setPackageSelector(PackageSelector&) ) ); connect( m_packageView->listView, SIGNAL( selectionChanged(Package*) ), m_packageInfoView, SLOT( displayPackage(Package*) ) ); connect( m_packageView->listView, SIGNAL(selectionChanged(Package*, PackageVersion*)), m_packageInfoView, SLOT(displayPackage(Package*, PackageVersion*)) ); // Connect the convenience method for copying text, // like pointed out by Scott Wheeler on the kde-core mailing list KStdAction::copy( KApplication::kApplication(), SLOT(copy()), NULL ); // Connect the package list view with the status bar, // so the latter one is updated properly //TODO: adapt /*connect( m_packageView->listView, SIGNAL(loadingPackageInfo(int,int)), this, SLOT(handleLoadingPackageInfo(int,int)) ); connect( m_packageView->listView, SIGNAL(finishedLoadingPackageDetails(PackageList&)), this, SLOT(handleFinishedLoadingPackageDetails(PackageList&)) );*/ }
ClsQGroupStateManip::ClsQGroupStateManip ( const char * _name = 0,string _strGroupID = ""): QFrame( 0, _name, Qt::WDestructiveClose), strGroupID(_strGroupID) { bApplied = false; clsQStateArrayView = NULL; iInterval = 1; iLoops = 1; iStepSize = 1; string strGroupName = ClsFESystemManager::Instance()->getGroupName(strGroupID).c_str(); string strTitle = "State Manipulation Panel for \"" + strGroupName + "\""; this->setCaption(strTitle.c_str()); QBitmap qbmEraser( eraser_cursor_width, eraser_cursor_height, eraser_cursor_bits, TRUE ); QBitmap qbmEraserMask( eraser_cursor_mask_width, eraser_cursor_mask_height, eraser_cursor_mask_bits, TRUE ); qcursorEraser = new QCursor( qbmEraser, qbmEraserMask,0 ,0 ); QBitmap qbmPencil( pencil_cursor_width, pencil_cursor_height, pencil_cursor_bits, TRUE ); QBitmap qbmPencilMask( pencil_cursor_mask_width, pencil_cursor_mask_height, pencil_cursor_mask_bits, TRUE ); qcursorPencil = new QCursor( qbmPencil, qbmPencilMask, 0, 0 ); QSplitter *qsplitter = new QSplitter(this); QFrame *qfmLeftPane = new QFrame(qsplitter); QBoxLayout * layoutMain = new QHBoxLayout( this); layoutMain->setResizeMode (QLayout::Fixed); layoutMain->addWidget(qsplitter); QBoxLayout * layoutLeftPane = new QVBoxLayout( qfmLeftPane, 5, -1, "mainL"); qlblCaption = new QLabel(qfmLeftPane); qlblCaption->setText(strGroupName.c_str()); layoutLeftPane->addWidget(qlblCaption); qfmStateArray = new QFrame(qfmLeftPane);; QHBoxLayout *qlayoutQfm = new QHBoxLayout( qfmStateArray); qlayoutQfm->setAutoAdd ( true); createStateArray(strGroupID); layoutLeftPane->addWidget(qfmStateArray, 0, Qt::AlignHCenter); qfmStateArray->show(); clsQStateArrayView->show(); clsQStateArrayView->setValue(DEFAULTVALUE); QHBoxLayout *qlayoutGradient = new QHBoxLayout( layoutLeftPane); QString qstr; QLabel* qlblMin = new QLabel(qfmLeftPane); qstr.setNum(fMinVal()); qlblMin->setText(qstr); qlayoutGradient->addWidget(qlblMin, 0, Qt::AlignRight); qlblGradientPixmap = new QLabel(qfmLeftPane);; qlayoutGradient->addWidget(qlblGradientPixmap, 1, Qt::AlignHCenter); qstr.setNum(fMaxVal()); QLabel* qlblMax = new QLabel(qfmLeftPane); qlblMax->setText(qstr); qlayoutGradient->addWidget(qlblMax); int iImgWidth = clsQStateArrayView->width() - qlblMin->minimumWidth() - qlblMax->minimumWidth() - 30; int iImgHeight = 13; qlblGradientPixmap->setFixedSize(iImgWidth,iImgHeight); qlblGradientPixmap->setPixmap(clsQStateArrayView->getGradientPixmap(iImgWidth, iImgHeight)); /* -------------------------------- */ qgrpbxTools = new QGroupBox( ); QLabel *lblValue = new QLabel(); lblValue->setText("Value:"); qdblspnbx = new QDoubleSpinBox( qgrpbxTools ); qdblspnbx->setMinimum(fMinVal()); qdblspnbx->setMaximum(fMaxVal()); qdblspnbx->setDecimals(3); qdblspnbx->setSingleStep ( 0.01); qdblspnbx->setValue(DEFAULTVALUE); connect(qdblspnbx, SIGNAL(valueChanged(double)), this, SLOT(slotChangeValue(double))); QPushButton* qpbtnPen = new QPushButton (QIcon(QPixmap(pencil)), ""); qpbtnPen->setToggleButton ( true); qpbtnPen->setFlat(true); qpbtnPen->setChecked(true); slotSelectTool(TOOL_PENCIL); QPushButton* qpbtnEraser = new QPushButton (QIcon(QPixmap(eraser)), ""); qpbtnEraser->setToggleButton ( true); qpbtnEraser->setFlat(true); QHBoxLayout *qlayoutTools = new QHBoxLayout; qlayoutTools->addWidget(lblValue); qlayoutTools->addWidget(qdblspnbx); qlayoutTools->addWidget(qpbtnPen); qlayoutTools->addWidget(qpbtnEraser); qgrpbxTools->setLayout(qlayoutTools); qbtngrpTools = new QButtonGroup(); connect(qbtngrpTools, SIGNAL(buttonClicked(int)), this, SLOT(slotSelectTool(int))); qbtngrpTools->addButton(qpbtnPen, TOOL_PENCIL); qbtngrpTools->addButton(qpbtnEraser, TOOL_ERASER); layoutLeftPane->addWidget(qgrpbxTools); /* ------------------------------------ */ QHBoxLayout *layout2 = new QHBoxLayout( layoutLeftPane); QPushButton *qpbtnClear = new QPushButton ("Clear", qfmLeftPane); connect(qpbtnClear, SIGNAL(clicked()), this, SLOT(slotClear())); layout2->addWidget(qpbtnClear, Qt::AlignTop); QPushButton *qpbtnAdd = new QPushButton ("Add", qfmLeftPane); connect(qpbtnAdd, SIGNAL(clicked()), this, SLOT(slotAdd())); layout2->addWidget(qpbtnAdd, Qt::AlignTop); QPushButton *qpbtnReplace = new QPushButton ("Replace", qfmLeftPane); connect(qpbtnReplace, SIGNAL(clicked()), this, SLOT(slotReplace())); layout2->addWidget(qpbtnReplace, Qt::AlignTop); /* ------------------------------------ */ QGroupBox *qgrpbxMode = new QGroupBox("Mode", qfmLeftPane); QRadioButton *qrbClamp = new QRadioButton ("Clamp", qgrpbxMode ); qrbClamp->setChecked( TRUE ); slotSetMode(ClsGroupManipPattern::MODE_CLAMP); QRadioButton *qrbAddPattern = new QRadioButton ("Add", qgrpbxMode ); QRadioButton *qrbMultiplyPattern = new QRadioButton ("Multiply", qgrpbxMode ); QHBoxLayout *qlayoutMode = new QHBoxLayout; qlayoutMode->addWidget(qrbClamp, ClsGroupManipPattern::MODE_CLAMP); qlayoutMode->addWidget(qrbAddPattern, ClsGroupManipPattern::MODE_ADD); qlayoutMode->addWidget(qrbMultiplyPattern, ClsGroupManipPattern::MODE_MULTIPLY); qgrpbxMode->setLayout(qlayoutMode); QButtonGroup *qbtngrpMode = new QButtonGroup(); connect(qbtngrpMode, SIGNAL(buttonClicked(int)), SLOT(slotSetMode(int)) ); qbtngrpMode->addButton(qrbClamp, ClsGroupManipPattern::MODE_CLAMP); qbtngrpMode->addButton(qrbAddPattern, ClsGroupManipPattern::MODE_ADD); qbtngrpMode->addButton(qrbMultiplyPattern, ClsGroupManipPattern::MODE_MULTIPLY); layoutLeftPane->addWidget(qgrpbxMode); /* ------------------------------------ */ /* ------------------------------------ */ QGroupBox *qgrpbxPlayBack = new QGroupBox("Play Back", qfmLeftPane); QRadioButton *qrbPersist = new QRadioButton( "For ever" ); qrbPersist->setChecked( TRUE ); slotSetPlayback(ClsGroupManipPattern::PLAYBACK_LOOP); QRadioButton *qrbIterations = new QRadioButton( "Times"); QButtonGroup *qbtngrpPlayBack = new QButtonGroup(); connect(qbtngrpPlayBack, SIGNAL(buttonClicked(int)), SLOT(slotSetPlayback(int)) ); qbtngrpPlayBack->addButton(qrbPersist, ClsGroupManipPattern::PLAYBACK_LOOP); qbtngrpPlayBack->addButton(qrbIterations, ClsGroupManipPattern::PLAYBACK_ITERATIONS); qspnbxIterations = new QSpinBox( ); qspnbxIterations->setMinimum(1); qspnbxIterations->setMaximum(INT_MAX); qspnbxIterations->setMaximumWidth(50); connect(qspnbxIterations, SIGNAL(valueChanged(int)), this, SLOT(slotSetLoops(int))); QLabel *qlblInterval = new QLabel(); qlblInterval->setText("Interval"); qspnbxInterval = new QSpinBox( ); qspnbxInterval->setMinimum(1); qspnbxInterval->setMaximum(INT_MAX); qspnbxInterval->setMaximumWidth(50); connect(qspnbxInterval, SIGNAL(valueChanged(int)), this, SLOT(slotSetInterval(int))); QLabel *qlblStepSize = new QLabel(); qlblStepSize->setText("StepSize"); qspnbxStepSize = new QSpinBox(); qspnbxStepSize->setMinimum(1); qspnbxStepSize->setMaximum(INT_MAX); qspnbxStepSize->setMaximumWidth(50); connect(qspnbxStepSize, SIGNAL(valueChanged(int)), this, SLOT(slotSetInterval(int))); QGridLayout* qglayoutPlayBack = new QGridLayout (); qglayoutPlayBack->addWidget(qrbPersist, 1,1); qglayoutPlayBack->addWidget(qrbIterations, 1, 2); qglayoutPlayBack->addWidget(qspnbxIterations, 1, 3); qglayoutPlayBack->addWidget(qlblInterval, 2, 2); qglayoutPlayBack->addWidget(qspnbxInterval, 2, 3); qglayoutPlayBack->addWidget(qlblStepSize, 3,2); qglayoutPlayBack->addWidget(qspnbxStepSize, 3, 3); qgrpbxPlayBack->setLayout(qglayoutPlayBack); layoutLeftPane->addWidget(qgrpbxPlayBack); /* ------------------------------------ */ QHBoxLayout *qlayoutCmdButtons = new QHBoxLayout( layoutLeftPane, 5); QPushButton *qpbtnApply = new QPushButton ("Send", qfmLeftPane); connect(qpbtnApply, SIGNAL(clicked()), this, SLOT(slotApply())); qpbtnRevoke = new QPushButton ("Revoke", qfmLeftPane); qpbtnRevoke->setEnabled(false); connect(qpbtnRevoke, SIGNAL(clicked()), this, SLOT(slotRevoke())); QPushButton *qpbtnClose = new QPushButton ("Close", qfmLeftPane); connect(qpbtnClose, SIGNAL(clicked()), this, SLOT(close())); qlayoutCmdButtons->addWidget(qpbtnApply); qlayoutCmdButtons->addWidget(qpbtnRevoke); qlayoutCmdButtons->addWidget(qpbtnClose); QToolTip::add(qpbtnPen, "Pencil"); QToolTip::add(qpbtnEraser, "Eraser"); QToolTip::add(qpbtnClear, "Clear"); QToolTip::add(qpbtnAdd, "Add"); QToolTip::add(qrbClamp, "Repace Value"); QToolTip::add(qrbAddPattern, "Add Values"); QToolTip::add(qrbMultiplyPattern, "Mutliply with Values"); QToolTip::add(qrbPersist, "Apply for ever"); QToolTip::add(qspnbxIterations, "Apply for selected timesteps"); QToolTip::add(qspnbxInterval, "Apply every X timestep"); QToolTip::add(qspnbxStepSize, "Apply step by X"); clsQSAList = new ClsQSAList(qsplitter, this); connect(clsQSAList, SIGNAL(sigChangeMatrix(vector <vector<double> >)), this, SLOT(slotMatrixChanged(vector <vector<double> >))); clsQSAList->show(); qsplitter->setResizeMode(clsQSAList, QSplitter::FollowSizeHint); };
void kpok::initWindow() { m_blinking = true; m_blinkStat = 0; m_blinkingBox = 0; // General font stuff. Define myFixedFont and wonFont. QFont myFixedFont; myFixedFont.setPointSize(12); QFont wonFont; wonFont.setPointSize(14); wonFont.setBold(true); topLayout = new QVBoxLayout(this, BORDER); QVBoxLayout* topInputLayout = new QVBoxLayout; topLayout->addLayout(topInputLayout); QHBoxLayout* betLayout = new QHBoxLayout; inputLayout = new QHBoxLayout; inputLayout->addLayout(betLayout); topInputLayout->addLayout(inputLayout); // The draw button drawButton = new QPushButton(this); drawButton->setText(i18n("&Deal")); connect(drawButton, SIGNAL(clicked()), this, SLOT(drawClick())); inputLayout->addWidget(drawButton); inputLayout->addStretch(1); // The waving text QFont waveFont; waveFont.setPointSize(16); waveFont.setBold(true); QFontMetrics tmp(waveFont); // The widget where the winner is announced. mWonWidget = new QWidget(this); inputLayout->addWidget(mWonWidget, 2); mWonWidget->setMinimumHeight(50); //FIXME hardcoded value for the wave mWonWidget->setMinimumWidth(tmp.width(i18n("You won %1").arg(KGlobal::locale()->formatMoney(100))) + 20); // workaround for width problem in wave QHBoxLayout* wonLayout = new QHBoxLayout(mWonWidget); wonLayout->setAutoAdd(true); wonLabel = new QLabel(mWonWidget); wonLabel->setFont(wonFont); wonLabel->setAlignment(AlignCenter); wonLabel->hide(); inputLayout->addStretch(1); // The pot view potLabel = new QLabel(this); potLabel->setFont(myFixedFont); potLabel->setFrameStyle(QFrame::WinPanel | QFrame::Sunken); inputLayout->addWidget(potLabel, 0, AlignCenter); // Label widget in the lower left. clickToHold = new QLabel(this); clickToHold->hide(); // Timers blinkTimer = new QTimer(this); connect( blinkTimer, SIGNAL(timeout()), SLOT(bTimerEvent()) ); waveTimer = new QTimer(this); connect( waveTimer, SIGNAL(timeout()), SLOT(waveTimerEvent()) ); drawTimer = new QTimer(this); connect (drawTimer, SIGNAL(timeout()), SLOT(drawCardsEvent()) ); // and now the betUp/Down Buttons betBox = new BetBox(this, 0); betLayout->addWidget(betBox); connect(betBox, SIGNAL(betChanged(int)), this, SLOT(betChange(int))); connect(betBox, SIGNAL(betAdjusted()), this, SLOT(adjustBet())); connect(betBox, SIGNAL(fold()), this, SLOT(out())); // some tips QToolTip::add(drawButton, i18n("Continue the round")); QToolTip::add(potLabel, i18n("The current pot")); // Load all cards into pixmaps first -> in the constructor. cardImages = new CardImages(this, 0); // The configuration KConfig* conf = kapp->config(); conf->setGroup("General"); // Load the card deck. if (conf->readBoolEntry("RandomDeck", true)) { cardImages->loadDeck(KCardDialog::getRandomDeck()); } else { cardImages->loadDeck(conf->readPathEntry("DeckPath", KCardDialog::getDefaultDeck())); } if (conf->readBoolEntry("RandomCardDir", true)) { cardImages->loadCards(KCardDialog::getRandomCardDir()); } else { cardImages->loadCards(conf->readPathEntry("CardPath", KCardDialog::getDefaultCardDir())); } }
/** * Initialize this object. */ PakooView::PakooView( QWidget *parent ) : DCOPObject("pakooIface"), QWidget(parent) { QHBoxLayout* topLayout = new QHBoxLayout( this ); topLayout->setAutoAdd( true ); hSplitter = new QSplitter( this ); hSplitter->setOpaqueResize( true ); QToolBox* toolBox = new QToolBox( hSplitter, "toolBox" ); treeView = new PortageTreeView( 0, "treeView" ); toolBox->addItem( treeView, TREEVIEWTEXT ); toolBox->addItem( new QLabel("Action View", 0, "tempactionlabel"), ACTIONVIEWTEXT ); toolBox->addItem( new QLabel("Config View", 0, "tempactionlabel"), CONFIGVIEWTEXT ); vSplitter = new QSplitter( hSplitter ); vSplitter->setOrientation(QSplitter::Vertical); vSplitter->setOpaqueResize( true ); packageView = new PackageView( vSplitter, "packageView", portageTreeScanner.packageScanner() ); packageInfoView = new PackageInfoView( vSplitter, "packageInfoView" ); hSplitter->setResizeMode( toolBox, QSplitter::KeepSize ); vSplitter->setResizeMode( packageInfoView->view(), QSplitter::KeepSize ); vSplitter->setSizes( PakooConfig::vSplitterSizes() ); hSplitter->setSizes( PakooConfig::hSplitterSizes() ); // // Here comes the big connection creator // // Connect the package displaying widgets to work together connect( treeView, SIGNAL(selectionChanged(PortageTree*, PortageSettings*, const QString&, const QString&)), packageView->listView, SLOT(displayPackages(PortageTree*, PortageSettings*, const QString&, const QString&)) ); connect( packageView->listView, SIGNAL(selectionChanged(Package*)), packageInfoView, SLOT(displayPackage(Package*)) ); connect( packageView->listView, SIGNAL(selectionChanged(Package*, PackageVersion*)), packageInfoView, SLOT(displayPackage(Package*, PackageVersion*)) ); // Connect the package list view with the status bar, // so the latter one is updated properly connect( packageView->listView, SIGNAL(loadingPackageInfo(int,int)), this, SLOT(handleLoadingPackageInfo(int,int)) ); connect( packageView->listView, SIGNAL(finishedLoadingPackageInfo(int)), this, SLOT(handleFinishedLoadingPackageInfo(int)) ); }