Example #1
0
MainWidget::MainWidget(QWidget* parent) : QWidget(parent),
                                          world(),
                                          topImage(world, TOP),
                                          bottomImage(world, BOTTOM),
                                          topImageView(topImage),
                                          bottomImageView(bottomImage),
                                          worldView(world),
                                          controls(this)
{
    // For the two images
    QWidget* imagesView = new QWidget(this);
    QVBoxLayout* imagesLayout = new QVBoxLayout(imagesView);

    QWidget* topContainer = new QWidget(this);
    topContainer->setMinimumSize(IMAGE_WIDTH, IMAGE_HEIGHT);
    topImageView.setParent(topContainer);

    QWidget* bottomContainer = new QWidget(this);
    bottomContainer->setMinimumSize(IMAGE_WIDTH, IMAGE_HEIGHT);
    bottomImageView.setParent(bottomContainer);

    QLabel* topLabel = new QLabel(tr("Top Image"));
    QLabel* bottomLabel = new QLabel(tr("Bottom Image"));

    imagesLayout->addWidget(topLabel);
    imagesLayout->addWidget(topContainer);
    imagesLayout->addWidget(bottomLabel);
    imagesLayout->addWidget(bottomContainer);

    imagesView->setLayout(imagesLayout);

    // For the world view and controls
    QWidget* worldControlView = new QWidget(this);
    QVBoxLayout* worldControlLayout = new QVBoxLayout(worldControlView);

    QLabel* worldLabel = new QLabel(tr("World State"));
    worldControlLayout->addWidget(worldLabel);
    worldControlLayout->addWidget(&worldView);
    worldControlLayout->addWidget(&controls);

    worldControlView->setLayout(worldControlLayout);

    // Combines them into the main layout
    QHBoxLayout* mainLayout = new QHBoxLayout(this);
    mainLayout->addWidget(imagesView);
    mainLayout->addWidget(worldControlView);
    this->setLayout(mainLayout);

    QObject::connect(&controls, SIGNAL(robotMoved(float, float, float)),
                     this, SLOT(updateRobot(float, float, float)));
    QObject::connect(&controls, SIGNAL(headMoved(float, float)),
                     this, SLOT(updateHead(float, float)));
    QObject::connect(&controls, SIGNAL(ballMoved(float, float)),
                     this, SLOT(updateBall(float, float)));
}
Example #2
0
VisionSimGUI::VisionSimGUI(Image& top, Image& bottom, World& world,
                           QWidget* parent) :
    QWidget(parent),
    topImageView(top),
    bottomImageView(bottom),
    worldView(world),
    controls(this)
{
    // A widget to hold the two images in a nice layout
    QWidget* imagesView = new QWidget(this);
    QVBoxLayout* imagesLayout = new QVBoxLayout(imagesView);

    // Extra container is so that the lines don't draw everywhere
    QWidget* topContainer = new QWidget(this);
    topContainer->setMinimumSize(IMAGE_WIDTH, IMAGE_HEIGHT);
    topImageView.setParent(topContainer);

    // Extra container is so that the lines don't draw everywhere
    QWidget* bottomContainer = new QWidget(this);
    bottomContainer->setMinimumSize(IMAGE_WIDTH, IMAGE_HEIGHT);
    bottomImageView.setParent(bottomContainer);

    // Labels for the images
    QLabel* topLabel = new QLabel(tr("Top Image"));
    QLabel* bottomLabel = new QLabel(tr("Bottom Image"));

    // Arrange the labels and images
    imagesLayout->addWidget(topLabel);
    imagesLayout->addWidget(topContainer);
    imagesLayout->addWidget(bottomLabel);
    imagesLayout->addWidget(bottomContainer);

    imagesView->setLayout(imagesLayout);

    // For the world view and controls
    QWidget* worldControlView = new QWidget(this);
    QVBoxLayout* worldControlLayout = new QVBoxLayout(worldControlView);

    // Arrange the world view and controls
    QLabel* worldLabel = new QLabel(tr("World State"));
    worldControlLayout->addWidget(worldLabel);
    worldControlLayout->addWidget(&worldView);
    worldControlLayout->addWidget(&controls);

    worldControlView->setLayout(worldControlLayout);

    // Combines the two parts into the main layout
    QHBoxLayout* mainLayout = new QHBoxLayout(this);
    mainLayout->addWidget(imagesView);
    mainLayout->addWidget(worldControlView);
    this->setLayout(mainLayout);
}
Example #3
0
MainWindow::MainWindow(QWidget *parent) :
	QMainWindow(parent)
{
	m_subjectMap.insert(Global::Score_Chinese,QObject::tr("Chinese"));
	m_subjectMap.insert(Global::Score_Maths,QObject::tr("Maths"));
	m_subjectMap.insert(Global::Score_ForeignLanguage,QObject::tr("Foreign Language"));
	m_subjectMap.insert(Global::Score_Physics,QObject::tr("Physics"));
	m_subjectMap.insert(Global::Score_Chemistry,QObject::tr("Chemistry"));
	m_subjectMap.insert(Global::Score_Biology,QObject::tr("Biology"));
	m_subjectMap.insert(Global::Score_Politics,QObject::tr("Politics"));
	m_subjectMap.insert(Global::Score_History,QObject::tr("History"));
	m_subjectMap.insert(Global::Score_Geography,QObject::tr("Geography"));

	QWidget* blankWidget = new QWidget;
	blankWidget->setMinimumSize(1000,600);
	setCentralWidget(blankWidget);

	createActions();
	createMenus();
	createToolBars();

	readSettings();

	setWindowIcon(QIcon(":/images/logo"));
	setWindowTitle(tr("RankView"));
}
Example #4
0
void SettingsBottomView::rowsInserted(
  const QModelIndex& parent, int start, int end) {
  QModelIndex index;
  QGridLayout* layout;
  QWidget* page;

  if (!parent.isValid()) {
    layout = new QGridLayout();

    layout->setHorizontalSpacing(5);
    layout->setVerticalSpacing(5);
    layout->setContentsMargins(5, 5, 5, 5);

    QScrollArea* scrollArea = new QScrollArea();

    page = new QWidget();
    page->setLayout(layout);
    page->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Expanding);
    page->setMinimumSize(0, 0);

    scrollArea->setFrameStyle(QFrame::NoFrame);
    scrollArea->setWidget(page);
    scrollArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);

    stack->addWidget(scrollArea);
  }

  // Invalid insertion index will mark insertion of a group
  insertionIndex = parent;
}
Example #5
0
File: 7.cpp Project: vietlq/cpp
int main(int argc, char* argv[])
{
    QApplication app(argc, argv);
    
    QWidget window;
    window.setWindowTitle("Hi there! What's your name?");
    
    QLineEdit name(&window);
    
    window.setMinimumSize(400, 300);
    
    name.setGeometry(20, 20, 200, 30);
    name.setText("Please enter your name");
    
    QPushButton button(&window);
    button.setGeometry(240, 20, 100, 30);
    button.setText("Click here");
    
    QLabel label(&window);
    label.setGeometry(20, 70, 300, 60);
    label.setText("Hi there! Please enter your name ;)");
    
    window.show();
    
    return app.exec();
}
FlightLogDialog::FlightLogDialog(QWidget *parent, FlightLogManager *flightLogManager) :
    QDialog(parent)
{
    qmlRegisterType<ExtendedDebugLogEntry>("org.openpilot", 1, 0, "DebugLogEntry");
    qmlRegisterType<UAVOLogSettingsWrapper>("org.openpilot", 1, 0, "UAVOLogSettingsWrapper");

    setWindowIcon(QIcon(":/core/images/openpilot_logo_32.png"));
    setWindowTitle(tr("Manage flight side logs"));
    setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
    setMinimumSize(600, 400);

    QQuickView *view = new QQuickView();
    view->rootContext()->setContextProperty("dialog", this);
    view->rootContext()->setContextProperty("logStatus", flightLogManager->flightLogStatus());
    view->rootContext()->setContextProperty("logControl", flightLogManager->flightLogControl());
    view->rootContext()->setContextProperty("logSettings", flightLogManager->flightLogSettings());
    view->rootContext()->setContextProperty("logManager", flightLogManager);
    view->setResizeMode(QQuickView::SizeRootObjectToView);
    view->setSource(QUrl("qrc:/flightlog/FlightLogDialog.qml"));

    QWidget *container = QWidget::createWindowContainer(view);
    container->setMinimumSize(600, 400);
    container->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
    QVBoxLayout *lay   = new QVBoxLayout();
    lay->setContentsMargins(0, 0, 0, 0);
    setLayout(lay);
    layout()->addWidget(container);
}
Example #7
0
FilesPage::FilesPage( QWidget* parent ) : PageBase( parent ), m_URLChanged( false )
{
	QWidget* page = new QWidget( this );
	QVBoxLayout* layout = new QVBoxLayout( page );
	layout->setSpacing( KDialog::spacingHint() );
	layout->setMargin( KDialog::marginHint() );

	m_firstGB = new QGroupBox( 1, Qt::Vertical, "You have to set this moron :)", page );
	m_firstURLComboBox = new KURLComboBox( KURLComboBox::Both, true, m_firstGB, "SourceURLComboBox" );
	m_firstURLRequester = new KURLRequester( m_firstURLComboBox, m_firstGB );
	m_firstURLRequester->setFocus();

	m_secondGB = new QGroupBox( 1, Qt::Vertical, "This too moron !", page );
	m_secondURLComboBox = new KURLComboBox( KURLComboBox::Both, true, m_secondGB, "DestURLComboBox" );
	m_secondURLRequester = new KURLRequester( m_secondURLComboBox, m_secondGB );

	connect( m_firstURLRequester, SIGNAL( urlSelected( const QString & ) ), SLOT( setSecondURL( const QString & ) ) );
	connect( m_secondURLRequester, SIGNAL( urlSelected( const QString & ) ), SLOT( setFirstURL( const QString & ) ) );

	m_thirdGB = new QGroupBox( 1, Qt::Vertical, i18n( "Encoding" ), page );
	m_encodingComboBox = new QComboBox( false, m_thirdGB, "encoding_combobox" );
	m_encodingComboBox->insertStringList( KGlobal::charsets()->availableEncodingNames() );

	layout->addWidget( m_firstGB );
	layout->addWidget( m_secondGB );
	layout->addWidget( m_thirdGB );

	layout->addStretch( 1 );
	page->setMinimumSize( sizeHintForWidget( page ) );

	addTab( page, i18n( "&Files" ) );
}
Example #8
0
void QSysMessagePanel::initUI()
{
    QWidget     *headw = new QWidget(this);
    IconButton  *closeB = QAppUtils::ref().getCloseIconBtn(headw);
    QHBoxLayout *headLay = new QHBoxLayout(headw);
    QWidget     *center = new QWidget(this);
    QWidget     *msgWid = new QWidget(center);
    QScrollArea *scroll = new QScrollArea(this);
    QVBoxLayout *vlay = new QVBoxLayout(this);
    QVBoxLayout *vlayMsg = new QVBoxLayout(center);
    int         width,height;


    vlay->setContentsMargins(0,0,0,0);
    vlayMsg->addWidget(msgWid);
    vlayMsg->addStretch();

    QAppUtils::ref().getScreenSize(width,height);
    center->setMinimumSize(width/4.1,height/1.3);
    scroll->setBackgroundRole(QPalette::Dark);
    scroll->setWidget(center);
    scroll->setMinimumSize(width/4,height/1.2);

    headLay->addStretch();
    headLay->addWidget(closeB);
    connect(closeB,SIGNAL(clicked()),this,SLOT(close()));
    m_lay = new QGridLayout(msgWid);
    m_lay->setContentsMargins(0,0,0,0);
    vlay->addWidget(headw);
    vlay->addWidget(scroll);
    vlay->addStretch();
}
Example #9
0
QmlWindow::QmlWindow(QUrl qmlSource, bool persistent, QWidget *parent)
    : QWidget(parent)
    , m_view(0)
    , m_lastSize(QSize())
    , m_exiting(false)
    , m_persistent(persistent)
{
    QHBoxLayout *layout = new QHBoxLayout(this);
    layout->setContentsMargins(0,0,0,0);

    m_view = new QQuickView();
    m_view->connect(m_view->engine(), &QQmlEngine::quit, m_view, &QWindow::close);

//    QQmlApplicationEngine *engine = new QQmlApplicationEngine(qmlSource);

    QWidget *container = QWidget::createWindowContainer(m_view);
    container->setMinimumSize(100, 100);
    container->setMaximumSize(60000, 60000);
    container->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
    container->setFocusPolicy(Qt::StrongFocus);
    m_view->setSource(qmlSource);
    m_view->setResizeMode(QQuickView::SizeRootObjectToView);
    m_view->rootObject()->setProperty("window", QVariant::fromValue(this));

    layout->addWidget(container);
}
Example #10
0
int main(int argc, char* argv[])
{
    QApplication app(argc, argv);
    
    QWidget window;
    window.setWindowTitle("Hi there! What's your name?");
    
    QLineEdit name(&window);
    
    window.setMinimumSize(400, 300);
    
    name.setGeometry(20, 20, 200, 30);
    name.setText("Please enter your name");
    
    QPushButton button(&window);
    button.setGeometry(240, 20, 100, 30);
    button.setText("Click here");
    
    QLabel label(&window);
    label.setGeometry(20, 70, 300, 60);
    label.setText("Hi there! Please enter your name ;)");
    
    QObject::connect(&name, SIGNAL(textChanged(QString)), &label, SLOT(setText(QString)));
    QObject::connect(&button, SIGNAL(clicked()), &name, SLOT(clear()));
    QObject::connect(&button, SIGNAL(clicked()), &label, SLOT(clear()));
    
    window.show();
    
    return app.exec();
}
Example #11
0
// Borrowed&modified from KBookmarkMenu...
BookmarkEditDialog::BookmarkEditDialog(const QString& title, const QString& url,
                                       QWidget * parent, const char * name, const QString& caption )
  : KDialogBase(parent, name, true, caption,
                (Ok|Cancel),
                Ok, false, KGuiItem()),
    m_title(0), m_location(0)
{
    setButtonOK( i18n( "&Update" ) );

    QWidget *main = new QWidget( this );
    setMainWidget( main );

    bool folder = url.isNull();
    QGridLayout *grid = new QGridLayout( main, 2, folder?1:2, spacingHint() );

    QLabel *nameLabel = new QLabel(i18n("Name:"), main, "title label");
    grid->addWidget(nameLabel, 0, 0);
    m_title = new KLineEdit(main, "title edit");
    m_title->setText(title);
    nameLabel->setBuddy(m_title);
    grid->addWidget(m_title, 0, 1);
    if(!folder) {
        QLabel *locationLabel = new QLabel(i18n("Location:"), main, "location label");
        grid->addWidget(locationLabel, 1, 0);
        m_location = new KLineEdit(main, "location edit");
        m_location->setText(url);
        locationLabel->setBuddy(m_location);
        grid->addWidget(m_location, 1, 1);
    }
    main->setMinimumSize( 300, 0 );
}
Example #12
0
QWidget *ItemDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem &option,
                                    const QModelIndex &index) const
{
    ItemWidget *w = m_cache[index.row()];
    QWidget *editor = ( w != NULL) ? w->createEditor(parent) : new QPlainTextEdit(parent);
    if (editor == NULL)
        return NULL;

    editor->setPalette(m_editorPalette);
    editor->setFont(m_editorFont);
    editor->setObjectName("editor");

    // maximal editor size
    QRect w_rect = parent->contentsRect();
    QRect o_rect = option.rect;
    QSize max_size( w_rect.width() - o_rect.left() - 4,
                    w_rect.height() - o_rect.top() - 4 );
    editor->setMaximumSize(max_size);
    editor->setMinimumSize(max_size);

    connect( editor, SIGNAL(destroyed()),
             this, SLOT(editingStops()) );
    connect( editor, SIGNAL(textChanged()),
             this, SLOT(editingStarts()) );

    return editor;
}
Example #13
0
void GLViewer::setup()
{
    QSurfaceFormat format;

    format.setVersion(3, 2);
    format.setProfile(QSurfaceFormat::CoreProfile);

    format.setDepthBufferSize(16);

    m_canvas = new Canvas(format);
    m_canvas->setContinuousRepaint(true, 0);
    m_canvas->setSwapInterval(Canvas::VerticalSyncronization);

    m_canvas->setPainter(m_painter);

    QWidget *widget = QWidget::createWindowContainer(m_canvas);
    widget->setMinimumSize(1, 1);
    widget->setAutoFillBackground(false); // Important for overdraw, not occluding the scene.
    widget->setFocusPolicy(Qt::TabFocus);
    widget->setParent(this);

    QHBoxLayout *layout = new QHBoxLayout;
    layout->setContentsMargins(0, 0, 0, 0);
    layout->addWidget(widget);
    setLayout(layout);

    show();
}
Example #14
0
int main(int argc, char **argv){
  QApplication window(argc, argv);
  QWidget *mainwindow = new QWidget;

  //make main window
  mainwindow->setWindowTitle("window title");
  mainwindow->setMaximumSize(500,300);
  mainwindow->setMinimumSize(250,150);
  mainwindow->resize(400,240);

  //put label on mainwindow
  QLabel *my_label = new QLabel(mainwindow);
  my_label->setFrameStyle( QFrame::Panel | QFrame::Sunken );
  my_label->setText("Hello World.\nIt's fun to creat a program.");
  my_label->setAlignment(Qt::AlignVCenter | Qt::AlignHCenter);
  my_label->setGeometry(50,10,300,50);

  //put button on mainwindow
  QPushButton *my_button = new QPushButton("Quit", mainwindow);
  my_button->setGeometry(150,100,100,50);
  my_button->setFont(QFont("Times", 20, QFont::Bold));
  QObject::connect(my_button, SIGNAL(clicked()), qApp, SLOT(quit()));

  //window.setMainWidget(mainwindow); //Qt3
  mainwindow->show();
  return window.exec();
}
Example #15
0
QWidget *popup_param_t::do_create_widgets()
{
    QWidget *top = new QWidget();
    QLabel *label = new QLabel( top);
    menu_ = new QComboBox( top);
    menu_->setFocusPolicy( Qt::NoFocus);

    for( int i = 0; i < menu_items_.size(); ++i)
    {
        if( menu_items_[i] == "--")
            menu_->insertSeparator( menu_->count());
        else
            menu_->addItem( menu_items_[i].c_str());
    }

    QSize s = menu_->sizeHint();

    label->move( 0, 0);
    label->resize( app().ui()->inspector().left_margin() - 5, s.height());
    label->setAlignment( Qt::AlignRight | Qt::AlignVCenter);
    label->setText( name().c_str());
    label->setToolTip( id().c_str());

    menu_->move( app().ui()->inspector().left_margin(), 0);
    menu_->resize( s.width(), s.height());
    menu_->setCurrentIndex( get_value<int>( *this));
    menu_->setEnabled( enabled());
    connect( menu_, SIGNAL( currentIndexChanged( int)), this, SLOT( item_picked( int)));

    top->setMinimumSize( app().ui()->inspector().width(), s.height());
    top->setMaximumSize( app().ui()->inspector().width(), s.height());
    top->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed);
    return top;
}
Example #16
0
void BitcoinGUI::createToolBars()
{

    QToolBar *toolbar = addToolBar(tr("Tabs toolbar"));
	toolbar->setObjectName("toolbar");
    toolbar->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
	addToolBar(Qt::LeftToolBarArea,toolbar);
    toolbar->setOrientation(Qt::Vertical);
    toolbar->setMovable(false);

    QWidget* header = new QWidget();
    header->setMinimumSize(140, 45);
    header->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
    header->setStyleSheet("QWidget { background-color: rgb(0,0,0); background-repeat: no-repeat; background-image: url(:/images/header); background-position: top center; }");
    toolbar->addWidget(header);

    toolbar->addAction(overviewAction);
    toolbar->addAction(sendCoinsAction);
    toolbar->addAction(receiveCoinsAction);
    toolbar->addAction(historyAction);
    toolbar->addAction(addressBookAction);
	toolbar->addAction(bittrexPageAction);
	toolbar->addAction(shockBotAction);
    toolbar->addAction(blockAction);
    toolbar->addAction(socialPageAction);
	toolbar->addAction(chatAction);
    toolbar->addAction(exportAction);
}
Example #17
0
void ItemWidget::updateSize(const QSize &maximumSize)
{
    QWidget *w = widget();
    w->setMinimumSize(0, 0);
    w->setMaximumSize(maximumSize);
    w->adjustSize();
    w->setFixedSize( w->size() );
}
Example #18
0
QWidget* TestPlugin3::getWidget()
{
    QWidget* w = new QWidget();
             w->setWindowTitle( metaObject()->className() );
             w->setMinimumSize( 300, 300 );

    return w;
}
Example #19
0
void SettingsBottomView::createEditors() {
  QModelIndex index;
  QGridLayout* layout;

  if (!model()) {
    return;
  }

  delete stack;
  stack = new QStackedWidget(this);

  for (int page = 0; page < model()->rowCount(); ++page) {
    layout = new QGridLayout();

    // Create labels and editors
    index = model()->index(page, 0);
    int row;
    for (row = 0; row < model()->rowCount(index); ++row) {
      QModelIndex child = model()->index(row, 0, index);
      QString description = getSettingDescription(child);

      QLabel* label = new QLabel(description, NULL);
      label->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Minimum);
      layout->addWidget(label, row, 0);

      QWidget* editor = createEditorForIndex(child);
      editor->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
      layout->addWidget(editor, row, 1);

      editor->show();
    }

    // Adding a stretcher at the bottom of all settings
    QWidget* dummy = new QWidget();
    layout->addWidget(dummy, row, 0);
    layout->setRowStretch(row, 1);

    // Setting space on the page
    layout->setHorizontalSpacing(5);
    layout->setVerticalSpacing(5);
    layout->setContentsMargins(5, 5, 5, 5);

    QScrollArea* scrollArea = new QScrollArea();

    QWidget* pageWidget = new QWidget();
    pageWidget->setLayout(layout);
    pageWidget->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Expanding);
    pageWidget->setMinimumSize(0, 0);

    scrollArea->setFrameStyle(QFrame::NoFrame);
    scrollArea->setWidget(pageWidget);
    scrollArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);

    stack->addWidget(scrollArea);
  }

  this->layout()->addWidget(stack);
}
Example #20
0
QWidget *float2_param_t::do_create_widgets()
{
    QWidget *top = new QWidget();
    QrLabel *label = new QrLabel( top);
    input0_ = new QrDoubleSpinBox( top);
    input1_ = new QrDoubleSpinBox( top);

    QSize s = input0_->sizeHint();

    label->move( 0, 0);
    label->resize( ui::inspector_t::Instance().left_margin() - 5, s.height());
    label->setAlignment( Qt::AlignRight | Qt::AlignVCenter);
    label->setText( name().c_str());

    int xpos = ui::inspector_t::Instance().left_margin();

    float low = absolute_min();
    float high = absolute_max();

    Imath::V2f v = relative_to_absolute( get_value<Imath::V2f>( *this));
    input0_->move( xpos, 0);
    input0_->resize( s.width(), s.height());
    input0_->setRange( low, high);
    input0_->setStep( step());
    input0_->setValue( v.x);
    input0_->setEnabled( enabled());
    connect( input0_, SIGNAL( calculatorValueChanged( double)), this, SLOT( value_changed( double)));
    connect( input0_, SIGNAL( spinBoxPressed()), this, SLOT( spinbox_pressed()));
    connect( input0_, SIGNAL( spinBoxMoved( double)), this, SLOT( spinbox_moved( double)));
    connect( input0_, SIGNAL( spinBoxReleased()), this, SLOT( spinbox_released()));
    xpos += ( s.width() + 5);

    input1_->move( xpos, 0);
    input1_->resize( s.width(), s.height());
    input1_->setRange( low, high);
    input1_->setStep( step());
    input1_->setValue( v.y);
    input1_->setEnabled( enabled());
    connect( input1_, SIGNAL( calculatorValueChanged( double)), this, SLOT( value_changed( double)));
    connect( input1_, SIGNAL( spinBoxPressed()), this, SLOT( spinbox_pressed()));
    connect( input1_, SIGNAL( spinBoxMoved( double)), this, SLOT( spinbox_moved( double)));
    connect( input1_, SIGNAL( spinBoxReleased()), this, SLOT( spinbox_released()));
    xpos += ( s.width() + 2);

    if( proportional())
    {
        create_proportional_button( top);

        if( prop_button_)
            prop_button_->move( xpos, 0);
    }

    top->setMinimumSize( ui::inspector_t::Instance().width(), s.height());
    top->setMaximumSize( ui::inspector_t::Instance().width(), s.height());
    top->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed);
    return top;
}
Example #21
0
SpecgramPianoroll::SpecgramPianoroll(const Setting &setting, int width, int noteHeight, QWidget *parent)
    : SpecgramView(setting, parent)
{
    _noteHeight = noteHeight;
    setSpecgram(_setting);
    QWidget *w = new stand::gui::VerticalPianoView(this);
    w->setMinimumSize(64, minimumHeight());
    w->setMaximumSize(64, minimumHeight());
}
void ADM_flyDialogQt4::postInit(uint8_t reInit)
{
	QWidget *graphicsView = ((ADM_QCanvas*)_canvas)->parentWidget();
	QSlider  *slider=(QSlider *)_slider;
	
	graphicsView->setMinimumSize(_w, _h);
	graphicsView->resize(_w, _h);
	uint32_t nbFrames=_in->getInfo()->nb_frames; 
	slider->setMaximum(nbFrames);
}
Example #23
0
ConsoleDockWidget::ConsoleDockWidget( ProjectModel *projectModel, KActionMenu *showDocksAction,
                                      QWidget *parent )
    : AbstractDockWidget( i18nc("@title:window Dock title", "Console"), showDocksAction, parent ),
      m_consoleWidget(0), m_commandLineEdit(0), m_cancelButton(0), m_consoleHistoryIndex(-1),
      m_projectModel(projectModel), m_state(WaitingForInput)
{
    setObjectName( "console" );

    setWhatsThis( i18nc("@info:whatsthis", "<title>A debugger console</title>"
                        "<para>Provides some commands (type <icode>.help</icode>) and can "
                        "execute script code in the current script context. If values are altered "
                        "by a console command they are also altered in a running script.</para>") );

    QWidget *container = new QWidget( this );
    container->setMinimumSize( 150, 100 );
    m_consoleWidget = new QPlainTextEdit( container );
    m_consoleWidget->setReadOnly( true );
    m_consoleWidget->setFont( KGlobalSettings::fixedFont() );
    m_consoleWidget->setContextMenuPolicy( Qt::CustomContextMenu );
    m_commandLineEdit = new KLineEdit( container );
    m_commandLineEdit->setFont( KGlobalSettings::fixedFont() );
    m_commandLineEdit->setClickMessage( i18nc("@info/plain", "Enter a command, eg. '.help'") );
    m_cancelButton = new QToolButton( container );
    m_cancelButton->setToolButtonStyle( Qt::ToolButtonIconOnly );
    m_cancelButton->setToolTip( i18nc("@info:tooltip", "Cancel evaluation and abort debugger") );
    m_cancelButton->setIcon( KIcon("process-stop") );
    m_cancelButton->hide();

    QHBoxLayout *inputBarLayout = new QHBoxLayout();
    inputBarLayout->setContentsMargins( 0, 0, 0, 0 );
    inputBarLayout->addWidget( m_commandLineEdit );
    inputBarLayout->addWidget( m_cancelButton );

    QVBoxLayout *consoleLayout = new QVBoxLayout( container );
    consoleLayout->setSpacing( 0 );
    consoleLayout->setContentsMargins( 0, 0, 0, 0 );
    consoleLayout->addWidget( m_consoleWidget );
    consoleLayout->addLayout( inputBarLayout );
    setWidget( container );
    connect( m_consoleWidget, SIGNAL(customContextMenuRequested(QPoint)),
             this, SLOT(contextMenu(QPoint)) );
    connect( m_commandLineEdit, SIGNAL(returnPressed(QString)),
             this, SLOT(executeCommand(QString)) );
    connect( m_cancelButton, SIGNAL(clicked(bool)), this, SLOT(cancelEvaluation()) );

    m_consoleHistoryIndex = -1;
    m_commandLineEdit->installEventFilter( this );
    KCompletion *completion = m_commandLineEdit->completionObject();
    completion->setItems( Debugger::ConsoleCommand::defaultCompletions() );

    connect( projectModel, SIGNAL(activeProjectAboutToChange(Project*,Project*)),
             this, SLOT(activeProjectAboutToChange(Project*,Project*)) );

    setState( WaitingForInput );
}
Example #24
0
void InvMain::makeLayout()
{

    // create a docking window for several lists on the right side

    QDockWidget *dw = new QDockWidget(this);
    dw->setWindowTitle("Renderer Listbox ");
    /*qt3 dw->setFeatures(Qt::Horizontal);
   dw->setCloseMode(QDockWidget::Docked);
   dw->setResizeEnabled(true);*/

    listTabs = new QTabWidget(dw);
    listTabs->setMinimumWidth(250);

    /*colorListBox = new QListView(listTabs);
	  colorStringList = new QStringList();
      colorListModel = new QStringListModel(*colorStringList, NULL);
	  colorListBox->setModel(colorListModel);*/
    colorListWidget = new QListWidget(listTabs);
    colorListWidget->setViewMode(QListView::IconMode);

    treeWidget = new objTreeWidget(this, listTabs);
    treeWidget->show();

    listTabs->addTab(treeWidget, "Object Tree");
    listTabs->addTab(colorListWidget, "ColorMap List");

    dw->setWidget(listTabs);
    addDockWidget(Qt::RightDockWidgetArea, dw, Qt::Horizontal);

    // make a central widget window for the render area

    QWidget *main = new QWidget(this);
    main->setMinimumSize(720, 574); // will give PAL size images
    viewer = new InvViewer(main);
    setCentralWidget(main);

    // create the lower docking window for sequencer

    dw = new QDockWidget(this);
    addDockWidget(Qt::BottomDockWidgetArea, dw, Qt::Vertical);
    dw->setWindowTitle("Renderer Sequencer");
    // qt3 dw->setHorizontallyStretchable(true);
    // qt3 dw->setResizeEnabled(true);
    sequencer = new InvSequencer(dw);
    dw->setWidget(sequencer);
    dw->hide();

    // set the view all mode for the renderer
    viewer->viewAll();

    //connect( colorListBox->selectionModel(), SIGNAL(selectionChanged ( QItemSelection,QItemSelection )),
    //         this, SLOT(colorSelectionChanged ( QItemSelection,QItemSelection )) );
}
Example #25
0
QAction* Nepomuk::Menu::createBusyAction( QObject* parent ) const
{
    QWidget* w = new QWidget();
    w->setMinimumSize( 22, 22 );
    w->setSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::Minimum );
    KPixmapSequenceOverlayPainter* busyPainter = new KPixmapSequenceOverlayPainter( w );
    busyPainter->setWidget( w );
    busyPainter->start();
	QWidgetAction* busyAction = new QWidgetAction( parent );
    busyAction->setDefaultWidget( w );
    return busyAction;
}
Example #26
0
void Dialog::prepareView()
{
	// Make sure the dialog controls are correctly enabled/disabled with
	// readonly status.
	checkStatus();

	QWidget * w = asQWidget();
	w->setWindowTitle(title_);

	QSize const hint = w->sizeHint();
	if (hint.height() >= 0 && hint.width() >= 0)
		w->setMinimumSize(hint);
}
Example #27
0
void powerfulTabWidget::feed2Full()
{
    QTabBar* pTabBar = tabBar();
    if (NULL != pTabBar)
    {
        for (int iIndex = 0; iIndex < count(); ++iIndex)
        {
            QWidget *pWidget = new QWidget;
            pWidget->setMaximumSize(pTabBar->width() / count() / 2, pTabBar->height());
            pWidget->setMinimumSize(pTabBar->width() / count() / 2, pTabBar->height());
            pTabBar->setTabButton(iIndex, QTabBar::LeftSide, pWidget);
        }
    }
}
Example #28
0
void DiffPage::addFormatTab()
{
	QWidget* page   = new QWidget( this );
	QVBoxLayout* layout = new QVBoxLayout( page );
	layout->setSpacing( KDialog::spacingHint() );
	layout->setMargin( KDialog::marginHint() );

	// add diff modes
	m_modeButtonGroup = new QButtonGroup( page );
        QGroupBox *box = new QGroupBox( page );
	box->setWhatsThis( i18n( "Select the format of the output generated by diff. Unified is the one that is used most frequently because it is very readable. The KDE developers like this format the best so use it for sending patches." ) );
	layout->addWidget( box );
	QVBoxLayout* bgLayout = new QVBoxLayout( box );
	box->setTitle( i18n( "Output Format" ) );
	//m_modeButtonGroup->setMargin( KDialog::marginHint() );

        QRadioButton *radioButton = new QRadioButton( i18n( "Context" ), box );
        m_modeButtonGroup->addButton( radioButton, Kompare::Context);
	bgLayout->addWidget( radioButton );
        radioButton = new QRadioButton( i18n( "Normal" ),  box );
        m_modeButtonGroup->addButton( radioButton, Kompare::Normal);
        bgLayout->addWidget( radioButton );
        radioButton =  new QRadioButton( i18n( "Unified" ), box );
        m_modeButtonGroup->addButton( radioButton, Kompare::Unified);
        bgLayout->addWidget( radioButton );

	// #lines of context (loc)
	QGroupBox* groupBox = new QGroupBox( page );
        QHBoxLayout *groupLayout = new QHBoxLayout;
        groupBox->setLayout( groupLayout );
	layout->addWidget( groupBox );
	groupBox->setTitle( i18n( "Lines of Context" ) );
	groupBox->setWhatsThis( i18n( "The number of context lines is normally 2 or 3. This makes the diff readable and applicable in most cases. More than 3 lines will only bloat the diff unnecessarily." ) );
	//groupBox->setMargin( KDialog::marginHint() );

	QLabel* label = new QLabel( i18n( "Number of context lines:" ));
        groupLayout->addWidget( label );
	label->setWhatsThis( i18n( "The number of context lines is normally 2 or 3. This makes the diff readable and applicable in most cases. More than 3 lines will only bloat the diff unnecessarily." ) );
	m_locSpinBox = new QSpinBox( groupBox );
	m_locSpinBox->setRange( 0, 100 );
	groupLayout->addWidget( m_locSpinBox );
	m_locSpinBox->setWhatsThis( i18n( "The number of context lines is normally 2 or 3. This makes the diff readable and applicable in most cases. More than 3 lines will only bloat the diff unnecessarily." ) );
	label->setBuddy( m_locSpinBox );

	layout->addStretch( 1 );
	page->setMinimumSize( sizeHintForWidget( page ) );

	m_tabWidget->addTab( page, i18n( "Format" ) );
}
Example #29
0
int main(int argc,char **argv)
{
	QApplication app(argc,argv);

	QWidget mainWindow;
	mainWindow.setMinimumSize(400, 400);
	mainWindow.setMaximumSize(400, 400);
	
	QPushButton hw("Hello World",&mainWindow);
	hw.setGeometry(20,20,160,60);

	//app.setMainWidget(&mainWindow);
	mainWindow.show();
	return app.exec();
}
Example #30
0
void DiffPage::addExcludeTab()
{
	QWidget* page = new QWidget( this );
	QVBoxLayout* layout = new QVBoxLayout( page );
	layout->setSpacing( KDialog::spacingHint() );
	layout->setMargin( KDialog::marginHint() );

	m_excludeFilePatternGroupBox = new QGroupBox( page );
        m_excludeFilePatternGroupBox->setCheckable(true);
        QHBoxLayout *excludeFileLayout = new QHBoxLayout;
        m_excludeFilePatternGroupBox->setLayout( excludeFileLayout );
	m_excludeFilePatternGroupBox->setTitle( i18n( "File Pattern to Exclude" ) );
	m_excludeFilePatternGroupBox->setToolTip( i18n( "If this is checked you can enter a shell pattern in the text box on the right or select entries from the list." ) );
	m_excludeFilePatternEditListBox = new KEditListWidget;
        excludeFileLayout->addWidget( m_excludeFilePatternEditListBox );
	m_excludeFilePatternEditListBox->setObjectName( "exclude_file_pattern_editlistbox" );
	m_excludeFilePatternEditListBox->setButtons( KEditListWidget::Add|KEditListWidget::Remove );
	m_excludeFilePatternEditListBox->setCheckAtEntering( false );
	m_excludeFilePatternEditListBox->setToolTip( i18n( "Here you can enter or remove a shell pattern or select one or more entries from the list." ) );
	layout->addWidget( m_excludeFilePatternGroupBox );


	connect( m_excludeFilePatternGroupBox, SIGNAL(toggled(bool)), this, SLOT(slotExcludeFilePatternToggled(bool)));

	m_excludeFileNameGroupBox = new QGroupBox( page );
        m_excludeFileNameGroupBox->setCheckable( true );
        excludeFileLayout = new QHBoxLayout;
        m_excludeFileNameGroupBox->setLayout( excludeFileLayout );
	m_excludeFileNameGroupBox->setTitle( i18n( "File with Filenames to Exclude" ) );
	m_excludeFileNameGroupBox->setToolTip( i18n( "If this is checked you can enter a filename in the combo box below." ) );
	m_excludeFileURLComboBox  = new KUrlComboBox( KUrlComboBox::Files, true );
        excludeFileLayout->addWidget( m_excludeFileURLComboBox );
	m_excludeFileURLComboBox->setObjectName( "exclude_file_urlcombo" );
	m_excludeFileURLComboBox->setToolTip( i18n( "Here you can enter the URL of a file with shell patterns to ignore during the comparison of the folders." ) );
	m_excludeFileURLRequester = new KUrlRequester( m_excludeFileURLComboBox,m_excludeFileNameGroupBox );
        excludeFileLayout->addWidget( m_excludeFileURLRequester );
	m_excludeFileURLRequester->setObjectName("exclude_file_name_urlrequester" );
	m_excludeFileURLRequester->setToolTip( i18n( "Any file you select in the dialog that pops up when you click it will be put in the dialog to the left of this button." ) );
	layout->addWidget( m_excludeFileNameGroupBox );

	connect( m_excludeFileNameGroupBox, SIGNAL(toggled(bool)), this, SLOT(slotExcludeFileToggled(bool)));

	layout->addStretch( 1 );
	page->setMinimumSize( sizeHintForWidget( page ) );

	m_tabWidget->addTab( page, i18n( "Exclude" ) );
}