Ejemplo n.º 1
0
void MainWindow::on_actionQueue3_triggered()  //Show Sky Map
{
    /*QDialog * dial = new QDialog;
    dial->setBaseSize(1300,800);
    dial->setWindowTitle("Sky map");
    //dial->setStyleSheet("background: url(:/new/prefix1/skymap_source.png)");*/

    QLabel *image = new QLabel();
    image->setPixmap( QPixmap( ":/new/prefix1/skymap_source.png" ) );

    image->setBackgroundRole(QPalette::Base);
    image->setBaseSize(1200,800);
    image->setScaledContents(true);

    QScrollArea * scrollArea = new QScrollArea;
    //scrollArea->setBackgroundRole(QPalette::Dark);
    scrollArea->setBaseSize(1200,800);
    scrollArea->setWidget(image);
    scrollArea->setWindowTitle("Sky map");
    scrollArea->show();
    //setCentralWidget(scrollArea);

    /*QVBoxLayout * mainLayout = new QVBoxLayout();

    dial->setLayout(mainLayout);

    dial->exec();*/

}
Ejemplo n.º 2
0
void CGraphicBuildingTile::display(QList<QString> _toDisplay)
{
    QDialog* infoDialog = new QDialog;//(dynamic_cast<QWidget*>(this->parent()));
    QVBoxLayout* newLayout = new QVBoxLayout();
    int q=0;
    QScrollArea* scrolArea = new QScrollArea(dynamic_cast<QWidget*>(this->parent()));
    for(int i=0;i<_toDisplay.count();i++)
    {   QLabel* newLabel = new QLabel(_toDisplay.at(i));
        newLabel->setFixedWidth(280);
        newLabel->setMinimumHeight(22);
        newLabel->setStyleSheet("border: 1px solid black");
        newLayout->addWidget(newLabel);
        q++;
    }
    QPalette pal;
    pal.setColor(QPalette::Background,QColor(230,200,167));
    infoDialog->setFixedWidth(330);
    infoDialog->setMinimumHeight(30+22*q);
    infoDialog->setLayout(newLayout);
    infoDialog->setAutoFillBackground(true);
    infoDialog->setPalette(pal);
    infoDialog->setWindowFlags(Qt::CustomizeWindowHint | Qt::WindowTitleHint | Qt::WindowCloseButtonHint | Qt::Dialog);
    scrolArea->setWidget(infoDialog);
    scrolArea->setWindowFlags(Qt::CustomizeWindowHint | Qt::WindowTitleHint | Qt::WindowCloseButtonHint | Qt::Dialog);
    scrolArea->setMaximumHeight(infoDialog->size().height()+2);
    scrolArea->setWindowTitle(QString("Info about"));
    scrolArea->show();
}
Ejemplo n.º 3
0
Archivo: main.cpp Proyecto: kattle/Demo
int main(int argc, char *argv[])
{
#ifdef LINUX
    QApplication a(argc, argv, QApplication::GuiServer);
    QWSServer::setCursorVisible(false);
#else
    QApplication a(argc, argv);
#endif
    QTextCodec*codec=QTextCodec::codecForName("UTF-8");
    QTextCodec::setCodecForLocale(codec);
    QTextCodec::setCodecForCStrings(codec);
    QTextCodec::setCodecForTr(codec);

    Foundation *tmpFounder = new Foundation;
#ifdef WINDOWS
    QScrollArea w;
    w.setWidget(tmpFounder);
    QString tmpPath = QString("%1/../../src/").arg(QApplication::applicationDirPath());
    tmpFounder->initUI(tmpPath);
    w.show();
#else
#endif

    tmpFounder->show();

    return a.exec();
}
Ejemplo n.º 4
0
void FileBrowser::activated(const QModelIndex &index)
{
    QFileInfo fileInfo = fileSystemModel->fileInfo(index);

    if (fileInfo.isDir() && fileInfo.fileName() != QLatin1String(".")) {
        if (fileInfo.fileName() == QLatin1String("..")) {
            QModelIndex parent = view->rootIndex().parent();

            fileInfo = fileSystemModel->fileInfo(parent);

            if (fileInfo.absoluteFilePath() == rootPath)
                fileSystemModel->setFilter(QDir::AllEntries | QDir::NoDotAndDotDot | QDir::AllDirs);

            view->setRootIndex(parent);
        } else {
            fileSystemModel->setFilter(QDir::AllEntries | QDir::AllDirs);

            view->setRootIndex(index);
        }

        setWindowTitle(fileInfo.fileName());
    } else {
        if (fileInfo.fileName() == QLatin1String("."))
            fileInfo = fileSystemModel->fileInfo(view->rootIndex());


#if defined(Q_WS_MAEMO_5)
        DocumentPropertiesWidget *widget = new DocumentPropertiesWidget(fileInfo, gallery, this);
        widget->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Preferred);

        QScrollArea *window = new QScrollArea(this);
        window->setWindowFlags(window->windowFlags() | Qt::Window);
        window->setAttribute(Qt::WA_DeleteOnClose);
        window->setAttribute(Qt::WA_Maemo5StackedWindow);
        window->setWidgetResizable(true);
        window->setWidget(widget);
        window->show();
#elif defined (Q_OS_SYMBIAN)
        QScrollArea *window = new QScrollArea(this);
        DocumentPropertiesWidget *widget = new DocumentPropertiesWidget(fileInfo, gallery, window);
        widget->setWindowModality(Qt::WindowModal);
        window->setWindowFlags(window->windowFlags() | Qt::Dialog);
        window->setAttribute(Qt::WA_DeleteOnClose);
        window->setWidgetResizable(true);
        window->setWidget(widget);
        window->showMaximized();
#else
        DocumentPropertiesWidget *widget = new DocumentPropertiesWidget(fileInfo, gallery, this);
        widget->setWindowFlags(widget->windowFlags() | Qt::Dialog);
        widget->setAttribute(Qt::WA_DeleteOnClose);
        widget->setWindowModality(Qt::WindowModal);
# if defined(Q_OS_SYMBIAN)
        widget->showMaximized();
# else
        widget->show();
# endif
#endif
    }
}
Ejemplo n.º 5
0
void tst_QAbstractScrollArea::setScrollBars()
{
    QScrollArea scrollArea;
    scrollArea.resize(300, 300);
    scrollArea.show();

    QPointer<QScrollBar> vbar = scrollArea.verticalScrollBar();
    QPointer<QScrollBar> hbar = scrollArea.horizontalScrollBar();

    // Now set properties on the scroll bars
    scrollArea.verticalScrollBar()->setInvertedAppearance(true);
    scrollArea.verticalScrollBar()->setInvertedControls(true);
    scrollArea.verticalScrollBar()->setTracking(true);
    scrollArea.verticalScrollBar()->setRange(-100, 100);
    scrollArea.verticalScrollBar()->setPageStep(42);
    scrollArea.verticalScrollBar()->setSingleStep(3);
    scrollArea.verticalScrollBar()->setValue(43);
    scrollArea.horizontalScrollBar()->setInvertedAppearance(true);
    scrollArea.horizontalScrollBar()->setInvertedControls(true);
    scrollArea.horizontalScrollBar()->setTracking(true);
    scrollArea.horizontalScrollBar()->setRange(-100, 100);
    scrollArea.horizontalScrollBar()->setPageStep(42);
    scrollArea.horizontalScrollBar()->setSingleStep(3);
    scrollArea.horizontalScrollBar()->setValue(43);

    qApp->processEvents();

    // Then replace the scroll bars
    scrollArea.setVerticalScrollBar(new QScrollBar);
    scrollArea.setHorizontalScrollBar(new QScrollBar);

    // Check that the old ones were deleted
    QVERIFY(!vbar);
    QVERIFY(!hbar);

    qApp->processEvents();

    // Check that all properties have been populated
    QVERIFY(scrollArea.verticalScrollBar()->invertedAppearance());
    QVERIFY(scrollArea.verticalScrollBar()->invertedControls());
    QVERIFY(scrollArea.verticalScrollBar()->hasTracking());
    QVERIFY(scrollArea.verticalScrollBar()->isVisible());
    QCOMPARE(scrollArea.verticalScrollBar()->minimum(), -100);
    QCOMPARE(scrollArea.verticalScrollBar()->maximum(), 100);
    QCOMPARE(scrollArea.verticalScrollBar()->pageStep(), 42);
    QCOMPARE(scrollArea.verticalScrollBar()->singleStep(), 3);
    QCOMPARE(scrollArea.verticalScrollBar()->value(), 43);
    QVERIFY(scrollArea.horizontalScrollBar()->invertedAppearance());
    QVERIFY(scrollArea.horizontalScrollBar()->invertedControls());
    QVERIFY(scrollArea.horizontalScrollBar()->hasTracking());
    QVERIFY(scrollArea.horizontalScrollBar()->isVisible());
    QCOMPARE(scrollArea.horizontalScrollBar()->minimum(), -100);
    QCOMPARE(scrollArea.horizontalScrollBar()->maximum(), 100);
    QCOMPARE(scrollArea.horizontalScrollBar()->pageStep(), 42);
    QCOMPARE(scrollArea.horizontalScrollBar()->singleStep(), 3);
    QCOMPARE(scrollArea.horizontalScrollBar()->value(), 43);
}
Ejemplo n.º 6
0
/**
 * @brief MapManager::init si occupa di inizializzare il thread che controlla il robot e di fare il setup della GUI
 */
