void ResourcesBrowser::setupBookmarks()
{
   ASSERT( m_tabsManager != NULL );

   QString topObjectName( "ResourcesBrowser/bookmarksFrame" );

   // frame
   QFrame* frame = NULL;
   QVBoxLayout* layout = NULL;
   {
      frame = new QFrame( m_tabsManager );
      frame->setObjectName( topObjectName );
      layout = new QVBoxLayout( frame );
      frame->setLayout( layout );
      layout->setSpacing(0);
      layout->setMargin(0);
      m_tabsManager->addTab( frame, "Bookmarks" );
   }

   // bookmarks list
   {
      m_bookmarks = new QListWidget( m_tabsManager );
      m_bookmarks->setContextMenuPolicy( Qt::CustomContextMenu );
      m_bookmarks->setObjectName( topObjectName + "/m_bookmarks" );
      layout->addWidget( m_bookmarks );

      connect( m_bookmarks, SIGNAL( itemDoubleClicked( QListWidgetItem* ) ), this, SLOT( onFocusOnFile( QListWidgetItem* ) ) );
      connect( m_bookmarks, SIGNAL( customContextMenuRequested( const QPoint& ) ), this, SLOT( showBookmarksPopupMenu( const QPoint& ) ) );
   }
}
ProceduralLevelGenerator::ProceduralLevelGenerator( QWidget* parent, GL2DProceduralLevel* params )
   : QFrame( parent )
   , m_params( params )
   , m_root( params->getParent() )
{
   QVBoxLayout* layout = new QVBoxLayout( this );
   setLayout( layout );

   QToolBar* toolbar = new QToolBar( this );
   {
      layout->addWidget( toolbar );

      QAction* generateLevelAction = toolbar->addAction( QIcon( ":/TamyEditor/Resources/Icons/Editor/play.png" ), "Generate level" );
      connect( generateLevelAction, SIGNAL( triggered() ), this, SLOT( generateScene() ) );
   }
   
   QFrame* statusBar = new QFrame( this );
   {
      layout->addWidget( statusBar );

      QHBoxLayout* statusBarLayout = new QHBoxLayout( statusBar );
      statusBarLayout->setSpacing( 0 );
      statusBarLayout->setMargin( 0 );
      statusBar->setLayout( statusBarLayout );

      QLabel* statusLabel = new QLabel( "Status: ", this );
      statusLabel->setMaximumWidth( 100 );
      statusBarLayout->addWidget( statusLabel );

      m_status = new QLabel( this );
      statusBarLayout->addWidget( m_status );
   }
}
QFrame * PinLabelDialog::initLabels(const QStringList & labels, bool singleRow, const QString & chipLabel)
{
	QFrame * frame = new QFrame();
	QVBoxLayout * vLayout = new QVBoxLayout();

	QLabel * label = new QLabel("<h2>" + chipLabel + "</h2>");
	label->setAlignment(Qt::AlignCenter);

	QFrame * subFrame = new QFrame();
	if (singleRow) {
		QGridLayout * gridLayout = new QGridLayout();
		gridLayout->setMargin(0);
		gridLayout->setSpacing(3);

		for (int i = 0; i < labels.count(); i++) {
			makeOnePinEntry(i, labels.at(i), Qt::AlignLeft, i, gridLayout);
		}

		subFrame->setLayout(gridLayout);
	}
	else {
		QHBoxLayout * hLayout = new QHBoxLayout();

		QFrame * lFrame = new QFrame();
		QGridLayout * lLayout = new QGridLayout;
		lLayout->setMargin(0);
		lLayout->setSpacing(3);
		for (int i = 0; i < labels.count() / 2; i++) {
			makeOnePinEntry(i, labels.at(i), Qt::AlignLeft, i, lLayout);
		}
		lFrame->setLayout(lLayout);

		QFrame * rFrame = new QFrame();
		QGridLayout * rLayout = new QGridLayout;
		rLayout->setMargin(0);
		rLayout->setSpacing(3);
		int row = labels.count() - 1;
		for (int i = labels.count() / 2; i < labels.count(); i++) {
			makeOnePinEntry(i, labels.at(i), Qt::AlignRight, row--, rLayout);
		}
		rFrame->setLayout(rLayout);

		hLayout->addWidget(lFrame);
		hLayout->addSpacing(15);
		hLayout->addWidget(rFrame);

		subFrame->setLayout(hLayout);
	}

	vLayout->addWidget(label);
	vLayout->addWidget(subFrame);
	frame->setLayout(vLayout);

	return frame;
}
Exemple #4
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);
}
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);
}
Exemple #6
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;
}
void MainWindow::createScene()
{
	graphicsScene = new GraphicsScene( &project, spriteView, animationView, 0, 0, 640, 480 );
	graphicsView = new GraphicsView(graphicsScene);
	graphicsView->scale( 1, 1 );
	graphicsView->rotate( 0 );
	graphicsView->setStyleSheet( "QGraphicsView { border-style: none; }" ); 
	graphicsScene->setGraphicsView( graphicsView );

	widgetRulerH = new WidgetRuler( this, graphicsView, false );
	widgetRulerV = new WidgetRuler( this, graphicsView, true );

	QGridLayout* layout = new QGridLayout();
	layout->setSpacing( 0 );
	layout->setMargin( 0 );
	QWidget* fake = new QWidget();
	fake->setBackgroundRole( QPalette::Dark );
	fake->setFixedSize( 20, 20 );
	layout->addWidget( fake, 0, 0 );
	layout->addWidget( widgetRulerV, 1, 0 );
	layout->addWidget( widgetRulerH, 0, 1 );
	layout->addWidget( graphicsView, 1, 1 );
	QFrame* f = new QFrame( this );
	f->setLayout( layout );
	setCentralWidget( f );

	connect( graphicsView, SIGNAL( repaintRulers() ), widgetRulerH, SLOT( repaintRulers() ) );
	connect( graphicsView, SIGNAL( repaintRulers() ), widgetRulerV, SLOT( repaintRulers() ) );

	connect( widgetRulerH, SIGNAL( dragRuler( int ) ), graphicsView, SLOT( dragHorizontalRuler( int ) ) );
	connect( widgetRulerV, SIGNAL( dragRuler( int ) ), graphicsView, SLOT( dragVerticalRuler( int ) ) );

	connect( widgetRulerH, SIGNAL( dropRuler( int ) ), graphicsView, SLOT( dropHorizontalRuler( int ) ) );
	connect( widgetRulerV, SIGNAL( dropRuler( int ) ), graphicsView, SLOT( dropVerticalRuler( int ) ) );
}
void KbLayoutWidget::initUI() {
    setObjectName("KeyboardLayoutFrame");
    setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
    this->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
    setSelectionMode(QAbstractItemView::NoSelection);
    setResizeMode(Adjust);

    for (int i = 0; i < m_buttons.length(); i++) {
        LayoutButton* itemButton = new LayoutButton(m_buttons[i]);
        m_layoutButtons.append(itemButton);
        itemButton->setFixedSize(widget_width, DDESESSIONCC::LAYOUTBUTTON_HEIGHT);

        QFrame* borderFrame = new QFrame;
        borderFrame->setObjectName("LayoutBorderFrame");
        QVBoxLayout* borderLayout = new QVBoxLayout;
        borderLayout->setContentsMargins(0, 0, 0, 0);
        borderLayout->setSpacing(0);
        borderLayout->addWidget(itemButton);
        borderFrame->setLayout(borderLayout);
        borderFrame->setFixedSize(widget_width, DDESESSIONCC::LAYOUTBUTTON_HEIGHT);

        QListWidgetItem* item = new QListWidgetItem(this);
        item->sizeHint();
        this->addItem(item);
        setItemWidget(item,  borderFrame);
        this->setGridSize(QSize(widget_width, DDESESSIONCC::LAYOUTBUTTON_HEIGHT));
        this->setFixedWidth(widget_width);
    }
    this->setFixedHeight(DDESESSIONCC::LAYOUTBUTTON_HEIGHT*3);



    updateStyle(":/skin/keybdlayoutwidget.qss", this);
}
Exemple #9
0
int main(int argc, char* argv[])
{
    QApplication app(argc, argv);

    QFrame frame;
    QVBoxLayout verticalLayout;
    QLineEdit filterText;

    ProblemsTableModel submissions;

    // add data here

    QSortFilterProxyModel proxy;
    proxy.setSortCaseSensitivity(Qt::CaseInsensitive);
    proxy.setFilterCaseSensitivity(Qt::CaseInsensitive);
    proxy.setSourceModel(&submissions);
    // sort and filter by "Full name" column
    proxy.setFilterKeyColumn(2);

    QTableView tableView;
    tableView.setModel(&proxy);
    tableView.setSortingEnabled(true);

    verticalLayout.addWidget(&filterText);
    verticalLayout.addWidget(&tableView);
    frame.setLayout(&verticalLayout);

    QObject::connect(&filterText, &QLineEdit::textChanged, &proxy, &QSortFilterProxyModel::setFilterFixedString);

    frame.show();

    return app.exec();
}
Exemple #10
0
PlaylistPage::PlaylistPage(SPView *mainView, QWidget *parent) :
    SPPage(mainView, parent)
{
    this->m_scrollView = new QScrollArea();
    this->m_treeView = new QTreeWidget();
    this->tabWidget()->addTab(m_scrollView, QString("Playlist"));

    m_scrollView->setWidgetResizable(true);
    m_header = new SpiderPage(this, this);
    m_header->setPage(":/views/playlist_header.xml", getToken());
    QFrame *frame = new QFrame(this);
    m_scrollView->setLayout(new QVBoxLayout());
    frame->setLayout(new QVBoxLayout());
    frame->layout()->addWidget(m_header);
    m_header->size().setWidth(100);
    m_header->size().setHeight(1164);
    ((QBoxLayout*)frame->layout())->addWidget(m_treeView, 2);

    m_scrollView->setWidget(frame);
    // Add sample
    QTreeWidgetItem *item1 = new QTreeWidgetItem();
    item1->setText(0, QString("Home"));
    item1->setData(0, Qt::UserRole, QVariant("soaring:internal:home"));
    m_treeView->addTopLevelItem(item1);
}
Exemple #11
0
SplashScreen::SplashScreen( QWidget *parent /* = NULL*/ ):QDialog(parent) {
    setEnabled(false);
    setAttribute(Qt::WA_DeleteOnClose);
    setWindowFlags(Qt::Window | Qt::FramelessWindowHint);
#ifdef Q_OS_WIN
    setWindowFlags(windowFlags() | Qt::MSWindowsFixedSizeDialogHint);
#endif
    setWindowModality(Qt::ApplicationModal);
    QHBoxLayout* mainLayout = new QHBoxLayout();
    setLayout(mainLayout);
    setContentsMargins(0, 0, 0, 0);
    mainLayout->setMargin(0);
    QFrame *frame = new QFrame(this);
    mainLayout->addWidget(frame);

    QHBoxLayout* frameLayout = new QHBoxLayout();
    frameLayout->setMargin(0);
    frame->setContentsMargins(0, 0, 0, 0);
    frame->setLayout(frameLayout);

    SplashScreenWidget* sWidget = new SplashScreenWidget();

    QVBoxLayout* aWLayout = (QVBoxLayout*)frame->layout();
    aWLayout->insertWidget(0, sWidget);
    aWLayout->setStretchFactor(sWidget, 100);
    installEventFilter(this);
}
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);
}
Exemple #13
0
NewBranchDialog::NewBranchDialog(QWidget *parent):
    KDialog(parent, Qt::Dialog)
{
    // dialog properties
    this->setCaption(i18nc("@title:window", 
                "<application>Hg</application> Commit: New Branch"));
    this->setButtons(KDialog::Ok | KDialog::Cancel);
    this->setDefaultButton(KDialog::Ok);
    this->enableButtonOk(false); // since commit message is empty when loaded

    m_branchList = HgWrapper::instance()->getBranches();

    QLabel *message = new QLabel(i18nc("@label", "Enter new branch name"));
    m_branchNameInput = new KLineEdit;
    m_errorLabel = new QLabel;

    QVBoxLayout *layout = new QVBoxLayout;
    layout->addWidget(message);
    layout->addWidget(m_branchNameInput);
    layout->addWidget(m_errorLabel);

    QFrame *frame = new QFrame;
    frame->setLayout(layout);
    setMainWidget(frame);

    connect(m_branchNameInput, SIGNAL(textChanged(const QString&)),
            this, SLOT(slotTextChanged(const QString&)));
}
Exemple #14
0
    void ListEm::setupUI(ListStorage* listStorage,
                         QLogger* logger)
    {
        /**
          * Create the central widget
          * and set it.
          */
        QFrame* cW = new QFrame(this);
        setCentralWidget(cW);

        /**
          * Set the layout to central widget.
          */
        QVBoxLayout* layout = new QVBoxLayout(cW);
        cW->setLayout(layout);
        layout->setMargin(0);
        layout->setSpacing(0);

        /**
          * Let's create the web view which
          * will be used to display our page
          * with which we will be communicating with.
          */
        m_webView = createWebView(listStorage,
                                  logger);
        m_webView->load(QUrl("qrc:///html/list-view.html"));

        /** Add it to layout */
        layout->addWidget(m_webView);

        m_webView->show();
    }
