Example #1
0
void KPrMSPresentationCreateDialog::setupGUI()
{
    back = new QVBox( this );
    back->setMargin( KDialog::marginHint() );

    QFrame *line;

    step1 = new QLabel( i18n( "Create directory structure" ), back );
    step2 = new QLabel( i18n( "Create pictures of the slides" ), back );
    step3 = new QLabel( i18n( "Create index file" ), back );

    line = new QFrame( back );
    line->setFrameStyle( QFrame::HLine | QFrame::Sunken );
    line->setMaximumHeight( 20 );

    progressBar = new KProgress( back );

    line = new QFrame( back );
    line->setFrameStyle( QFrame::HLine | QFrame::Sunken );
    line->setMaximumHeight( 20 );

    KButtonBox *bb = new KButtonBox( back );
    bb->addStretch();
    bDone = bb->addButton( i18n( "Done" ) );

    bDone->setEnabled( false );

    connect( bDone, SIGNAL( clicked() ), this, SLOT( accept() ) );
}
Example #2
0
void KMahjongg::setupStatusBar()
{
    m_gameTimerLabel = new QLabel(i18n("Time: 0:00:00"), statusBar());
    statusBar()->addWidget(m_gameTimerLabel);

    QFrame * timerDivider = new QFrame(statusBar());
    timerDivider->setFrameStyle(QFrame::VLine);
    statusBar()->addWidget(timerDivider);

    m_tilesLeftLabel = new QLabel(i18n("Removed: 0000/0000"), statusBar());
    statusBar()->addWidget(m_tilesLeftLabel, 1);

    QFrame * tileDivider = new QFrame(statusBar());
    tileDivider->setFrameStyle(QFrame::VLine);
    statusBar()->addWidget(tileDivider);

    m_gameNumLabel = new QLabel(i18n("Game: 000000000000000000000"), statusBar());
    statusBar()->addWidget(m_gameNumLabel);

    QFrame * gameNumDivider = new QFrame(statusBar());
    gameNumDivider->setFrameStyle(QFrame::VLine);
    statusBar()->addWidget(gameNumDivider);

    m_statusLabel = new QLabel(QStringLiteral("Kmahjongg"), statusBar());
    statusBar()->addWidget(m_statusLabel);
}
void ContactEditorTabPage::updateLayout()
{
    KAB::ContactEditorWidget::List::ConstIterator it;

    int row = 0;
    for(it = mWidgets.begin(); it != mWidgets.end(); ++it)
    {
        if((*it)->logicalWidth() == 2)
        {
            mLayout->addMultiCellWidget(*it, row, row + (*it)->logicalHeight() - 1, 0, 1);
            row += (*it)->logicalHeight();

            if(it != mWidgets.fromLast())
            {
                QFrame *frame = new QFrame(this);
                frame->setFrameStyle(QFrame::HLine | QFrame::Sunken);
                mLayout->addMultiCellWidget(frame, row, row, 0, 1);
                row++;
            }
            continue;
        }

        // fill left side
        int leftHeight = (*it)->logicalHeight();

        if(it == mWidgets.fromLast())      // last widget gets full width
        {
            mLayout->addMultiCellWidget(*it, row, row + leftHeight - 1, 0, 1);
            return;
        }
        else
        {
            mLayout->addMultiCellWidget(*it, row, row + leftHeight - 1, 0, 0);
            QFrame *frame = new QFrame(this);
            frame->setFrameStyle(QFrame::HLine | QFrame::Sunken);
            mLayout->addMultiCellWidget(frame, row + leftHeight, row + leftHeight, 0, 1);
        }

        // fill right side
        for(int i = 0; i < leftHeight; ++i)
        {
            ++it;
            if(it == mWidgets.end())
                break;

            int rightHeight = (*it)->logicalHeight();
            if(rightHeight + i <= leftHeight)
                mLayout->addMultiCellWidget(*it, row + i, row + i + rightHeight - 1, 1, 1);
            else
            {
                --i;
                break;
            }
        }

        row += 2;
    }
}
Example #4
0
void EditAccount::createTabbedView()
{
    delete layout();

    QVBoxLayout* thelayout = new QVBoxLayout(this);
    thelayout->setMargin(0);
    thelayout->setSpacing(4);

    QHBoxLayout* formLayout = new QHBoxLayout;
    formLayout->setMargin(6);
    formLayout->setSpacing(4);
    formLayout->addWidget(new QLabel(tr("Name")));
    formLayout->addWidget(accountNameInput);
    thelayout->addLayout(formLayout);

    QFrame* separator = new QFrame;
    separator->setFrameStyle(QFrame::HLine);
    thelayout->addWidget(separator);

    connect(tabWidget, SIGNAL(currentChanged(int)), this, SLOT(currentTabChanged(int)));
    thelayout->addWidget(tabWidget);

    updateGeometry();

    accountNameInput->setFocus();
}
Example #5
0
CGMainWindow::CGMainWindow (QWidget* parent, Qt::WindowFlags flags)
: QMainWindow (parent, flags) {
	resize (604, 614);

	// Create a nice frame to put around the OpenGL widget
	QFrame* f = new QFrame (this);
	f->setFrameStyle(QFrame::Sunken | QFrame::Panel);
	f->setLineWidth(2);

	// Create our OpenGL widget
	ogl = new CGView (this,f);

	// Create a menu
	QMenu *file = new QMenu("&File",this);
	file->addAction ("Quit", this, SLOT(close()), Qt::CTRL+Qt::Key_Q);

	menuBar()->addMenu(file);

    QAction *action;
	// Create a 'View' menu
	QMenu *show = new QMenu("&Show",this);
	action = show->addAction("show sphere", ogl, SLOT(toggleSphere()), Qt::Key_C);
	action->setCheckable(true);
	menuBar()->addMenu(show);

	// Put the GL widget inside the frame
	QHBoxLayout* layout = new QHBoxLayout();
	layout->addWidget(ogl);
	layout->setMargin(0);
	f->setLayout(layout);

	setCentralWidget(f);

	statusBar()->showMessage("Ready",1000);
}
Example #6
0
int drv_frame(int drvid, void *a0, void* a1, void* a2, void* a3, void* a4, void* a5, void* a6, void* a7, void* a8, void* a9)
{
    handle_head* head = (handle_head*)a0;
    QFrame *self = (QFrame*)head->native;
    switch (drvid) {
    case FRAME_INIT: {
        drvNewObj(a0,new QFrame);
        break;
    }
    case FRAME_SETFRAMESTYLE: {
        self->setFrameStyle(drvGetInt(a1));
        break;
    }
    case FRAME_FRAMESTYLE: {
        drvSetInt(a1,self->frameStyle());
        break;
    }
    case FRAME_SETFRAMERECT: {
        self->setFrameRect(drvGetRect(a1));
        break;
    }
    case FRAME_FRAMERECT: {
        drvSetRect(a1,self->frameRect());
        break;
    }
    default:
        return 0;
    }
    return 1;
}
void MainWindow::createWidgets()
{
	QFrame* frame = new QFrame();
	frame->setStyleSheet(PSS("QWidget { background: kColour1; border-color: kColour2; }"));
	frame->setFrameStyle(QFrame::Box);

	QVBoxLayout *layout = new TightVBoxLayout;
	frame->setLayout(layout);

	layout->addWidget(new WindowHeader);

	QWidget* blackSep = new QWidget();
	blackSep->setFixedHeight(1);
	blackSep->setStyleSheet(PSS("QWidget { background: kColour2; }"));
	layout->addWidget(blackSep);

	layout->addSpacing(50);
	{
		QLabel* deviceImage = new QLabel();
		deviceImage->setFixedSize(600, 136);
		deviceImage->setStyleSheet(QString("QWidget { background-image: url(:/Device); }"));
		layout->addWidget(deviceImage, 0, Qt::AlignHCenter);
	}
	
	layout->addSpacing(50);

	m_controlsWidget = new ControlsWidget();
	layout->addWidget(m_controlsWidget, 0, Qt::AlignHCenter);

	layout->addStretch();

	setCentralWidget(frame);
}
Example #8
0
QFrame *CentralWidget::createRightPanel()
{
    QVBoxLayout *rightPanelLayout = new QVBoxLayout;

    rightPanelLayout->addWidget(new Section(tr(SECTION_CONNECT)));
    rightPanelLayout->addWidget(createConnectButton());

    rightPanelLayout->addWidget(new Section(tr(SECTION_CONNECT_STATUS)));
    rightPanelLayout->addWidget(createConnectionStatusUi());

    rightPanelLayout->addWidget(new Section(tr(SECTION_BATTERY)));
    rightPanelLayout->addWidget(createBatteryChargeUi());

    rightPanelLayout->addWidget(new Section(tr(SECTION_OBSTACLE)));
    rightPanelLayout->addWidget(createDistanceToObstacleUi());

    rightPanelLayout->addWidget(new Section(tr(SECTION_SPEED)));
    rightPanelLayout->addWidget(createSpeedUi());
    rightPanelLayout->addStretch(1);

    QFrame *rightPanelWidget = new QFrame;
    rightPanelWidget->setMinimumWidth(200);
    rightPanelWidget->setFrameStyle(QFrame::StyledPanel | QFrame::Raised);
    rightPanelWidget->setLayout(rightPanelLayout);

    return rightPanelWidget;
}
Example #9
0
tHoldIndicatorFluid::tHoldIndicatorFluid( QWidget* parent )
: tPanelInfoBox( Qt::AlignCenter, parent )
{
    // translation done this way so that tHoldIndicatorFluid doesn't have to have a Q_OBJECT macro 
    // and be moved to a separate file, before making any changes make sure they work!
    static const char* hold_strings[] = 
    {
        QT_TRANSLATE_NOOP( "tPageFluid", "Hold" ),
    };
    
    SetOverlayOnGL( true );
    QLabel* pName = new QLabel( qApp->translate( "tPageFluid", hold_strings[0] ) );
    QLabel* pImage = new QLabel();
    pImage->setPixmap( QPixmap( tPath::ResourceFile("lowrance/switch_screen.png") ) );
    QFrame* pHSep = new QFrame();
    pHSep->setFrameStyle( QFrame::HLine | QFrame::Plain );
    pHSep->setLineWidth( 1 );

    QVBoxLayout* pLayout = new QVBoxLayout();
    tPanelInfoBox::SetDefaultContentsMargins( pLayout );
    pLayout->addWidget( pName, 0, Qt::AlignHCenter );
    pLayout->addWidget( pHSep );
    pLayout->addWidget( pImage, 0, Qt::AlignHCenter );
    setLayout(pLayout);
    adjustSize();

    tOverlayManagerQueue::Instance()->RegisterOverlayWidget( this, tOverlayManagerQueue::OMPHoldIndicator );
}
Example #10
0
Dialog::Dialog(QWidget *parent, Qt::WindowFlags flag)
  : QDialog(parent, flag)
{
  pageLayout = new QVBoxLayout();
  pageLayout->setContentsMargins(10, 10, 10, 5);
  pageLayout->setSpacing(5);

  buttonBox = new QDialogButtonBox();

  buttonsLayout = new QHBoxLayout();
  buttonsLayout->setMargin(10);
  buttonsLayout->addWidget(buttonBox);

  QFrame *line = new QFrame();
  line->setFrameStyle(QFrame::HLine | QFrame::Sunken);

  mainLayout = new QVBoxLayout();
  mainLayout->setMargin(0);
  mainLayout->setSpacing(0);
  mainLayout->addLayout(pageLayout, 1);
  mainLayout->addWidget(line);
  mainLayout->addLayout(buttonsLayout);
  setLayout(mainLayout);

  connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
}
Example #11
0
//-----------------------------------------------------------------------------
About::About (QWidget * aParent, const char *aName, bool aInit)
  : AboutInherited(aParent, aName)
{
  QBoxLayout* box;
  QLabel* lbl;
  QFrame* frm;
  QString str;
  QFont fnt;

  if (aInit) return;

  box = new QVBoxLayout(this, 20, 6);

  lblTheme = new QLabel(" ", this);
  fnt = lblTheme->font();
  fnt.setPointSize(fnt.pointSize() * 1.2);
  lblTheme->setFont(fnt);
  lblTheme->setMinimumSize(lblTheme->sizeHint());
  lblTheme->setAutoResize(true);
  box->addWidget(lblTheme);

  lblVersion = new QLabel(" ", this);
  lblVersion->setMinimumSize(lblVersion->sizeHint());
  lblVersion->setAutoResize(true);
  box->addWidget(lblVersion);

  lblAuthor = new QLabel(" ", this);
  lblAuthor->setMinimumSize(lblAuthor->sizeHint());
  lblAuthor->setAutoResize(true);
  box->addWidget(lblAuthor);

  lblHomepage = new QLabel(" ", this);
  lblHomepage->setMinimumSize(lblHomepage->sizeHint());
  lblHomepage->setAutoResize(true);
  box->addWidget(lblHomepage);

  frm = new QFrame(this);
  frm->setFrameStyle(QFrame::HLine|QFrame::Raised);
  box->addSpacing(5);
  box->addWidget(frm);
  box->addSpacing(5);

  lbl = new QLabel(i18n("KDE Theme Manager"), this);
  lbl->setFont(fnt);
  lbl->setMinimumSize(lbl->sizeHint());
  box->addWidget(lbl);

  str.sprintf(i18n("Version %s\n\n"
		   "Copyright (C) 1998 by\n%s\n\n"
		   "Gnu Public License (GPL)"),
	           KTHEME_VERSION, 
                   "Stefan Taferner <taferner@kde.org>\n"
                   "Waldo Bastian <bastian@kde.org>");
  lbl = new QLabel(str, this);
  lbl->setMinimumSize(lbl->sizeHint());
  box->addWidget(lbl);

  box->addStretch(1000);
  box->activate();
}
MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    //ui->setupUi(this);
    //ustvarim Widget
    centralWidget = new QWidget(this);
    this->setCentralWidget( centralWidget );
    centralWidget->setWindowTitle("DLX");
    centralWidget->setMaximumSize(1000, 1000);
    centralWidget->setMinimumSize(10, 10);
    centralWidget->resize(400,400);
    mainLayout = new QGridLayout( centralWidget );
    mainLayout->setSpacing(0);
    for(int mr = 0; mr < 3; mr++)//ustvarim 3 vrstice
    {
        for(int mc = 0; mc < 3; mc++)//ustvarim 3 stolpce
        {
            //veliki robovi
            QFrame * widget = new QFrame;
            widget->setFrameStyle(QFrame::Plain);
            widget->setFrameShape(QFrame::Box);

            //znotraj velikih robov se en grid
            QGridLayout * gridLayout = new QGridLayout(widget);
            gridLayout->setSpacing(0);
            gridLayout->setMargin(0);

            for(int r = 0; r < 3; r++)//3 vrstice
            {
                for(int c = 0; c < 3; c++)//3 stolpci
                {
                    //ustvarim skatlo s textom
                    QTextEdit * tile = new QTextEdit("");
                    tile->setFrameStyle(QFrame::Plain);
                    tile->setFrameShape(QFrame::Box);
                    tile->setAlignment(Qt::AlignCenter);
                    tile->setTabChangesFocus(true);
                    tile->setStyleSheet("font: 24pt ;");

                    gridLayout->addWidget(tile, r, c, 1, 1, Qt::AlignCenter);
                }
            }
           mainLayout->addWidget(widget, mr, mc, 1, 1, Qt::AlignCenter);
        }
    }
    //ustvarim menu z eventom
    QMenuBar* menuBar = new QMenuBar();
    QMenu *fileMenu = new QMenu("Algoritem");
    menuBar->addMenu(fileMenu);
    QAction *helpAction = fileMenu->addAction("Find solution");
    connect(helpAction, SIGNAL(triggered()), this, SLOT(algoritem()));
    centralWidget->layout()->setMenuBar(menuBar);
    QMenu *fileMenu1 = new QMenu("Input");
    menuBar->addMenu(fileMenu1);
    QAction *Action = fileMenu1->addAction("Reset");
    connect(Action, SIGNAL(triggered()), this, SLOT(reset()));
    QAction *Action2 = fileMenu1->addAction("Qassim Hamza");
    connect(Action2, SIGNAL(triggered()), this, SLOT(hamza()));
}
Example #13
0
CGMainWindow::CGMainWindow(QWidget *parent, Qt::WindowFlags flags)
    : QMainWindow(parent, flags) {
    resize(604, 614);

    // Create a nice frame to put around the OpenGL widget
    QFrame *f = new QFrame(this);
    f->setFrameStyle(QFrame::Sunken | QFrame::Panel);
    f->setLineWidth(2);

    // Create our OpenGL widget
    ogl = new CGView(this, f);

    QMenu *file = new QMenu("&Plane", this);
    file->addAction("&Reset plane", this->ogl, SLOT(reset_plane()), Qt::CTRL + Qt::Key_R);
    file->addAction("&Toggle follow", this->ogl, SLOT(toggle_follow()), Qt::CTRL + Qt::Key_T);
    file->addAction("Quit", this, SLOT(close()), Qt::CTRL + Qt::Key_Q);

    menuBar()->addMenu(file);

    // Put the GL widget inside the frame
    QHBoxLayout *layout = new QHBoxLayout();
    layout->addWidget(ogl);
    layout->setMargin(0);
    f->setLayout(layout);

    setCentralWidget(f);

    statusBar()->showMessage("Ready", 1000);
}
Example #14
0
MailSelectionPage::MailSelectionPage(QWidget* parent) : QWizardPage(parent)
{
    QVBoxLayout* mainLayout = new QVBoxLayout(this);
    mainLayout->setSpacing( 6 );
    mainLayout->setMargin( 2 );
    mainLayout->addWidget(new QLabel(tr("Cleanup Messages"), this));

    QFrame *line = new QFrame( this);
    line->setFrameStyle(QFrame::HLine | QFrame::Sunken );
    mainLayout->addWidget(line);

    QGridLayout *grid = new QGridLayout();
    grid->addWidget(new QLabel(tr("Older than"), this), 0, 0);
    QDate date;
    dp = new QDateEdit(date.currentDate(),this);
    grid->addWidget( dp, 0, 1 );

    grid->addWidget(new QLabel(tr("Larger than"), this), 1, 0);
    sizeBox = new QSpinBox(this);
    sizeBox->setButtonSymbols(QSpinBox::UpDownArrows);
    sizeBox->setSuffix(' ' + tr("kB", "kilobyte"));
    sizeBox->setMinimum( 0 );
    sizeBox->setMaximum( 100000 );
    sizeBox->setValue( 10 );
    sizeBox->setSingleStep( 10 );
    grid->addWidget(sizeBox, 1, 1);
    QSpacerItem *spacer = new QSpacerItem( 20, 20, QSizePolicy::Minimum,QSizePolicy::Expanding);
    mainLayout->addLayout(grid);
    mainLayout->addItem(spacer);
    registerField("MailSelectionPage_sizeBox",sizeBox);
    registerField("MailSelectionPage_dateBox",dp);
}
ImportPrivKeyDialog::ImportPrivKeyDialog(QWidget* parent)
    : QDialog(parent)
    , ui(new Ui::ImportPrivKeyDialog)
{
    ui->setupUi(this);

    GUIUtil::setupPrivKeyWidget(ui->privKeyEdit, this);

    ui->buttonBox->button(QDialogButtonBox::Ok)->setText(tr("Ok"));
    ui->buttonBox->button(QDialogButtonBox::Ok)->setCursor(Qt::PointingHandCursor);
    ui->buttonBox->button(QDialogButtonBox::Ok)->setStyleSheet(GULDEN_DIALOG_CONFIRM_BUTTON_STYLE_NOMARGIN);
    ui->buttonBox->button(QDialogButtonBox::Reset)->setText(tr("Cancel"));
    ui->buttonBox->button(QDialogButtonBox::Reset)->setCursor(Qt::PointingHandCursor);
    ui->buttonBox->button(QDialogButtonBox::Reset)->setStyleSheet(GULDEN_DIALOG_CANCEL_BUTTON_STYLE_NOMARGIN);
    QObject::connect(ui->buttonBox->button(QDialogButtonBox::Reset), SIGNAL(clicked()), this, SLOT(reject()));

    QFrame* horizontalLine = new QFrame(this);
    horizontalLine->setFrameStyle(QFrame::HLine);
    horizontalLine->setFixedHeight(1);
    horizontalLine->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
    horizontalLine->setStyleSheet(GULDEN_DIALOG_HLINE_STYLE_NOMARGIN);
    ui->verticalLayout->insertWidget(1, horizontalLine);

    setMinimumSize(300, 200);
}
Example #16
0
PreselectionPage::PreselectionPage(QWidget* parent) : QWizardPage(parent)
{
    QVBoxLayout* vb = new QVBoxLayout(this);
    QLabel* title = new QLabel(tr("What would you like to cleanup?"));
    title->setWordWrap(true);
    vb->addWidget(title);
    QFrame *line = new QFrame( this);
    line->setFrameStyle(QFrame::HLine | QFrame::Sunken );
    vb->addWidget(line);
    mailCheckBox     = new QCheckBox(tr("Messages"));
    vb->addWidget(mailCheckBox);
    eventCheckBox    = new QCheckBox(tr("Events"));
    vb->addWidget(eventCheckBox);
    documentCheckBox = new QCheckBox(tr("Documents"));
    vb->addWidget(documentCheckBox);
    QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Minimum,
    QSizePolicy::Expanding);
    vb->addItem(spacer);
    registerField("documentToCleanup", documentCheckBox);
    registerField("mailToCleanup",mailCheckBox);
    registerField("eventToCleanup",eventCheckBox);

    connect(mailCheckBox,SIGNAL(clicked()),this,SIGNAL(completeChanged()));
    connect(eventCheckBox,SIGNAL(clicked()),this,SIGNAL(completeChanged()));
    connect(documentCheckBox,SIGNAL(clicked()),this,SIGNAL(completeChanged()));
}
CPropertiesDialog::CPropertiesDialog( QWidget *pwidgetParent, HODBCINSTPROPERTY hFirstProperty )
	: QDialog( pwidgetParent )
{
    QVBoxLayout *           playout                 = new QVBoxLayout;
    QTableView *            ptableview              = new QTableView;
    QFrame *                pframe                  = new QFrame;
    QDialogButtonBox *      pdialogbuttonbox        = new QDialogButtonBox( QDialogButtonBox::Cancel | QDialogButtonBox::Ok | QDialogButtonBox::Help );

    pframe->setFrameStyle( QFrame::HLine );

    ppropertiesmodel    = new CPropertiesModel( 0, hFirstProperty );
    ppropertiesdelegate = new CPropertiesDelegate;
    ptableview->setModel( ppropertiesmodel );
    ptableview->setItemDelegateForColumn ( 1, ppropertiesdelegate );
    ptableview->verticalHeader()->hide();

    connect( pdialogbuttonbox, SIGNAL(accepted()), this, SLOT(accept()) );
    connect( pdialogbuttonbox, SIGNAL(rejected()), this, SLOT(reject()) );

    playout->addWidget( ptableview, 10 );
    playout->addWidget( pframe );
    playout->addWidget( pdialogbuttonbox );

    setWindowIcon( QPixmap( xpmODBC ) );
    setLayout( playout );

    doLoadState();
}
Example #18
0
QFrame * KviOptionsWidget::addSeparator(int x1,int y1,int x2,int y2)
{
	QFrame * f = new QFrame(this);
	f->setFrameStyle(QFrame::HLine | QFrame::Sunken);
	addWidgetToLayout(f,x1,y1,x2,y2);
	return f;
}
Example #19
0
void WiredDestination::createInterface()
{
  QGridLayout *lay = new QGridLayout(this);
  lay->setAlignment(Qt::AlignTop);
  lay->setColumnStretch(1,1);
  setContentsMargins(3,3,3,3);
  
  // Top
  QLabel *icon = new QLabel();
  icon->setPixmap(KIcon("network-workgroup").pixmap(32,32));
  QLabel *type = new QLabel(i18n("Subnet"));
  
  lay->addWidget(icon,0,0, Qt::AlignLeft);
  lay->addWidget(type,0,1,Qt::AlignCenter);
  
  // Line Sep
  QFrame *sepLine = new QFrame();
  sepLine->setFrameStyle( QFrame::HLine );
  lay->addWidget(sepLine,1,0,1,2);
  
  // Bottom
  m_netmaskLabel = new QLabel();
  m_netmaskLabel->setTextInteractionFlags(Qt::TextSelectableByMouse);
  
  m_subnetLabel = new QLabel();
  m_subnetLabel->setTextInteractionFlags(Qt::TextSelectableByMouse);
  
  setNetmaskString();
  setSubnetString();
  
  lay->addWidget(m_subnetLabel,2,0,1,2, Qt::AlignTop);
  lay->addWidget(m_netmaskLabel,3,0,1,2, Qt::AlignTop);
}
Example #20
0
CGMainWindow::CGMainWindow (QWidget* parent, Qt::WindowFlags flags)
				: QMainWindow (parent, flags) {
								resize (1024, 768);
								setWindowState(Qt::WindowMaximized);

								// Create a menu
								QMenu *file = new QMenu("&File",this);
								file->addAction ("Load Polyhedron", this, SLOT(loadPolyhedron()), Qt::CTRL+Qt::Key_G);
								file->addAction ("Quit", qApp, SLOT(quit()), Qt::CTRL+Qt::Key_Q);
								menuBar()->addMenu(file);

								// Create a nice frame to put around the OpenGL widget
								QFrame* f = new QFrame (this);
								f->setFrameStyle(QFrame::Sunken | QFrame::Panel);
								f->setLineWidth(2);

								// Create our OpenGL widget
								ogl = new CGView (this,f);

								// Put the GL widget inside the frame
								QHBoxLayout* layout = new QHBoxLayout();
								layout->addWidget(ogl);
								layout->setMargin(0);
								f->setLayout(layout);

								setCentralWidget(f);

								statusBar()->showMessage("Ready",1000);
				}