void MapManager::init()
{
    // Creo il thread del robot
    setupRobotManagerThread();

    // Adesso creo la view QML
    QQuickView view;

    QQmlContext* rootContext = view.rootContext();

    // Espongo al modulo QML questa classe, in modo che possa connettere i suoi signal
    rootContext->setContextProperty("window", this);

    // Inserisco come proprietà QML delle costanti che corrispondono alla grandezza della finestra
    rootContext->setContextProperty("WINDOW_WIDTH", WIDTH);
    rootContext->setContextProperty("WINDOW_HEIGHT", HEIGHT);

    //Carico il file base
    view.setSource(QStringLiteral("main.qml"));

    // Finito con i setaggi, mostro la finestra
    view.show();


    // Creo il widget che mostra le immagini della camera del robot durante la rircerca
    QWidget cameraWidget;
    QHBoxLayout *hbox = new QHBoxLayout(&cameraWidget);

    // Aggiungo alla horizontal box la QLabel che conterrà le immagini della camera
    hbox->addWidget(&cameraLabel);

    cameraWidget.show();


    // Creo il widget che mostra le vittime trovate
    QWidget victimsFoundWidget;
    QScrollArea *scrollArea = new QScrollArea();

    layout = new QVBoxLayout(&victimsFoundWidget);

    // setto le proprietà della ScrollArea e la mostro
    scrollArea->setWidget(&victimsFoundWidget);
    scrollArea->setWidgetResizable(true);
    scrollArea->setMinimumWidth(260);
    scrollArea->setMinimumHeight(300);
    scrollArea->show();

    // Avvio il loop della GUI
    QApplication::instance()->exec();
}
Ejemplo n.º 7
0
void tst_QScrollArea::ensureMicroFocusVisible_Task_167838()
{
    QScrollArea scrollArea;
    scrollArea.resize(100, 100);
    scrollArea.show();
    QWidget *parent = new QWidget;
    parent->setLayout(new QVBoxLayout);
    QWidget *child = new WidgetWithMicroFocus;
    parent->layout()->addWidget(child);
    parent->resize(300, 300); 
    scrollArea.setWidget(parent);
    scrollArea.ensureWidgetVisible(child, 10, 10);
    QRect microFocus = child->inputMethodQuery(Qt::ImMicroFocus).toRect();
    QPoint p = child->mapTo(scrollArea.viewport(), microFocus.topLeft());
    microFocus.translate(p - microFocus.topLeft());
    QVERIFY(scrollArea.viewport()->rect().contains(microFocus));
}
void DenoisingWidget::on_pbPrepare_clicked()
{
    // prepare widget
    cleanWidget();

    QLayout *layout;
    if (Constants::showThresholdsWidgetSeparately) {
        QScrollArea* scrollArea = new QScrollArea();
        scrollArea->setBackgroundRole(QPalette::Window);
        scrollArea->setFrameShadow(QFrame::Plain);
        scrollArea->setFrameShape(QFrame::NoFrame);
        scrollArea->setWidgetResizable(true);

        QWidget* wdg = new QWidget();
        wdg->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
        wdg->setLayout(new QVBoxLayout(wdg));
        scrollArea->setWidget(wdg);
        scrollArea->show();

        layout = wdg->layout();
    } else {
        if (!ui->scrollAreaWidgetContents->layout()) {
            ui->scrollAreaWidgetContents->setLayout(new QVBoxLayout());
        }

        layout = ui->scrollAreaWidgetContents->layout();
    }

    // prepare signal (wavelet transform)
    m_denoisingManager->setSignal(*m_noisedAudioSignal.data());
    m_denoisingManager->prepareToDenoising(ui->cbWaveletType->currentText(), ui->sbLevel->value());
    PlotManager::plot(ui->inputTransformedSignalWidget, m_denoisingManager->transformedSignal());

    auto decomposition = m_denoisingManager->transformedDecomposition();
    m_itemsCount = decomposition.size();

    // initialize thresholds widgets
    for (auto item : decomposition) {
        auto wdg = new ThresholdsWidget(this);
        m_widgets.push_back(wdg);
        wdg->setSignalSource(item);
        layout->addWidget(wdg);
    }

    Q_ASSERT(m_itemsCount == m_widgets.size());
}
Ejemplo n.º 9
0
int main(int argc, char **argv)
{
    QApplication app(argc, argv);

    QScrollArea scrollView;

    QWidget * staticWidget = new StaticWidget();
    staticWidget->resize(400, 200);
    scrollView.setWidget(staticWidget);

    scrollView.setAttribute(Qt::WA_StaticContents);

    scrollView.resize(600, 400);
    scrollView.show();

    return app.exec();
}
Ejemplo n.º 10
0
int main(int argc, char *argv[])
{
	application app(argc, argv);
	icon_editor* editor = new icon_editor;
	editor->set_icon_image(QImage(":/icon_editor_images/mouse.png"));

	QScrollArea area;
	area.setWidget(editor);
	area.setWidgetResizable(true);
	area.setFocusPolicy(Qt::NoFocus);
	area.viewport()->setBackgroundRole(QPalette::Dark);
	area.viewport()->setAutoFillBackground(true);
	area.setWindowTitle(QObject::tr("Icon Editor"));

	editor->setFocus(Qt::OtherFocusReason);  // TODO: simpler way of focusing scroll area's widget?
	area.show();
	return app.exec();
}
Ejemplo n.º 11
0
void PrettyImage::ShowFullsize() {
  // Work out how large to make the window, based on the size of the screen
  QRect desktop_rect(QApplication::desktop()->availableGeometry(this));
  QSize window_size(qMin(desktop_rect.width() - 20, image_.width()),
                    qMin(desktop_rect.height() - 20, image_.height()));

  // Create the window
  QScrollArea* window = new QScrollArea;
  window->setAttribute(Qt::WA_DeleteOnClose, true);
  window->setWindowTitle(tr("Clementine image viewer"));
  window->resize(window_size);

  // Create the label that displays the image
  QLabel* label = new QLabel(window);
  label->setPixmap(QPixmap::fromImage(image_));

  // Show the label in the window
  window->setWidget(label);
  window->setFrameShape(QFrame::NoFrame);
  window->show();
}
Ejemplo n.º 12
0
void tst_QAbstractScrollArea::task214488_layoutDirection()
{
    QScrollArea scrollArea;
    scrollArea.resize(200, 200);
    QWidget widget;
    widget.resize(600, 600);
    scrollArea.setWidget(&widget);
    scrollArea.show();
    QScrollBar *hbar = scrollArea.horizontalScrollBar();
    hbar->setValue((hbar->minimum() + hbar->maximum()) / 2);

    QFETCH(Qt::LayoutDirection, dir);
    QFETCH(Qt::Key, key);
    QFETCH(bool, lessThan);

    scrollArea.setLayoutDirection(dir);

    int refValue = hbar->value();
    qApp->sendEvent(&scrollArea, new QKeyEvent(QEvent::KeyPress, key, Qt::NoModifier));
    QVERIFY(lessThan ? (hbar->value() < refValue) : (hbar->value() > refValue));
}
Ejemplo n.º 13
0
void tst_QScrollArea::checkHFW_Task_197736()
{
    QScrollArea scrollArea;
    HFWWidget *w = new HFWWidget;
    scrollArea.resize(200,100);
    scrollArea.show();
    scrollArea.setWidgetResizable(true);
    scrollArea.setWidget(w);

    // at 200x100px, we expect HFW to be 200px tall, not 100px
    QVERIFY(w->height() >= 200);

    // at 200x300px, we expect HFW to be 300px tall (the heightForWidth is a min, not prescribed)
    scrollArea.resize(QSize(200, 300));
    QVERIFY(w->height() >= 250); // 50px for a fudge factor (size of frame margins/scrollbars etc)

    // make sure this only happens with widget resizable
    scrollArea.setWidgetResizable(false);
    scrollArea.resize(QSize(100,100));
    w->resize(QSize(200,200));
    QVERIFY(w->width() == 200);
    QVERIFY(w->height() == 200);
}
Ejemplo n.º 14
0
//@@@ basic definitions
int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    Arena *w = new Arena;

    //vector<string> vec;
    w->vec.push_back("1");
    w->vec.push_back("2");
    w->vec.push_back("3");
    w->vec.push_back("4");