Exemple #15
0
HgCreateDialog::HgCreateDialog(const QString &directory, QWidget *parent):
    KDialog(parent, Qt::Dialog),
    m_workingDirectory(directory)
{
    // dialog properties
    this->setCaption(i18nc("@title:window", 
                "<application>Hg</application> Initialize Repository"));
    this->setButtons(KDialog::Ok | KDialog::Cancel);
    this->setDefaultButton(KDialog::Ok);
    this->setButtonText(KDialog::Ok, i18nc("@action:button", "Initialize Repository"));
    //this->enableButtonOk(false);


    //////////////
    // Setup UI //
    //////////////
    
    m_directory = new QLabel("<b>" + m_workingDirectory + "</b>");
    m_repoNameEdit = new KLineEdit;

    QHBoxLayout *mainLayout = new QHBoxLayout;
    mainLayout->addWidget(m_directory);
    mainLayout->addWidget(m_repoNameEdit);

    QFrame *frame = new QFrame;
    frame->setLayout(mainLayout);
    setMainWidget(frame);
    m_repoNameEdit->setFocus();
}
Exemple #16
0
QWidget * PrefsDialog::createZoomerForm() {
	QGroupBox * zoomer = new QGroupBox(tr("Mouse Wheel Behavior"), this );

	QHBoxLayout * zhlayout = new QHBoxLayout();
	zhlayout->setSpacing(SPACING);

    QFrame * frame = new QFrame();
    frame->setFixedWidth(FORMLABELWIDTH);

    QVBoxLayout * vLayout = new QVBoxLayout();
    vLayout->setSpacing(0);
    vLayout->setMargin(0);

    for (int i = 0; i < 3; i++) {
	    m_wheelLabel[i] = new QLabel();
        vLayout->addWidget(m_wheelLabel[i]);
    }

	updateWheelText();

    frame->setLayout(vLayout);
	zhlayout->addWidget(frame);

	QPushButton * pushButton = new QPushButton(tr("Change Wheel Behavior"), this);
	connect(pushButton, SIGNAL(clicked()), this, SLOT(changeWheelBehavior()));
	zhlayout->addWidget(pushButton);

	zoomer->setLayout(zhlayout);

	return zoomer;
}
void PvDualSourceSample::CreateLayout()
{
    CreateMenu();

    mSource1 = new Source( 0 );
    mSource1Widget = new SourceWidget( "Source 1", mSource1 );
    mSource1->SetWidget( mSource1Widget );

    mSource2 = new Source( 1 );
    mSource2Widget = new SourceWidget( "Source 2", mSource2 );
    mSource2->SetWidget( mSource2Widget );

    QHBoxLayout *lLayout = new QHBoxLayout;
    lLayout->addWidget( mSource1Widget );
    lLayout->addWidget( mSource2Widget );

    QFrame *lMainBox = new QFrame;
    lMainBox->setLayout( lLayout );

    setCentralWidget( lMainBox );
    setWindowTitle( tr( "PvDualSourceSample" ) );
    setWindowIcon( QIcon( QPixmap( ":PvDualSourceSample/res/PvDualSourceSample.ico" ) ) );

    EnableInterface();
}
FileSelectWidget::FileSelectWidget(QWidget *parent) : QWidget(parent), CommonMyWidgetWrapper(this)
{
	QFrame *frameTextAndButton = new QFrame;
	QHBoxLayout *layoutTextAndButton = new QHBoxLayout;
	QVBoxLayout *layout = new QVBoxLayout(this);
	layout->setContentsMargins(0, 0, 0, 0);
	layout->setSpacing(2);
	layoutTextAndButton->setContentsMargins(0, 0, 0, 0);
	layoutTextAndButton->setSpacing(2);
	lineEdit = new QLineEdit;
	button = new QPushButton;
	labelImage = new QLabel;
	labelImage->setAlignment(Qt::AlignTop | Qt::AlignHCenter);
	labelImage->setContentsMargins(0, 0, 0, 0);
	labelImage->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
	labelImage->setMaximumHeight(150);
	labelImage->setMaximumWidth(300);
	labelImage->setStyleSheet(
		"QLabel { color: red; font-weight: bold; border: 1px solid black;"
		"background-color: white; padding: 1px; }");
	QIcon iconFolder = QIcon::fromTheme("folder", QIcon(":/system/icons/folder.svg"));
	button->setIcon(iconFolder);
	layoutTextAndButton->addWidget(lineEdit);
	layoutTextAndButton->addWidget(button);
	frameTextAndButton->setLayout(layoutTextAndButton);

	layout->addWidget(frameTextAndButton);
	layout->addWidget(labelImage);

	defaultValue = "";
	connect(button, SIGNAL(clicked()), this, SLOT(slotSelectFile()));
	connect(lineEdit, SIGNAL(editingFinished()), this, SLOT(slotChangedFile()));
}
KicadModuleDialog::KicadModuleDialog(const QString & partType, const QString & filename, const QStringList & modules, QWidget *parent) : QDialog(parent) 
{
	this->setWindowTitle(QObject::tr("Select %1").arg(partType));

	QVBoxLayout * vLayout = new QVBoxLayout(this);

	QFrame * frame = new QFrame(this);

	QFormLayout * formLayout = new QFormLayout();

	m_comboBox = new QComboBox(this);
	m_comboBox->addItems(modules);
	formLayout->addRow(QString("%1:").arg(partType), m_comboBox );

	frame->setLayout(formLayout);

	QLabel * label = new QLabel(QString("There are %1 %3 descriptions in '%2'.  Please select one.").arg(modules.count()).arg(filename).arg(partType));
	vLayout->addWidget(label);

	vLayout->addWidget(frame);

    QDialogButtonBox * buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
	buttonBox->button(QDialogButtonBox::Cancel)->setText(tr("Cancel"));
	buttonBox->button(QDialogButtonBox::Ok)->setText(tr("OK"));

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

	vLayout->addWidget(buttonBox);

	this->setLayout(vLayout);
}
/** 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){
Exemple #21
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);
				}
void PreferencesDialog::setupGeneralFrame()
{
	promptOverwriteCheck = new QCheckBox("Prompt when overwriting existing files");
	promptCloseUnsavedCheck = new QCheckBox("Prompt when closing unsaved files");

	QGroupBox* promptGroup = new QGroupBox("Warnings");
	QVBoxLayout* vLayout = new QVBoxLayout();
	vLayout->addWidget(promptOverwriteCheck);
	vLayout->addWidget(promptCloseUnsavedCheck);
	promptGroup->setLayout(vLayout);

	QFrame* generalFrame = new QFrame();
	vLayout = new QVBoxLayout();
	vLayout->addWidget(promptGroup);
	vLayout->addWidget(new QWidget(), 100);
	vLayout->setContentsMargins(0, 0, 0, 0);
	generalFrame->setLayout(vLayout);

	QListWidgetItem *item = new QListWidgetItem("General");
	item->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
	item->setTextAlignment(Qt::AlignCenter);
	item->setIcon(QIcon(":/icons/oxygen/configure.png"));
	listWidget->addItem(item);
	stackedWidget->addWidget(generalFrame);
}
/** Main application
 *
 * @param argc :: ignored
 * @param argv :: ignored
 * @return return code
 */