Example #21
0
ListWidgetEditor::ListWidgetEditor(QDesignerFormWindowInterface *form,
                                   QWidget *parent)
    : QDialog(parent)
{
    setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
    QDialogButtonBox *buttonBox = new QDialogButtonBox;
    buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Ok);
    connect(buttonBox, SIGNAL(accepted()), SLOT(accept()));
    connect(buttonBox, SIGNAL(rejected()), SLOT(reject()));

    m_itemsEditor = new ItemListEditor(form, 0);
    m_itemsEditor->layout()->setMargin(0);
    m_itemsEditor->setNewItemText(tr("New Item"));

    QFrame *sep = new QFrame;
    sep->setFrameStyle(QFrame::HLine | QFrame::Sunken);

    QBoxLayout *box = new QVBoxLayout(this);
    box->addWidget(m_itemsEditor);
    box->addWidget(sep);
    box->addWidget(buttonBox);

    // Numbers copied from itemlisteditor.ui
    // (Automatic resizing doesn't work because ui has parent).
    resize(550, 360);
}
/** Create a variant editor for a parameter
 * @brief SensorTransformationConfig::createSensorWidget
 * @param parent
 * @param param
 * @param paramIndex
 * @return a widget containing the editor and a description label
 */
QWidget *SensorTransformationConfig::createSensorWidget(QWidget *parent, const TransformationBaseClass::ParameterDescription &param, int paramIndex)
{
    QFrame * frame = new QFrame(parent);
    frame->setFrameShape(QFrame::StyledPanel);
    frame->setFrameShadow(QFrame::Plain);
    frame->setFrameStyle(1);
    QHBoxLayout *layout = new QHBoxLayout(frame);
    frame->setLayout(layout);
    QLabel *name = new QLabel(param.name + " : ", frame);
    QLabel *description = new QLabel(param.description, frame);
    description->setWordWrap(true);

    QVector<QVariant> trParams;
    if(m_transformationList[m_currentIndex]){
        trParams = m_transformationList[m_currentIndex]->getParameters();
    }

    QWidget *editor;
    if(param.typeAndDefault.type() == QVariant::String){
        QPlainTextEdit *editor2 = new QPlainTextEdit(param.typeAndDefault.toString(), frame);
        connect(editor2, SIGNAL(textChanged()), this, SLOT(on_textEditorChange()));
        editor = editor2;
    }else if(param.typeAndDefault.type() == QVariant::Double){
        QDoubleSpinBox *editor2 = new QDoubleSpinBox(frame);
        editor2->setMaximum(9999999999);
        editor2->setMinimum(-9999999999);
        editor2->setValue(trParams[paramIndex].toDouble());
        connect(editor2, SIGNAL(valueChanged(double)), this, SLOT(on_doubleEditorChange(double)));
        editor = editor2;
    }else if(param.typeAndDefault.type() == QVariant::Int){
Example #23
0
void LabeledSection::initialize(const QString& text, QWidget* pSectionWidget)
{
   // Expand label
   mpExpandLabel = new QLabel(this);

   // Text label
   mpTextLabel = new QLabel(this);
   QFont font = mpTextLabel->font();
   font.setBold(true);
   mpTextLabel->setFont(font);

   // Horizontal line
   QFrame* pHLine = new QFrame(this);
   pHLine->setFrameStyle(QFrame::HLine | QFrame::Sunken);

   // Layout
   QGridLayout* pLayout = new QGridLayout(this);
   pLayout->setMargin(0);
   pLayout->setSpacing(5);
   pLayout->addWidget(mpExpandLabel, 0, 0);
   pLayout->addWidget(mpTextLabel, 0, 1);
   pLayout->addWidget(pHLine, 0, 2);
   pLayout->setRowStretch(1, 10);
   pLayout->setColumnStretch(2, 10);

   // Initialization
   setText(text);
   setSectionWidget(pSectionWidget);
}
Example #24
0
InspectorRest::InspectorRest(QWidget* parent)
   : InspectorElementBase(parent)
      {
      s.setupUi(addWidget());
      r.setupUi(addWidget());

      const std::vector<InspectorItem> iiList = {
            { Pid::LEADING_SPACE,  1, s.leadingSpace,  s.resetLeadingSpace  },
            { Pid::SMALL,          0, r.small,         r.resetSmall         },
            };
      const std::vector<InspectorPanel> ppList = {
            { s.title, s.panel },
            { r.title, r.panel }
            };
      mapSignals(iiList, ppList);

      //
      // Select
      //
      QLabel* l = new QLabel;
      l->setText(tr("Select"));
      QFont font(l->font());
      font.setBold(true);
      l->setFont(font);
      l->setAlignment(Qt::AlignHCenter);
      _layout->addWidget(l);
      QFrame* f = new QFrame;
      f->setFrameStyle(QFrame::HLine | QFrame::Raised);
      f->setLineWidth(2);
      _layout->addWidget(f);

      QHBoxLayout* hbox = new QHBoxLayout;
      dot1 = new QToolButton(this);
      dot1->setText(tr("Dot 1"));
      hbox->addWidget(dot1);
      dot2 = new QToolButton(this);
      dot2->setText(tr("Dot 2"));
      hbox->addWidget(dot2);
      dot3 = new QToolButton(this);
      dot3->setText(tr("Dot 3"));
      hbox->addWidget(dot3);
      dot4 = new QToolButton(this);
      dot4->setText(tr("Dot 4"));
      hbox->addWidget(dot4);
      _layout->addLayout(hbox);
      hbox = new QHBoxLayout;
      tuplet = new QToolButton(this);
      tuplet->setText(tr("Tuplet"));
      tuplet->setEnabled(false);
      hbox->addWidget(tuplet);
      _layout->addLayout(hbox);

//TODO      e.offset->setSingleStep(1.0);        // step in spatium units

      connect(dot1,     SIGNAL(clicked()),     SLOT(dot1Clicked()));
      connect(dot2,     SIGNAL(clicked()),     SLOT(dot2Clicked()));
      connect(dot3,     SIGNAL(clicked()),     SLOT(dot3Clicked()));
      connect(dot4,     SIGNAL(clicked()),     SLOT(dot4Clicked()));
      connect(tuplet,   SIGNAL(clicked()),     SLOT(tupletClicked()));
      }
Example #25
0
QWidget * ToolTipManager::createTipContent( QModelIndex item )
{
    const QSize dialogIconSize = QSize(IconSize(KIconLoader::Dialog), IconSize(KIconLoader::Dialog));
    const QSize toolbarIconSize = QSize(IconSize(KIconLoader::MainToolbar), IconSize(KIconLoader::MainToolbar));

    QWidget * tipContent = new QWidget();
    QGridLayout* tipLayout = new QGridLayout();

    QLayout * primaryLine = generateToolTipLine( &item, tipContent, dialogIconSize, true );
    tipLayout->addLayout( primaryLine, 0, 0 );

    for ( int done = 0; d->view->model()->rowCount( item ) > done; done = 1 + done ) {
        QModelIndex childItem = d->view->model()->index( done, 0, item );
        QLayout * subLine = generateToolTipLine( &childItem, tipContent, toolbarIconSize, false );
        tipLayout->addLayout( subLine, done + 2, 0 );
    }

    tipLayout->setVerticalSpacing( 0 );
    tipContent->setLayout( tipLayout );

    if( d->view->model()->rowCount( item ) > 0 ) {
        QFrame * separatorLine = new QFrame( tipContent );
        separatorLine->setFrameStyle( QFrame::HLine );
        tipLayout->addWidget( separatorLine, 1, 0 );
    }

    return tipContent;
}
Example #26
0
SoutInputBox::SoutInputBox( QWidget *_parent, const QString& mrl ) : QGroupBox( _parent )
{
    /**
     * Source Block
     **/
    setTitle( qtr( "Source" ) );
    QGridLayout *sourceLayout = new QGridLayout( this );

    QLabel *sourceLabel = new QLabel( qtr( "Source:" ) );
    sourceLayout->addWidget( sourceLabel, 0, 0 );

    sourceLine = new QLineEdit;
    sourceLine->setReadOnly( true );
    sourceLine->setText( mrl );
    sourceLabel->setBuddy( sourceLine );
    sourceLayout->addWidget( sourceLine, 0, 1 );

    QLabel *sourceTypeLabel = new QLabel( qtr( "Type:" ) );
    sourceLayout->addWidget( sourceTypeLabel, 1, 0 );
    sourceValueLabel = new QLabel;
    sourceLayout->addWidget( sourceValueLabel, 1, 1 );

    /* Line */
    QFrame *line = new QFrame;
    line->setFrameStyle( QFrame::HLine |QFrame::Sunken );
    sourceLayout->addWidget( line, 2, 0, 1, -1 );
}
Example #27
0
KLineEditDlg::KLineEditDlg( const QString&_text, const QString& _value,
                            QWidget *parent, bool _file_mode )
    : QDialog( parent, 0L, true )
{
    QGridLayout *layout = new QGridLayout(this, 4, 3, 10);

    QLabel *label = new QLabel(_text, this);
    layout->addWidget(label, 0, 0, AlignLeft);

    edit = new KLineEdit( this, 0L );
    edit->setMinimumWidth(edit->sizeHint().width() * 3);
    connect( edit, SIGNAL(returnPressed()), SLOT(accept()) );

    if ( _file_mode ) {
        completion = new KURLCompletion();
        edit->setCompletionObject( completion );
        edit->setAutoDeleteCompletionObject( true );
    } else
        completion = 0L;

    layout->addMultiCellWidget(edit, 1, 1, 0, _file_mode ? 1 : 2);
    layout->setColStretch(1, 1);

    if (_file_mode) {
        QPushButton *browse = new QPushButton(i18n("&Browse..."), this);
        layout->addWidget(browse, 1, 2, AlignCenter);
        connect(browse, SIGNAL(clicked()),
                SLOT(slotBrowse()));
    }

    QFrame *hLine = new QFrame(this);
    hLine->setFrameStyle(QFrame::Sunken|QFrame::HLine);
    layout->addMultiCellWidget(hLine, 2, 2, 0, 2);

    KButtonBox *bBox = new KButtonBox(this);
    layout->addMultiCellWidget(bBox, 3, 3, 0, 2);

    QPushButton *ok = bBox->addButton(KStdGuiItem::ok());
    ok->setDefault(true);
    connect( ok, SIGNAL(clicked()), SLOT(accept()));

    bBox->addStretch(1);

    QPushButton *clear = bBox->addButton(KStdGuiItem::clear());
    connect( clear, SIGNAL(clicked()), SLOT(slotClear()));

    bBox->addStretch(1);

    QPushButton *cancel = bBox->addButton(KStdGuiItem::cancel());
    connect( cancel, SIGNAL(clicked()), SLOT(reject()));

    bBox->layout();

    layout->activate();

    edit->setText( _value );
    edit->setSelection(0, edit->text().length());
    edit->setFocus();
}
Example #28
0
void K3bDeviceTreeToolTip::maybeTip( const QPoint& pos )
{
  if( !parentWidget() || !m_view )
    return;

  K3bDeviceBranchViewItem* item = dynamic_cast<K3bDeviceBranchViewItem*>( m_view->itemAt( pos ) );
  if( !item )
    return;

  K3bDevice::Device* dev = static_cast<K3bDeviceBranch*>( item->branch() )->device();

  QFrame* tooltip = new QFrame( parentWidget() );
  tooltip->setFrameStyle( QFrame::Panel | QFrame::Raised );
  tooltip->setFrameShape( QFrame::StyledPanel );
  QGridLayout* lay = new QGridLayout( tooltip, 2, 2, tooltip->frameWidth()*2 /*margin*/, 6 /*spacing*/ );

  QString text = k3bappcore->mediaCache()->medium( dev ).longString();
  int detailsStart = text.find( "<p>", 3 );
  QString details = text.mid( detailsStart );
  text.truncate( detailsStart );

  QLabel* label = new QLabel( text, tooltip );
  label->setMargin( 9 );
  lay->addMultiCellWidget( label, 0, 0, 0, 1 );
  label = new QLabel( details, tooltip );
  label->setMargin( 9 );
  label->setAlignment( Qt::Vertical );
  lay->addMultiCellWidget( label, 1, 2, 0, 0 );
  label = new QLabel( tooltip );
  lay->addWidget( label, 2, 1 );
  lay->setColStretch( 0, 1 );

  if( K3bTheme* theme = k3bappcore->themeManager()->currentTheme() ) {
    tooltip->setPaletteBackgroundColor( theme->backgroundColor() );
    tooltip->setPaletteForegroundColor( theme->foregroundColor() );
    K3bTheme::PixmapType pm;
    int c = k3bappcore->mediaCache()->medium( dev ).content();
    if( c & (K3bMedium::CONTENT_VIDEO_CD|K3bMedium::CONTENT_VIDEO_DVD) )
      pm = K3bTheme::MEDIA_VIDEO;
    else if( c & K3bMedium::CONTENT_AUDIO &&
	      c & K3bMedium::CONTENT_DATA )
      pm = K3bTheme::MEDIA_MIXED;
    else if( c & K3bMedium::CONTENT_AUDIO )
      pm = K3bTheme::MEDIA_AUDIO;
    else if( c & K3bMedium::CONTENT_DATA )
      pm = K3bTheme::MEDIA_DATA;
    else {
      K3bDevice::DiskInfo di = k3bappcore->mediaCache()->diskInfo( dev );
      if( di.diskState() == K3bDevice::STATE_EMPTY )
	pm = K3bTheme::MEDIA_EMPTY;
      else
	pm = K3bTheme::MEDIA_NONE;
    }
    label->setPixmap( theme->pixmap( pm ) );
  }

  // the tooltip will take care of deleting the widget
  tip( m_view->itemRect( item ), tooltip );
}
void FilmListItemWidget::mouseReleaseEvent(QMouseEvent*){
    this->setStyleSheet("FilmListItemWidget { background-color: #ddffdd} ");
    QFrame* popup = new QFrame(FilterForm::instance, Qt::Popup | Qt::Dialog);
    popup->resize(560,220);
    popup->setFrameStyle(6);
    new FilmDisplay(popup, film_);
    popup->show();
}
Example #30
0
GLObjectWindow::GLObjectWindow(QWidget *parent)
    : QWidget(parent)
{
    // Create a menu
    QMenu *file = new QMenu(this);
    file->addAction(tr("Exit"), qApp, &QApplication::quit);

    // Create a menu bar
    QMenuBar *m = new QMenuBar(this);
    m->addMenu(file)->setText(tr("&File"));

    // Create a nice frame to put around the OpenGL widget
    QFrame *f = new QFrame(this);
    f->setFrameStyle(QFrame::Sunken | QFrame::Panel);
    f->setLineWidth(2);

    // Create our OpenGL widget
    GLBox *c = new GLBox(f, "glbox");

    // Create the three sliders; one for each rotation axis
    QSlider *x = new QSlider(Qt::Vertical, this);
    x->setMaximum(360);
    x->setPageStep(60);
    x->setTickPosition(QSlider::TicksLeft);
    connect(x, &QSlider::valueChanged, c, &GLBox::setXRotation);

    QSlider *y = new QSlider(Qt::Vertical, this);
    y->setMaximum(360);
    y->setPageStep(60);
    y->setTickPosition(QSlider::TicksLeft);
    connect(y, &QSlider::valueChanged, c, &GLBox::setYRotation);

    QSlider *z = new QSlider(Qt::Vertical, this);
    z->setMaximum(360);
    z->setPageStep(60);
    z->setTickPosition(QSlider::TicksLeft);
    connect(z, &QSlider::valueChanged, c, &GLBox::setZRotation);

    // Now that we have all the widgets, put them into a nice layout

    // Top level layout, puts the sliders to the left of the frame/GL widget
    QHBoxLayout *hlayout = new QHBoxLayout(this);

    // Put the sliders on top of each other
    QVBoxLayout *vlayout = new QVBoxLayout();
    vlayout->addWidget(x);
    vlayout->addWidget(y);
    vlayout->addWidget(z);

    // Put the GL widget inside the frame
    QHBoxLayout *flayout = new QHBoxLayout(f);
    flayout->setMargin(0);
    flayout->addWidget(c, 1);

    hlayout->setMenuBar(m);
    hlayout->addLayout(vlayout);
    hlayout->addWidget(f, 1);
}