/*
    w->vec.push_back("5");
    w->vec.push_back("6");
    w->vec.push_back("7");
    w->vec.push_back("8");
    w->vec.push_back("9");
    w->vec.push_back("10");
    w->vec.push_back("11"); w->vec.push_back("12");w->vec.push_back("13");w->vec.push_back("14");w->vec.push_back("15");
    w->vec.push_back("16");w->vec.push_back("17");w->vec.push_back("18");w->vec.push_back("19");w->vec.push_back("20");
    w->vec.push_back("21");w->vec.push_back("22");w->vec.push_back("23");w->vec.push_back("24");w->vec.push_back("25");
    w->vec.push_back("26");w->vec.push_back("27");w->vec.push_back("28");w->vec.push_back("29");w->vec.push_back("30");
    w->vec.push_back("31");w->vec.push_back("32");w->vec.push_back("33");w->vec.push_back("34");w->vec.push_back("35");
    w->vec.push_back("36");w->vec.push_back("37");w->vec.push_back("38");w->vec.push_back("39");w->vec.push_back("40");
    w->vec.push_back("41");
    

//  ################################################################//


    
    /**********************Creating indexes ******************************/
	
	ifstream iput;
    int updateCounter=100; //to update index files
//	int n=10;	// display list size
	string str1="qvlc";
	
	int flag=0,flag1=0;
	FILE* fp;
	fp=fopen("counter.txt","r");
	if(fp==NULL)
	{
		flag=1;
	}
	else
		fclose(fp);

	if(flag==1)
	{
		int k=1;
		fp=fopen("counter.txt","w");
		fprintf(fp,"%i",k);
		fclose(fp);
	}
	else
	{
		
		iput.open("counter.txt");
		int count;
		iput>>count;
		iput.close();
		
		if(count>=updateCounter)
		{
		//	callFileList();
			flag1=1;
			count=-1;
		}
		count++;
		
		fp=fopen("counter.txt","w+");
		fprintf(fp,"%i",count);
		fclose(fp);
	}
	
	if(flag1==1 || flag==1)
	{
		fileList f1;
		f1.runner();
	}


	
    

/********************Reading files in Prefix -trie********************************/	
		Btree b1;
		b1.takeInput(str1);
		tries t2;
		callPrefixTrie(t2);

/*************************history trie*****************************************/		

		tries t1;
		callHistoryTrie(t1);
				
/**************************************************************/
		string str;
		cout<<"enter the string :"<<endl;
		//cin>>str;
		 
        //vector<fax*> inputVector;
        //inputVector=process(str,t2,t1,n);
		
/*		for(int i=0;i<star.size();i++)
		{
			cout<<star[i]->nam<<endl;
		}
*/		 
/*		fax* fax1=new fax("rhythmbox-client","##");
		show(fax1,t2,t1);
		onClose(t1);
*/
    
//##########################################################################3


    w->startArena(t1,t2, 15);

    QScrollArea scrollarea;
    scrollarea.setWidget(w);
    scrollarea.setWidgetResizable(true);
    scrollarea.viewport()->setBackgroundRole(QPalette::Dark);
    scrollarea.viewport()->setAutoFillBackground(true);
    scrollarea.setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
    scrollarea.setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
    scrollarea.setWindowTitle(QObject::tr("arena"));
    scrollarea.show();




    //w->show();


    return a.exec();
}