int main( int argc, char ** argv )
{
  double min=0;
  double max=100;

  QApplication app(argc, argv);
  app.setOrganizationName("MantidProject");
  app.setApplicationName("Color Bar Widget Example");
  QMainWindow * mainWin = new QMainWindow();

  QFrame * frame = new QFrame(mainWin);
  mainWin->setCentralWidget(frame);

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

  ColorBarWidget * widget = new ColorBarWidget(frame);

  widget->setViewRange(min, max);
  widget->setLog(false);

  layout->addWidget(widget);
  mainWin->move(100, 100);
  mainWin->resize(40, 500);
  mainWin->show();

  app.exec();

  mainWin->close();
  delete mainWin;
  return 0;
}
Exemple #24
0
QFrame* MainWindow::initVideoFrame()
{
    QFrame *frame = new QFrame(this);

    QVBoxLayout *layout = new QVBoxLayout();

    player->setMinimumHeight(240);

#ifdef MACOSX
            player->openImage(qApp->applicationDirPath().append("/../Resources/placeholder.jpg"));

#else
            player->openImage(qApp->applicationDirPath().append("/placeholder.jpg"));
#endif

    frame->setObjectName("video_frame");
    frame->setStyleSheet("QFrame#video_frame { background: qlineargradient(x1:0.5, y1:0, x2:0.5, y2:1, stop:0 rgb(8, 9, 9), stop:0.6 rgb(40, 40, 40), "
                         "stop:0.8 rgb(57, 57, 57), stop:0.9 rgb(51, 51, 51), stop:1 rgb(31, 31, 31)) } ");

    frame->setLayout(layout);


    layout->setMargin(0);
    layout->addWidget(player);

    return frame;
}
/*" + gaycolor.red() + "," + gaycolor.green() + "," + gaycolor.blue() + "*/
PluginGeneratorGUI::PluginGeneratorGUI(PluginManager& pman,QWidget* parent )
:QDockWidget(parent),plugscriptname(),author(),mail(),init(false),finfo(QApplication::applicationDirPath()),doc(NULL),PM(pman)
{
	QFrame* f = new QFrame(this);
	QGridLayout* lay = new QGridLayout();
	tabs = new QTabWidget(this);
	tabs->setUsesScrollButtons(true);
	//setWidget(tabs);
	int openedtabs = tabs->count();
	if (openedtabs == 0)
		addNewFilter();
	else 
	{
		if (openedtabs > 1)
			for (int ii = 1;ii < openedtabs;++ii)
				tabs->removeTab(ii);
		addNewFilter();
	}
	lay->addWidget(tabs);
	lay->setAlignment(Qt::AlignVCenter);
	f->setLayout(lay);
	setWidget(f);
	createContextMenu();
	this->setVisible(false);
	//this->setScroll
}
Exemple #26
0
HgRenameDialog::HgRenameDialog(const KFileItem &source, QWidget *parent):
    KDialog(parent, Qt::Dialog),
    m_source(source.name()),
    m_source_dir(source.url().directory())
{
    this->setCaption(i18nc("@title:window",
                "<application>Hg</application> Rename"));
    this->setButtons(KDialog::Ok | KDialog::Cancel);
    this->setDefaultButton(KDialog::Ok);
    this->setButtonText(KDialog::Ok, i18nc("@action:button", "Rename"));

    QFrame *frame = new QFrame(this);
    QGridLayout *mainLayout = new QGridLayout(frame);

    QLabel *sourceLabel = new QLabel(i18nc("@label:label to source file",
                "Source "), frame);
    QLabel *sourceFileLabel = new QLabel("<b>" + m_source + "</b>");
    mainLayout->addWidget(sourceLabel, 0, 0);
    mainLayout->addWidget(sourceFileLabel, 0, 1);

    QLabel *destinationLabel 
        = new QLabel(i18nc("@label:rename", "Rename to "), frame);
    m_destinationFile = new KLineEdit(m_source, frame);
    mainLayout->addWidget(destinationLabel, 1, 0);
    mainLayout->addWidget(m_destinationFile, 1, 1);

    frame->setLayout(mainLayout);
    setMainWidget(frame);

    m_destinationFile->setFocus();
    m_destinationFile->selectAll();

    connect(m_destinationFile, SIGNAL(textChanged(const QString &)),
            this, SLOT(slotTextChanged(const QString &)));
}
PESvgView::PESvgView(QWidget * parent) : QFrame(parent)
{
    this->setObjectName("peSVG");

    m_pegi = NULL;
  
    QVBoxLayout * mainLayout = new QVBoxLayout;

    m_filename = new QLabel();
    mainLayout->addWidget(m_filename);

    QFrame * boundsFrame = new QFrame;
    QHBoxLayout * boundsLayout = new QHBoxLayout;

    QLabel * label = new QLabel("x:");
    boundsLayout->addWidget(label);
    m_x = new QLabel;
    boundsLayout->addWidget(m_x);
    boundsLayout->addSpacing(PEUtils::Spacing);

    label = new QLabel("y:");
    boundsLayout->addWidget(label);
    m_y = new QLabel;
    boundsLayout->addWidget(m_y);
    boundsLayout->addSpacing(PEUtils::Spacing);

    label = new QLabel(tr("width:"));
    boundsLayout->addWidget(label);
    m_width = new QLabel;
    boundsLayout->addWidget(m_width);
    boundsLayout->addSpacing(PEUtils::Spacing);

    label = new QLabel(tr("height:"));
    boundsLayout->addWidget(label);
    m_height = new QLabel;
    boundsLayout->addWidget(m_height);
    boundsLayout->addSpacing(PEUtils::Spacing);

    m_units = new QLabel();
    boundsLayout->addWidget(m_units);

    boundsLayout->addSpacerItem(new QSpacerItem(1, 1, QSizePolicy::Expanding));
    boundsFrame->setLayout(boundsLayout);
    mainLayout->addWidget(boundsFrame);

    m_svgElement = new QLabel;
    m_svgElement->setWordWrap(false);
    m_svgElement->setTextFormat(Qt::PlainText);
    mainLayout->addWidget(m_svgElement);

    mainLayout->addSpacerItem(new QSpacerItem(1, 1, QSizePolicy::Minimum, QSizePolicy::Expanding));

	//this->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);

    this->setLayout(mainLayout);


}
SchematicViewer::SchematicViewer(QWidget *parent)
	: QWidget(parent), m_fullSchematic(true), m_maximizedNode(false), m_sceneHandle(0)
{
	m_viewer = new SchematicSceneViewer(this);
	m_stageScene = new StageSchematicScene(this);
	m_fxScene = new FxSchematicScene(this);

	m_commonToolbar = new QToolBar(m_viewer);
	m_stageToolbar = new QToolBar(m_viewer);
	m_fxToolbar = new QToolBar(m_viewer);
	m_swapToolbar = new QToolBar(m_viewer);

	m_commonToolbar->setObjectName("ToolBarWithoutBorder");
	m_stageToolbar->setObjectName("ToolBarWithoutBorder");
	m_fxToolbar->setObjectName("ToolBarWithoutBorder");
	m_swapToolbar->setObjectName("ToolBarWithoutBorder");

	createToolbars();
	createActions();

	// layout
	QVBoxLayout *mainLayout = new QVBoxLayout();
	mainLayout->setMargin(1);
	mainLayout->setSpacing(0);
	{
		mainLayout->addWidget(m_viewer, 1);

		QFrame *bottomFrame = new QFrame(this);
		bottomFrame->setObjectName("SchematicBottomFrame");
		QHBoxLayout *horizontalLayout = new QHBoxLayout();
		horizontalLayout->setMargin(0);
		horizontalLayout->setSpacing(0);
		{
			horizontalLayout->addWidget(m_commonToolbar);
			horizontalLayout->addStretch();
			horizontalLayout->addWidget(m_fxToolbar);
			horizontalLayout->addWidget(m_stageToolbar);
			horizontalLayout->addWidget(m_swapToolbar);
		}
		bottomFrame->setLayout(horizontalLayout);

		mainLayout->addWidget(bottomFrame, 0);
	}
	setLayout(mainLayout);

	connect(m_fxScene, SIGNAL(showPreview(TFxP)), this, SIGNAL(showPreview(TFxP)));
	connect(m_fxScene, SIGNAL(doCollapse(const QList<TFxP> &)), this, SIGNAL(doCollapse(const QList<TFxP> &)));
	connect(m_stageScene, SIGNAL(doCollapse(QList<TStageObjectId>)), this, SIGNAL(doCollapse(QList<TStageObjectId>)));
	connect(m_fxScene, SIGNAL(doExplodeChild(const QList<TFxP> &)), this, SIGNAL(doExplodeChild(const QList<TFxP> &)));
	connect(m_stageScene, SIGNAL(doExplodeChild(QList<TStageObjectId>)), this, SIGNAL(doExplodeChild(QList<TStageObjectId>)));
	connect(m_stageScene, SIGNAL(editObject()), this, SIGNAL(editObject()));
	connect(m_fxScene, SIGNAL(editObject()), this, SIGNAL(editObject()));

	m_viewer->setScene(m_stageScene);
	m_fxToolbar->hide();

	setFocusProxy(m_viewer);
}
//--- RD -----------------------------------------------------------------------
void MainWindow::createRdInfo()
{
    QVBoxLayout *rdInfoL = new QVBoxLayout;
    ui->rdInfoPage->setLayout(rdInfoL);
    QHBoxLayout *rdInfoTopL = new QHBoxLayout;
    rdInfoTopL->setSpacing(0);
    rdInfoTopL->setMargin(0);
    rdInfoL->addLayout(rdInfoTopL);

    rdCheck = new QCheckBox("Change R&D icon", ui->rdInfoPage);
    rdCheck->setFixedWidth(bgCheck->width());
    connect(rdCheck, SIGNAL(clicked(bool)), this, SLOT(rdSetEnabled(bool)));
    rdInfoTopL->addWidget(rdCheck);
    rdDefaultBtn = new QPushButton("Set default", ui->rdInfoPage);
    connect(rdDefaultBtn, SIGNAL(clicked()), this, SLOT(rdSetDefault()));
    rdInfoTopL->addWidget(rdDefaultBtn);

    rdShowOnPreview = new QCheckBox("Show on preview", ui->rdInfoPage);
    connect(rdShowOnPreview, SIGNAL(clicked(bool)),
            this, SLOT(rdSetShowOnPreview(bool)));
    rdInfoL->addWidget(rdShowOnPreview);

    QHBoxLayout *rdFileNameLayout = new QHBoxLayout;
    rdFileNameLabel = new QLabel("File name: ", ui->rdInfoPage);
    rdFileNameLabel->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
    rdFileName = new QLabel(QFileInfo(rdPath).fileName(), ui->rdInfoPage);
    rdFileName->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
    QFont italic = rdFileName->font();
    italic.setItalic(true);
    rdFileName->setFont(italic);
    rdFileNameLayout->addWidget(rdFileNameLabel);
    rdFileNameLayout->addWidget(rdFileName);

    rdInfoL->addLayout(rdFileNameLayout);

    QFrame *rdPreviewFrame = new QFrame(ui->rdInfoPage);
    rdPreviewFrame->setFrameStyle(QFrame::StyledPanel);

    QVBoxLayout *rdPreviewLayout = new QVBoxLayout;
    rdPreviewLayout->setSpacing(0);
    rdPreviewLayout->setMargin(0);
    rdPreviewFrame->setLayout(rdPreviewLayout);

    rdPreview = new QLabel(ui->rdInfoPage);
    rdPreview->setAutoFillBackground(true);
    rdPreview->setPalette(QPalette(bgColor));
    rdPreview->setAlignment(Qt::AlignCenter);
    rdPreview->setPixmap(QPixmap::fromImage(QImage(rdPath)));
    rdPreviewLayout->addWidget(rdPreview);

    rdInfoL->addWidget(rdPreviewFrame);

    rdSelectBtn = new QPushButton("Choose image", ui->rdInfoPage);
    connect(rdSelectBtn, SIGNAL(clicked()), this, SLOT(rdSelectImage()));
    rdInfoL->addWidget(rdSelectBtn);

    rdSetEnabled(false);
}
void MaterialAssignmentEditorWindow::append_row(
    QVBoxLayout*        parent,
    QLayout*            row_layout)
{
    QFrame* row = new QFrame();
    row->setProperty("hasFrame", true);
    row->setLayout(row_layout);
    parent->addWidget(row);
}